From 3ee2b4423c7a1c0149620fc226f2e90d94c6aa54 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:31:29 -0500 Subject: [PATCH] [decompiler] Cleanup for Jak 3 (#3845) This PR does a few cleanups: - improve method names/comments/flags for `enemy.gc` and a few other files - fix `new-stack-matrix0` not working for jak 3 - add `matrix-copy!` detection for jak 3 - add `vector-copy!` detection --------- Co-authored-by: water111 --- decompiler/IR2/FormExpressionAnalysis.cpp | 309 +++++++-- decompiler/analysis/insert_lets.cpp | 35 +- decompiler/config/jak3/all-types.gc | 430 ++++++------ .../config/jak3/ntsc_v1/type_casts.jsonc | 8 + .../config/jak3/ntsc_v1/var_names.jsonc | 5 + goal_src/jak3/engine/ai/enemy-h.gc | 191 ++--- goal_src/jak3/engine/ai/enemy.gc | 653 +++++++++++------- goal_src/jak3/engine/ambient/ambient-h.gc | 319 ++++----- goal_src/jak3/engine/ambient/ambient.gc | 83 +-- goal_src/jak3/engine/anim/aligner-h.gc | 16 - goal_src/jak3/engine/anim/aligner.gc | 2 +- goal_src/jak3/engine/anim/fma-sphere.gc | 4 +- goal_src/jak3/engine/anim/joint-exploder.gc | 72 +- goal_src/jak3/engine/anim/joint-mod-h.gc | 10 +- goal_src/jak3/engine/anim/joint-mod.gc | 74 +- goal_src/jak3/engine/anim/joint.gc | 86 +-- goal_src/jak3/engine/camera/cam-combiner.gc | 16 +- goal_src/jak3/engine/camera/cam-interface.gc | 2 +- goal_src/jak3/engine/camera/cam-layout.gc | 87 ++- goal_src/jak3/engine/camera/cam-master.gc | 48 +- goal_src/jak3/engine/camera/cam-states-dbg.gc | 6 +- goal_src/jak3/engine/camera/cam-states.gc | 214 +++--- goal_src/jak3/engine/camera/cam-update.gc | 148 +--- goal_src/jak3/engine/camera/camera-h.gc | 4 +- goal_src/jak3/engine/camera/camera.gc | 54 +- goal_src/jak3/engine/camera/pov-camera.gc | 14 +- goal_src/jak3/engine/collide/collide-debug.gc | 6 +- .../jak3/engine/collide/collide-edge-grab.gc | 33 +- .../jak3/engine/collide/collide-shape-h.gc | 2 +- .../engine/collide/collide-shape-rider.gc | 4 +- goal_src/jak3/engine/collide/collide-shape.gc | 130 ++-- .../jak3/engine/collide/collide-target-h.gc | 4 +- goal_src/jak3/engine/collide/collide-touch.gc | 2 +- goal_src/jak3/engine/collide/find-nearest.gc | 12 +- goal_src/jak3/engine/collide/los-control.gc | 4 +- goal_src/jak3/engine/common-obs/airlock.gc | 8 +- goal_src/jak3/engine/common-obs/base-plat.gc | 7 +- goal_src/jak3/engine/common-obs/basebutton.gc | 15 +- .../jak3/engine/common-obs/blocking-plane.gc | 3 +- goal_src/jak3/engine/common-obs/bouncer.gc | 1 + .../engine/common-obs/collectables-part.gc | 2 +- .../jak3/engine/common-obs/collectables.gc | 75 +- goal_src/jak3/engine/common-obs/crates.gc | 26 +- goal_src/jak3/engine/common-obs/debris.gc | 10 +- goal_src/jak3/engine/common-obs/elevator.gc | 6 +- .../jak3/engine/common-obs/enemy-states.gc | 104 ++- .../jak3/engine/common-obs/generic-obs.gc | 180 +++-- .../engine/common-obs/guard-projectile.gc | 20 +- .../engine/common-obs/metalhead-projectile.gc | 22 +- .../jak3/engine/common-obs/particle-curves.gc | 2 +- goal_src/jak3/engine/common-obs/plat.gc | 5 +- goal_src/jak3/engine/common-obs/powerups.gc | 34 +- goal_src/jak3/engine/common-obs/projectile.gc | 16 +- .../jak3/engine/common-obs/ragdoll-test.gc | 11 +- .../jak3/engine/common-obs/rigid-body-plat.gc | 9 +- .../jak3/engine/common-obs/shield-sphere.gc | 4 +- goal_src/jak3/engine/common-obs/vent.gc | 13 +- goal_src/jak3/engine/common-obs/voicebox.gc | 23 +- goal_src/jak3/engine/common-obs/warp-gate.gc | 49 +- goal_src/jak3/engine/common-obs/water-anim.gc | 5 +- goal_src/jak3/engine/common-obs/water-flow.gc | 9 +- goal_src/jak3/engine/common-obs/water.gc | 24 +- .../jak3/engine/debug/collision-editor.gc | 59 +- goal_src/jak3/engine/debug/debug-sphere.gc | 6 +- goal_src/jak3/engine/debug/debug.gc | 50 +- goal_src/jak3/engine/debug/editable-h.gc | 8 +- goal_src/jak3/engine/debug/manipulator.gc | 44 +- goal_src/jak3/engine/debug/viewer.gc | 3 +- goal_src/jak3/engine/draw/drawable.gc | 2 +- goal_src/jak3/engine/entity/entity-h.gc | 2 +- goal_src/jak3/engine/entity/entity.gc | 18 +- goal_src/jak3/engine/game/effect-control.gc | 14 +- goal_src/jak3/engine/game/game-h.gc | 4 +- goal_src/jak3/engine/game/game-info-h.gc | 2 +- goal_src/jak3/engine/game/game-info.gc | 14 +- goal_src/jak3/engine/game/game-save.gc | 10 +- goal_src/jak3/engine/game/main.gc | 6 +- goal_src/jak3/engine/game/settings.gc | 28 +- goal_src/jak3/engine/game/task/task-arrow.gc | 24 +- .../jak3/engine/game/task/task-control.gc | 19 +- goal_src/jak3/engine/geometry/bounding-box.gc | 4 +- goal_src/jak3/engine/geometry/geometry-h.gc | 10 +- goal_src/jak3/engine/geometry/geometry.gc | 29 +- goal_src/jak3/engine/geometry/path.gc | 30 +- goal_src/jak3/engine/geometry/vol.gc | 14 +- .../engine/gfx/background/hfrag/hfrag-vu1.gc | 6 +- .../jak3/engine/gfx/background/hfrag/hfrag.gc | 12 +- .../engine/gfx/background/tfrag/tfrag-near.gc | 6 +- .../jak3/engine/gfx/background/tfrag/tfrag.gc | 8 +- goal_src/jak3/engine/gfx/blit-displays.gc | 4 +- .../jak3/engine/gfx/foreground/merc/emerc.gc | 2 +- .../jak3/engine/gfx/foreground/merc/merc.gc | 2 +- .../jak3/engine/gfx/generic/generic-vu1.gc | 8 +- .../gfx/generic/lightning/lightning-h.gc | 8 +- .../gfx/generic/lightning/lightning-new.gc | 18 +- .../engine/gfx/generic/lightning/lightning.gc | 19 +- goal_src/jak3/engine/gfx/math-camera.gc | 8 +- goal_src/jak3/engine/gfx/mood/mood-funcs.gc | 2 +- goal_src/jak3/engine/gfx/mood/mood.gc | 34 +- goal_src/jak3/engine/gfx/ocean/ocean-mid.gc | 19 +- goal_src/jak3/engine/gfx/ocean/ocean-near.gc | 19 +- .../jak3/engine/gfx/ocean/ocean-texture.gc | 2 +- goal_src/jak3/engine/gfx/ocean/ocean.gc | 142 ++-- goal_src/jak3/engine/gfx/shrub/shrubbery.gc | 13 +- goal_src/jak3/engine/gfx/sky/sky-data.gc | 4 +- goal_src/jak3/engine/gfx/sky/sky-tng.gc | 41 +- .../gfx/sprite/particles/light-trails.gc | 36 +- .../sprite/particles/sparticle-launcher.gc | 197 +----- .../jak3/engine/gfx/sprite/simple-sprite-h.gc | 2 +- .../jak3/engine/gfx/sprite/sprite-glow.gc | 30 +- goal_src/jak3/engine/gfx/sprite/sprite.gc | 20 +- goal_src/jak3/engine/level/level-h.gc | 2 +- goal_src/jak3/engine/level/level.gc | 6 +- goal_src/jak3/engine/level/region.gc | 4 +- goal_src/jak3/engine/math/euler.gc | 4 +- goal_src/jak3/engine/math/matrix-compose.gc | 36 +- goal_src/jak3/engine/math/matrix-h.gc | 35 +- goal_src/jak3/engine/math/matrix.gc | 75 +- goal_src/jak3/engine/math/quaternion.gc | 40 +- goal_src/jak3/engine/math/transformq-h.gc | 6 +- goal_src/jak3/engine/math/vector.gc | 28 +- goal_src/jak3/engine/nav/nav-control-h.gc | 2 +- goal_src/jak3/engine/nav/nav-control.gc | 189 +++-- goal_src/jak3/engine/nav/nav-enemy-h.gc | 4 +- goal_src/jak3/engine/nav/nav-enemy.gc | 184 ++--- goal_src/jak3/engine/nav/nav-engine.gc | 8 +- goal_src/jak3/engine/nav/nav-mesh-h.gc | 14 +- goal_src/jak3/engine/nav/nav-mesh.gc | 40 +- goal_src/jak3/engine/physics/chain-physics.gc | 18 +- goal_src/jak3/engine/physics/cloth.gc | 32 +- goal_src/jak3/engine/physics/ragdoll-edit.gc | 107 +-- goal_src/jak3/engine/physics/ragdoll.gc | 28 +- goal_src/jak3/engine/physics/rigid-body.gc | 36 +- goal_src/jak3/engine/physics/trajectory.gc | 28 +- .../jak3/engine/process-drawable/focus.gc | 6 +- .../process-drawable/process-focusable.gc | 6 +- .../process-drawable/process-taskable.gc | 7 +- .../engine/process-drawable/simple-focus.gc | 2 +- .../process-drawable/simple-nav-sphere.gc | 2 +- goal_src/jak3/engine/scene/scene.gc | 4 +- goal_src/jak3/engine/sound/gsound.gc | 6 +- goal_src/jak3/engine/sound/speech.gc | 2 +- .../jak3/engine/spatial-hash/actor-hash.gc | 2 +- .../engine/spatial-hash/spatial-hash-h.gc | 2 +- .../jak3/engine/spatial-hash/spatial-hash.gc | 8 +- goal_src/jak3/engine/target/board/board-h.gc | 2 +- .../jak3/engine/target/board/board-states.gc | 48 +- .../jak3/engine/target/board/board-util.gc | 4 +- .../jak3/engine/target/board/target-board.gc | 91 +-- .../engine/target/collide-reaction-target.gc | 88 +-- .../jak3/engine/target/flut/flut-racer.gc | 87 +-- goal_src/jak3/engine/target/flut/flut.gc | 11 +- .../jak3/engine/target/flut/target-flut.gc | 103 +-- .../jak3/engine/target/gun/gun-blue-shot.gc | 165 ++--- .../jak3/engine/target/gun/gun-dark-shot.gc | 173 ++--- goal_src/jak3/engine/target/gun/gun-part.gc | 8 +- .../jak3/engine/target/gun/gun-red-shot.gc | 93 ++- goal_src/jak3/engine/target/gun/gun-util.gc | 52 +- .../jak3/engine/target/gun/gun-yellow-shot.gc | 76 +- .../jak3/engine/target/indax/target-indax.gc | 32 +- goal_src/jak3/engine/target/lightjak-wings.gc | 4 +- goal_src/jak3/engine/target/logic-target.gc | 176 ++--- goal_src/jak3/engine/target/mech/carry-h.gc | 28 +- goal_src/jak3/engine/target/mech/mech-part.gc | 2 +- .../jak3/engine/target/mech/mech-states.gc | 74 +- goal_src/jak3/engine/target/mech/mech.gc | 9 +- .../jak3/engine/target/mech/target-mech.gc | 44 +- goal_src/jak3/engine/target/pilot-states.gc | 65 +- goal_src/jak3/engine/target/target-darkjak.gc | 39 +- goal_src/jak3/engine/target/target-death.gc | 92 ++- goal_src/jak3/engine/target/target-gun.gc | 59 +- goal_src/jak3/engine/target/target-handler.gc | 93 ++- .../jak3/engine/target/target-invisible.gc | 13 +- goal_src/jak3/engine/target/target-ladder.gc | 23 +- goal_src/jak3/engine/target/target-launch.gc | 8 +- .../jak3/engine/target/target-lightjak.gc | 32 +- goal_src/jak3/engine/target/target-part.gc | 40 +- goal_src/jak3/engine/target/target-pilot.gc | 6 +- goal_src/jak3/engine/target/target-tube.gc | 17 +- .../jak3/engine/target/target-turret-shot.gc | 10 +- goal_src/jak3/engine/target/target-turret.gc | 66 +- goal_src/jak3/engine/target/target-util.gc | 41 +- goal_src/jak3/engine/target/target.gc | 20 +- goal_src/jak3/engine/target/target2.gc | 14 +- goal_src/jak3/engine/ui/bigmap.gc | 12 +- goal_src/jak3/engine/ui/minimap.gc | 70 +- goal_src/jak3/engine/ui/progress/progress.gc | 44 +- goal_src/jak3/engine/util/script.gc | 16 +- goal_src/jak3/engine/util/sync-info.gc | 4 +- goal_src/jak3/kernel/gkernel-h.gc | 2 +- .../levels/city/blow-tower/blow-tower-obs.gc | 94 +-- .../levels/city/blow-tower/blow-tower-obs2.gc | 82 +-- .../levels/city/blow-tower/cty-blow-tower.gc | 170 +++-- goal_src/jak3/levels/city/bombbot/bombbot.gc | 334 ++++----- .../city/common/cty-guard-projectile.gc | 12 +- .../levels/city/common/ff-squad-control.gc | 2 +- .../jak3/levels/city/common/guard-grenade.gc | 21 +- .../jak3/levels/city/common/guard-rifle.gc | 4 +- .../jak3/levels/city/common/guard-states.gc | 43 +- .../jak3/levels/city/common/guard-tazer.gc | 40 +- .../jak3/levels/city/common/height-map.gc | 4 +- .../levels/city/common/kg-squad-member.gc | 8 +- .../jak3/levels/city/common/krimson-wall.gc | 29 +- .../levels/city/common/mh-squad-member.gc | 10 +- .../jak3/levels/city/common/nav-graph-h.gc | 2 +- goal_src/jak3/levels/city/common/nav-graph.gc | 20 +- .../jak3/levels/city/common/searchlight.gc | 1 + goal_src/jak3/levels/city/common/trail.gc | 40 +- goal_src/jak3/levels/city/ctyport-obs.gc | 17 +- goal_src/jak3/levels/city/ctywide-obs.gc | 120 +--- goal_src/jak3/levels/city/ctywide-tasks.gc | 27 +- goal_src/jak3/levels/city/ctywide-texture.gc | 20 +- .../city/destroy-grid/cty-destroy-grid.gc | 117 ++-- goal_src/jak3/levels/city/farm/ctyfarm-obs.gc | 10 +- .../jak3/levels/city/freehq/freehq-scenes.gc | 1 + goal_src/jak3/levels/city/hijack/billiards.gc | 12 +- .../levels/city/hijack/cty-hijack-missile.gc | 64 +- .../jak3/levels/city/hijack/cty-hijack.gc | 43 +- .../jak3/levels/city/hijack/guide-arrow.gc | 4 +- .../jak3/levels/city/hijack/kg-vehicles.gc | 27 +- .../levels/city/industrial/ctyinda-obs.gc | 2 + .../city/port/attack/ctyport-attack-bbush.gc | 10 +- .../levels/city/port/attack/ctyport-attack.gc | 47 +- .../jak3/levels/city/port/attack/h-torpedo.gc | 16 +- .../jak3/levels/city/port/ctyport-part.gc | 2 + .../levels/city/protect/assault-enemies.gc | 90 +-- .../levels/city/protect/assault-shared.gc | 6 +- .../jak3/levels/city/protect/assault-task.gc | 52 +- .../jak3/levels/city/protect/cty-protect.gc | 24 +- .../jak3/levels/city/protect/flying-turret.gc | 121 ++-- .../levels/city/protect/protect-gunship.gc | 96 +-- .../levels/city/protect/roboguard-city.gc | 127 ++-- .../jak3/levels/city/slums/ctyslumc-obs.gc | 3 +- .../jak3/levels/city/slums/neon-baron-part.gc | 3 +- .../levels/city/sniper/cty-sniper-battery.gc | 14 +- .../levels/city/sniper/cty-sniper-turret.gc | 68 +- .../city/traffic/citizen/citizen-chick.gc | 75 +- .../city/traffic/citizen/citizen-enemy.gc | 17 +- .../city/traffic/citizen/citizen-fat.gc | 75 +- .../levels/city/traffic/citizen/citizen-h.gc | 1 - .../city/traffic/citizen/citizen-norm.gc | 77 ++- .../levels/city/traffic/citizen/citizen.gc | 165 +++-- .../levels/city/traffic/citizen/civilian.gc | 117 ++-- .../jak3/levels/city/traffic/citizen/guard.gc | 251 +++---- .../city/traffic/citizen/metalhead-flitter.gc | 111 +-- .../city/traffic/citizen/metalhead-grunt.gc | 91 +-- .../traffic/citizen/metalhead-predator.gc | 78 ++- .../levels/city/traffic/traffic-engine.gc | 22 +- .../levels/city/traffic/traffic-manager.gc | 6 +- .../jak3/levels/city/traffic/vehicle/bike.gc | 17 +- .../city/traffic/vehicle/vehicle-control.gc | 18 +- .../city/traffic/vehicle/vehicle-effects.gc | 37 +- .../city/traffic/vehicle/vehicle-physics.gc | 2 +- .../city/traffic/vehicle/vehicle-rider.gc | 5 +- .../city/traffic/vehicle/vehicle-util.gc | 34 +- .../levels/city/traffic/vehicle/vehicle.gc | 52 +- .../jak3/levels/city/vinroom/power-game.gc | 86 +-- goal_src/jak3/levels/comb/comb-field.gc | 3 +- goal_src/jak3/levels/comb/comb-mood.gc | 20 +- goal_src/jak3/levels/comb/comb-obs.gc | 30 +- goal_src/jak3/levels/comb/comb-sentry.gc | 54 +- goal_src/jak3/levels/comb/comb-travel.gc | 19 +- goal_src/jak3/levels/comb/combx-obs.gc | 1 + goal_src/jak3/levels/comb/h-sled.gc | 125 ++-- .../jak3/levels/comb/pecker/pecker-ingame.gc | 1 + goal_src/jak3/levels/comb/railx-obs.gc | 1 + goal_src/jak3/levels/common-obs/ladder.gc | 14 +- .../jak3/levels/common/ai/ashelin/ash-shot.gc | 8 +- .../levels/common/ai/ashelin/ash-states.gc | 36 +- goal_src/jak3/levels/common/ai/ashelin/ash.gc | 117 ++-- goal_src/jak3/levels/common/ai/bot-h.gc | 2 +- goal_src/jak3/levels/common/ai/bot-states.gc | 2 +- goal_src/jak3/levels/common/ai/bot.gc | 88 ++- goal_src/jak3/levels/common/battle.gc | 11 +- goal_src/jak3/levels/common/elec-gate.gc | 10 +- .../common/enemy/darkprec/dp-bipedal-shot.gc | 8 +- .../common/enemy/darkprec/dp-bipedal.gc | 158 +++-- .../levels/common/enemy/darkprec/neo-wasp.gc | 107 +-- goal_src/jak3/levels/common/enemy/flitter.gc | 103 +-- goal_src/jak3/levels/common/enemy/grunt.gc | 101 +-- .../levels/common/enemy/hover/hover-enemy.gc | 56 +- .../common/enemy/hover/hover-formation.gc | 47 +- .../common/enemy/hover/hover-nav-control.gc | 33 +- .../levels/common/enemy/hover/robo-hover.gc | 88 +-- goal_src/jak3/levels/common/enemy/kg-grunt.gc | 114 +-- goal_src/jak3/levels/common/enemy/mantis.gc | 181 ++--- .../common/enemy/prebot-eco-creature.gc | 257 +++---- .../jak3/levels/common/enemy/roboguard.gc | 143 ++-- goal_src/jak3/levels/common/enemy/spyder.gc | 115 +-- .../jak3/levels/common/enemy/spydroid-orig.gc | 79 ++- goal_src/jak3/levels/common/enemy/spydroid.gc | 132 ++-- .../levels/common/external-player-control.gc | 16 +- .../levels/common/hvehicle/squad-control.gc | 30 +- .../levels/common/hvehicle/turret-control.gc | 64 +- .../levels/common/hvehicle/vehicle-manager.gc | 4 +- .../jak3/levels/common/race/race-manager.gc | 30 +- goal_src/jak3/levels/common/race/race-mesh.gc | 18 +- .../desert/artifact-race/artifact-race.gc | 111 +-- .../jak3/levels/desert/boss/deswalk-obs.gc | 32 +- .../levels/desert/boss/terraformer-drone.gc | 88 +-- .../levels/desert/boss/terraformer-head.gc | 47 +- .../levels/desert/boss/terraformer-setup.gc | 118 ++-- .../jak3/levels/desert/chase/desert-chase.gc | 112 +-- .../jak3/levels/desert/chase/desert-jump.gc | 25 +- goal_src/jak3/levels/desert/chase/marauder.gc | 134 ++-- .../jak3/levels/desert/chase/wcar-catapult.gc | 35 +- .../jak3/levels/desert/des-bbush-tasks.gc | 7 +- .../jak3/levels/desert/des-burning-bush.gc | 67 +- goal_src/jak3/levels/desert/des-bush.gc | 27 +- goal_src/jak3/levels/desert/des-cactus.gc | 4 +- .../jak3/levels/desert/desert-dust-storm.gc | 20 +- goal_src/jak3/levels/desert/desert-part.gc | 2 +- goal_src/jak3/levels/desert/desert-scenes.gc | 6 +- goal_src/jak3/levels/desert/desertf-obs.gc | 7 +- goal_src/jak3/levels/desert/desertg-obs.gc | 10 +- .../jak3/levels/desert/hover/des-beast-2.gc | 53 +- .../jak3/levels/desert/hover/des-beast.gc | 165 ++--- goal_src/jak3/levels/desert/hover/mh-flyer.gc | 107 +-- .../jak3/levels/desert/hover/scorpion-gun.gc | 64 +- .../levels/desert/lizard/desert-lizard-h.gc | 66 +- .../desert/lizard/desert-lizard-task.gc | 8 +- .../levels/desert/lizard/desert-lizard.gc | 97 +-- .../levels/desert/oasis/ash-oasis-course.gc | 11 +- .../jak3/levels/desert/oasis/oasis-defense.gc | 15 +- .../jak3/levels/desert/race/course-race.gc | 27 +- .../jak3/levels/desert/race/kleever-rider.gc | 34 +- .../levels/desert/race/turtle-training.gc | 37 +- .../desert/rescue/desert-rescue-bbush.gc | 19 +- .../levels/desert/rescue/desert-rescue.gc | 54 +- .../levels/desert/rescue/neo-satellite.gc | 149 ++-- .../levels/desert/rescue/rope-prim-system.gc | 7 +- .../jak3/levels/desert/rescue/rope-system.gc | 8 +- .../levels/desert/rescue/wland-passenger.gc | 97 +-- .../levels/desert/wvehicle/w-parking-spot.gc | 18 +- .../desert/wvehicle/was-squad-control.gc | 45 +- .../jak3/levels/desert/wvehicle/wcar-fox.gc | 2 +- .../levels/desert/wvehicle/wcar-mirage.gc | 23 +- .../desert/wvehicle/wcar-projectiles.gc | 30 +- .../jak3/levels/desert/wvehicle/wcar-rhino.gc | 19 +- .../levels/desert/wvehicle/wcar-scorpion.gc | 44 +- .../jak3/levels/desert/wvehicle/wcar-snake.gc | 2 +- .../jak3/levels/desert/wvehicle/wcar-toad.gc | 67 +- .../levels/desert/wvehicle/wcar-turtle.gc | 2 +- .../levels/desert/wvehicle/wcar-x-ride.gc | 2 +- goal_src/jak3/levels/desert/wvehicle/wcar.gc | 31 +- .../levels/desert/wvehicle/wvehicle-ai.gc | 32 +- .../levels/desert/wvehicle/wvehicle-obs.gc | 10 +- .../levels/desert/wvehicle/wvehicle-part.gc | 2 +- .../desert/wvehicle/wvehicle-physics.gc | 35 +- .../levels/desert/wvehicle/wvehicle-race.gc | 35 +- .../levels/desert/wvehicle/wvehicle-states.gc | 4 +- .../levels/desert/wvehicle/wvehicle-util.gc | 40 +- .../levels/desert/wvehicle/wvehicle-wheel.gc | 8 +- .../jak3/levels/desert/wvehicle/wvehicle.gc | 31 +- .../levels/factory/car/hvehicle-effects.gc | 13 +- .../levels/factory/car/hvehicle-physics.gc | 46 +- .../jak3/levels/factory/car/hvehicle-util.gc | 16 +- goal_src/jak3/levels/factory/car/hvehicle.gc | 26 +- .../jak3/levels/factory/car/wcar-faccar.gc | 52 +- goal_src/jak3/levels/factory/conveyor.gc | 5 +- goal_src/jak3/levels/factory/fac-gunturret.gc | 94 +-- .../levels/factory/fac-robotank-turret.gc | 36 +- goal_src/jak3/levels/factory/fac-robotank.gc | 8 +- goal_src/jak3/levels/factory/fac-tower.gc | 33 +- .../jak3/levels/factory/factory-boss-setup.gc | 64 +- .../levels/factory/factory-boss-states.gc | 30 +- .../jak3/levels/factory/factory-manager.gc | 40 +- goal_src/jak3/levels/factory/factoryb-init.gc | 2 +- goal_src/jak3/levels/factory/factoryc-obs.gc | 56 +- goal_src/jak3/levels/factory/factoryc-obs2.gc | 36 +- .../jak3/levels/factory/ffight-projectile.gc | 8 +- .../jak3/levels/factory/ftank-projectile.gc | 12 +- .../jak3/levels/factory/fturret-projectile.gc | 10 +- goal_src/jak3/levels/factory/h-warf.gc | 80 +-- goal_src/jak3/levels/factory/lfaccity-mood.gc | 3 +- goal_src/jak3/levels/factory/lfacrm1-mood.gc | 3 +- goal_src/jak3/levels/factory/missile-bot.gc | 93 +-- .../jak3/levels/factory/warf-projectile.gc | 45 +- .../jak3/levels/forest/eco-green-collider.gc | 2 +- .../jak3/levels/forest/for-turret-shot.gc | 14 +- goal_src/jak3/levels/forest/for-turret.gc | 28 +- goal_src/jak3/levels/forest/forest-bridges.gc | 7 +- .../jak3/levels/forest/forest-kill-plants.gc | 36 +- goal_src/jak3/levels/forest/forest-part.gc | 8 +- .../jak3/levels/forest/forest-ring-chase.gc | 62 +- goal_src/jak3/levels/forest/forest-tasks.gc | 14 +- goal_src/jak3/levels/forest/foresta-obs.gc | 19 +- goal_src/jak3/levels/forest/mh-plant.gc | 17 +- goal_src/jak3/levels/forest/neo-spawner.gc | 30 +- goal_src/jak3/levels/glider/glider-manager.gc | 17 +- .../jak3/levels/glider/glider-ring-part.gc | 8 +- goal_src/jak3/levels/glider/glider-ring.gc | 28 +- goal_src/jak3/levels/glider/h-glider.gc | 52 +- goal_src/jak3/levels/gungame/gun-dummy.gc | 28 +- .../jak3/levels/gungame/gungame-manager.gc | 23 +- goal_src/jak3/levels/gungame/gungame-obs.gc | 5 +- goal_src/jak3/levels/hiphog/hiphog-scenes.gc | 4 +- goal_src/jak3/levels/intro/intro-obs.gc | 1 + .../jak3/levels/mhcity/destroy-dark-eco.gc | 38 +- goal_src/jak3/levels/mhcity/mhcity-obs.gc | 42 +- goal_src/jak3/levels/mhcity/mhcity-obs2.gc | 5 +- goal_src/jak3/levels/mhcity/mhcity-part.gc | 7 +- goal_src/jak3/levels/mine/gekko.gc | 196 +++--- goal_src/jak3/levels/mine/manta.gc | 144 ++-- goal_src/jak3/levels/mine/mine-obs.gc | 18 +- goal_src/jak3/levels/mine/mine-platforms.gc | 32 +- goal_src/jak3/levels/mine/mine-scenes.gc | 1 + goal_src/jak3/levels/mine/mine-train.gc | 20 +- goal_src/jak3/levels/mine/mined-mood.gc | 6 +- goal_src/jak3/levels/mine/mined-scenes.gc | 5 +- goal_src/jak3/levels/mine/minee-scenes.gc | 1 + goal_src/jak3/levels/mine/monster-frog.gc | 83 +-- goal_src/jak3/levels/mine/prebot-extras.gc | 54 +- goal_src/jak3/levels/mine/prebot-setup.gc | 17 +- goal_src/jak3/levels/mine/prebot-states.gc | 41 +- goal_src/jak3/levels/mine/rat.gc | 135 ++-- goal_src/jak3/levels/nest/egg-spider.gc | 129 ++-- goal_src/jak3/levels/nest/mh-bat.gc | 90 +-- .../jak3/levels/nest/mh-centipede-part.gc | 4 +- goal_src/jak3/levels/nest/mh-centipede.gc | 84 +-- goal_src/jak3/levels/nest/nst-obs.gc | 193 +++--- goal_src/jak3/levels/nest/nst-part.gc | 22 +- goal_src/jak3/levels/precursor/precura-obs.gc | 116 ++-- .../jak3/levels/precursor/precura-obs2.gc | 84 +-- goal_src/jak3/levels/precursor/precurc-obs.gc | 6 +- goal_src/jak3/levels/precursor/precurd-obs.gc | 24 +- goal_src/jak3/levels/precursor/prim-beam.gc | 16 +- goal_src/jak3/levels/sewer/flyingsaw.gc | 11 +- goal_src/jak3/levels/sewer/jump-pad.gc | 1 + goal_src/jak3/levels/sewer/kg-hopper.gc | 113 +-- goal_src/jak3/levels/sewer/mh-wasp.gc | 96 +-- goal_src/jak3/levels/sewer/needle-fish.gc | 80 ++- goal_src/jak3/levels/sewer/neo-grenadier.gc | 113 +-- goal_src/jak3/levels/sewer/neo-juicer.gc | 131 ++-- .../jak3/levels/sewer/saberfish-spawner.gc | 10 +- goal_src/jak3/levels/sewer/saberfish.gc | 208 +++--- goal_src/jak3/levels/sewer/sew-laser-guard.gc | 84 ++- .../jak3/levels/sewer/sew-laser-turret.gc | 90 +-- goal_src/jak3/levels/sewer/sew-platforms.gc | 25 +- goal_src/jak3/levels/sewer/sew-whirlpool.gc | 1 + goal_src/jak3/levels/sewer/sewer-frog.gc | 92 +-- .../jak3/levels/sewer/sewer-move-turret.gc | 17 +- goal_src/jak3/levels/sewer/sewer-obs.gc | 118 ++-- goal_src/jak3/levels/sewer/sewer-obs2.gc | 28 +- goal_src/jak3/levels/sewer/sewer-part.gc | 4 +- .../jak3/levels/stadium/dm-mine-spider.gc | 125 ++-- goal_src/jak3/levels/stadium/king-rider.gc | 4 +- goal_src/jak3/levels/stadium/rapid-gunner.gc | 92 +-- goal_src/jak3/levels/stadium/rubble-attack.gc | 22 +- goal_src/jak3/levels/stadium/rubble-obs.gc | 18 +- goal_src/jak3/levels/stadium/stadium-obs.gc | 13 +- goal_src/jak3/levels/temple/flamer-hover.gc | 80 ++- goal_src/jak3/levels/temple/hover-training.gc | 15 +- goal_src/jak3/levels/temple/temple-obs.gc | 22 +- goal_src/jak3/levels/temple/temple-obs2.gc | 22 +- goal_src/jak3/levels/temple/templed-obs.gc | 13 +- goal_src/jak3/levels/temple/templex-obs.gc | 1 + goal_src/jak3/levels/temple/templex-scenes.gc | 1 + .../jak3/levels/temple/tomb-baby-spider.gc | 92 +-- goal_src/jak3/levels/title/title-obs.gc | 10 +- goal_src/jak3/levels/tower/tower-obs.gc | 31 +- goal_src/jak3/levels/volcano/flamer-lava.gc | 117 ++-- goal_src/jak3/levels/volcano/flut-wild.gc | 81 ++- goal_src/jak3/levels/volcano/spiky-frog.gc | 92 +-- goal_src/jak3/levels/volcano/volcano-obs.gc | 43 +- goal_src/jak3/levels/volcano/volcano-obs2.gc | 12 +- goal_src/jak3/levels/volcano/volcano-part.gc | 4 +- .../jak3/levels/volcano/volcano-scenes.gc | 2 +- goal_src/jak3/levels/volcano/volcanox-obs.gc | 9 +- .../wascity/bbush/des-bush-time-chase.gc | 14 +- .../jak3/levels/wascity/chase/kanga-lizard.gc | 79 ++- goal_src/jak3/levels/wascity/cty-faction.gc | 20 +- goal_src/jak3/levels/wascity/ctymark-obs-h.gc | 4 +- goal_src/jak3/levels/wascity/ctymark-obs.gc | 3 +- .../levels/wascity/defend/was-pre-game.gc | 15 +- goal_src/jak3/levels/wascity/dm-flyer.gc | 22 +- goal_src/jak3/levels/wascity/dogat.gc | 78 ++- .../levels/wascity/doors/wasdoors-init.gc | 6 +- goal_src/jak3/levels/wascity/flee-info.gc | 16 +- .../jak3/levels/wascity/formation-object.gc | 8 +- goal_src/jak3/levels/wascity/formations.gc | 2 +- .../levels/wascity/leaper/was-leaper-race.gc | 11 +- .../jak3/levels/wascity/maker-projectile.gc | 14 +- .../jak3/levels/wascity/palace/waspala-obs.gc | 6 +- .../jak3/levels/wascity/squad-control-city.gc | 2 +- goal_src/jak3/levels/wascity/tizard.gc | 4 +- goal_src/jak3/levels/wascity/traffic-util.gc | 36 +- goal_src/jak3/levels/wascity/wasall-obs.gc | 14 +- goal_src/jak3/levels/wascity/wasall-tasks.gc | 8 +- .../jak3/levels/wascity/wascity-turret.gc | 32 +- goal_src/jak3/levels/wascity/wascitya-obs.gc | 1 + .../jak3/levels/wascity/wasdef-manager.gc | 75 +- goal_src/jak3/levels/wascity/wasgun-hud.gc | 4 +- .../jak3/levels/wascity/wasgun-manager.gc | 20 +- .../levels/wascity/wasstadium/nst-eggs-h.gc | 26 +- .../jak3/levels/wascity/wasstadium/nst-gas.gc | 19 +- .../levels/wascity/wasstadium/nst-tasks.gc | 31 +- .../levels/wascity/wasstadium/sig-rider.gc | 6 +- .../levels/wascity/wasstadium/wasstada-obs.gc | 11 +- .../wascity/wasstadium/wasstada-part.gc | 13 +- .../levels/wascity/wasstadium/wasstadb-obs.gc | 24 +- .../levels/wascity/wasstadium/wasstadc-obs.gc | 55 +- goal_src/jak3/levels/wascity/waswide-obs.gc | 17 +- .../jak3/levels/wascity/wlander-female.gc | 75 +- goal_src/jak3/levels/wascity/wlander-male.gc | 178 ++--- .../reference/jak3/decompiler-macros.gc | 12 + .../reference/jak3/engine/ai/enemy-h_REF.gc | 170 ++--- .../reference/jak3/engine/ai/enemy_REF.gc | 653 +++++++++++------- .../jak3/engine/ambient/ambient-h_REF.gc | 301 ++++---- .../jak3/engine/ambient/ambient_REF.gc | 77 ++- .../reference/jak3/engine/anim/aligner_REF.gc | 2 +- .../jak3/engine/anim/fma-sphere_REF.gc | 4 +- .../jak3/engine/anim/joint-exploder_REF.gc | 76 +- .../jak3/engine/anim/joint-mod-h_REF.gc | 10 +- .../jak3/engine/anim/joint-mod_REF.gc | 74 +- .../reference/jak3/engine/anim/joint_REF.gc | 99 +-- .../jak3/engine/camera/cam-combiner_REF.gc | 52 +- .../jak3/engine/camera/cam-interface_REF.gc | 6 +- .../jak3/engine/camera/cam-layout_REF.gc | 87 ++- .../jak3/engine/camera/cam-master_REF.gc | 48 +- .../jak3/engine/camera/cam-states-dbg_REF.gc | 6 +- .../jak3/engine/camera/cam-states_REF.gc | 464 ++++++------- .../jak3/engine/camera/cam-update_REF.gc | 148 +--- .../jak3/engine/camera/camera-h_REF.gc | 4 +- .../jak3/engine/camera/camera_REF.gc | 92 +-- .../jak3/engine/camera/pov-camera_REF.gc | 18 +- .../jak3/engine/collide/collide-debug_REF.gc | 6 +- .../engine/collide/collide-edge-grab_REF.gc | 33 +- .../engine/collide/collide-shape-h_REF.gc | 2 +- .../engine/collide/collide-shape-rider_REF.gc | 4 +- .../jak3/engine/collide/collide-shape_REF.gc | 130 ++-- .../engine/collide/collide-target-h_REF.gc | 4 +- .../jak3/engine/collide/collide-touch_REF.gc | 2 +- .../jak3/engine/collide/find-nearest_REF.gc | 16 +- .../jak3/engine/collide/los-control_REF.gc | 8 +- .../jak3/engine/common-obs/airlock_REF.gc | 8 +- .../jak3/engine/common-obs/base-plat_REF.gc | 11 +- .../jak3/engine/common-obs/basebutton_REF.gc | 19 +- .../engine/common-obs/blocking-plane_REF.gc | 3 +- .../jak3/engine/common-obs/bouncer_REF.gc | 1 + .../common-obs/collectables-part_REF.gc | 6 +- .../engine/common-obs/collectables_REF.gc | 75 +- .../jak3/engine/common-obs/crates_REF.gc | 26 +- .../jak3/engine/common-obs/debris_REF.gc | 14 +- .../jak3/engine/common-obs/elevator_REF.gc | 10 +- .../engine/common-obs/enemy-states_REF.gc | 104 ++- .../jak3/engine/common-obs/generic-obs_REF.gc | 171 +++-- .../engine/common-obs/guard-projectile_REF.gc | 20 +- .../common-obs/metalhead-projectile_REF.gc | 22 +- .../engine/common-obs/particle-curves_REF.gc | 6 +- .../jak3/engine/common-obs/plat_REF.gc | 5 +- .../jak3/engine/common-obs/powerups_REF.gc | 28 +- .../jak3/engine/common-obs/projectile_REF.gc | 20 +- .../engine/common-obs/ragdoll-test_REF.gc | 15 +- .../engine/common-obs/rigid-body-plat_REF.gc | 13 +- .../engine/common-obs/shield-sphere_REF.gc | 4 +- .../jak3/engine/common-obs/vent_REF.gc | 17 +- .../jak3/engine/common-obs/voicebox_REF.gc | 23 +- .../jak3/engine/common-obs/warp-gate_REF.gc | 46 +- .../jak3/engine/common-obs/water-anim_REF.gc | 9 +- .../jak3/engine/common-obs/water-flow_REF.gc | 9 +- .../jak3/engine/common-obs/water_REF.gc | 28 +- .../jak3/engine/debug/collision-editor_REF.gc | 59 +- .../jak3/engine/debug/debug-sphere_REF.gc | 10 +- .../reference/jak3/engine/debug/debug_REF.gc | 50 +- .../jak3/engine/debug/editable-h_REF.gc | 12 +- .../jak3/engine/debug/manipulator_REF.gc | 44 +- .../reference/jak3/engine/debug/viewer_REF.gc | 7 +- .../jak3/engine/draw/drawable_REF.gc | 2 +- .../jak3/engine/entity/entity_REF.gc | 19 +- .../jak3/engine/game/effect-control_REF.gc | 14 +- .../jak3/engine/game/game-info-h_REF.gc | 2 +- .../jak3/engine/game/game-info_REF.gc | 14 +- .../jak3/engine/game/game-save_REF.gc | 10 +- .../reference/jak3/engine/game/main_REF.gc | 6 +- .../jak3/engine/game/settings_REF.gc | 28 +- .../jak3/engine/game/task/task-arrow_REF.gc | 24 +- .../jak3/engine/game/task/task-control_REF.gc | 2 +- .../jak3/engine/geometry/bounding-box_REF.gc | 4 +- .../jak3/engine/geometry/geometry-h_REF.gc | 14 +- .../jak3/engine/geometry/geometry_REF.gc | 94 +-- .../jak3/engine/geometry/path_REF.gc | 34 +- .../reference/jak3/engine/geometry/vol_REF.gc | 18 +- .../engine/gfx/background/background_REF.gc | 2 +- .../gfx/background/hfrag/hfrag-vu1_REF.gc | 10 +- .../engine/gfx/background/hfrag/hfrag_REF.gc | 12 +- .../gfx/background/tfrag/tfrag-near_REF.gc | 10 +- .../engine/gfx/background/tfrag/tfrag_REF.gc | 12 +- .../jak3/engine/gfx/blit-displays_REF.gc | 4 +- .../jak3/engine/gfx/foreground/lights_REF.gc | 2 +- .../engine/gfx/foreground/merc/emerc_REF.gc | 2 +- .../engine/gfx/foreground/merc/merc_REF.gc | 2 +- .../engine/gfx/generic/generic-effect_REF.gc | 28 +- .../engine/gfx/generic/generic-vu1_REF.gc | 8 +- .../gfx/generic/lightning/lightning-h_REF.gc | 12 +- .../generic/lightning/lightning-new_REF.gc | 18 +- .../gfx/generic/lightning/lightning_REF.gc | 23 +- .../jak3/engine/gfx/math-camera_REF.gc | 150 ++-- .../jak3/engine/gfx/mood/mood-funcs_REF.gc | 6 +- .../jak3/engine/gfx/mood/mood_REF.gc | 34 +- .../jak3/engine/gfx/ocean/ocean-mid_REF.gc | 19 +- .../jak3/engine/gfx/ocean/ocean-near_REF.gc | 19 +- .../engine/gfx/ocean/ocean-texture_REF.gc | 2 +- .../jak3/engine/gfx/ocean/ocean_REF.gc | 142 ++-- .../jak3/engine/gfx/shrub/shrubbery_REF.gc | 17 +- .../jak3/engine/gfx/sky/sky-data_REF.gc | 4 +- .../jak3/engine/gfx/sky/sky-tng_REF.gc | 35 +- .../gfx/sprite/particles/light-trails_REF.gc | 36 +- .../particles/sparticle-launcher_REF.gc | 240 +------ .../engine/gfx/sprite/simple-sprite-h_REF.gc | 2 +- .../jak3/engine/gfx/sprite/sprite-glow_REF.gc | 30 +- .../jak3/engine/gfx/sprite/sprite_REF.gc | 19 +- .../jak3/engine/level/level-h_REF.gc | 2 +- .../reference/jak3/engine/level/level_REF.gc | 6 +- .../reference/jak3/engine/level/region_REF.gc | 4 +- .../reference/jak3/engine/math/euler_REF.gc | 2 +- .../jak3/engine/math/matrix-compose_REF.gc | 40 +- .../jak3/engine/math/matrix-h_REF.gc | 21 +- .../reference/jak3/engine/math/matrix_REF.gc | 144 +--- .../jak3/engine/math/quaternion_REF.gc | 32 +- .../jak3/engine/math/transform_REF.gc | 76 +- .../jak3/engine/math/transformq-h_REF.gc | 2 + .../reference/jak3/engine/math/vector_REF.gc | 28 +- .../jak3/engine/nav/nav-control-h_REF.gc | 2 +- .../jak3/engine/nav/nav-control_REF.gc | 176 +++-- .../jak3/engine/nav/nav-enemy-h_REF.gc | 4 +- .../jak3/engine/nav/nav-enemy_REF.gc | 184 ++--- .../jak3/engine/nav/nav-engine_REF.gc | 12 +- .../jak3/engine/nav/nav-mesh-h_REF.gc | 14 +- .../reference/jak3/engine/nav/nav-mesh_REF.gc | 44 +- .../jak3/engine/physics/chain-physics_REF.gc | 22 +- .../jak3/engine/physics/cloth_REF.gc | 100 ++- .../jak3/engine/physics/ragdoll-edit_REF.gc | 107 +-- .../jak3/engine/physics/ragdoll_REF.gc | 136 ++-- .../jak3/engine/physics/rigid-body_REF.gc | 36 +- .../jak3/engine/physics/trajectory_REF.gc | 28 +- .../jak3/engine/process-drawable/focus_REF.gc | 6 +- .../process-drawable/process-drawable_REF.gc | 32 +- .../process-drawable/process-focusable_REF.gc | 6 +- .../process-drawable/process-taskable_REF.gc | 1 + .../process-drawable/simple-focus_REF.gc | 6 +- .../process-drawable/simple-nav-sphere_REF.gc | 2 +- .../reference/jak3/engine/ps2/pad_REF.gc | 2 +- .../reference/jak3/engine/scene/scene_REF.gc | 14 +- .../reference/jak3/engine/sound/gsound_REF.gc | 6 +- .../reference/jak3/engine/sound/speech_REF.gc | 2 +- .../engine/spatial-hash/actor-hash_REF.gc | 6 +- .../engine/spatial-hash/spatial-hash-h_REF.gc | 2 +- .../engine/spatial-hash/spatial-hash_REF.gc | 8 +- .../jak3/engine/target/board/board-h_REF.gc | 2 +- .../engine/target/board/board-states_REF.gc | 48 +- .../engine/target/board/board-util_REF.gc | 4 +- .../engine/target/board/target-board_REF.gc | 91 +-- .../target/collide-reaction-target_REF.gc | 88 +-- .../jak3/engine/target/flut/flut-racer_REF.gc | 87 +-- .../jak3/engine/target/flut/flut_REF.gc | 3 +- .../engine/target/flut/target-flut_REF.gc | 72 +- .../engine/target/gun/gun-blue-shot_REF.gc | 165 ++--- .../engine/target/gun/gun-dark-shot_REF.gc | 173 ++--- .../jak3/engine/target/gun/gun-part_REF.gc | 8 +- .../engine/target/gun/gun-red-shot_REF.gc | 97 ++- .../jak3/engine/target/gun/gun-util_REF.gc | 52 +- .../engine/target/gun/gun-yellow-shot_REF.gc | 78 +-- .../target/indax/target-indax-hang_REF.gc | 15 +- .../engine/target/indax/target-indax_REF.gc | 26 +- .../jak3/engine/target/lightjak-wings_REF.gc | 4 +- .../jak3/engine/target/logic-target_REF.gc | 176 ++--- .../jak3/engine/target/mech/carry-h_REF.gc | 28 +- .../jak3/engine/target/mech/mech-part_REF.gc | 2 +- .../engine/target/mech/mech-states_REF.gc | 74 +- .../jak3/engine/target/mech/mech_REF.gc | 5 +- .../engine/target/mech/target-mech_REF.gc | 44 +- .../jak3/engine/target/pilot-states_REF.gc | 50 +- .../jak3/engine/target/target-darkjak_REF.gc | 39 +- .../jak3/engine/target/target-death_REF.gc | 92 ++- .../jak3/engine/target/target-gun_REF.gc | 59 +- .../jak3/engine/target/target-handler_REF.gc | 64 +- .../engine/target/target-invisible_REF.gc | 13 +- .../jak3/engine/target/target-ladder_REF.gc | 23 +- .../jak3/engine/target/target-launch_REF.gc | 8 +- .../jak3/engine/target/target-lightjak_REF.gc | 32 +- .../jak3/engine/target/target-part_REF.gc | 40 +- .../jak3/engine/target/target-pilot_REF.gc | 6 +- .../jak3/engine/target/target-tube_REF.gc | 17 +- .../engine/target/target-turret-shot_REF.gc | 10 +- .../jak3/engine/target/target-turret_REF.gc | 63 +- .../jak3/engine/target/target-util_REF.gc | 41 +- .../jak3/engine/target/target2_REF.gc | 14 +- .../jak3/engine/target/target_REF.gc | 27 +- .../reference/jak3/engine/ui/bigmap_REF.gc | 20 +- .../reference/jak3/engine/ui/minimap_REF.gc | 56 +- .../jak3/engine/ui/progress/progress_REF.gc | 44 +- .../jak3/engine/util/sync-info_REF.gc | 4 +- .../city/blow-tower/blow-tower-obs2_REF.gc | 82 +-- .../city/blow-tower/blow-tower-obs_REF.gc | 94 +-- .../city/blow-tower/cty-blow-tower_REF.gc | 170 +++-- .../jak3/levels/city/bombbot/bombbot_REF.gc | 334 ++++----- .../city/common/cty-guard-projectile_REF.gc | 16 +- .../city/common/ff-squad-control_REF.gc | 6 +- .../levels/city/common/guard-grenade_REF.gc | 21 +- .../levels/city/common/guard-rifle_REF.gc | 4 +- .../levels/city/common/guard-states_REF.gc | 43 +- .../levels/city/common/guard-tazer_REF.gc | 44 +- .../jak3/levels/city/common/height-map_REF.gc | 8 +- .../levels/city/common/kg-squad-member_REF.gc | 8 +- .../levels/city/common/krimson-wall_REF.gc | 29 +- .../levels/city/common/mh-squad-member_REF.gc | 10 +- .../levels/city/common/nav-graph-h_REF.gc | 2 +- .../jak3/levels/city/common/nav-graph_REF.gc | 20 +- .../levels/city/common/searchlight_REF.gc | 5 +- .../jak3/levels/city/common/trail_REF.gc | 40 +- .../jak3/levels/city/ctyport-obs_REF.gc | 21 +- .../jak3/levels/city/ctywide-obs_REF.gc | 120 +--- .../jak3/levels/city/ctywide-tasks_REF.gc | 6 +- .../jak3/levels/city/ctywide-texture_REF.gc | 24 +- .../city/destroy-grid/cty-destroy-grid_REF.gc | 115 +-- .../jak3/levels/city/farm/ctyfarm-obs_REF.gc | 14 +- .../levels/city/freehq/freehq-scenes_REF.gc | 5 +- .../jak3/levels/city/hijack/billiards_REF.gc | 16 +- .../city/hijack/cty-hijack-missile_REF.gc | 64 +- .../jak3/levels/city/hijack/cty-hijack_REF.gc | 43 +- .../levels/city/hijack/guide-arrow_REF.gc | 4 +- .../levels/city/hijack/kg-vehicles_REF.gc | 27 +- .../levels/city/industrial/ctyinda-obs_REF.gc | 6 +- .../port/attack/ctyport-attack-bbush_REF.gc | 10 +- .../city/port/attack/ctyport-attack_REF.gc | 47 +- .../levels/city/port/attack/h-torpedo_REF.gc | 16 +- .../jak3/levels/city/port/ctyport-part_REF.gc | 2 + .../city/protect/assault-enemies_REF.gc | 87 +-- .../levels/city/protect/assault-shared_REF.gc | 6 +- .../levels/city/protect/assault-task_REF.gc | 52 +- .../levels/city/protect/cty-protect_REF.gc | 15 +- .../levels/city/protect/flying-turret_REF.gc | 121 ++-- .../city/protect/protect-gunship_REF.gc | 96 +-- .../levels/city/protect/roboguard-city_REF.gc | 127 ++-- .../levels/city/slums/ctyslumc-obs_REF.gc | 3 +- .../levels/city/slums/neon-baron-part_REF.gc | 7 +- .../city/sniper/cty-sniper-battery_REF.gc | 11 +- .../city/sniper/cty-sniper-turret_REF.gc | 69 +- .../city/traffic/citizen/citizen-chick_REF.gc | 79 ++- .../city/traffic/citizen/citizen-enemy_REF.gc | 21 +- .../city/traffic/citizen/citizen-fat_REF.gc | 79 ++- .../city/traffic/citizen/citizen-h_REF.gc | 5 - .../city/traffic/citizen/citizen-norm_REF.gc | 77 ++- .../city/traffic/citizen/citizen_REF.gc | 166 +++-- .../city/traffic/citizen/civilian_REF.gc | 117 ++-- .../levels/city/traffic/citizen/guard_REF.gc | 255 +++---- .../traffic/citizen/metalhead-flitter_REF.gc | 111 +-- .../traffic/citizen/metalhead-grunt_REF.gc | 95 +-- .../traffic/citizen/metalhead-predator_REF.gc | 78 ++- .../levels/city/traffic/traffic-engine_REF.gc | 22 +- .../city/traffic/traffic-manager_REF.gc | 10 +- .../levels/city/traffic/vehicle/bike_REF.gc | 17 +- .../traffic/vehicle/vehicle-control_REF.gc | 18 +- .../traffic/vehicle/vehicle-effects_REF.gc | 37 +- .../traffic/vehicle/vehicle-physics_REF.gc | 2 +- .../city/traffic/vehicle/vehicle-rider_REF.gc | 5 +- .../city/traffic/vehicle/vehicle-util_REF.gc | 34 +- .../city/traffic/vehicle/vehicle_REF.gc | 52 +- .../levels/city/vinroom/power-game_REF.gc | 86 +-- .../jak3/levels/comb/comb-field_REF.gc | 3 +- .../jak3/levels/comb/comb-mood_REF.gc | 24 +- .../jak3/levels/comb/comb-obs_REF.gc | 20 +- .../jak3/levels/comb/comb-sentry_REF.gc | 54 +- .../jak3/levels/comb/comb-travel_REF.gc | 16 +- .../jak3/levels/comb/combx-obs_REF.gc | 5 +- .../reference/jak3/levels/comb/h-sled_REF.gc | 125 ++-- .../levels/comb/pecker/pecker-ingame_REF.gc | 5 +- .../jak3/levels/comb/railx-obs_REF.gc | 5 +- .../jak3/levels/common-obs/ladder_REF.gc | 14 +- .../levels/common/ai/ashelin/ash-shot_REF.gc | 12 +- .../common/ai/ashelin/ash-states_REF.gc | 36 +- .../jak3/levels/common/ai/ashelin/ash_REF.gc | 117 ++-- .../jak3/levels/common/ai/bot-h_REF.gc | 2 +- .../jak3/levels/common/ai/bot-states_REF.gc | 6 +- .../jak3/levels/common/ai/bot_REF.gc | 88 ++- .../jak3/levels/common/battle_REF.gc | 11 +- .../jak3/levels/common/elec-gate_REF.gc | 10 +- .../enemy/darkprec/dp-bipedal-shot_REF.gc | 12 +- .../common/enemy/darkprec/dp-bipedal_REF.gc | 156 +++-- .../common/enemy/darkprec/neo-wasp_REF.gc | 107 +-- .../jak3/levels/common/enemy/flitter_REF.gc | 103 +-- .../jak3/levels/common/enemy/grunt_REF.gc | 96 +-- .../common/enemy/hover/hover-enemy_REF.gc | 56 +- .../common/enemy/hover/hover-formation_REF.gc | 52 +- .../enemy/hover/hover-nav-control_REF.gc | 34 +- .../common/enemy/hover/robo-hover_REF.gc | 88 +-- .../jak3/levels/common/enemy/kg-grunt_REF.gc | 111 +-- .../jak3/levels/common/enemy/mantis_REF.gc | 181 ++--- .../common/enemy/prebot-eco-creature_REF.gc | 257 +++---- .../jak3/levels/common/enemy/roboguard_REF.gc | 134 ++-- .../jak3/levels/common/enemy/spyder_REF.gc | 115 +-- .../levels/common/enemy/spydroid-orig_REF.gc | 79 ++- .../jak3/levels/common/enemy/spydroid_REF.gc | 132 ++-- .../common/external-player-control_REF.gc | 16 +- .../common/hvehicle/squad-control_REF.gc | 30 +- .../common/hvehicle/turret-control_REF.gc | 64 +- .../common/hvehicle/vehicle-manager_REF.gc | 4 +- .../levels/common/race/race-manager_REF.gc | 30 +- .../jak3/levels/common/race/race-mesh_REF.gc | 18 +- .../desert/artifact-race/artifact-race_REF.gc | 109 ++- .../levels/desert/boss/deswalk-obs_REF.gc | 36 +- .../desert/boss/terraformer-drone_REF.gc | 92 +-- .../desert/boss/terraformer-head_REF.gc | 51 +- .../desert/boss/terraformer-setup_REF.gc | 118 ++-- .../levels/desert/chase/desert-chase_REF.gc | 44 +- .../levels/desert/chase/desert-jump_REF.gc | 22 +- .../jak3/levels/desert/chase/marauder_REF.gc | 134 ++-- .../levels/desert/chase/wcar-catapult_REF.gc | 35 +- .../jak3/levels/desert/des-bbush-tasks_REF.gc | 4 +- .../levels/desert/des-burning-bush_REF.gc | 67 +- .../jak3/levels/desert/des-bush_REF.gc | 27 +- .../jak3/levels/desert/des-cactus_REF.gc | 4 +- .../levels/desert/desert-dust-storm_REF.gc | 20 +- .../jak3/levels/desert/desert-part_REF.gc | 6 +- .../jak3/levels/desert/desert-scenes_REF.gc | 10 +- .../jak3/levels/desert/desertf-obs_REF.gc | 11 +- .../jak3/levels/desert/desertg-obs_REF.gc | 14 +- .../levels/desert/hover/des-beast-2_REF.gc | 53 +- .../jak3/levels/desert/hover/des-beast_REF.gc | 165 ++--- .../jak3/levels/desert/hover/mh-flyer_REF.gc | 104 +-- .../levels/desert/hover/scorpion-gun_REF.gc | 58 +- .../desert/lizard/desert-lizard-h_REF.gc | 70 +- .../desert/lizard/desert-lizard-task_REF.gc | 5 +- .../levels/desert/lizard/desert-lizard_REF.gc | 101 +-- .../desert/oasis/ash-oasis-course_REF.gc | 15 +- .../levels/desert/oasis/oasis-defense_REF.gc | 15 +- .../levels/desert/race/course-race_REF.gc | 15 +- .../levels/desert/race/kleever-rider_REF.gc | 38 +- .../levels/desert/race/turtle-training_REF.gc | 37 +- .../desert/rescue/desert-rescue-bbush_REF.gc | 23 +- .../levels/desert/rescue/desert-rescue_REF.gc | 54 +- .../levels/desert/rescue/neo-satellite_REF.gc | 149 ++-- .../desert/rescue/rope-prim-system_REF.gc | 6 +- .../levels/desert/rescue/rope-system_REF.gc | 12 +- .../desert/rescue/wland-passenger_REF.gc | 97 +-- .../desert/wvehicle/w-parking-spot_REF.gc | 15 +- .../desert/wvehicle/was-squad-control_REF.gc | 45 +- .../levels/desert/wvehicle/wcar-fox_REF.gc | 6 +- .../levels/desert/wvehicle/wcar-mirage_REF.gc | 23 +- .../desert/wvehicle/wcar-projectiles_REF.gc | 30 +- .../levels/desert/wvehicle/wcar-rhino_REF.gc | 19 +- .../desert/wvehicle/wcar-scorpion_REF.gc | 44 +- .../levels/desert/wvehicle/wcar-snake_REF.gc | 6 +- .../levels/desert/wvehicle/wcar-toad_REF.gc | 67 +- .../levels/desert/wvehicle/wcar-turtle_REF.gc | 2 +- .../levels/desert/wvehicle/wcar-x-ride_REF.gc | 6 +- .../jak3/levels/desert/wvehicle/wcar_REF.gc | 31 +- .../levels/desert/wvehicle/wvehicle-ai_REF.gc | 32 +- .../desert/wvehicle/wvehicle-obs_REF.gc | 14 +- .../desert/wvehicle/wvehicle-part_REF.gc | 2 +- .../desert/wvehicle/wvehicle-physics_REF.gc | 35 +- .../desert/wvehicle/wvehicle-race_REF.gc | 39 +- .../desert/wvehicle/wvehicle-states_REF.gc | 4 +- .../desert/wvehicle/wvehicle-util_REF.gc | 40 +- .../desert/wvehicle/wvehicle-wheel_REF.gc | 8 +- .../levels/desert/wvehicle/wvehicle_REF.gc | 31 +- .../factory/car/hvehicle-effects_REF.gc | 17 +- .../factory/car/hvehicle-physics_REF.gc | 46 +- .../levels/factory/car/hvehicle-util_REF.gc | 16 +- .../jak3/levels/factory/car/hvehicle_REF.gc | 26 +- .../levels/factory/car/wcar-faccar_REF.gc | 3 +- .../jak3/levels/factory/conveyor_REF.gc | 5 +- .../jak3/levels/factory/fac-gunturret_REF.gc | 84 +-- .../levels/factory/fac-robotank-turret_REF.gc | 36 +- .../jak3/levels/factory/fac-robotank_REF.gc | 8 +- .../jak3/levels/factory/fac-tower_REF.gc | 33 +- .../levels/factory/factory-boss-setup_REF.gc | 68 +- .../levels/factory/factory-boss-states_REF.gc | 30 +- .../levels/factory/factory-manager_REF.gc | 40 +- .../jak3/levels/factory/factoryb-init_REF.gc | 6 +- .../jak3/levels/factory/factoryc-obs2_REF.gc | 26 +- .../jak3/levels/factory/factoryc-obs_REF.gc | 51 +- .../levels/factory/ffight-projectile_REF.gc | 8 +- .../levels/factory/ftank-projectile_REF.gc | 12 +- .../levels/factory/fturret-projectile_REF.gc | 10 +- .../jak3/levels/factory/h-warf_REF.gc | 79 +-- .../jak3/levels/factory/lfaccity-mood_REF.gc | 7 +- .../jak3/levels/factory/lfacrm1-mood_REF.gc | 7 +- .../jak3/levels/factory/missile-bot_REF.gc | 93 +-- .../levels/factory/warf-projectile_REF.gc | 45 +- .../levels/forest/eco-green-collider_REF.gc | 6 +- .../jak3/levels/forest/for-turret-shot_REF.gc | 14 +- .../jak3/levels/forest/for-turret_REF.gc | 28 +- .../jak3/levels/forest/forest-bridges_REF.gc | 11 +- .../levels/forest/forest-kill-plants_REF.gc | 2 +- .../jak3/levels/forest/forest-part_REF.gc | 12 +- .../levels/forest/forest-ring-chase_REF.gc | 43 +- .../jak3/levels/forest/forest-tasks_REF.gc | 2 +- .../jak3/levels/forest/foresta-obs_REF.gc | 19 +- .../jak3/levels/forest/mh-plant_REF.gc | 21 +- .../jak3/levels/forest/neo-spawner_REF.gc | 30 +- .../jak3/levels/glider/glider-manager_REF.gc | 17 +- .../levels/glider/glider-ring-part_REF.gc | 8 +- .../jak3/levels/glider/glider-ring_REF.gc | 28 +- .../jak3/levels/glider/h-glider_REF.gc | 52 +- .../jak3/levels/gungame/gun-dummy_REF.gc | 28 +- .../levels/gungame/gungame-manager_REF.gc | 17 +- .../jak3/levels/gungame/gungame-obs_REF.gc | 1 + .../jak3/levels/hiphog/hiphog-scenes_REF.gc | 8 +- .../jak3/levels/intro/intro-obs_REF.gc | 5 +- .../levels/mhcity/destroy-dark-eco_REF.gc | 38 +- .../jak3/levels/mhcity/mhcity-obs2_REF.gc | 5 +- .../jak3/levels/mhcity/mhcity-obs_REF.gc | 33 +- .../jak3/levels/mhcity/mhcity-part_REF.gc | 11 +- .../reference/jak3/levels/mine/gekko_REF.gc | 196 +++--- .../reference/jak3/levels/mine/manta_REF.gc | 144 ++-- .../jak3/levels/mine/mine-obs_REF.gc | 18 +- .../jak3/levels/mine/mine-platforms_REF.gc | 17 +- .../jak3/levels/mine/mine-scenes_REF.gc | 5 +- .../jak3/levels/mine/mine-train_REF.gc | 17 +- .../jak3/levels/mine/mined-mood_REF.gc | 10 +- .../jak3/levels/mine/mined-scenes_REF.gc | 9 +- .../jak3/levels/mine/minee-scenes_REF.gc | 5 +- .../jak3/levels/mine/monster-frog_REF.gc | 87 +-- .../jak3/levels/mine/prebot-extras_REF.gc | 54 +- .../jak3/levels/mine/prebot-setup_REF.gc | 17 +- .../jak3/levels/mine/prebot-states_REF.gc | 41 +- .../reference/jak3/levels/mine/rat_REF.gc | 135 ++-- .../jak3/levels/nest/egg-spider_REF.gc | 129 ++-- .../reference/jak3/levels/nest/mh-bat_REF.gc | 90 +-- .../jak3/levels/nest/mh-centipede-part_REF.gc | 8 +- .../jak3/levels/nest/mh-centipede_REF.gc | 84 +-- .../reference/jak3/levels/nest/nst-obs_REF.gc | 170 +++-- .../jak3/levels/nest/nst-part_REF.gc | 26 +- .../jak3/levels/precursor/precura-obs2_REF.gc | 84 +-- .../jak3/levels/precursor/precura-obs_REF.gc | 74 +- .../jak3/levels/precursor/precurc-obs_REF.gc | 10 +- .../jak3/levels/precursor/precurd-obs_REF.gc | 28 +- .../jak3/levels/precursor/prim-beam_REF.gc | 20 +- .../jak3/levels/sewer/flyingsaw_REF.gc | 15 +- .../jak3/levels/sewer/jump-pad_REF.gc | 1 + .../jak3/levels/sewer/kg-hopper_REF.gc | 105 +-- .../jak3/levels/sewer/mh-wasp_REF.gc | 96 +-- .../jak3/levels/sewer/needle-fish_REF.gc | 84 +-- .../jak3/levels/sewer/neo-grenadier_REF.gc | 117 ++-- .../jak3/levels/sewer/neo-juicer_REF.gc | 128 ++-- .../levels/sewer/saberfish-spawner_REF.gc | 14 +- .../jak3/levels/sewer/saberfish_REF.gc | 208 +++--- .../jak3/levels/sewer/sew-laser-guard_REF.gc | 77 ++- .../jak3/levels/sewer/sew-laser-turret_REF.gc | 90 +-- .../jak3/levels/sewer/sew-platforms_REF.gc | 25 +- .../jak3/levels/sewer/sew-whirlpool_REF.gc | 1 + .../jak3/levels/sewer/sewer-frog_REF.gc | 92 +-- .../levels/sewer/sewer-move-turret_REF.gc | 17 +- .../jak3/levels/sewer/sewer-obs2_REF.gc | 10 +- .../jak3/levels/sewer/sewer-obs_REF.gc | 91 ++- .../jak3/levels/sewer/sewer-part_REF.gc | 8 +- .../jak3/levels/stadium/dm-mine-spider_REF.gc | 125 ++-- .../jak3/levels/stadium/king-rider_REF.gc | 8 +- .../jak3/levels/stadium/rapid-gunner_REF.gc | 96 +-- .../jak3/levels/stadium/rubble-attack_REF.gc | 26 +- .../jak3/levels/stadium/rubble-obs_REF.gc | 22 +- .../jak3/levels/stadium/stadium-obs_REF.gc | 17 +- .../jak3/levels/temple/flamer-hover_REF.gc | 84 +-- .../jak3/levels/temple/hover-training_REF.gc | 9 +- .../jak3/levels/temple/temple-obs2_REF.gc | 23 +- .../jak3/levels/temple/temple-obs_REF.gc | 22 +- .../jak3/levels/temple/templed-obs_REF.gc | 17 +- .../jak3/levels/temple/templex-obs_REF.gc | 5 +- .../jak3/levels/temple/templex-scenes_REF.gc | 5 +- .../levels/temple/tomb-baby-spider_REF.gc | 96 +-- .../jak3/levels/title/title-obs_REF.gc | 14 +- .../jak3/levels/tower/tower-obs_REF.gc | 22 +- .../jak3/levels/volcano/flamer-lava_REF.gc | 122 ++-- .../jak3/levels/volcano/flut-wild_REF.gc | 85 +-- .../jak3/levels/volcano/spiky-frog_REF.gc | 89 +-- .../jak3/levels/volcano/volcano-obs2_REF.gc | 12 +- .../jak3/levels/volcano/volcano-obs_REF.gc | 43 +- .../jak3/levels/volcano/volcano-part_REF.gc | 8 +- .../jak3/levels/volcano/volcano-scenes_REF.gc | 2 +- .../jak3/levels/volcano/volcanox-obs_REF.gc | 9 +- .../wascity/bbush/des-bush-time-chase_REF.gc | 14 +- .../levels/wascity/chase/kanga-lizard_REF.gc | 79 ++- .../jak3/levels/wascity/cty-faction_REF.gc | 24 +- .../jak3/levels/wascity/ctymark-obs-h_REF.gc | 8 +- .../jak3/levels/wascity/ctymark-obs_REF.gc | 3 +- .../levels/wascity/defend/was-pre-game_REF.gc | 15 +- .../jak3/levels/wascity/dm-flyer_REF.gc | 22 +- .../jak3/levels/wascity/dogat_REF.gc | 82 +-- .../levels/wascity/doors/wasdoors-init_REF.gc | 10 +- .../jak3/levels/wascity/flee-info_REF.gc | 20 +- .../levels/wascity/formation-object_REF.gc | 8 +- .../jak3/levels/wascity/formations_REF.gc | 6 +- .../wascity/leaper/was-leaper-race_REF.gc | 15 +- .../levels/wascity/maker-projectile_REF.gc | 10 +- .../levels/wascity/palace/waspala-obs_REF.gc | 3 + .../levels/wascity/squad-control-city_REF.gc | 2 +- .../jak3/levels/wascity/tizard_REF.gc | 4 +- .../jak3/levels/wascity/traffic-util_REF.gc | 40 +- .../jak3/levels/wascity/wasall-obs_REF.gc | 14 +- .../jak3/levels/wascity/wasall-tasks_REF.gc | 8 +- .../jak3/levels/wascity/wascity-turret_REF.gc | 32 +- .../jak3/levels/wascity/wascitya-obs_REF.gc | 1 + .../jak3/levels/wascity/wasdef-manager_REF.gc | 75 +- .../jak3/levels/wascity/wasgun-hud_REF.gc | 4 +- .../jak3/levels/wascity/wasgun-manager_REF.gc | 20 +- .../wascity/wasstadium/nst-eggs-h_REF.gc | 30 +- .../levels/wascity/wasstadium/nst-gas_REF.gc | 23 +- .../wascity/wasstadium/nst-tasks_REF.gc | 6 +- .../wascity/wasstadium/sig-rider_REF.gc | 6 +- .../wascity/wasstadium/wasstada-obs_REF.gc | 15 +- .../wascity/wasstadium/wasstada-part_REF.gc | 17 +- .../wascity/wasstadium/wasstadb-obs_REF.gc | 24 +- .../wascity/wasstadium/wasstadc-obs_REF.gc | 59 +- .../jak3/levels/wascity/waswide-obs_REF.gc | 17 +- .../jak3/levels/wascity/wlander-female_REF.gc | 79 ++- .../jak3/levels/wascity/wlander-male_REF.gc | 183 ++--- test/offline/config/jak3/config.jsonc | 4 +- 1009 files changed, 21556 insertions(+), 22544 deletions(-) diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 4210b6bee99..e16f9c9c915 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -2964,6 +2964,121 @@ bool try_to_rewrite_vector_inline_ctor(const Env& env, return false; } +bool try_to_rewrite_matrix_inline_copy(const Env& env, FormPool& pool, FormStack& stack) { + if (env.func->name() == "(method 63 collide-shape-moving)") { + return false; + } + auto matrix_entries = + stack.try_getting_active_stack_entries({true, true, true, true, false, false, false, false}); + if (matrix_entries) { + // first, check the loads. they should be something like source = (-> MAT vec quad) + // MAT should always be a variable + const char* names[] = {"rvec", "uvec", "fvec", "trans"}; + + std::vector load_src_ras, store_dest_ras, store_src_ras; + for (int i = 0; i < 4; i++) { + auto deref_matcher = + Matcher::deref(Matcher::any_reg(0), false, + {DerefTokenMatcher::string(names[i]), DerefTokenMatcher::string("quad")}); + auto mr = match(deref_matcher, matrix_entries->at(i).source, &env); + if (!mr.matched) { + return false; + } + load_src_ras.push_back(mr.maps.regs.at(0).value()); + } + + // check the stores + for (int i = 4; i < 8; i++) { + Matcher matcher = Matcher::set(Matcher::deref(Matcher::any_reg(0), false, + {DerefTokenMatcher::string(names[i - 4]), + DerefTokenMatcher::string("quad")}), + Matcher::any_reg(1)); + auto mr = match(matcher, matrix_entries->at(i).elt, &env); + if (!mr.matched) { + return false; + } + store_dest_ras.push_back(mr.maps.regs.at(0).value()); + store_src_ras.push_back(mr.maps.regs.at(1).value()); + } + + // check loads are all loading from the same matrix + for (int i = 1; i < 4; i++) { + if (load_src_ras.at(i).reg() != load_src_ras.at(0).reg()) { + return false; + } + } + + // check stores are all storing to the same matrix + for (int i = 1; i < 4; i++) { + if (store_dest_ras.at(i).reg() != store_dest_ras.at(0).reg()) { + return false; + } + } + + // check temps are consistent + for (int i = 0; i < 4; i++) { + if (store_src_ras.at(i).reg() != matrix_entries->at(i).destination.value().reg()) { + return false; + } + } + + // check types + if (env.get_variable_type(load_src_ras.at(0), true) != TypeSpec("matrix")) { + return false; + } + + if (env.get_variable_type(store_dest_ras.at(0), true) != TypeSpec("matrix")) { + return false; + } + + stack.pop(8); + auto* menv = const_cast(&env); + for (int i = 0; i < 4; i++) { + menv->disable_use(store_dest_ras.at(i)); + } + + auto src_repopped = stack.pop_reg(load_src_ras.at(0), {}, env, true); + if (!src_repopped) { + // lg::info("repop src failed!!"); + src_repopped = var_to_form(load_src_ras.at(0), pool); + } else { + // lg::info(" popped src: {}", src_repopped->to_string(env)); + } + + // src_repopped = matrix_entries->at(0).source; + bool found = false; + RegisterAccess ra; + auto dst_repopped = stack.pop_reg(store_dest_ras.at(0).reg(), {}, env, true, -1, &ra, &found); + if (!dst_repopped) { + // lg::info("repop dst failed!!"); + dst_repopped = var_to_form(store_dest_ras.at(0), pool); + } else { + ASSERT(found); + // lg::info(" popped dst: {} {} {}", dst_repopped->to_string(env), ra.reg().to_string(), + // ra.mode() == AccessMode::WRITE); + } + + if (found) { + stack.push_value_to_reg( + ra, + pool.form( + GenericOperator::make_function(pool.form("matrix-copy!")), + std::vector{dst_repopped, src_repopped}), + true, TypeSpec("matrix")); + } else { + stack.push_form_element( + pool.alloc_element( + GenericOperator::make_function(pool.form("matrix-copy!")), + std::vector{dst_repopped, src_repopped}), + true); + } + + return true; + } + + return false; +} + bool try_to_rewrite_matrix_inline_ctor(const Env& env, FormPool& pool, FormStack& stack) { // now, let's check for a matrix initialization. auto matrix_entries = stack.try_getting_active_stack_entries({true, false, false, false, false}); @@ -2983,54 +3098,79 @@ bool try_to_rewrite_matrix_inline_ctor(const Env& env, FormPool& pool, FormStack // zeroing the rows: std::vector write_vars; - if (env.version == GameVersion::Jak1) { - for (int i = 0; i < 4; i++) { - auto elt = matrix_entries->at(i + 1).elt; + switch (env.version) { + case GameVersion::Jak1: { + for (int i = 0; i < 4; i++) { + auto elt = matrix_entries->at(i + 1).elt; - auto matcher = Matcher::set( - Matcher::deref(Matcher::any_reg(0), false, - {DerefTokenMatcher::string("vector"), DerefTokenMatcher::integer(i), - DerefTokenMatcher::string("quad")}), - Matcher::cast("uint128", Matcher::integer(0))); + auto matcher = Matcher::set( + Matcher::deref(Matcher::any_reg(0), false, + {DerefTokenMatcher::string("vector"), DerefTokenMatcher::integer(i), + DerefTokenMatcher::string("quad")}), + Matcher::cast("uint128", Matcher::integer(0))); - auto mr = match(matcher, elt); - if (mr.matched) { - if (var_name != env.get_variable_name(*mr.maps.regs.at(0))) { + auto mr = match(matcher, elt); + if (mr.matched) { + if (var_name != env.get_variable_name(*mr.maps.regs.at(0))) { + return false; + } + write_vars.push_back(*mr.maps.regs.at(0)); + } else { return false; } - write_vars.push_back(*mr.maps.regs.at(0)); - } else { - return false; } - } - } else { - for (int i = 0; i < 4; i++) { - auto elt = matrix_entries->at(i + 1).elt; + } break; + case GameVersion::Jak2: { + for (int i = 0; i < 4; i++) { + auto elt = matrix_entries->at(i + 1).elt; + + Matcher matcher; + if (i == 3) { + matcher = Matcher::set(Matcher::deref(Matcher::any_reg(0), false, + {DerefTokenMatcher::string("trans"), + DerefTokenMatcher::string("quad")}), + Matcher::cast("uint128", Matcher::integer(0))); - Matcher matcher; - if (i == 3) { - matcher = Matcher::set(Matcher::deref(Matcher::any_reg(0), false, - {DerefTokenMatcher::string("trans"), - DerefTokenMatcher::string("quad")}), - Matcher::cast("uint128", Matcher::integer(0))); + } else { + matcher = Matcher::set( + Matcher::deref(Matcher::any_reg(0), false, + {DerefTokenMatcher::string("quad"), DerefTokenMatcher::integer(i)}), + Matcher::cast("uint128", Matcher::integer(0))); + } - } else { - matcher = Matcher::set( - Matcher::deref(Matcher::any_reg(0), false, - {DerefTokenMatcher::string("quad"), DerefTokenMatcher::integer(i)}), - Matcher::cast("uint128", Matcher::integer(0))); + auto mr = match(matcher, elt); + if (mr.matched) { + if (var_name != env.get_variable_name(*mr.maps.regs.at(0))) { + return false; + } + write_vars.push_back(*mr.maps.regs.at(0)); + } else { + return false; + } } - - auto mr = match(matcher, elt); - if (mr.matched) { - if (var_name != env.get_variable_name(*mr.maps.regs.at(0))) { + } break; + case GameVersion::Jak3: { + for (int i = 0; i < 4; i++) { + auto elt = matrix_entries->at(i + 1).elt; + + const char* names[] = {"rvec", "uvec", "fvec", "trans"}; + + Matcher matcher = Matcher::set(Matcher::deref(Matcher::any_reg(0), false, + {DerefTokenMatcher::string(names[i]), + DerefTokenMatcher::string("quad")}), + Matcher::cast("uint128", Matcher::integer(0))); + + auto mr = match(matcher, elt); + if (mr.matched) { + if (var_name != env.get_variable_name(*mr.maps.regs.at(0))) { + return false; + } + write_vars.push_back(*mr.maps.regs.at(0)); + } else { return false; } - write_vars.push_back(*mr.maps.regs.at(0)); - } else { - return false; } - } + } break; } // success! @@ -3050,6 +3190,70 @@ bool try_to_rewrite_matrix_inline_ctor(const Env& env, FormPool& pool, FormStack return false; } +bool is_deref_to_quad(DerefElement* deref) { + return deref && !deref->is_addr_of() && !deref->tokens().empty() && + deref->tokens().back().is_field_name("quad"); +} + +Form* pop_last_deref_token(Form* form) { + auto deref = form->try_as_element(); + ASSERT(deref); + if (deref->tokens().size() == 1) { + return deref->base(); + } else { + deref->tokens().pop_back(); + return form; + } +} + +FormElement* try_to_rewrite_vector_copy(Form* dst, + const TypeSpec& dst_type, + Form* src, + const TypeSpec& src_type, + FormPool& pool, + const Env& env) { + if (env.func->name() == "vector-copy!") { + return nullptr; + } + + if (dst && src) { + // check types + if (dst_type != TypeSpec("vector")) { + return nullptr; + } + + // kinda sus - we really want to check the place where this was loaded... + if (src_type != TypeSpec("uint128")) { + return nullptr; + } + + auto* dst_deref = dst->try_as_element(); + auto* src_deref = src->try_as_element(); + if (!dst_deref) { + return nullptr; + } + + if (!src_deref) { + return nullptr; + } + + if (!is_deref_to_quad(dst_deref)) { + return nullptr; + } + + if (!is_deref_to_quad(src_deref)) { + return nullptr; + } + + auto ret = pool.alloc_element( + GenericOperator::make_function(pool.form("vector-copy!")), + std::vector{pop_last_deref_token(dst), pop_last_deref_token(src)}); + // lg::info("success: {}\n", ret->to_string(env)); + return ret; + } + return nullptr; +} + } // namespace void StorePlainDeref::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) { @@ -3066,14 +3270,27 @@ void StorePlainDeref::push_to_stack(const Env& env, FormPool& pool, FormStack& s if (size() == 16) { std::swap(popped.at(0), popped.at(1)); } - m_dst->try_as_element()->set_base( - make_optional_cast(m_dst_cast_type, popped.at(1), pool, env)); + auto dst_deref = m_dst->try_as_element(); + dst_deref->set_base(make_optional_cast(m_dst_cast_type, popped.at(1), pool, env)); m_dst->mark_popped(); - m_dst->try_as_element()->inline_nested(); - auto fr = pool.alloc_element( - m_dst, make_optional_cast(m_src_cast_type, popped.at(0), pool, env)); - // so the bitfield set check can run - fr->mark_popped(); + dst_deref->inline_nested(); + + FormElement* fr = nullptr; + + // hack: for now only do this on Jak 3 + if (size() == 16 && env.version == GameVersion::Jak3) { + fr = try_to_rewrite_vector_copy( + m_dst, env.get_variable_type(m_base_var, true), popped.at(0), + m_src_cast_type.value_or(env.get_variable_type(m_expr.var(), true)), pool, env); + } + + if (!fr) { + fr = pool.alloc_element( + m_dst, make_optional_cast(m_src_cast_type, popped.at(0), pool, env)); + // so the bitfield set check can run + fr->mark_popped(); + } + fr->push_to_stack(env, pool, stack); } else { auto vars = std::vector({m_base_var}); @@ -3092,7 +3309,9 @@ void StorePlainDeref::push_to_stack(const Env& env, FormPool& pool, FormStack& s if (!try_to_rewrite_matrix_inline_ctor(env, pool, stack)) { if (!try_to_rewrite_vector_inline_ctor(env, pool, stack, "vector")) { - try_to_rewrite_vector_inline_ctor(env, pool, stack, "quaternion"); + if (!try_to_rewrite_vector_inline_ctor(env, pool, stack, "quaternion")) { + try_to_rewrite_matrix_inline_copy(env, pool, stack); + } } } } diff --git a/decompiler/analysis/insert_lets.cpp b/decompiler/analysis/insert_lets.cpp index 6328f6e34ea..e932960051a 100644 --- a/decompiler/analysis/insert_lets.cpp +++ b/decompiler/analysis/insert_lets.cpp @@ -2716,8 +2716,12 @@ FormElement* rewrite_launch_particles(LetElement* in, const Env& env, FormPool& } auto set_elt = dynamic_cast(in->body()->at(0)); + GenericElement* vector_copy_elt = nullptr; if (!set_elt) { - return nullptr; + vector_copy_elt = dynamic_cast(in->body()->at(0)); + if (!vector_copy_elt || vector_copy_elt->op().to_form(env).print() != "vector-copy!") { + return nullptr; + } } auto func_elt = dynamic_cast(in->body()->at(1)); @@ -2747,19 +2751,24 @@ FormElement* rewrite_launch_particles(LetElement* in, const Env& env, FormPool& return nullptr; } - auto origin = dynamic_cast(set_elt->src()->elts().at(0)); - if (!origin) { - return nullptr; - } - auto tokens = origin->tokens().size(); - Form* origin_form; - // remove only the quad if there are multiple derefs - if (tokens > 1) { - origin_form = pool.form(origin->base(), false, origin->tokens()); - auto orig = dynamic_cast(origin_form->elts().at(0)); - orig->tokens().pop_back(); + Form* origin_form = nullptr; + if (set_elt) { + auto origin = dynamic_cast(set_elt->src()->elts().at(0)); + auto tokens = origin->tokens().size(); + // remove only the quad if there are multiple derefs + if (tokens > 1) { + origin_form = pool.form(origin->base(), false, origin->tokens()); + auto orig = dynamic_cast(origin_form->elts().at(0)); + orig->tokens().pop_back(); + } else { + origin_form = origin->base(); + } } else { - origin_form = origin->base(); + // the vector copy rewrite already did the logic above. + origin_form = vector_copy_elt->elts().at(1); + } + if (!origin_form) { + return nullptr; } auto launch_state = func_elt->elts().at(func_elt->elts().size() - 3); diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 67373676303..788bd08f307 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -219,31 +219,6 @@ :flag-assert #xe00000010 ) -#| -(deftype array (UNKNOWN) - ((allocated-length int32 :offset-assert 4) - (length int32 :offset-assert 0) - (content-type type :offset-assert 8) ;; guessed by decompiler - (data uint8 :dynamic :offset-assert 12) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ) -|# - (define-extern identity "The identity function." (function object object)) @@ -557,9 +532,9 @@ (new "Allocate a process-tree with the kernel clock." (symbol type string) _type_) ;; 0 (activate "Move a process from dead to active, moving it to the given tree." (_type_ process-tree string pointer) process-tree) ;; 9 (deactivate "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." (_type_) none) ;; 10 - (init-from-entity! (_type_ entity-actor) object) ;; 11 + (init-from-entity! "Set up a newly created process from the entity that created it." (_type_ entity-actor) object) ;; 11 (run-logic? "Should this process be run? Checked by execute-process-tree." (_type_) symbol) ;; 12 - (process-tree-method-13 () none) ;; 13 + (entity-info-slot "Not a method. This vtable slot stores entity-info for this type." () none) ;; 13 ) ) @@ -1971,6 +1946,8 @@ ) (deftype lissajous (structure) + "A curve where the x and y position are set by two different sinusoids. + This stores the parameters and state for evaluating this curve." ((x-mag float :offset-assert 0) (y-mag float :offset-assert 4) (theta float :offset-assert 8) @@ -1984,11 +1961,14 @@ :size-assert #x1c :flag-assert #xa0000001c (:methods - (lissajous-method-9 (_type_ vector) vector) ;; 9 + (evaluate! "Set the x and y component of the vector to the current point on the curve." + (_type_ vector) vector) ;; 9 ) ) (deftype lissajous-interp (structure) + "Handles interpolating between two different lissajous parameters, and also + stepping forward the dynamics." ((current lissajous :inline :offset-assert 0) (dest lissajous :inline :offset-assert 28) (rate lissajous :inline :offset-assert 56) @@ -1997,8 +1977,10 @@ :size-assert #x54 :flag-assert #xb00000054 (:methods - (lissajous-interp-method-9 (_type_ vector) vector) ;; 9 - (lissajous-interp-method-10 (_type_) float) ;; 10 + (evaluate! "Set the x and y component of the vector to the current point on the curve." + (_type_ vector) vector) ;; 9 + (update! "Update both the interpolation, and the curves themselves." + (_type_) float) ;; 10 ) ) @@ -2012,6 +1994,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (deftype transformq (transform) + "A transform, but the rotation is represented with a quaternion." ((quat quaternion :inline :offset 16 :score 1) ) :method-count-assert 9 @@ -2020,6 +2003,7 @@ ) (deftype trsq (trs) + "A trs, but the rotation is represented with a quaternion." ((quat quaternion :inline :offset 32 :score 1) ) :method-count-assert 9 @@ -2296,8 +2280,6 @@ ;; quaternion ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; quaternion is already defined! - (define-extern quaternion-axis-angle! "Construct a quaternion from an axis and angle. The axis should be normalized." (function quaternion float float float float quaternion)) @@ -5861,7 +5843,7 @@ (define-extern matrix-remove-z-rot "Remove the z rotation component of a rotation." (function matrix vector matrix)) (define-extern matrix-rot-diff! "Get the difference of rotation between two matrices, expressed as a quaternion." - (function vector matrix matrix float)) + (function quaternion matrix matrix float)) (define-extern quaternion-seek "Strange quaternion rotate toward function. arg3 is ignored. arg4 is the max seek amount." (function quaternion quaternion quaternion float float quaternion)) @@ -7903,7 +7885,7 @@ (update-vis-volumes (_type_) none) ;; 23 ;; (art-group-get-by-name (_type_ string (pointer uint32)) art-group) (level-group-method-24 (_type_) none) ;; 24 ;; (alt-load-command-get-index (_type_ symbol int) pair) (print-volume-sizes (_type_) none) ;; 25 - (status-of-level-and-borrows "Get the combined status of a level and borrow levels." (_type_ symbol symbol) symbol) ;; 26 ;; (update-vis-volumes-from-nav-mesh (_type_) none) + (level-status? "Get the combined status of a level and borrow levels." (_type_ symbol symbol) symbol) ;; 26 ;; (update-vis-volumes-from-nav-mesh (_type_) none) (do-nothing "Empty method." (_type_) none) ;; 27 (load-in-progress? "Is there a load happening now?" (_type_) symbol) ;; 28 ;; (level-status (_type_ symbol) symbol) (is-load-allowed? "Does the exclusive-load setting allow us to load this level?" (_type_ (pointer symbol)) symbol) ;; 29 @@ -17330,7 +17312,7 @@ (task-node-commands (array game-task-node-command) :offset-assert 416) (task-node-exclusive (array uint16) :offset-assert 420) (task-counter uint32 :offset-assert 424) - (unknown-arr4 (array uint16) :offset-assert 428) + (talker-state (array uint16) :offset-assert 428) (level-opened uint8 32 :offset-assert 432) (total-deaths int32 :offset-assert 464) (continue-deaths int32 :offset-assert 468) @@ -17567,20 +17549,25 @@ (defenum talker-flags :type uint16 :bitfield #t - (tf0 0) - (tf1 1) - (tf2 2) - (tf3 3) - (tf4 4) - (tf5 5) - (tf6 6) - (tf7 7) - (tf8 8) + (play-only-once 0) + (reduce-volume 1) + (auto-save-on-each-start 2) + (auto-save-once-on-exit 3) + (only-play-in-region 4) + (fade-in 5) + (slide-in 6) + (bigger-font 7) + (long-timeout 8) ) ;; ---ambient-h:talker-flags (deftype talker-speech-class (structure) - "Contains metadata about a voice line or hint text being played/displayed." + "Contains metadata about a voice line or hint text being played/displayed. + In the talker state, there's a pos-state and neg-state. + Calling yes-play! adjusts the pos-state and no-play! adjusts the neg-state. + Playback is only allowed if the pos-state is less than or equal to pos + and neg-state is greater than or equal to neg. + " ((name string :offset-assert 0) (channel gui-channel :offset-assert 4) (flags talker-flags :offset-assert 6) @@ -17599,11 +17586,11 @@ :flag-assert #xe00000020 ;; field on-close uses ~A with a signed load. (:methods - (talker-speech-class-method-9 (_type_) symbol) ;; 9 - (play-communicator-speech! (_type_) none) ;; 10 - (talker-speech-class-method-11 (_type_) none) ;; 11 - (talker-speech-class-method-12 (_type_ int) none) ;; 12 - (talker-speech-class-method-13 (_type_ int) none) ;; 13 + (should-play? "Return if the talker is in a state where it should play." (_type_) symbol) ;; 9 + (mark-played! "Mark something as played by making its state UINT16_MAX" (_type_) none) ;; 10 + (reset-state! "Reset the state of this talker to 0 (the initial value)" (_type_) none) ;; 11 + (yes-play! (_type_ int) none) ;; 12 + (no-play! (_type_ int) none) ;; 13 ) ) @@ -19466,11 +19453,6 @@ :bitfield #t :type uint32 (disabled) ;; keep object velocity - (af01) - (af02) - (af03) - (af04) - (af05) ) ;; ---aligner-h:align-flags @@ -19656,9 +19638,9 @@ (sf23 23) (sf24 24) (sf25 25) - (sf26 26) + (hang 26) (sf27 27) - (sf28 28) + (invisible 28) (sf29 29) (sf30 30) (sf31 31) @@ -22017,8 +21999,8 @@ (unknown-float37 float :offset 5636) (unknown-vector37 vector :inline :offset 5648) (unknown-vector38 vector :inline :offset 5664) - (unknown-vector39 vector :inline :offset 5680) - (unknown-vector40 vector :inline :offset 5696) + (unknown-quat39 quaternion :inline :offset 5680) + (unknown-quat40 quaternion :inline :offset 5696) (sliding-start-time time-frame :offset 5712) (unknown-time-frame18 time-frame :offset 5720) (unknown-sound-id00 sound-id :offset 5776) @@ -22466,12 +22448,12 @@ :size-assert #xd0 :flag-assert #x1c005000d0 (:methods - (process-mask->search-info-flag (_type_) search-info-flag) ;; 20 + (get-search-info-flag "Get search-info-flag for this process." (_type_) search-info-flag) ;; 20 (get-trans "Get the `trans` for this process." (_type_ int) vector) ;; 21 (get-quat "Get the quaternion for this process." (_type_ int) quaternion) ;; 22 (get-transv "Get the `transv` for this process." (_type_) vector) ;; 23 (time-to-apex-or-ground (_type_ int) int) ;; 24 - (get-water-height (_type_) meters) ;; 25 + (get-water-height "Get the height of the water that we're in." (_type_) meters) ;; 25 (get-notice-time (_type_) time-frame) ;; 26 (get-inv-mass (_type_) float) ;; 27 ) @@ -22551,7 +22533,7 @@ check that the [[collide-spec]] of the focus and the process match." (_type_ process-focusable) object) ;; 10 (reset-to-collide-spec "Reset this focus with the given [[collide-spec]]." (_type_ collide-spec) none) ;; 11 - (try-update-focus "Try to set the `handle` of this focus to the given process." (_type_ process-focusable) symbol) ;; 12 + (focus-on! "Set the `handle` of this focus to the given process. Return if the handle changed." (_type_ process-focusable) symbol) ;; 12 ) ) @@ -25794,7 +25776,7 @@ (bit-4 4) (bit-5 5) (subtask-complete 6) - (bit-7 7) + (special 7) (complete 8) (bit-9 9) (bit-10 10) @@ -29132,7 +29114,7 @@ (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) ;; 21 (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) ;; 22 (set-spheres-from-nav-ids (_type_) none) ;; 23 - (add-root-sphere-to-hash! (_type_ vector int) symbol) ;; 24 + (check-sphere-blocked! (_type_ vector int) symbol) ;; 24 (get-max-rotation-rate (_type_) float) ;; 25 (get-sphere-mask (_type_) uint) ;; 26 (get-target-speed (_type_) meters) ;; 27 @@ -29286,7 +29268,7 @@ (add-a-sphere-with-flag (_type_ vector int) int) ;; 27 (update-from-spheres (_type_) none) ;; 28 (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) ;; 29 - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) ;; 30 + (check-sphere-blocked (_type_ vector int int) symbol) ;; 30 (add-sphere-with-mask-and-id (_type_ vector vector float int) symbol) ;; 31 (sphere-hash-method-32 (_type_ sphere int) symbol) ;; 32 ) @@ -41339,11 +41321,11 @@ ;; +++enemy-h:enemy-aware (defenum enemy-aware :type uint64 - (ea0 0) - (ea1 1) - (ea2 2) - (ea3 3) - (ea4 4) + (unaware 0) + (aware1 1) + (aware2 2) + (hostile 3) + (flee 4) ) ;; ---enemy-h:enemy-aware @@ -41388,6 +41370,7 @@ (death-start 34) (auto-death-phase-out 35) (has-gem 36) + ;; these seem to be an extension of the flags for nav-enemy. (ef37 37) (ef38 38) (ef39 39) @@ -41408,8 +41391,10 @@ :size-assert #x20 :flag-assert #xe00000020 (:methods - (try-update-focus (_type_ process-focusable enemy) symbol :replace) ;; 12 - (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol) ;; 13 + (focus-on! "Make this enemy focus on the process-focusable. If already focused, update awareness." + (_type_ process-focusable enemy) symbol :replace) ;; 12 + (focus-on-with-awareness! "Focus on the process-focusable, updating the aware." + (_type_ process-focusable enemy-aware) symbol) ;; 13 ) ) @@ -41463,34 +41448,34 @@ (jump-height-min meters :offset-assert 244) (jump-height-factor float :offset-assert 248) (knocked-seek-ry-clamp float :offset-assert 252) - (knocked-soft-vxz-lo float :offset-assert 256) - (knocked-soft-vxz-hi float :offset-assert 260) - (knocked-soft-vy-lo float :offset-assert 264) - (knocked-soft-vy-hi float :offset-assert 268) - (knocked-medium-vxz-lo float :offset-assert 272) - (knocked-medium-vxz-hi float :offset-assert 276) - (knocked-medium-vy-lo float :offset-assert 280) - (knocked-medium-vy-hi float :offset-assert 284) - (knocked-hard-vxz-lo float :offset-assert 288) - (knocked-hard-vxz-hi float :offset-assert 292) - (knocked-hard-vy-lo float :offset-assert 296) - (knocked-hard-vy-hi float :offset-assert 300) - (knocked-huge-vxz-lo float :offset-assert 304) - (knocked-huge-vxz-hi float :offset-assert 308) - (knocked-huge-vy-lo float :offset-assert 312) - (knocked-huge-vy-hi float :offset-assert 316) - (knocked-yellow-vxz-lo float :offset-assert 320) - (knocked-yellow-vxz-hi float :offset-assert 324) - (knocked-yellow-vy-lo float :offset-assert 328) - (knocked-yellow-vy-hi float :offset-assert 332) - (knocked-red-vxz-lo float :offset-assert 336) - (knocked-red-vxz-hi float :offset-assert 340) - (knocked-red-vy-lo float :offset-assert 344) - (knocked-red-vy-hi float :offset-assert 348) - (knocked-blue-vxz-lo float :offset-assert 352) - (knocked-blue-vxz-hi float :offset-assert 356) - (knocked-blue-vy-lo float :offset-assert 360) - (knocked-blue-vy-hi float :offset-assert 364) + (knocked-soft-vxz-lo meters :offset-assert 256) + (knocked-soft-vxz-hi meters :offset-assert 260) + (knocked-soft-vy-lo meters :offset-assert 264) + (knocked-soft-vy-hi meters :offset-assert 268) + (knocked-medium-vxz-lo meters :offset-assert 272) + (knocked-medium-vxz-hi meters :offset-assert 276) + (knocked-medium-vy-lo meters :offset-assert 280) + (knocked-medium-vy-hi meters :offset-assert 284) + (knocked-hard-vxz-lo meters :offset-assert 288) + (knocked-hard-vxz-hi meters :offset-assert 292) + (knocked-hard-vy-lo meters :offset-assert 296) + (knocked-hard-vy-hi meters :offset-assert 300) + (knocked-huge-vxz-lo meters :offset-assert 304) + (knocked-huge-vxz-hi meters :offset-assert 308) + (knocked-huge-vy-lo meters :offset-assert 312) + (knocked-huge-vy-hi meters :offset-assert 316) + (knocked-yellow-vxz-lo meters :offset-assert 320) + (knocked-yellow-vxz-hi meters :offset-assert 324) + (knocked-yellow-vy-lo meters :offset-assert 328) + (knocked-yellow-vy-hi meters :offset-assert 332) + (knocked-red-vxz-lo meters :offset-assert 336) + (knocked-red-vxz-hi meters :offset-assert 340) + (knocked-red-vy-lo meters :offset-assert 344) + (knocked-red-vy-hi meters :offset-assert 348) + (knocked-blue-vxz-lo meters :offset-assert 352) + (knocked-blue-vxz-hi meters :offset-assert 356) + (knocked-blue-vy-lo meters :offset-assert 360) + (knocked-blue-vy-hi meters :offset-assert 364) (ragdoll-info ragdoll-setup :offset-assert 368) (shadow-size meters :offset-assert 372) (shadow-max-y meters :offset-assert 376) @@ -41534,6 +41519,16 @@ (ejf6 6) (ejf7 7) ) + +(defenum jump-stage + :type int32 + (init 0) + (winding-up 1) + (takeoff 2) + (in-air 3) + (touchdown 4) + (landing 5) + ) ;; ---enemy-h:enemy-jump-flags (deftype enemy-jump-info (structure) @@ -41658,109 +41653,125 @@ gun-dark-2-stretch ;; 49 ) (:methods - (enemy-method-50 (_type_ int) none) ;; 50 - (accelerate-fall! (_type_ vector) float) ;; 51 - (damage-enemy! (_type_ object event-message-block) float) ;; 52 - (reset-penetrate! (_type_) none) ;; 53 - (get-knockback-dir! (_type_ vector) vector) ;; 54 - (get-knockback-angle (_type_) degrees) ;; 55 - (knocked-handler (_type_ vector) object) ;; 56 - (can-collide-with-focus? (_type_ process-focusable) object) ;; 57 - (check-water (_type_) object) ;; 58 - (enemy-common-post (_type_) none) ;; 59 - (lerp-damage (_type_ float) float) ;; 60 - (scale-impact-vel-y! (_type_ vector vector float) vector) ;; 61 - (get-damage-from-attack (_type_ object event-message-block) float) ;; 62 - (enemy-method-63 (_type_ float) float) ;; 63 - (update-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware) ;; 64 - (penetrate->next-state (_type_ process event-message-block float) symbol) ;; 65 - (get-penetrated-by (_type_) penetrate) ;; 66 - (coin-flip? (_type_) symbol) ;; 67 - (get-enemy-aware (_type_ enemy-aware) enemy-aware) ;; 68 - (enemy-method-69 (_type_) none) ;; 69 - (enemy-method-70 (_type_ process-focusable enemy-aware) none) ;; 70 - (go-dormant (_type_) object) ;; 71 - (go-dormant-aware (_type_) object) ;; 72 - (go-idle (_type_) object) ;; 73 - (go-ambush-delay (_type_) object) ;; 74 + (update-collision-action "Change the collision for certain conditions (knocked, etc)" (_type_ int) none) ;; 50 + (adjust-transv-under-water! "Modify the velocity as needed if the enemy is underwater." (_type_ vector) float) ;; 51 + (damage-enemy-from-attack! "Given an attack message, apply damage." (_type_ object event-message-block) float) ;; 52 + (reset-penetrate-later! "After a little bit, reset the penetrate flags back to default." (_type_) none) ;; 53 + (get-knockback-dir! "Compute the knockback direction for an incoming attack." (_type_ vector) vector) ;; 54 + (get-knockback-angle "Get the yaw angle for the current knock." (_type_) degrees) ;; 55 + (knocked-handler "Called when this enemy is knocked." (_type_ vector) object) ;; 56 + (can-focus-on? "Check that this enemy can focus on the given focusable. + This reuses the collide bitmask, but isn't actually a collision." (_type_ process-focusable) object) ;; 57 + (check-water "Respond to possibly being in water." (_type_) object) ;; 58 + (enemy-common-post "Common implementation of post. Runs ja-post." (_type_) none) ;; 59 + (impact-velocity-to-hit-points "Given an impact velocity, compute hit points." (_type_ float) float) ;; 60 + (attack-direction-from-impact-vel "Compute the direction of an attack given an impact velocity. + This reduces the vertical component, probably to avoid sending the enemy into the air too much." (_type_ vector vector float) vector) ;; 61 + (get-damage-from-attack "Compute hit point damage for an attack message." (_type_ object event-message-block) float) ;; 62 + (apply-incoming-hitpoint-mods "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (_type_ float) float) ;; 63 + (get-awareness-of-proc "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (_type_ process-focusable enemy-best-focus) enemy-aware) ;; 64 + (msg-for-incoming-attack "Given an attack message, what do we do next? Returns a message name that should be sent to self." (_type_ process event-message-block float) symbol) ;; 65 + (get-penetrated-by "Figure out the penetrated-by mask for this process." (_type_) penetrate) ;; 66 + (coin-flip? "Return #t half the time, #f the other." (_type_) symbol) ;; 67 + (modify-awareness "Apply modifications to awareness based on the reaction time of an enemy and other settings." (_type_ enemy-aware) enemy-aware) ;; 68 + (focus-on-attacker! "If possible, update this enemies focus to the attacker." (_type_) none) ;; 69 + (set-focus! "Change our focus to the given process. Optionally, specify awareness." (_type_ process-focusable enemy-aware) none) ;; 70 + (go-dormant "Go to the dormant state. This disables drawing/processing/collision, and runs no logic." (_type_) object) ;; 71 + (go-dormant-aware "Go to the dormat aware state. + Similar to dormant, drawing/collision are disabled, but enemies can exit dormant-aware." (_type_) object) ;; 72 + (go-idle "Go to an idle state." (_type_) object) ;; 73 + (go-ambush "May go to ambush-delay first, if set in the res-lump." (_type_) object) ;; 74 (go-stare (_type_) object) ;; 75 (go-stare2 (_type_) object) ;; 76 - (go-directed (_type_) object) ;; 77 - (go-hostile (_type_) object) ;; 78 - (go-flee (_type_) object) ;; 79 - (go-best-state (_type_) object) ;; 80 - (go-die (_type_) object) ;; 81 - (event-handler (_type_ process int symbol event-message-block) object :behavior enemy) ;; 82 - (enemy-touch-handler (_type_ process event-message-block) object) ;; 83 - (send-attack-on-jump-or-knocked (_type_ process event-message-block) object) ;; 84 - (knocked-anim (_type_ enemy-knocked-info) symbol) ;; 85 - (knocked-land-anim (_type_ enemy-knocked-info) symbol) ;; 86 - (knocked-anim-handler (_type_ int enemy-knocked-info) symbol) ;; 87 - (enemy-method-88 (_type_ enemy-knocked-info) symbol) ;; 88 - (within-gspot-range? (_type_) symbol) ;; 89 - (enemy-method-90 (_type_ ragdoll-proc) none) ;; 90 - (enemy-method-91 (_type_ enemy-jump-info) object) ;; 91 - (init-jump-info! (_type_ enemy-jump-info) none) ;; 92 - (setup-jump! (_type_ enemy-jump-info) none) ;; 93 - (move-to-gspot! (_type_) float) ;; 94 - (on-ground? (_type_ enemy-jump-info) symbol) ;; 95 - (jump-in-air-anim (_type_ enemy-jump-info) symbol) ;; 96 - (jump-land-anim (_type_ enemy-jump-info) symbol) ;; 97 - (jump-wind-up-anim (_type_ enemy-jump-info) symbol) ;; 98 - (jump-anim-handler (_type_ int enemy-jump-info) symbol) ;; 99 - (in-jump-handler (_type_ int enemy-jump-info) none) ;; 100 - (enemy-method-101 (_type_ int enemy-jump-info) none) ;; 101 - (go-directed2 (_type_) object) ;; 102 - (enemy-method-103 (_type_ vector float) symbol) ;; 103 - (enemy-method-104 (_type_ vector float) symbol) ;; 104 - (enemy-method-105 (_type_ float symbol) symbol) ;; 105 - (find-best-focus (_type_) process) ;; 106 - (is-pfoc-in-mesh? (_type_ process-focusable vector) symbol) ;; 107 - (enemy-method-108 (_type_ process-focusable) symbol) ;; 108 - (enemy-method-109 (_type_) symbol) ;; 109 - (send-attack (_type_ process touching-shapes-entry uint) symbol) ;; 110 - (on-attack (_type_ process-focusable) none) ;; 111 - (get-incoming-attack! (_type_ process-drawable event-message-block penetrate attack-info touching-shapes-entry) none) ;; 112 - (get-focus! (_type_) process-focusable) ;; 113 - (send-attack-to-all-tshapes (_type_ process-focusable event-message-block) int) ;; 114 - (set-look-at-mode! (_type_ int) none) ;; 115 - (stop-look-at! (_type_) none) ;; 116 - (apply-friction (_type_) none) ;; 117 - (init-enemy-info! (_type_ enemy-info) none) ;; 118 - (init-enemy-defaults! (_type_ enemy-info) none) ;; 119 - (init-enemy-collision! (_type_) none) ;; 120 - (init-enemy! (_type_) none) ;; 121 - (go-idle2 (_type_) object) ;; 122 - (enemy-method-123 (_type_) symbol) ;; 123 - (disable-ragdoll (_type_) none) ;; 124 - (ragdoll-settled? (_type_) object) ;; 125 - (ragdoll-spawn! (_type_ symbol symbol) vector) ;; 126 - (deactivate-ragdoll! (_type_) none) ;; 127 - (rnd-float (_type_) float) ;; 128 - (rnd-float-range (_type_ float float) float) ;; 129 - (rnd-int (_type_ int) int) ;; 130 - (enemy-method-131 (_type_ int int) int) ;; 131 - (set-reaction-time! (_type_ time-frame time-frame) time-frame) ;; 132 - (rnd-chance? (_type_ float) symbol) ;; 133 - (enemy-method-134 (_type_ float) symbol) ;; 134 + (go-directed "Go to the directed state which assumes that something else will control the enemy." (_type_) object) ;; 77 + (go-hostile "Go to the hostile state, actively trying to attack the target." (_type_) object) ;; 78 + (go-flee "Go to the flee state, running away." (_type_) object) ;; 79 + (go-state-for-focused "Go to the appropriate state for the current awareness of the focused process." (_type_) object) ;; 80 + (go-die "Go to the die state." (_type_) object) ;; 81 + (event-handler "Commmon handler for events." (_type_ process int symbol event-message-block) object :behavior enemy) ;; 82 + (enemy-touch-handler "General handler for an event when a process intentionally sends a touch event." (_type_ process event-message-block) object) ;; 83 + (enemy-touched-handler "General handler for when anything touches an enemy (automatic response)." (_type_ process event-message-block) object) ;; 84 + (knocked-anim "start the knocked animation." (_type_ enemy-knocked-info) symbol) ;; 85 + (knocked-land-anim "start the knocked-land animation." (_type_ enemy-knocked-info) symbol) ;; 86 + (knocked-anim-handler "start or play the approriate animation for an enemy being knocked." (_type_ int enemy-knocked-info) symbol) ;; 87 + (done-being-knocked? "has the enemy hit the ground or stopped after being knocked back?" (_type_ enemy-knocked-info) symbol) ;; 88 + (invalid-height? "Return #t if the enemy is too high in the air, or below the ground." (_type_) symbol) ;; 89 + (copy-ragdoll-orientation-to-root "Apply rotational offset from ragdolling back to the enemy. + Used when disabling a ragdoll to update the enemy + orientation to match the end of ragdoll orientation." (_type_ ragdoll-proc) none) ;; 90 + (check-jump-blocked? "Is this jump blocked by something?" (_type_ enemy-jump-info) object) ;; 91 + (init-jump-info! "Populate an enemy-jump-info for jumping to this enemy's event-param-point" (_type_ enemy-jump-info) none) ;; 92 + (setup-jump-trajectory! "Compute jump trajectory." (_type_ enemy-jump-info) none) ;; 93 + (move-to-gspot! "Snap the enemy down onto the cached ground spot (gspot)." (_type_) float) ;; 94 + (landed-jump-yet? "Is this on, or close to, the ground?" (_type_ enemy-jump-info) symbol) ;; 95 + (jump-in-air-anim "Start playing the in-air anim" (_type_ enemy-jump-info) symbol) ;; 96 + (jump-land-anim "Play the landing anim" (_type_ enemy-jump-info) symbol) ;; 97 + (jump-wind-up-anim "Start playing the wind-up anim" (_type_ enemy-jump-info) symbol) ;; 98 + (jump-anim-handler (_type_ jump-stage enemy-jump-info) symbol) ;; 99 + (move-along-ballistic-trajectory-for-jump "Adjust trans, transv for the jump, if we're airborne." (_type_ jump-stage enemy-jump-info) none) ;; 100 + (adjust-heading-for-jump "Can be overriden. Yaw the enemy in response to an ongoing jump." (_type_ jump-stage enemy-jump-info) none) ;; 101 + (go-next-state-auto "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (_type_) object) ;; 102 + (heading-matches-direction? "Does this enemy's heading match the given heading? Threshold in degrees." (_type_ vector float) symbol) ;; 103 + (pointing-toward? "Is this enemy pointing toward the given point? Threshold in degrees." (_type_ vector float) symbol) ;; 104 + (pointing-toward-focus? "Is this enemy pointing toward its focused process?" (_type_ float symbol) symbol) ;; 105 + (find-best-focus "Search for the best thing to focus on." (_type_) process) ;; 106 + (can-become-hostile-to? "Return if this enemy can become hostile to the process." (_type_ process-focusable vector) symbol) ;; 107 + (should-flee-from? "Return if this enemy should flee from the process." (_type_ process-focusable) symbol) ;; 108 + (out-of-bounds? "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (_type_) symbol) ;; 109 + (send-attack-from-tshape "Send an attack from this enemy to something else." (_type_ process touching-shapes-entry uint) symbol) ;; 110 + (on-attack "Handler after this enemy attacks something. By default focuses on the attacked, but could be overriden." (_type_ process-focusable) none) ;; 111 + (handle-incoming-attack! "Set up this enemy to handle an incoming attack event." (_type_ process-drawable event-message-block penetrate attack-info touching-shapes-entry) none) ;; 112 + (get-focus! "If we're focusing on something alive, return it." (_type_) process-focusable) ;; 113 + (find-and-damage-attackers "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." (_type_ process-focusable event-message-block) int) ;; 114 + (set-look-at-mode! "Pick between 1: look at the focus, or 2: look at where you're going." (_type_ int) none) ;; 115 + (stop-look-at! "Stop looking at something. Disables neck joint mod." (_type_) none) ;; 116 + (apply-friction "Slow down the enemy due to friction with the ground." (_type_) none) ;; 117 + (set-enemy-info! "Set the enemy-info" (_type_ enemy-info) none) ;; 118 + (setup-enemy! "Initialize the enemy by setting all the enemy-specific fields." (_type_ enemy-info) none) ;; 119 + (init-enemy-collision! "Typical place to construct collision shapes" (_type_) none) ;; 120 + (init-enemy! "Typical place for shared init code. Runs from entity or process style init." (_type_) none) ;; 121 + (go-fallback-init "If there's no specific settings for initial state, go to this state after spawning." (_type_) object) ;; 122 + (allow-ragdoll? "Can this enemy ragdoll now?" (_type_) symbol) ;; 123 + (disable-ragdoll "Smoothly disable the ragdoll and transition back to normal control." (_type_) none) ;; 124 + (ragdoll-settled? "Has the ragdoll stopped moving?" (_type_) object) ;; 125 + (ragdoll-spawn! "If possible, spawn ragdoll and start using it." (_type_ symbol symbol) vector) ;; 126 + (deactivate-ragdoll! "Deactivate the ragdoll process." (_type_) none) ;; 127 + (rnd-float "Get a random number from 0 to 1" (_type_) float) ;; 128 + (rnd-float-range "Get a random float in the range" (_type_ float float) float) ;; 129 + (rnd-int "Get a random int from to to the specified int" (_type_ int) int) ;; 130 + (rnd-int-excluding-masked "Get a random int in the range. Exclude a value n by setting the n-th bit of the mask."(_type_ int int) int) ;; 131 + (rnd-time-frame "Get a random time frame." (_type_ time-frame time-frame) time-frame) ;; 132 + (rnd-chance? "Returns true with the given probability." (_type_ float) symbol) ;; 133 + (rnd-chance-for-idle? + "Like rnd-chance, but is more likely to return true when the game is close to not fitting in frame rate. + This makes enemies start idling more if the game isn't running fast enough." (_type_ float) symbol) ;; 134 (enemy-method-135 (_type_) none) ;; 135 - (set-ground-pat! (_type_ collide-query collide-spec float float float process) pat-surface) ;; 136 - (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol) ;; 137 - (try-locate-ground (_type_ meters meters symbol collide-spec) symbol) ;; 138 - (move-above-ground! (_type_ vector move-above-ground-params) none) ;; 139 - (update-focus (_type_) process) ;; 140 - (enemy-method-141 (_type_ float) symbol) ;; 141 - (penetrate->knocked-type (_type_ penetrate) knocked-type) ;; 142 + (find-ground-and-set-pat! "Figure out what ground we're standing on and update the ground-pat. + Usually this will be done automatically by the collision system. + This method should be called after manually repositioning an enemy." (_type_ collide-query collide-spec float float float process) pat-surface) ;; 136 + (enemy-above-ground? "Is this enemy above the ground?" (_type_ collide-query vector collide-spec float float float) symbol) ;; 137 + (move-to-ground "Snap the enemy to the ground below." (_type_ meters meters symbol collide-spec) symbol) ;; 138 + (move-above-ground! "Move the enemy. May keep the enemy snapped to the ground depending on flags." (_type_ vector move-above-ground-params) none) ;; 139 + (update-focus "Potentially update the focus, if there is something better to focus on." (_type_) process) ;; 140 + (check-awareness-trigger "Check triggering logic for awareness to see if this enemy can become aware yet." (_type_ float) symbol) ;; 141 + (penetrate->knocked-type "Based on the penetrate of an attacker, pick the knocked-type." (_type_ penetrate) knocked-type) ;; 142 (on-dying (_type_) none) ;; 143 (falling? (_type_) symbol) ;; 144 - (find-offending-pfoc (_type_ process attack-info) process-focusable) ;; 145 - (play-damage-sound (_type_ int) sound-id) ;; 146 - (check-victory (_type_) none) ;; 147 - (go-gun-dark-2-stretch (_type_) object) ;; 148 - (have-more-than-10-joints? (_type_) object) ;; 149 - (enemy-method-150 (_type_) symbol) ;; 150 - (should-move-to-ground? (_type_) symbol) ;; 151 - (enemy-method-152 (_type_) float) ;; 152 + (find-offending-pfoc "Figure out the attacker process from the attack message sender and attack-info. + This is to handle cases where the attacker process is a non-focusable subprocess, + or the attacker is driving a vehicle."(_type_ process attack-info) process-focusable) ;; 145 + (play-damage-sound "Pick and play the damage/death sound." (_type_ int) sound-id) ;; 146 + (clear-stale-victory "Remove victory flag if needed." (_type_) none) ;; 147 + (go-gun-dark-2-stretch "Go to the gun-dark-2-stretch state." (_type_) object) ;; 148 + (have-more-than-10-joints? "Does what it says, unused" (_type_) object) ;; 149 + (can-be-nuked? "Can this enemy be instantly destroyed by the nuke?" (_type_) symbol) ;; 150 + (should-move-to-ground? "Should this enemy be moved to the ground while moving?" (_type_) symbol) ;; 151 + (gem-chance "The chance of this enemy having a gem." (_type_) float) ;; 152 (get-gem-pool-idx (_type_) int) ;; 153 (mark-as-dead (_type_) none) ;; 154 ) @@ -41834,8 +41845,8 @@ debug-control ;; 159 ) (:methods - (init-enemy-info! (_type_ nav-enemy-info) none :replace) ;; 118 - (init-enemy-defaults! (_type_ nav-enemy-info) object :replace) ;; 125 + (set-enemy-info! (_type_ nav-enemy-info) none :replace) ;; 118 + (setup-enemy! (_type_ nav-enemy-info) object :replace) ;; 125 (normalize-heading! (_type_ nav-control) none) ;; 160 (nav-enemy-method-161 (_type_ nav-control) none) ;; 161 (nav-enemy-method-162 (_type_) none) ;; 162 @@ -41884,13 +41895,16 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-extern *enemy-dummy-shadow-control* shadow-control) -(define-extern get-penetrate-using-from-attack-event (function process-drawable event-message-block penetrate)) -(define-extern enemy-setup-gem (function object :behavior enemy)) -(define-extern enemy-init-by-other (function process-drawable enemy-init-by-other-params object :behavior enemy)) -(define-extern enemy-event-handler (function process int symbol event-message-block object :behavior enemy)) -(define-extern enemy-simple-post (function none :behavior enemy)) -(define-extern enemy-falling-post (function none :behavior enemy)) -(define-extern enemy-die-falling-post (function none :behavior enemy)) +(define-extern get-penetrate-using-from-attack-event "Given an attack event to an enemy, return the penetrate that should be applied to the enemy" + (function process-drawable event-message-block penetrate)) +(define-extern enemy-setup-gem "Determine if the enemy should have a gem and set drawing masks/particles as needed." (function object :behavior enemy)) +(define-extern enemy-init-by-other "Function to initialize an enemy from a parent process." (function process-drawable enemy-init-by-other-params object :behavior enemy)) +(define-extern enemy-event-handler "Default event handler for enemy." (function process int symbol event-message-block object :behavior enemy)) +(define-extern enemy-simple-post "Default post for enemy." (function none :behavior enemy)) +(define-extern enemy-falling-post "Post function that simply makes the enemy go down. + Collision is enabled, so enemy will bounce off of walls or similar." (function none :behavior enemy)) +(define-extern enemy-die-falling-post "Post function that causes the enemy to go down until it hits the ground. + Doesn't use full collision system - enemy will stop moving as soon as it hits any ground."(function none :behavior enemy)) (define-extern *shockwave-knock-scalar* curve2d-fast) (define-extern ja-group-index? (function int symbol :behavior enemy)) @@ -49371,7 +49385,7 @@ in-ditch ;; 192 ) (:methods - (init-enemy-defaults! (_type_ nav-enemy-info) none :replace) + ;(init-enemy-defaults! (_type_ nav-enemy-info) none :replace) (set-squad (_type_) none) ;; 193 (citizen-method-194 (_type_) none) ;; 194 (citizen-method-195 (_type_) none) ;; 195 diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index bba5220544d..ab158e4a665 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -3160,6 +3160,9 @@ [27, "a0", "process-focusable"], [30, "a0", "process-focusable"] ], + "(method 20 enemy)": [ + [[0, 30], "v0", "search-info-flag"] + ], "(method 59 enemy)": [ [57, "a0", "process-focusable"], [60, "a0", "process-focusable"] @@ -3192,7 +3195,9 @@ [140, "a1", "process-focusable"] ], "(method 140 enemy)": [[18, "a1", "process-focusable"]], + "(method 142 enemy)": [[[0, 40], "v0", "knocked-type"]], "get-penetrate-using-from-attack-event": [ + [[20, 40], "v0", "penetrate"], [2, "v1", "attack-info"], [5, "v1", "attack-info"], [25, "v1", "collide-shape"] @@ -3202,6 +3207,9 @@ [67, "s3", "process-drawable"], [68, "a1", "collide-shape"] ], + "(method 68 enemy)": [ + [[0, 50], "v0", "enemy-aware"] + ], "(method 82 enemy)": [ [80, "v1", "process-drawable"], [122, "v1", "attack-info"], diff --git a/decompiler/config/jak3/ntsc_v1/var_names.jsonc b/decompiler/config/jak3/ntsc_v1/var_names.jsonc index 39f24b388dc..4ff26b14e0d 100644 --- a/decompiler/config/jak3/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak3/ntsc_v1/var_names.jsonc @@ -1903,6 +1903,11 @@ "v1-8": "ii" } }, + "(method 20 enemy)": { + "vars": { + "v0-0": ["flag", "search-info-flag"] + } + }, "(method 119 enemy)": { "vars": { "a1-5": ["cspec", "collide-spec"] diff --git a/goal_src/jak3/engine/ai/enemy-h.gc b/goal_src/jak3/engine/ai/enemy-h.gc index 0939586e865..157a802ec87 100644 --- a/goal_src/jak3/engine/ai/enemy-h.gc +++ b/goal_src/jak3/engine/ai/enemy-h.gc @@ -8,11 +8,11 @@ ;; +++enemy-aware (defenum enemy-aware :type uint64 - (ea0 0) - (ea1 1) - (ea2 2) - (ea3 3) - (ea4 4) + (unaware 0) + (aware1 1) + (aware2 2) + (hostile 3) + (flee 4) ) ;; ---enemy-aware @@ -58,6 +58,7 @@ (death-start 34) (auto-death-phase-out 35) (has-gem 36) + ;; these seem to be an extension of the flags for nav-enemy. (ef37 37) (ef38 38) (ef39 39) @@ -83,6 +84,16 @@ (ejf6 6) (ejf7 7) ) + +(defenum jump-stage + :type int32 + (init 0) + (winding-up 1) + (takeoff 2) + (in-air 3) + (touchdown 4) + (landing 5) + ) ;; ---enemy-jump-flags @@ -96,8 +107,8 @@ (flags enemy-flag) ) (:methods - (try-update-focus (_type_ process-focusable enemy) symbol :replace) - (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol) + (focus-on! (_type_ process-focusable enemy) symbol :replace) + (focus-on-with-awareness! (_type_ process-focusable enemy-aware) symbol) ) ) @@ -152,34 +163,34 @@ (jump-height-min meters) (jump-height-factor float) (knocked-seek-ry-clamp float) - (knocked-soft-vxz-lo float) - (knocked-soft-vxz-hi float) - (knocked-soft-vy-lo float) - (knocked-soft-vy-hi float) - (knocked-medium-vxz-lo float) - (knocked-medium-vxz-hi float) - (knocked-medium-vy-lo float) - (knocked-medium-vy-hi float) - (knocked-hard-vxz-lo float) - (knocked-hard-vxz-hi float) - (knocked-hard-vy-lo float) - (knocked-hard-vy-hi float) - (knocked-huge-vxz-lo float) - (knocked-huge-vxz-hi float) - (knocked-huge-vy-lo float) - (knocked-huge-vy-hi float) - (knocked-yellow-vxz-lo float) - (knocked-yellow-vxz-hi float) - (knocked-yellow-vy-lo float) - (knocked-yellow-vy-hi float) - (knocked-red-vxz-lo float) - (knocked-red-vxz-hi float) - (knocked-red-vy-lo float) - (knocked-red-vy-hi float) - (knocked-blue-vxz-lo float) - (knocked-blue-vxz-hi float) - (knocked-blue-vy-lo float) - (knocked-blue-vy-hi float) + (knocked-soft-vxz-lo meters) + (knocked-soft-vxz-hi meters) + (knocked-soft-vy-lo meters) + (knocked-soft-vy-hi meters) + (knocked-medium-vxz-lo meters) + (knocked-medium-vxz-hi meters) + (knocked-medium-vy-lo meters) + (knocked-medium-vy-hi meters) + (knocked-hard-vxz-lo meters) + (knocked-hard-vxz-hi meters) + (knocked-hard-vy-lo meters) + (knocked-hard-vy-hi meters) + (knocked-huge-vxz-lo meters) + (knocked-huge-vxz-hi meters) + (knocked-huge-vy-lo meters) + (knocked-huge-vy-hi meters) + (knocked-yellow-vxz-lo meters) + (knocked-yellow-vxz-hi meters) + (knocked-yellow-vy-lo meters) + (knocked-yellow-vy-hi meters) + (knocked-red-vxz-lo meters) + (knocked-red-vxz-hi meters) + (knocked-red-vy-lo meters) + (knocked-red-vy-hi meters) + (knocked-blue-vxz-lo meters) + (knocked-blue-vxz-hi meters) + (knocked-blue-vy-lo meters) + (knocked-blue-vy-hi meters) (ragdoll-info ragdoll-setup) (shadow-size meters) (shadow-max-y meters) @@ -316,80 +327,80 @@ gun-dark-2-stretch ) (:methods - (enemy-method-50 (_type_ int) none) - (accelerate-fall! (_type_ vector) float) - (damage-enemy! (_type_ object event-message-block) float) - (reset-penetrate! (_type_) none) + (update-collision-action (_type_ int) none) + (adjust-transv-under-water! (_type_ vector) float) + (damage-enemy-from-attack! (_type_ object event-message-block) float) + (reset-penetrate-later! (_type_) none) (get-knockback-dir! (_type_ vector) vector) (get-knockback-angle (_type_) degrees) (knocked-handler (_type_ vector) object) - (can-collide-with-focus? (_type_ process-focusable) object) + (can-focus-on? (_type_ process-focusable) object) (check-water (_type_) object) (enemy-common-post (_type_) none) - (lerp-damage (_type_ float) float) - (scale-impact-vel-y! (_type_ vector vector float) vector) + (impact-velocity-to-hit-points (_type_ float) float) + (attack-direction-from-impact-vel (_type_ vector vector float) vector) (get-damage-from-attack (_type_ object event-message-block) float) - (enemy-method-63 (_type_ float) float) - (update-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware) - (penetrate->next-state (_type_ process event-message-block float) symbol) + (apply-incoming-hitpoint-mods (_type_ float) float) + (get-awareness-of-proc (_type_ process-focusable enemy-best-focus) enemy-aware) + (msg-for-incoming-attack (_type_ process event-message-block float) symbol) (get-penetrated-by (_type_) penetrate) (coin-flip? (_type_) symbol) - (get-enemy-aware (_type_ enemy-aware) enemy-aware) - (enemy-method-69 (_type_) none) - (enemy-method-70 (_type_ process-focusable enemy-aware) none) + (modify-awareness (_type_ enemy-aware) enemy-aware) + (focus-on-attacker! (_type_) none) + (set-focus! (_type_ process-focusable enemy-aware) none) (go-dormant (_type_) object) (go-dormant-aware (_type_) object) (go-idle (_type_) object) - (go-ambush-delay (_type_) object) + (go-ambush (_type_) object) (go-stare (_type_) object) (go-stare2 (_type_) object) (go-directed (_type_) object) (go-hostile (_type_) object) (go-flee (_type_) object) - (go-best-state (_type_) object) + (go-state-for-focused (_type_) object) (go-die (_type_) object) (event-handler (_type_ process int symbol event-message-block) object :behavior enemy) (enemy-touch-handler (_type_ process event-message-block) object) - (send-attack-on-jump-or-knocked (_type_ process event-message-block) object) + (enemy-touched-handler (_type_ process event-message-block) object) (knocked-anim (_type_ enemy-knocked-info) symbol) (knocked-land-anim (_type_ enemy-knocked-info) symbol) (knocked-anim-handler (_type_ int enemy-knocked-info) symbol) - (enemy-method-88 (_type_ enemy-knocked-info) symbol) - (within-gspot-range? (_type_) symbol) - (enemy-method-90 (_type_ ragdoll-proc) none) - (enemy-method-91 (_type_ enemy-jump-info) object) + (done-being-knocked? (_type_ enemy-knocked-info) symbol) + (invalid-height? (_type_) symbol) + (copy-ragdoll-orientation-to-root (_type_ ragdoll-proc) none) + (check-jump-blocked? (_type_ enemy-jump-info) object) (init-jump-info! (_type_ enemy-jump-info) none) - (setup-jump! (_type_ enemy-jump-info) none) + (setup-jump-trajectory! (_type_ enemy-jump-info) none) (move-to-gspot! (_type_) float) - (on-ground? (_type_ enemy-jump-info) symbol) + (landed-jump-yet? (_type_ enemy-jump-info) symbol) (jump-in-air-anim (_type_ enemy-jump-info) symbol) (jump-land-anim (_type_ enemy-jump-info) symbol) (jump-wind-up-anim (_type_ enemy-jump-info) symbol) - (jump-anim-handler (_type_ int enemy-jump-info) symbol) - (in-jump-handler (_type_ int enemy-jump-info) none) - (enemy-method-101 (_type_ int enemy-jump-info) none) - (go-directed2 (_type_) object) - (enemy-method-103 (_type_ vector float) symbol) - (enemy-method-104 (_type_ vector float) symbol) - (enemy-method-105 (_type_ float symbol) symbol) + (jump-anim-handler (_type_ jump-stage enemy-jump-info) symbol) + (move-along-ballistic-trajectory-for-jump (_type_ jump-stage enemy-jump-info) none) + (adjust-heading-for-jump (_type_ jump-stage enemy-jump-info) none) + (go-next-state-auto (_type_) object) + (heading-matches-direction? (_type_ vector float) symbol) + (pointing-toward? (_type_ vector float) symbol) + (pointing-toward-focus? (_type_ float symbol) symbol) (find-best-focus (_type_) process) - (is-pfoc-in-mesh? (_type_ process-focusable vector) symbol) - (enemy-method-108 (_type_ process-focusable) symbol) - (enemy-method-109 (_type_) symbol) - (send-attack (_type_ process touching-shapes-entry uint) symbol) + (can-become-hostile-to? (_type_ process-focusable vector) symbol) + (should-flee-from? (_type_ process-focusable) symbol) + (out-of-bounds? (_type_) symbol) + (send-attack-from-tshape (_type_ process touching-shapes-entry uint) symbol) (on-attack (_type_ process-focusable) none) - (get-incoming-attack! (_type_ process-drawable event-message-block penetrate attack-info touching-shapes-entry) none) + (handle-incoming-attack! (_type_ process-drawable event-message-block penetrate attack-info touching-shapes-entry) none) (get-focus! (_type_) process-focusable) - (send-attack-to-all-tshapes (_type_ process-focusable event-message-block) int) + (find-and-damage-attackers (_type_ process-focusable event-message-block) int) (set-look-at-mode! (_type_ int) none) (stop-look-at! (_type_) none) (apply-friction (_type_) none) - (init-enemy-info! (_type_ enemy-info) none) - (init-enemy-defaults! (_type_ enemy-info) none) + (set-enemy-info! (_type_ enemy-info) none) + (setup-enemy! (_type_ enemy-info) none) (init-enemy-collision! (_type_) none) (init-enemy! (_type_) none) - (go-idle2 (_type_) object) - (enemy-method-123 (_type_) symbol) + (go-fallback-init (_type_) object) + (allow-ragdoll? (_type_) symbol) (disable-ragdoll (_type_) none) (ragdoll-settled? (_type_) object) (ragdoll-spawn! (_type_ symbol symbol) vector) @@ -397,28 +408,28 @@ (rnd-float (_type_) float) (rnd-float-range (_type_ float float) float) (rnd-int (_type_ int) int) - (enemy-method-131 (_type_ int int) int) - (set-reaction-time! (_type_ time-frame time-frame) time-frame) + (rnd-int-excluding-masked (_type_ int int) int) + (rnd-time-frame (_type_ time-frame time-frame) time-frame) (rnd-chance? (_type_ float) symbol) - (enemy-method-134 (_type_ float) symbol) + (rnd-chance-for-idle? (_type_ float) symbol) (enemy-method-135 (_type_) none) - (set-ground-pat! (_type_ collide-query collide-spec float float float process) pat-surface) + (find-ground-and-set-pat! (_type_ collide-query collide-spec float float float process) pat-surface) (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol) - (try-locate-ground (_type_ meters meters symbol collide-spec) symbol) + (move-to-ground (_type_ meters meters symbol collide-spec) symbol) (move-above-ground! (_type_ vector move-above-ground-params) none) (update-focus (_type_) process) - (enemy-method-141 (_type_ float) symbol) + (check-awareness-trigger (_type_ float) symbol) (penetrate->knocked-type (_type_ penetrate) knocked-type) (on-dying (_type_) none) (falling? (_type_) symbol) (find-offending-pfoc (_type_ process attack-info) process-focusable) (play-damage-sound (_type_ int) sound-id) - (check-victory (_type_) none) + (clear-stale-victory (_type_) none) (go-gun-dark-2-stretch (_type_) object) (have-more-than-10-joints? (_type_) object) - (enemy-method-150 (_type_) symbol) + (can-be-nuked? (_type_) symbol) (should-move-to-ground? (_type_) symbol) - (enemy-method-152 (_type_) float) + (gem-chance (_type_) float) (get-gem-pool-idx (_type_) int) (mark-as-dead (_type_) none) ) @@ -432,20 +443,22 @@ ) -(defmethod try-update-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) - (let* ((t9-0 (method-of-type focus try-update-focus)) +(defmethod focus-on! ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) + "Make this enemy focus on the process-focusable. If already focused, update awareness." + (let* ((t9-0 (method-of-type focus focus-on!)) (s3-0 (t9-0 this arg0)) ) (when (not s3-0) (logclear! (-> this flags) (enemy-flag look-at-focus)) - (set! (-> this aware) (get-enemy-aware arg1 (update-awareness! arg1 arg0 (the-as enemy-best-focus #f)))) + (set! (-> this aware) (modify-awareness arg1 (get-awareness-of-proc arg1 arg0 (the-as enemy-best-focus #f)))) ) s3-0 ) ) -(defmethod enemy-focus-method-13 ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) - (let* ((t9-0 (method-of-type focus try-update-focus)) +(defmethod focus-on-with-awareness! ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) + "Focus on the process-focusable, updating the aware." + (let* ((t9-0 (method-of-type focus focus-on!)) (v0-0 (t9-0 this arg0)) ) (set! (-> this aware) arg1) @@ -462,7 +475,7 @@ (let ((t9-0 (method-of-type focus clear-focused))) (t9-0 this) ) - (set! (-> this aware) (enemy-aware ea0)) + (set! (-> this aware) (enemy-aware unaware)) (logclear! (-> this flags) (enemy-flag look-at-focus)) (none) ) diff --git a/goal_src/jak3/engine/ai/enemy.gc b/goal_src/jak3/engine/ai/enemy.gc index 9b4abc89850..c703e10c22b 100644 --- a/goal_src/jak3/engine/ai/enemy.gc +++ b/goal_src/jak3/engine/ai/enemy.gc @@ -31,27 +31,33 @@ ) (defmethod rnd-float ((this enemy)) + "Get a random number from 0 to 1" (rand-vu) ) (defmethod rnd-float-range ((this enemy) (arg0 float) (arg1 float)) + "Get a random float in the range" (+ arg0 (* (rand-vu) (- arg1 arg0))) ) (defmethod rnd-int ((this enemy) (arg0 int)) + "Get a random int from to to the specified int" (the int (* (rand-vu) (the float arg0))) ) -(defmethod set-reaction-time! ((this enemy) (arg0 time-frame) (arg1 time-frame)) +(defmethod rnd-time-frame ((this enemy) (arg0 time-frame) (arg1 time-frame)) + "Get a random time frame." (+ arg0 (the int (* (rand-vu) (the float (+ (- 1 arg0) arg1))))) ) (defmethod rnd-chance? ((this enemy) (arg0 float)) + "Returns true with the given probability." (>= arg0 (rand-vu)) ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod enemy-method-131 ((this enemy) (arg0 int) (arg1 int)) +(defmethod rnd-int-excluding-masked ((this enemy) (arg0 int) (arg1 int)) + "Get a random int in the range. Exclude a value n by setting the n-th bit of the mask." (let ((v1-0 0) (s5-0 0) ) @@ -90,7 +96,9 @@ ) ) -(defmethod enemy-method-134 ((this enemy) (arg0 float)) +(defmethod rnd-chance-for-idle? ((this enemy) (arg0 float)) + "Like rnd-chance, but is more likely to return true when the game is close to not fitting in frame rate. + This makes enemies start idling more if the game isn't running fast enough." (let* ((v1-5 (-> *display* frames (-> *display* last-screen) run-time)) (f1-2 (fmax 0.0 (fmin 1.0 (* 0.001 (+ -7000.0 (the float v1-5)))))) ) @@ -99,6 +107,7 @@ ) (defmethod coin-flip? ((this enemy)) + "Return #t half the time, #f the other." (zero? (rnd-int this 2)) ) @@ -127,27 +136,29 @@ ) ) -(defmethod can-collide-with-focus? ((this enemy) (arg0 process-focusable)) +(defmethod can-focus-on? ((this enemy) (arg0 process-focusable)) + "Check that this enemy can focus on the given focusable. + This reuses the collide bitmask, but isn't actually a collision." (and arg0 (!= this arg0) (collide-spec-match? (-> this focus) arg0)) ) -;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this enemy)) +(defmethod get-search-info-flag ((this enemy)) + "Get search-info-flag for this process." (let ((v1-0 (-> this enemy-flags)) - (v0-0 0) + (flag (search-info-flag)) ) (when (and (!= (-> this hit-points) 0.0) (logtest? (-> this enemy-flags) (enemy-flag vulnerable)) (logtest? (enemy-flag trackable) (-> this enemy-flags)) ) (if (logtest? (process-mask enemy) (-> this mask)) - (set! v0-0 (logior v0-0 16)) + (set! flag (logior flag (search-info-flag enemy))) ) (if (logtest? v1-0 (enemy-flag attackable)) - (set! v0-0 (logior v0-0 8)) + (set! flag (logior flag (search-info-flag attackable))) ) ) - (the-as search-info-flag v0-0) + flag ) ) @@ -178,16 +189,19 @@ ) (defmethod get-penetrated-by ((this enemy)) + "Figure out the penetrated-by mask for this process." (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (the int (-> this hit-points))) ) ;; WARN: Return type mismatch float vs meters. (defmethod get-water-height ((this enemy)) + "Get the height of the water that we're in." (the-as meters (-> this water-surface-height)) ) ;; WARN: Return type mismatch enemy-flag vs object. (defmethod check-water ((this enemy)) + "Respond to possibly being in water." (let ((s4-0 (-> this root))) (when (>= (-> this water-max-height) (-> s4-0 trans y)) (let ((s5-0 (new 'stack-no-clear 'water-info))) @@ -197,15 +211,15 @@ (set! (-> this water-surface-height) (-> s5-0 trans y)) (when (not (focus-test? this touch-water under-water)) (let ((v1-9 (new 'stack-no-clear 'vector))) - (set! (-> v1-9 quad) (-> this root trans quad)) + (vector-copy! v1-9 (-> this root trans)) (set! (-> v1-9 y) (+ 409.6 (-> s5-0 trans y))) (cond ((logtest? (-> *part-group-id-table* 192 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-9 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-9) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 192)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-9 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-9) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 192)) ) ) @@ -246,6 +260,7 @@ ) (defmethod enemy-common-post ((this enemy)) + "Common implementation of post. Runs ja-post." (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this last-draw-time)) ) @@ -284,7 +299,7 @@ ) ) (if (logtest? (-> this enemy-flags) (enemy-flag victory)) - (check-victory this) + (clear-stale-victory this) ) (if (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags)) (check-water this) @@ -298,7 +313,8 @@ ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod check-victory ((this enemy)) +(defmethod clear-stale-victory ((this enemy)) + "Remove victory flag if needed." (if (or (time-elapsed? (-> this hit-focus-time) (seconds 2)) (and (handle->process (-> this focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) @@ -312,11 +328,11 @@ (none) ) -;; WARN: Return type mismatch int vs penetrate. (defun get-penetrate-using-from-attack-event ((arg0 process-drawable) (arg1 event-message-block)) + "Given an attack event to an enemy, return the penetrate that should be applied to the enemy" (let ((v1-0 (the-as object (-> arg1 param 1)))) (if (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-0) mask)) - (return (the-as penetrate (-> (the-as attack-info v1-0) penetrate-using))) + (return (-> (the-as attack-info v1-0) penetrate-using)) ) ) (let* ((gp-0 arg0) @@ -327,24 +343,23 @@ ) (when v1-3 (let* ((gp-1 (-> v1-3 root)) - (v1-4 (if (type? gp-1 collide-shape) + (v1-4 (if (the-as penetrate (type? gp-1 collide-shape)) gp-1 ) ) ) (if v1-4 - (return - (the-as penetrate (logior (-> (the-as collide-shape v1-4) penetrate-using) (penetrate generic-attack))) - ) + (return (logior (-> (the-as collide-shape v1-4) penetrate-using) (penetrate generic-attack))) ) ) ) ) - (the-as penetrate 2) + (penetrate generic-attack) ) ;; WARN: Return type mismatch process vs process-focusable. (defmethod get-focus! ((this enemy)) + "If we're focusing on something alive, return it." (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 (not (and v0-0 @@ -359,15 +374,17 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod enemy-method-70 ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod set-focus! ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) + "Change our focus to the given process. Optionally, specify awareness." (if arg1 - (enemy-focus-method-13 (-> this focus) arg0 arg1) - (try-update-focus (-> this focus) arg0 this) + (focus-on-with-awareness! (-> this focus) arg0 arg1) + (focus-on! (-> this focus) arg0 this) ) (none) ) -(defmethod enemy-method-69 ((this enemy)) +(defmethod focus-on-attacker! ((this enemy)) + "If possible, update this enemies focus to the attacker." (when (not (logtest? (enemy-flag lock-focus) (-> this enemy-flags))) (let* ((s4-0 (handle->process (-> this incoming attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) @@ -375,8 +392,8 @@ ) ) ) - (when (can-collide-with-focus? this (the-as process-focusable s5-0)) - (enemy-method-70 this (the-as process-focusable s5-0) (the-as enemy-aware #f)) + (when (can-focus-on? this (the-as process-focusable s5-0)) + (set-focus! this (the-as process-focusable s5-0) (the-as enemy-aware #f)) (logior! (-> this focus flags) (enemy-flag look-at-focus)) ) ) @@ -385,7 +402,10 @@ (none) ) -(defmethod send-attack-to-all-tshapes ((this enemy) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this enemy) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when (and s4-0 (and (logtest? (-> this incoming penetrate-using) (penetrate board)) @@ -398,7 +418,7 @@ (get-touched-prim s3-0 (-> this root) s4-0) (when (logtest? (-> s2-0 prim-core action) (collide-action solid semi-solid deadly)) (let* ((a0-5 this) - (t9-2 (method-of-object a0-5 send-attack)) + (t9-2 (method-of-object a0-5 send-attack-from-tshape)) (a1-3 arg0) (a2-3 s4-0) (v1-13 *game-info*) @@ -423,6 +443,7 @@ ) (defmethod go-dormant ((this enemy)) + "Go to the dormant state. This disables drawing/processing/collision, and runs no logic." (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) @@ -434,6 +455,8 @@ ) (defmethod go-dormant-aware ((this enemy)) + "Go to the dormat aware state. + Similar to dormant, drawing/collision are disabled, but enemies can exit dormant-aware." (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) @@ -445,6 +468,7 @@ ) (defmethod go-idle ((this enemy)) + "Go to an idle state." (go (method-of-object this idle)) ) @@ -457,24 +481,29 @@ ) (defmethod go-hostile ((this enemy)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this hostile)) ) (defmethod have-more-than-10-joints? ((this enemy)) + "Does what it says, unused" (and (nonzero? (-> this node-list)) (-> this node-list) (< 10 (-> this node-list length))) ) -(defmethod enemy-method-150 ((this enemy)) +(defmethod can-be-nuked? ((this enemy)) + "Can this enemy be instantly destroyed by the nuke?" #t ) (defmethod go-gun-dark-2-stretch ((this enemy)) + "Go to the gun-dark-2-stretch state." (if (not (and (-> this next-state) (= (-> this next-state name) 'gun-dark-2-stretch))) (go (method-of-object this gun-dark-2-stretch)) ) ) -(defmethod go-ambush-delay ((this enemy)) +(defmethod go-ambush ((this enemy)) + "May go to ambush-delay first, if set in the res-lump." (if (< 0.0 (res-lump-float (-> this entity) 'ambush-delay)) (go (method-of-object this ambush-delay)) (go (method-of-object this ambush)) @@ -482,17 +511,20 @@ ) (defmethod go-flee ((this enemy)) + "Go to the flee state, running away." (go (method-of-object this flee)) ) (defmethod go-directed ((this enemy)) + "Go to the directed state which assumes that something else will control the enemy." (go (method-of-object this directed)) ) -(defmethod go-best-state ((this enemy)) +(defmethod go-state-for-focused ((this enemy)) + "Go to the appropriate state for the current awareness of the focused process." (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware ea3)) (get-focus! this)) + ((and (= s5-0 (enemy-aware hostile)) (get-focus! this)) (go-hostile this) ) ((<= (the-as int s5-0) 0) @@ -501,7 +533,7 @@ ((>= 1 (the-as int s5-0)) (go (method-of-object this active)) ) - ((= s5-0 (enemy-aware ea4)) + ((= s5-0 (enemy-aware flee)) (go-flee this) ) (else @@ -511,14 +543,16 @@ ) ) -(defmethod go-directed2 ((this enemy)) +(defmethod go-next-state-auto ((this enemy)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (if (logtest? (enemy-flag directed) (-> this enemy-flags)) (go-directed this) - (go-best-state this) + (go-state-for-focused this) ) ) (defmethod go-die ((this enemy)) + "Go to the die state." (if (-> this enemy-info use-die-falling) (go (method-of-object this die-falling)) (go (method-of-object this die)) @@ -526,6 +560,7 @@ ) (defmethod play-damage-sound ((this enemy) (arg0 int)) + "Pick and play the damage/death sound." (let ((name (static-sound-name ""))) (let ((v1-0 arg0)) (cond @@ -546,11 +581,12 @@ ) ) -(defmethod enemy-method-103 ((this enemy) (arg0 vector) (arg1 float)) +(defmethod heading-matches-direction? ((this enemy) (arg0 vector) (arg1 float)) + "Does this enemy's heading match the given heading? Threshold in degrees." (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (set! (-> s5-0 y) 0.0) @@ -559,13 +595,15 @@ ) ) -(defmethod enemy-method-104 ((this enemy) (arg0 vector) (arg1 float)) +(defmethod pointing-toward? ((this enemy) (arg0 vector) (arg1 float)) + "Is this enemy pointing toward the given point? Threshold in degrees." (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) - (enemy-method-103 this v1-1 arg1) + (heading-matches-direction? this v1-1 arg1) ) ) -(defmethod enemy-method-105 ((this enemy) (arg0 float) (arg1 symbol)) +(defmethod pointing-toward-focus? ((this enemy) (arg0 float) (arg1 symbol)) + "Is this enemy pointing toward its focused process?" (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 @@ -573,7 +611,7 @@ (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) ) ) - (enemy-method-103 this s4-1 arg0) + (heading-matches-direction? this s4-1 arg0) ) ) (else @@ -583,7 +621,8 @@ ) ) -(defmethod send-attack ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (let ((a0-1 (-> this enemy-info attack-damage))) (if (and (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (= a0-1 1)) (set! a0-1 2) @@ -615,22 +654,23 @@ ;; WARN: Return type mismatch enemy-flag vs none. (defmethod on-attack ((this enemy) (arg0 process-focusable)) + "Handler after this enemy attacks something. By default focuses on the attacked, but could be overriden." (when (logtest? (process-mask target bot) (-> arg0 mask)) (set! (-> this root penetrated-by) (the-as penetrate -1)) - (reset-penetrate! this) + (reset-penetrate-later! this) ) (let ((s5-0 (if (type? arg0 process-focusable) arg0 ) ) ) - (when (can-collide-with-focus? this s5-0) + (when (can-focus-on? this s5-0) (let ((v1-10 (handle->process (-> this focus handle)))) (when (or (= s5-0 v1-10) (and (not (logtest? (enemy-flag lock-focus) (-> this enemy-flags))) (or (not v1-10) (not (logtest? (-> this focus flags) (enemy-flag look-at-focus)))) ) ) - (enemy-method-70 this s5-0 (the-as enemy-aware #f)) + (set-focus! this s5-0 (the-as enemy-aware #f)) (set-time! (-> this hit-focus-time)) (logior! (-> this enemy-flags) (enemy-flag victory)) ) @@ -641,14 +681,16 @@ ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod reset-penetrate! ((this enemy)) +(defmethod reset-penetrate-later! ((this enemy)) + "After a little bit, reset the penetrate flags back to default." (logior! (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) (set-time! (-> this auto-reset-penetrate-time)) (none) ) (defmethod get-knockback-dir! ((this enemy) (arg0 vector)) - (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + "Compute the knockback direction for an incoming attack." + (vector-copy! arg0 (-> this incoming attack-direction)) (let ((v1-1 arg0)) (when (= (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))) 0.0) (vector-z-quaternion! arg0 (-> this root quat)) @@ -659,44 +701,44 @@ (vector-xz-normalize! arg0 1.0) ) -;; WARN: Return type mismatch int vs knocked-type. (defmethod penetrate->knocked-type ((this enemy) (arg0 penetrate)) - (the-as knocked-type (cond - ((logtest? arg0 (penetrate vehicle)) - 7 - ) - ((logtest? (penetrate jak-blue-shot) arg0) - 6 - ) - ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) - 4 - ) - ((logtest? (penetrate jak-red-shot) arg0) - 5 - ) - ((logtest? (penetrate dark-bomb dark-smack) arg0) - 3 - ) - ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) - 2 - ) - ((logtest? arg0 (penetrate mech-punch)) - 1 - ) - (else - 0 - ) - ) - ) + "Based on the penetrate of an attacker, pick the knocked-type." + (cond + ((logtest? arg0 (penetrate vehicle)) + (knocked-type vehicle) + ) + ((logtest? (penetrate jak-blue-shot) arg0) + (knocked-type blue-shot) + ) + ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) + (knocked-type yellow-shot) + ) + ((logtest? (penetrate jak-red-shot) arg0) + (knocked-type red-shot) + ) + ((logtest? (penetrate dark-bomb dark-smack) arg0) + (knocked-type dark-shot) + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + (knocked-type explode-or-darkjak) + ) + ((logtest? arg0 (penetrate mech-punch)) + (knocked-type mech-punch) + ) + (else + (knocked-type none) + ) + ) ) -(defmethod get-incoming-attack! ((this enemy) - (arg0 process-drawable) - (arg1 event-message-block) - (arg2 penetrate) - (arg3 attack-info) - (arg4 touching-shapes-entry) - ) +(defmethod handle-incoming-attack! ((this enemy) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + "Set up this enemy to handle an incoming attack event." (set! (-> this incoming penetrate-using) arg2) (set! (-> this incoming attack-id) (-> arg3 id)) (let ((v1-3 (if (logtest? (attack-mask knock) (-> arg3 mask)) @@ -723,13 +765,13 @@ ) (cond ((= v1-3 (knocked-type vehicle)) - (set! (-> this incoming attack-direction quad) (-> arg3 vector quad)) + (vector-copy! (-> this incoming attack-direction) (-> arg3 vector)) ) (else (let ((s2-0 (new 'stack-no-clear 'attack-info))) (attack-info-method-9 arg3 s2-0 arg0 this) - (set! (-> this incoming attacker-pos quad) (-> s2-0 intersection quad)) - (set! (-> this incoming attack-direction quad) (-> s2-0 attacker-velocity quad)) + (vector-copy! (-> this incoming attacker-pos) (-> s2-0 intersection)) + (vector-copy! (-> this incoming attack-direction) (-> s2-0 attacker-velocity)) ) ) ) @@ -751,6 +793,7 @@ ) (defmethod set-look-at-mode! ((this enemy) (arg0 int)) + "Pick between 1: look at the focus, or 2: look at where you're going." (case arg0 ((1) (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) @@ -769,6 +812,7 @@ ) (defmethod stop-look-at! ((this enemy)) + "Stop looking at something. Disables neck joint mod." (when (nonzero? (-> this neck)) (logclear! (-> this enemy-flags) (enemy-flag look-at-focus look-at-move-dest)) (shut-down (-> this neck)) @@ -777,7 +821,10 @@ (none) ) -(defmethod set-ground-pat! ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) +(defmethod find-ground-and-set-pat! ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) + "Figure out what ground we're standing on and update the ground-pat. + Usually this will be done automatically by the collision system. + This method should be called after manually repositioning an enemy." (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) (let ((v0-1 (-> arg0 best-other-tri pat))) (set! (-> this root ground-pat) v0-1) @@ -787,26 +834,28 @@ ) (defmethod enemy-above-ground? ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) + "Is this enemy above the ground?" (above-ground? (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) ) -(defmethod try-locate-ground ((this enemy) (arg0 meters) (arg1 meters) (arg2 symbol) (arg3 collide-spec)) +(defmethod move-to-ground ((this enemy) (arg0 meters) (arg1 meters) (arg2 symbol) (arg3 collide-spec)) + "Snap the enemy to the ground below." (let ((s4-0 (new 'stack-no-clear 'collide-query))) (cond - ((set-ground-pat! this s4-0 arg3 arg0 arg1 1024.0 (the-as process #f)) + ((find-ground-and-set-pat! this s4-0 arg3 arg0 arg1 1024.0 (the-as process #f)) (let ((s5-1 (-> this root))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this root trans)) (set! (-> s3-0 y) (-> s4-0 best-other-tri intersect y)) (move-to-point! s5-1 s3-0) (let ((a0-3 (-> s4-0 best-other-tri normal)) (v1-8 (-> s4-0 best-other-tri pat)) ) - (set! (-> s5-1 ground-touch-point quad) (-> s3-0 quad)) - (set! (-> s5-1 poly-normal quad) (-> a0-3 quad)) - (set! (-> s5-1 surface-normal quad) (-> a0-3 quad)) - (set! (-> s5-1 local-normal quad) (-> a0-3 quad)) - (set! (-> s5-1 ground-poly-normal quad) (-> a0-3 quad)) + (vector-copy! (-> s5-1 ground-touch-point) s3-0) + (vector-copy! (-> s5-1 poly-normal) a0-3) + (vector-copy! (-> s5-1 surface-normal) a0-3) + (vector-copy! (-> s5-1 local-normal) a0-3) + (vector-copy! (-> s5-1 ground-poly-normal) a0-3) (set! (-> s5-1 poly-pat) v1-8) (set! (-> s5-1 cur-pat) v1-8) (set! (-> s5-1 ground-pat) v1-8) @@ -837,9 +886,9 @@ ) (when (not (logtest? (-> v1-11 root-prim prim-core action) (collide-action no-normal-reset))) (let ((a0-12 (-> v1-11 dynam gravity-normal))) - (set! (-> v1-11 local-normal quad) (-> a0-12 quad)) - (set! (-> v1-11 surface-normal quad) (-> a0-12 quad)) - (set! (-> v1-11 poly-normal quad) (-> a0-12 quad)) + (vector-copy! (-> v1-11 local-normal) a0-12) + (vector-copy! (-> v1-11 surface-normal) a0-12) + (vector-copy! (-> v1-11 poly-normal) a0-12) ) (set! (-> v1-11 coverage) 0.0) (set! (-> v1-11 touch-angle) 0.0) @@ -855,20 +904,29 @@ ) (defmethod move-above-ground! ((this enemy) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) - (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) - (set! (-> arg1 old-gspot-normal quad) (-> gp-0 gspot-normal quad)) + (vector-copy! (-> arg1 old-gspot-pos) (-> gp-0 gspot-pos)) + (vector-copy! (-> arg1 old-gspot-normal) (-> gp-0 gspot-normal)) (set! (-> gp-0 trans-old-old-old quad) (-> gp-0 trans-old-old quad)) (set! (-> gp-0 trans-old-old quad) (-> gp-0 trans-old quad)) (set! (-> gp-0 trans-old quad) (-> gp-0 trans quad)) (set! (-> gp-0 prev-status) (-> gp-0 status)) (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) - (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) + (vector-copy! (-> arg1 new-pos) (-> gp-0 trans)) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (cond - ((set-ground-pat! this s2-0 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0 (the-as process #f)) + ((find-ground-and-set-pat! + this + s2-0 + (-> arg1 gnd-collide-with) + (-> arg1 popup) + 81920.0 + 1024.0 + (the-as process #f) + ) (when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y)) (set! (-> arg1 on-ground?) #t) (set! (-> arg1 pat) (-> s2-0 best-other-tri pat)) @@ -884,7 +942,7 @@ ) ) ) - (set! (-> gp-0 trans quad) (-> gp-0 trans-old quad)) + (vector-copy! (-> gp-0 trans) (-> gp-0 trans-old)) (move-to-point! gp-0 (-> arg1 new-pos)) (when (logtest? (logand (-> arg1 overlaps-params collide-with-filter) (collide-spec hit-by-player-list hit-by-others-list player-list) @@ -895,8 +953,8 @@ (when (-> arg1 dont-move-if-overlaps?) (set! (-> arg1 do-move?) #f) (move-to-point! gp-0 (-> gp-0 trans-old)) - (set! (-> gp-0 gspot-pos quad) (-> arg1 old-gspot-pos quad)) - (set! (-> gp-0 gspot-normal quad) (-> arg1 old-gspot-normal quad)) + (vector-copy! (-> gp-0 gspot-pos) (-> arg1 old-gspot-pos)) + (vector-copy! (-> gp-0 gspot-normal) (-> arg1 old-gspot-normal)) ) ) ) @@ -907,11 +965,11 @@ (a0-21 (-> gp-0 gspot-normal)) (v1-39 (-> arg1 pat)) ) - (set! (-> gp-0 ground-touch-point quad) (-> a1-6 quad)) - (set! (-> gp-0 poly-normal quad) (-> a0-21 quad)) - (set! (-> gp-0 surface-normal quad) (-> a0-21 quad)) - (set! (-> gp-0 local-normal quad) (-> a0-21 quad)) - (set! (-> gp-0 ground-poly-normal quad) (-> a0-21 quad)) + (vector-copy! (-> gp-0 ground-touch-point) a1-6) + (vector-copy! (-> gp-0 poly-normal) a0-21) + (vector-copy! (-> gp-0 surface-normal) a0-21) + (vector-copy! (-> gp-0 local-normal) a0-21) + (vector-copy! (-> gp-0 ground-poly-normal) a0-21) (set! (-> gp-0 poly-pat) v1-39) (set! (-> gp-0 cur-pat) v1-39) (set! (-> gp-0 ground-pat) v1-39) @@ -938,9 +996,9 @@ ) (when (not (logtest? (-> gp-0 root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-49 (-> gp-0 dynam gravity-normal))) - (set! (-> gp-0 local-normal quad) (-> v1-49 quad)) - (set! (-> gp-0 surface-normal quad) (-> v1-49 quad)) - (set! (-> gp-0 poly-normal quad) (-> v1-49 quad)) + (vector-copy! (-> gp-0 local-normal) v1-49) + (vector-copy! (-> gp-0 surface-normal) v1-49) + (vector-copy! (-> gp-0 poly-normal) v1-49) ) (set! (-> gp-0 coverage) 0.0) (set! (-> gp-0 touch-angle) 0.0) @@ -954,6 +1012,7 @@ ) (defmethod apply-friction ((this enemy)) + "Slow down the enemy due to friction with the ground." (let ((v1-0 (-> this root))) (when (logtest? (-> v1-0 status) (collide-status touch-surface)) (let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> this enemy-info friction))))))) @@ -967,20 +1026,24 @@ ) (defmethod init-enemy-collision! ((this enemy)) + "Typical place to construct collision shapes" 0 (none) ) (defmethod init-enemy! ((this enemy)) + "Typical place for shared init code. Runs from entity or process style init." 0 (none) ) -(defmethod go-idle2 ((this enemy)) +(defmethod go-fallback-init ((this enemy)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this idle)) ) -(defmethod init-enemy-info! ((this enemy) (arg0 enemy-info)) +(defmethod set-enemy-info! ((this enemy) (arg0 enemy-info)) + "Set the enemy-info" (set! (-> this enemy-info) arg0) (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) (set! (-> this neck) @@ -997,7 +1060,8 @@ (none) ) -(defmethod init-enemy-defaults! ((this enemy) (arg0 enemy-info)) +(defmethod setup-enemy! ((this enemy) (arg0 enemy-info)) + "Initialize the enemy by setting all the enemy-specific fields." (local-vars (sv-16 res-tag)) (when (coin-flip? this) (let ((a0-2 (-> this node-list data 2))) @@ -1010,7 +1074,7 @@ (logior! (-> this mask) (process-mask enemy)) (logior! (-> this mask) (process-mask actor-pause)) (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) - (init-enemy-info! this arg0) + (set-enemy-info! this arg0) (set! (-> this ragdoll-proc) (the-as handle #f)) (let ((a1-2 (-> this enemy-info idle-anim-script))) (if a1-2 @@ -1093,7 +1157,7 @@ ) (set! (-> this penetrate-flinch) (-> arg0 penetrate-flinch)) (set! (-> this penetrate-knocked) (-> arg0 penetrate-knocked)) - (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.6))) + (set! (-> this reaction-time) (rnd-time-frame this (seconds 0.1) (seconds 0.6))) (let* ((v1-77 (-> this enemy-flags)) (a0-28 (-> this fact enemy-options)) (v1-78 @@ -1114,7 +1178,7 @@ (not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) ) - (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) ) (if (zero? (-> this draw light-index)) (set! (-> this draw light-index) (the-as uint 10)) @@ -1123,7 +1187,8 @@ (none) ) -(defmethod enemy-method-152 ((this enemy)) +(defmethod gem-chance ((this enemy)) + "The chance of this enemy having a gem." 1.0 ) @@ -1132,6 +1197,7 @@ ) (defbehavior enemy-setup-gem enemy () + "Determine if the enemy should have a gem and set drawing masks/particles as needed." (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag has-gem)))) (when (> (-> self enemy-info gem-joint) 0) (let ((gp-0 (get-gem-pool-idx self))) @@ -1143,7 +1209,7 @@ (and (nonzero? gp-0) (let* ((v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-15 (the-as number (logior #x3f800000 v1-14))) ) - (< (+ -1.0 (the-as float v1-15)) (enemy-method-152 self)) + (< (+ -1.0 (the-as float v1-15)) (gem-chance self)) ) ) ) @@ -1172,6 +1238,7 @@ ) (defbehavior enemy-init-by-other enemy ((arg0 process-drawable) (arg1 enemy-init-by-other-params)) + "Function to initialize an enemy from a parent process." (let ((a1-1 (-> arg1 entity))) (if a1-1 (process-entity-set! self a1-1) @@ -1193,7 +1260,7 @@ ) ) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg1 trans quad)) + (vector-copy! (-> self root trans) (-> arg1 trans)) (quaternion-copy! (-> self root quat) (-> arg1 quat)) (vector-identity! (-> self root scale)) (init-enemy! self) @@ -1214,16 +1281,17 @@ (go-dormant-aware self) ) ((logtest? (enemy-option ambush) (-> self fact enemy-options)) - (go-ambush-delay self) + (go-ambush self) ) (else - (go-idle2 self) + (go-fallback-init self) ) ) ) ) (defmethod init-from-entity! ((this enemy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((a1-2 (res-lump-struct arg0 'art-level symbol))) (when a1-2 (let ((a0-3 (level-get *level* a1-2))) @@ -1253,17 +1321,19 @@ (go-dormant-aware this) ) (else - (go-idle2 this) + (go-fallback-init this) ) ) ) ) -(defmethod is-pfoc-in-mesh? ((this enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this enemy) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." #t ) -(defmethod enemy-method-108 ((this enemy) (arg0 process-focusable)) +(defmethod should-flee-from? ((this enemy) (arg0 process-focusable)) + "Return if this enemy should flee from the process." #f ) @@ -1272,12 +1342,13 @@ (let ((t9-0 (method-of-type focus reset-to-collide-spec))) (t9-0 this arg0) ) - (set! (-> this aware) (enemy-aware ea0)) + (set! (-> this aware) (enemy-aware unaware)) 0 (none) ) (defmethod update-focus ((this enemy)) + "Potentially update the focus, if there is something better to focus on." (let ((gp-0 (-> this focus))) (let ((a1-0 (handle->process (-> gp-0 handle)))) (when a1-0 @@ -1291,9 +1362,11 @@ (find-best-focus this) (return (the-as process #f)) ) - (let ((v1-14 - (get-enemy-aware this (update-awareness! this (the-as process-focusable a1-0) (the-as enemy-best-focus #f))) - ) + (let ((v1-14 (modify-awareness + this + (get-awareness-of-proc this (the-as process-focusable a1-0) (the-as enemy-best-focus #f)) + ) + ) ) (set! (-> gp-0 aware) v1-14) (if (>= 1 (the-as int v1-14)) @@ -1319,12 +1392,13 @@ ) (defmethod find-best-focus ((this enemy)) + "Search for the best thing to focus on." (let ((s4-0 (-> this focus collide-with)) (gp-0 (new 'stack-no-clear 'enemy-best-focus)) ) (set! (-> gp-0 proc) #f) (set! (-> gp-0 rating) 409600000.0) - (set! (-> gp-0 aware) (enemy-aware ea0)) + (set! (-> gp-0 aware) (enemy-aware unaware)) (when (logtest? s4-0 (collide-spec player-list)) (let ((v1-4 (-> *collide-player-list* alive-list next0))) *collide-player-list* @@ -1342,7 +1416,7 @@ (and a1-1 (not (logtest? (-> (the-as process-focusable a1-1) focus-status) (focus-status disable dead)))) (!= this a1-1) ) - (update-awareness! this (the-as process-focusable a1-1) gp-0) + (get-awareness-of-proc this (the-as process-focusable a1-1) gp-0) ) ) ) @@ -1372,7 +1446,7 @@ (and a1-3 (not (logtest? (-> (the-as process-focusable a1-3) focus-status) (focus-status disable dead)))) (!= this a1-3) ) - (update-awareness! this (the-as process-focusable a1-3) gp-0) + (get-awareness-of-proc this (the-as process-focusable a1-3) gp-0) ) ) ) @@ -1401,7 +1475,7 @@ (and a1-5 (not (logtest? (-> (the-as process-focusable a1-5) focus-status) (focus-status disable dead)))) (!= this a1-5) ) - (update-awareness! this (the-as process-focusable a1-5) gp-0) + (get-awareness-of-proc this (the-as process-focusable a1-5) gp-0) ) ) ) @@ -1416,7 +1490,7 @@ ) (let ((s4-1 (-> gp-0 proc))) (when s4-1 - (enemy-method-70 this (the-as process-focusable s4-1) (get-enemy-aware this (-> gp-0 aware))) + (set-focus! this (the-as process-focusable s4-1) (modify-awareness this (-> gp-0 aware))) s4-1 ) ) @@ -1424,7 +1498,8 @@ ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-awareness! ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod get-awareness-of-proc ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) + "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (let ((f30-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans))) (s3-1 #f) (s2-0 #f) @@ -1432,7 +1507,7 @@ (cond ((< f30-0 (-> this enemy-info proximity-notice-distance)) (set! s3-1 #t) - (set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f))) + (set! s2-0 (can-become-hostile-to? this arg0 (the-as vector #f))) ) (else (let ((f0-1 (the-as float (-> this enemy-info notice-distance)))) @@ -1440,7 +1515,7 @@ (set! f0-1 (+ (the-as meters f0-1) (-> this enemy-info notice-distance-delta))) ) (when (or (< f30-0 f0-1) (not (logtest? (-> this enemy-flags) (enemy-flag use-notice-distance)))) - (set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f))) + (set! s2-0 (can-become-hostile-to? this arg0 (the-as vector #f))) (if s2-0 (set! s3-1 #t) ) @@ -1451,22 +1526,22 @@ (let ((aware (cond (s3-1 (cond - ((enemy-method-108 this arg0) - (the-as enemy-aware (enemy-aware ea4)) + ((should-flee-from? this arg0) + (the-as enemy-aware (enemy-aware flee)) ) (s2-0 - (the-as enemy-aware (enemy-aware ea3)) + (the-as enemy-aware (enemy-aware hostile)) ) (else - (the-as enemy-aware (enemy-aware ea2)) + (the-as enemy-aware (enemy-aware aware2)) ) ) ) ((< f30-0 (-> this fact idle-distance)) - (the-as enemy-aware (enemy-aware ea1)) + (the-as enemy-aware (enemy-aware aware1)) ) (else - (the-as enemy-aware (enemy-aware ea0)) + (the-as enemy-aware (enemy-aware unaware)) ) ) ) @@ -1474,13 +1549,13 @@ (when (and (> (the-as int aware) 0) (logtest? (enemy-flag use-trigger) (-> this enemy-flags))) (cond ((logtest? (enemy-option idle-til-trigger) (-> this fact enemy-options)) - (if (not (enemy-method-141 this f30-0)) - (set! aware (enemy-aware ea0)) + (if (not (check-awareness-trigger this f30-0)) + (set! aware (enemy-aware unaware)) ) ) (else - (if (and (< 1 (the-as int aware)) (not (enemy-method-141 this f30-0))) - (set! aware (enemy-aware ea1)) + (if (and (< 1 (the-as int aware)) (not (check-awareness-trigger this f30-0))) + (set! aware (enemy-aware aware1)) ) ) ) @@ -1497,7 +1572,8 @@ ) ) -(defmethod enemy-method-141 ((this enemy) (arg0 float)) +(defmethod check-awareness-trigger ((this enemy) (arg0 float)) + "Check triggering logic for awareness to see if this enemy can become aware yet." (let* ((v1-0 (-> this fact)) (a2-0 (-> v1-0 trig-mask-count)) (a3-0 (-> v1-0 trig-mask)) @@ -1530,8 +1606,8 @@ #f ) -;; WARN: Return type mismatch int vs enemy-aware. -(defmethod get-enemy-aware ((this enemy) (arg0 enemy-aware)) +(defmethod modify-awareness ((this enemy) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." (let ((v1-1 (< 1 (the-as int arg0)))) (cond (v1-1 @@ -1549,22 +1625,22 @@ (logclear! (-> this enemy-flags) (enemy-flag notice)) ) ) - (the-as enemy-aware (cond - (v1-1 - (the-as int arg0) - ) - ((or (= arg0 (enemy-aware ea0)) (time-elapsed? (-> this last-draw-time) (seconds 2))) - 0 - ) - (else - 1 - ) - ) - ) + (cond + (v1-1 + arg0 + ) + ((or (= arg0 (enemy-aware unaware)) (time-elapsed? (-> this last-draw-time) (seconds 2))) + (enemy-aware unaware) + ) + (else + (enemy-aware aware1) + ) + ) ) ) (defmethod event-handler ((this enemy) (proc process) (argc int) (msg symbol) (block event-message-block)) + "Commmon handler for events." (local-vars (s5-6 rgbaf) (sv-640 event-message-block) (sv-656 process) (sv-672 event-message-block)) (cond ((= msg 'go-gun-dark-2-stretch) @@ -1620,7 +1696,7 @@ ) ) ) - (send-attack-on-jump-or-knocked this proc block) + (enemy-touched-handler this proc block) ) ((= msg 'attack-invinc) (case (-> (the-as attack-info (-> block param 1)) mode) @@ -1637,7 +1713,7 @@ ((= msg 'attack-no-avoid) (let* ((s2-0 (-> block param 1)) (s3-4 this) - (s1-0 (method-of-object s3-4 get-incoming-attack!)) + (s1-0 (method-of-object s3-4 handle-incoming-attack!)) (s0-0 proc) ) (set! sv-640 block) @@ -1654,7 +1730,7 @@ ) ) ) - (damage-enemy! this proc block) + (damage-enemy-from-attack! this proc block) ) ((= msg 'attack) (let ((s2-1 (the-as object (-> block param 1)))) @@ -1664,7 +1740,7 @@ (not (logtest? (-> this focus-status) (focus-status grabbed))) ) (let* ((s1-1 this) - (s0-1 (method-of-object s1-1 get-incoming-attack!)) + (s0-1 (method-of-object s1-1 handle-incoming-attack!)) ) (set! sv-656 proc) (set! sv-672 block) @@ -1684,12 +1760,12 @@ (send-event (ppointer->process (-> this parent)) 'child-hit) (let ((f0-1 0.0)) (if (not *debug-unkillable*) - (set! f0-1 (damage-enemy! this proc block)) + (set! f0-1 (damage-enemy-from-attack! this proc block)) ) - (let ((s2-2 (penetrate->next-state this proc block f0-1))) + (let ((s2-2 (msg-for-incoming-attack this proc block f0-1))) (when s2-2 (logclear! (-> this enemy-flags) (enemy-flag use-trigger)) - (send-attack-to-all-tshapes this (the-as process-focusable proc) block) + (find-and-damage-attackers this (the-as process-focusable proc) block) (let ((a1-17 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-17 from) (process->ppointer proc)) (set! (-> a1-17 num-params) argc) @@ -1750,7 +1826,7 @@ (set! (-> s5-1 attacker) (the-as handle v1-85)) ) (logior! (-> s5-1 mask) (attack-mask attacker)) - (let ((v1-89 (scale-impact-vel-y! + (let ((v1-89 (attack-direction-from-impact-vel this (new 'stack-no-clear 'vector) (vector-negate! (new 'stack-no-clear 'vector) (-> (the-as rigid-body-impact s4-1) velocity)) @@ -1758,14 +1834,14 @@ ) ) ) - (set! (-> s5-1 attacker-velocity quad) (-> v1-89 quad)) - (set! (-> s5-1 vector quad) (-> v1-89 quad)) + (vector-copy! (-> s5-1 attacker-velocity) v1-89) + (vector-copy! (-> s5-1 vector) v1-89) ) (logior! (-> s5-1 mask) (attack-mask attacker-velocity)) (logior! (-> s5-1 mask) (attack-mask vector)) - (set! (-> s5-1 intersection quad) (-> (the-as rigid-body-impact s4-1) point quad)) + (vector-copy! (-> s5-1 intersection) (-> (the-as rigid-body-impact s4-1) point)) (logior! (-> s5-1 mask) (attack-mask intersection)) - (set! (-> s5-1 damage) (lerp-damage this f30-1)) + (set! (-> s5-1 damage) (impact-velocity-to-hit-points this f30-1)) (logior! (-> s5-1 mask) (attack-mask damage)) (when (< 0.0 (-> s5-1 damage)) (format @@ -1796,7 +1872,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action proc) (send-event proc 'get-attack-count 1) @@ -1815,7 +1891,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action proc) (send-event proc 'get-attack-count 1) @@ -1840,7 +1916,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action proc) (send-event proc 'get-attack-count 1) @@ -1862,7 +1938,7 @@ (cond (v1-202 (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) - (go-ambush-delay this) + (go-ambush this) (go-hostile this) ) ) @@ -1871,7 +1947,7 @@ ) ) (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) - (go-ambush-delay this) + (go-ambush this) (go (method-of-object this notice)) ) ) @@ -1887,8 +1963,8 @@ ) (logclear! (-> this enemy-flags) (enemy-flag directed directed-ready use-trigger)) (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) - (go-ambush-delay this) - (go-best-state this) + (go-ambush this) + (go-state-for-focused this) ) #t ) @@ -1900,7 +1976,7 @@ ) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this jump-why) (-> block param 0)) - (set! (-> this event-param-point quad) (-> (the-as vector (-> block param 1)) quad)) + (vector-copy! (-> this event-param-point) (the-as vector (-> block param 1))) (go (method-of-object this jump)) ) ) @@ -1954,7 +2030,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (go-die this) ) @@ -2045,12 +2121,15 @@ ) ) -(defmethod lerp-damage ((this enemy) (arg0 float)) +(defmethod impact-velocity-to-hit-points ((this enemy) (arg0 float)) + "Given an impact velocity, compute hit points." (lerp-scale 0.0 (-> this enemy-info default-hit-points) arg0 20480.0 122880.0) ) -(defmethod scale-impact-vel-y! ((this enemy) (arg0 vector) (arg1 vector) (arg2 float)) - (set! (-> arg0 quad) (-> arg1 quad)) +(defmethod attack-direction-from-impact-vel ((this enemy) (arg0 vector) (arg1 vector) (arg2 float)) + "Compute the direction of an attack given an impact velocity. + This reduces the vertical component, probably to avoid sending the enemy into the air too much." + (vector-copy! arg0 arg1) (vector-normalize! arg0 arg2) (set! (-> arg0 y) (lerp-scale (-> this enemy-info knocked-hard-vy-lo) @@ -2065,6 +2144,7 @@ ) (defmethod get-damage-from-attack ((this enemy) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let ((v1-0 (the-as object (-> arg1 param 1)))) (if (logtest? (attack-mask damage) (-> (the-as attack-info v1-0) mask)) (-> (the-as attack-info v1-0) damage) @@ -2073,7 +2153,10 @@ ) ) -(defmethod enemy-method-63 ((this enemy) (arg0 float)) +(defmethod apply-incoming-hitpoint-mods ((this enemy) (arg0 float)) + "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (let ((f0-1 (fmax 0.0 (fmin arg0 (-> this hit-points))))) (cond ((and (= (-> this incoming knocked-type) (knocked-type blue-shot)) (= f0-1 (-> this hit-points)) (< 0.0 f0-1)) @@ -2097,13 +2180,14 @@ ) ) -(defmethod penetrate->next-state ((this enemy) (arg0 process) (arg1 event-message-block) (arg2 float)) +(defmethod msg-for-incoming-attack ((this enemy) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." (let ((gp-0 (-> this incoming penetrate-using))) (cond ((and (logtest? (penetrate jak-dark-blackhole) gp-0) #t) 'go-gun-dark-2-stretch ) - ((and (logtest? (penetrate jak-dark-nuke) (-> this incoming penetrate-using)) (enemy-method-150 this)) + ((and (logtest? (penetrate jak-dark-nuke) (-> this incoming penetrate-using)) (can-be-nuked? this)) 'go-gun-dark-3-nuke ) ((logtest? gp-0 (-> this penetrate-flinch)) @@ -2119,9 +2203,10 @@ ) ) -(defmethod damage-enemy! ((this enemy) (arg0 object) (arg1 event-message-block)) +(defmethod damage-enemy-from-attack! ((this enemy) (arg0 object) (arg1 event-message-block)) + "Given an attack message, apply damage." (let* ((f0-0 (get-damage-from-attack this arg0 arg1)) - (f30-0 (enemy-method-63 this f0-0)) + (f30-0 (apply-incoming-hitpoint-mods this f0-0)) ) (set! (-> this hit-points) (- (-> this hit-points) f30-0)) (if (not (logtest? (-> this enemy-flags) (enemy-flag auto-reset-penetrate))) @@ -2132,10 +2217,14 @@ ) (defmethod find-offending-pfoc ((this enemy) (arg0 process) (arg1 attack-info)) + "Figure out the attacker process from the attack message sender and attack-info. + This is to handle cases where the attacker process is a non-focusable subprocess, + or the attacker is driving a vehicle." (find-offending-process-focusable arg0 arg1) ) (defmethod enemy-touch-handler ((this enemy) (arg0 process) (arg1 event-message-block)) + "General handler for an event when a process intentionally sends a touch event." (let* ((s4-0 (-> arg1 param 0)) (s2-0 arg0) (s3-0 (if (type? s2-0 process-focusable) @@ -2167,7 +2256,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s4-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s4-0) a3-2) ) ) ((and ((method-of-type touching-shapes-entry prims-touching-action?) @@ -2191,7 +2280,8 @@ ) ;; WARN: Return type mismatch symbol vs object. -(defmethod send-attack-on-jump-or-knocked ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this enemy) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (let ((s4-0 (-> arg1 param 0))) (when s4-0 (when (or (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -2218,7 +2308,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s4-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s4-0) a3-2) ) ) ) @@ -2227,10 +2317,12 @@ ) (defbehavior enemy-event-handler enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Default event handler for enemy." (event-handler self arg0 arg1 arg2 arg3) ) (defbehavior enemy-simple-post enemy () + "Default post for enemy." (enemy-common-post self) (update-transforms (-> self root)) 0 @@ -2238,10 +2330,12 @@ ) (defbehavior enemy-falling-post enemy () + "Post function that simply makes the enemy go down. + Collision is enabled, so enemy will bounce off of walls or similar." (let ((gp-0 (-> self root))) (cond ((focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) ) (else (let ((a1-1 (new-stack-vector0))) @@ -2263,7 +2357,8 @@ (none) ) -(defmethod accelerate-fall! ((this enemy) (arg0 vector)) +(defmethod adjust-transv-under-water! ((this enemy) (arg0 vector)) + "Modify the velocity as needed if the enemy is underwater." (let* ((f2-0 0.8) (f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 f2-0))))) ) @@ -2273,15 +2368,17 @@ ) (defbehavior enemy-die-falling-post enemy () + "Post function that causes the enemy to go down until it hits the ground. + Doesn't use full collision system - enemy will stop moving as soon as it hits any ground." (let ((gp-0 (-> self root))) (if (focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 (new-stack-vector0) 0.0)) ) (let ((s4-1 (new 'stack-no-clear 'collide-query)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> gp-0 trans quad)) + (vector-copy! s5-1 (-> gp-0 trans)) (vector-v++! s5-1 (-> gp-0 transv)) (when (find-ground gp-0 @@ -2306,26 +2403,29 @@ ) ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-91 ((this enemy) (arg0 enemy-jump-info)) +(defmethod check-jump-blocked? ((this enemy) (arg0 enemy-jump-info)) + "Is this jump blocked by something?" #f ) (defmethod init-jump-info! ((this enemy) (arg0 enemy-jump-info)) + "Populate an enemy-jump-info for jumping to this enemy's event-param-point" (set! (-> arg0 flags) (enemy-jump-flags ejf0)) (set! (-> arg0 anim-speed) (rnd-float-range this 0.9 1.1)) (set! (-> arg0 hang-time) 0) - (set! (-> arg0 dest-pos quad) (-> this event-param-point quad)) - (set! (-> arg0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> arg0 dest-pos) (-> this event-param-point)) + (vector-copy! (-> arg0 start-pos) (-> this root trans)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (if (enemy-above-ground? this s4-0 (-> arg0 dest-pos) (-> this gnd-collide-with) 8192.0 81920.0 1024.0) (set! (-> arg0 dest-pos y) (-> s4-0 best-other-tri intersect y)) ) ) - (setup-jump! this arg0) + (setup-jump-trajectory! this arg0) (none) ) -(defmethod setup-jump! ((this enemy) (arg0 enemy-jump-info)) +(defmethod setup-jump-trajectory! ((this enemy) (arg0 enemy-jump-info)) + "Compute jump trajectory." (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) (f0-2 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) ) @@ -2334,7 +2434,8 @@ (none) ) -(defmethod on-ground? ((this enemy) (arg0 enemy-jump-info)) +(defmethod landed-jump-yet? ((this enemy) (arg0 enemy-jump-info)) + "Is this on, or close to, the ground?" (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-1 (new 'stack-no-clear 'collide-query))) @@ -2346,6 +2447,7 @@ ) (defmethod move-to-gspot! ((this enemy)) + "Snap the enemy down onto the cached ground spot (gspot)." (let* ((v1-0 (-> this root)) (f0-0 (-> v1-0 gspot-pos y)) ) @@ -2356,14 +2458,16 @@ (set! (-> this root transv y) 0.0) ) -(defmethod enemy-method-101 ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod adjust-heading-for-jump ((this enemy) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Can be overriden. Yaw the enemy in response to an ongoing jump." 0 (none) ) -(defmethod in-jump-handler ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod move-along-ballistic-trajectory-for-jump ((this enemy) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Adjust trans, transv for the jump, if we're airborne." (case arg0 - ((2 3) + (((jump-stage takeoff) (jump-stage in-air)) (let ((f30-0 (the float (-> arg1 hang-time)))) (let ((a1-3 (compute-trans-at-time (-> arg1 traj) f30-0 (new 'stack-no-clear 'vector)))) (move-to-point! (-> this root) a1-3) @@ -2380,6 +2484,7 @@ ) (defmethod jump-wind-up-anim ((this enemy) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -2398,6 +2503,7 @@ ) (defmethod jump-in-air-anim ((this enemy) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) (let ((v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -2429,6 +2535,7 @@ ) (defmethod jump-land-anim ((this enemy) (arg0 enemy-jump-info)) + "Play the landing anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -2446,62 +2553,63 @@ #t ) -(defmethod jump-anim-handler ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this enemy) (arg0 jump-stage) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) - (let ((v1-0 arg0)) - (cond - ((zero? v1-0) - (not (jump-wind-up-anim this arg1)) - ) - ((= v1-0 1) - (set! s5-0 (ja-done? 0)) - (let ((a0-4 (-> this skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) - (set! (-> a0-4 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 - ) - ((= v1-0 2) - (jump-in-air-anim this arg1) - #f - ) - ((= v1-0 3) - (set! s5-0 (ja-done? 0)) - (let ((a0-9 (-> this skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) - (set! (-> a0-9 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 + (case arg0 + (((jump-stage init)) + (not (jump-wind-up-anim this arg1)) + ) + (((jump-stage winding-up)) + (set! s5-0 (ja-done? 0)) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) - ((= v1-0 4) - (not (jump-land-anim this arg1)) + (ja-blend-eval) + s5-0 + ) + (((jump-stage takeoff)) + (jump-in-air-anim this arg1) + #f + ) + (((jump-stage in-air)) + (set! s5-0 (ja-done? 0)) + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) + (set! (-> a0-9 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) ) - ((= v1-0 5) - (set! s5-0 (ja-done? 0)) - (let ((a0-14 (-> this skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group frames num-frames) -1))) - (set! (-> a0-14 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 + (ja-blend-eval) + s5-0 + ) + (((jump-stage touchdown)) + (not (jump-land-anim this arg1)) + ) + (((jump-stage landing)) + (set! s5-0 (ja-done? 0)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group frames num-frames) -1))) + (set! (-> a0-14 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) ) - (else - #t - ) + (ja-blend-eval) + s5-0 + ) + (else + #t ) ) ) -(defmethod enemy-method-109 ((this enemy)) +(defmethod out-of-bounds? ((this enemy)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." #f ) -(defmethod enemy-method-50 ((this enemy) (arg0 int)) +(defmethod update-collision-action ((this enemy) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" 0 (none) ) @@ -2516,6 +2624,7 @@ ) (defmethod knocked-handler ((this enemy) (arg0 vector)) + "Called when this enemy is knocked." (local-vars (v0-22 number)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2655,6 +2764,7 @@ ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this enemy)) + "Get the yaw angle for the current knock." (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) @@ -2703,6 +2813,7 @@ ) (defmethod knocked-anim ((this enemy) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-anim))) (a0-4 (-> this skel root-channel 0)) @@ -2717,6 +2828,7 @@ ) (defmethod knocked-land-anim ((this enemy) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -2729,7 +2841,8 @@ #t ) -(defmethod enemy-method-88 ((this enemy) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this enemy) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" (let ((gp-0 (-> this root))) (or (>= (-> arg0 on-surface-count) 3) (and (logtest? (-> gp-0 status) (collide-status on-ground)) (>= 16384.0 (-> gp-0 transv y))) @@ -2745,7 +2858,8 @@ ) ) -(defmethod within-gspot-range? ((this enemy)) +(defmethod invalid-height? ((this enemy)) + "Return #t if the enemy is too high in the air, or below the ground." (let ((gp-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) ) @@ -2770,7 +2884,10 @@ ) ) -(defmethod enemy-method-90 ((this enemy) (arg0 ragdoll-proc)) +(defmethod copy-ragdoll-orientation-to-root ((this enemy) (arg0 ragdoll-proc)) + "Apply rotational offset from ragdolling back to the enemy. + Used when disabling a ragdoll to update the enemy + orientation to match the end of ragdoll orientation." (let* ((s4-0 (-> arg0 ragdoll)) (s2-0 (-> s4-0 ragdoll-joints)) (s1-0 @@ -2794,6 +2911,7 @@ ) (defmethod knocked-anim-handler ((this enemy) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -2838,14 +2956,16 @@ (ja-group? (-> self draw art-group data arg0)) ) -(defmethod enemy-method-123 ((this enemy)) +(defmethod allow-ragdoll? ((this enemy)) + "Can this enemy ragdoll now?" #t ) (defmethod ragdoll-spawn! ((this enemy) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." (local-vars (s2-0 process)) (with-pp - (when (and (enemy-method-123 this) (-> this enemy-info ragdoll-info)) + (when (and (allow-ragdoll? this) (-> this enemy-info ragdoll-info)) (let ((s3-0 (handle->process (-> this ragdoll-proc)))) (cond (s3-0 @@ -2899,7 +3019,7 @@ ) (vector-float*! s1-0 s1-0 (/ 1.0 (-> pp clock time-adjust-ratio))) (let ((v0-1 (-> (the-as ragdoll-proc s2-0) ragdoll ragdoll-joints 0 velocity))) - (set! (-> v0-1 quad) (-> s1-0 quad)) + (vector-copy! v0-1 s1-0) v0-1 ) ) @@ -2909,7 +3029,8 @@ ) (defmethod deactivate-ragdoll! ((this enemy)) - (when (and (enemy-method-123 this) (-> this enemy-info ragdoll-info)) + "Deactivate the ragdoll process." + (when (and (allow-ragdoll? this) (-> this enemy-info ragdoll-info)) (let ((a0-3 (handle->process (-> this ragdoll-proc)))) (when a0-3 (when (and (-> this draw) (-> this draw shadow-ctrl)) @@ -2926,7 +3047,9 @@ (none) ) +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this enemy)) + "Has the ragdoll stopped moving?" (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (or (not s5-0) (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) @@ -2947,7 +3070,7 @@ ) (< (cos (* f1-2 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) ) - (and (not (enemy-method-109 this)) (not (within-gspot-range? this))) + (and (not (out-of-bounds? this)) (not (invalid-height? this))) ) ) ) @@ -2957,11 +3080,12 @@ ) (defmethod disable-ragdoll ((this enemy)) + "Smoothly disable the ragdoll and transition back to normal control." (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (when s5-0 (disable-for-duration (the-as ragdoll-proc s5-0) (-> this enemy-info ragdoll-blend-out-time)) (logclear! (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-flags) (ragdoll-flag rf9)) - (enemy-method-90 this (the-as ragdoll-proc s5-0)) + (copy-ragdoll-orientation-to-root this (the-as ragdoll-proc s5-0)) ) ) 0 @@ -2969,5 +3093,6 @@ ) (defmethod should-move-to-ground? ((this enemy)) + "Should this enemy be moved to the ground while moving?" (-> this enemy-info move-to-ground) ) diff --git a/goal_src/jak3/engine/ambient/ambient-h.gc b/goal_src/jak3/engine/ambient/ambient-h.gc index 46c6b4c0867..16b35eca9d1 100644 --- a/goal_src/jak3/engine/ambient/ambient-h.gc +++ b/goal_src/jak3/engine/ambient/ambient-h.gc @@ -9,15 +9,15 @@ (defenum talker-flags :type uint16 :bitfield #t - (tf0 0) - (tf1 1) - (tf2 2) - (tf3 3) - (tf4 4) - (tf5 5) - (tf6 6) - (tf7 7) - (tf8 8) + (play-only-once 0) + (reduce-volume 1) + (auto-save-on-each-start 2) + (auto-save-once-on-exit 3) + (only-play-in-region 4) + (fade-in 5) + (slide-in 6) + (bigger-font 7) + (long-timeout 8) ) ;; ---talker-flags @@ -33,7 +33,12 @@ ;; DECOMP BEGINS (deftype talker-speech-class (structure) - "Contains metadata about a voice line or hint text being played/displayed." + "Contains metadata about a voice line or hint text being played/displayed. +In the talker state, there's a pos-state and neg-state. +Calling yes-play! adjusts the pos-state and no-play! adjusts the neg-state. +Playback is only allowed if the pos-state is less than or equal to pos +and neg-state is greater than or equal to neg. +" ((name string) (channel gui-channel) (flags talker-flags) @@ -48,11 +53,11 @@ ) :pack-me (:methods - (talker-speech-class-method-9 (_type_) symbol) - (play-communicator-speech! (_type_) none) - (talker-speech-class-method-11 (_type_) none) - (talker-speech-class-method-12 (_type_ int) none) - (talker-speech-class-method-13 (_type_ int) none) + (should-play? (_type_) symbol) + (mark-played! (_type_) none) + (reset-state! (_type_) none) + (yes-play! (_type_ int) none) + (no-play! (_type_ int) none) ) ) @@ -88,7 +93,7 @@ (new 'static 'talker-speech-class :name "DSbop002" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1 :text-duration (seconds 5) :neg #x1 @@ -99,7 +104,7 @@ (new 'static 'talker-speech-class :name "DSbop004" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :text-duration (seconds 5) :neg #x1 @@ -110,7 +115,7 @@ (new 'static 'talker-speech-class :name "DSbop008" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :text-duration (seconds 5) :neg #x1 @@ -121,7 +126,7 @@ (new 'static 'talker-speech-class :name "DSbop010" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :text-duration (seconds 5) :neg #x1 @@ -132,7 +137,7 @@ (new 'static 'talker-speech-class :name "DSbop011" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5 :neg #x1 :on-close #f @@ -141,7 +146,7 @@ (new 'static 'talker-speech-class :name "DSbop016" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x6 :text-duration (seconds 5) :neg #x1 @@ -152,7 +157,7 @@ (new 'static 'talker-speech-class :name "DSbop017" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x7 :neg #x1 :on-close #f @@ -161,7 +166,7 @@ (new 'static 'talker-speech-class :name "ds020" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x8 :text-duration (seconds 5) :neg #x1 @@ -172,7 +177,7 @@ (new 'static 'talker-speech-class :name "ds043" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x9 :text-duration (seconds 1) :neg #x1 @@ -183,7 +188,7 @@ (new 'static 'talker-speech-class :name "ds043m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #xa :text-duration (seconds 1) :neg #x1 @@ -194,7 +199,7 @@ (new 'static 'talker-speech-class :name "ds046" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #xb :text-duration (seconds 1) :neg #x1 @@ -205,7 +210,7 @@ (new 'static 'talker-speech-class :name "ds046m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #xc :text-duration (seconds 1) :neg #x1 @@ -216,7 +221,7 @@ (new 'static 'talker-speech-class :name "dax101" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xd :neg #x1 :on-close #f @@ -225,7 +230,7 @@ (new 'static 'talker-speech-class :name "dax102" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xe :neg #x1 :on-close #f @@ -234,7 +239,7 @@ (new 'static 'talker-speech-class :name "dax103" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #xf :text-duration (seconds 1) :neg #x1 @@ -245,7 +250,7 @@ (new 'static 'talker-speech-class :name "dax104" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x10 :text-duration (seconds 1) :neg #x1 @@ -256,7 +261,7 @@ (new 'static 'talker-speech-class :name "dax105" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x11 :text-duration (seconds 1) :neg #x1 @@ -267,7 +272,7 @@ (new 'static 'talker-speech-class :name "dax106" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x12 :text-duration (seconds 1) :neg #x1 @@ -278,7 +283,7 @@ (new 'static 'talker-speech-class :name "dax107" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x13 :neg #x1 :on-close #f @@ -287,7 +292,7 @@ (new 'static 'talker-speech-class :name "dax108" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x14 :text-duration (seconds 1) :neg #x1 @@ -298,7 +303,7 @@ (new 'static 'talker-speech-class :name "dax109" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x15 :text-duration (seconds 1) :neg #x1 @@ -309,7 +314,7 @@ (new 'static 'talker-speech-class :name "dax110" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16 :neg #x1 :on-close #f @@ -318,7 +323,7 @@ (new 'static 'talker-speech-class :name "dax111" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x17 :text-duration (seconds 1) :neg #x1 @@ -329,7 +334,7 @@ (new 'static 'talker-speech-class :name "dax112" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x18 :text-duration (seconds 1) :neg #x1 @@ -392,7 +397,7 @@ (new 'static 'talker-speech-class :name "demo001" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #x1f :text-duration (seconds 5) :neg #x1 @@ -403,7 +408,7 @@ (new 'static 'talker-speech-class :name "demo002" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x20 :text-duration (seconds 5) :neg #x1 @@ -413,7 +418,7 @@ (new 'static 'talker-speech-class :name "demo003" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x21 :text-duration (seconds 8) :neg #x1 @@ -423,7 +428,7 @@ (new 'static 'talker-speech-class :name "demo004" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x22 :text-duration (seconds 8) :neg #x1 @@ -433,7 +438,7 @@ (new 'static 'talker-speech-class :name "demo005" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x23 :text-duration (seconds 8) :neg #x1 @@ -443,7 +448,7 @@ (new 'static 'talker-speech-class :name "sam001" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x24 :neg #x1 :on-close #f @@ -452,7 +457,7 @@ (new 'static 'talker-speech-class :name "ds162" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x25 :neg #x1 :on-close #f @@ -461,7 +466,7 @@ (new 'static 'talker-speech-class :name "sksp0002" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x26 :neg #x1 :on-close #f @@ -470,7 +475,7 @@ (new 'static 'talker-speech-class :name "sksp0005" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x27 :neg #x1 :on-close #f @@ -479,7 +484,7 @@ (new 'static 'talker-speech-class :name "sksp0004" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x28 :neg #x1 :on-close #f @@ -488,7 +493,7 @@ (new 'static 'talker-speech-class :name "sksp009b" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x29 :neg #x1 :on-close #f @@ -497,7 +502,7 @@ (new 'static 'talker-speech-class :name "sksp0006" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2a :neg #x1 :on-close #f @@ -506,7 +511,7 @@ (new 'static 'talker-speech-class :name "sksp009c" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2b :neg #x1 :on-close #f @@ -515,7 +520,7 @@ (new 'static 'talker-speech-class :name "sksp0035" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2c :neg #x1 :on-close #f @@ -524,7 +529,7 @@ (new 'static 'talker-speech-class :name "sksp009d" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2d :neg #x1 :on-close #f @@ -533,7 +538,7 @@ (new 'static 'talker-speech-class :name "sksp009e" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2e :neg #x1 :on-close #f @@ -542,7 +547,7 @@ (new 'static 'talker-speech-class :name "sksp0072" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2f :neg #x1 :on-close #f @@ -600,7 +605,7 @@ (new 'static 'talker-speech-class :name "str001" :channel (gui-channel message) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x36 :text-duration (seconds 3) :neg #x1 @@ -630,7 +635,7 @@ (new 'static 'talker-speech-class :name "intro01" :channel (gui-channel notice) - :flags (talker-flags tf5) + :flags (talker-flags fade-in) :speech #x39 :text-duration (seconds 3.5) :neg #x1 @@ -641,7 +646,7 @@ (new 'static 'talker-speech-class :name "intro01e" :channel (gui-channel notice) - :flags (talker-flags tf5) + :flags (talker-flags fade-in) :speech #x3a :text-duration (seconds 3.5) :neg #x1 @@ -652,7 +657,7 @@ (new 'static 'talker-speech-class :name "intro01j" :channel (gui-channel notice) - :flags (talker-flags tf5) + :flags (talker-flags fade-in) :speech #x3b :text-duration (seconds 3.5) :neg #x1 @@ -663,7 +668,7 @@ (new 'static 'talker-speech-class :name "intro01k" :channel (gui-channel notice) - :flags (talker-flags tf5) + :flags (talker-flags fade-in) :speech #x3c :text-duration (seconds 3.5) :neg #x1 @@ -684,7 +689,7 @@ (new 'static 'talker-speech-class :name "peck002" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3e :delay (seconds 2) :neg #x1 @@ -694,7 +699,7 @@ (new 'static 'talker-speech-class :name "peck004" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x3f :neg #x1 :on-close #f @@ -703,7 +708,7 @@ (new 'static 'talker-speech-class :name "sam007" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3 tf8) + :flags (talker-flags play-only-once auto-save-once-on-exit long-timeout) :speech #x40 :neg #x1 :on-close #f @@ -712,7 +717,7 @@ (new 'static 'talker-speech-class :name "klev001" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x41 :delay (seconds 2) :neg #x1 @@ -722,7 +727,7 @@ (new 'static 'talker-speech-class :name "dax118" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x42 :text-duration (seconds 1) :neg #x1 @@ -732,7 +737,7 @@ (new 'static 'talker-speech-class :name "peck135" :channel (gui-channel pecker) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x43 :neg #x1 :on-close #f @@ -741,7 +746,7 @@ (new 'static 'talker-speech-class :name "peck114" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x44 :text-duration (seconds 1) :neg #x1 @@ -752,7 +757,7 @@ (new 'static 'talker-speech-class :name "peck115" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x45 :text-duration (seconds 1) :neg #x1 @@ -763,7 +768,7 @@ (new 'static 'talker-speech-class :name "peck129" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x46 :text-duration (seconds 1) :neg #x1 @@ -774,7 +779,7 @@ (new 'static 'talker-speech-class :name "peck122" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x47 :text-duration (seconds 1) :neg #x1 @@ -785,7 +790,7 @@ (new 'static 'talker-speech-class :name "peck119" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x48 :text-duration (seconds 1) :neg #x1 @@ -796,7 +801,7 @@ (new 'static 'talker-speech-class :name "peck124" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x49 :text-duration (seconds 1) :neg #x1 @@ -807,7 +812,7 @@ (new 'static 'talker-speech-class :name "peck141" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x4a :text-duration (seconds 1) :neg #x1 @@ -818,7 +823,7 @@ (new 'static 'talker-speech-class :name "peck141m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #x4b :text-duration (seconds 1) :neg #x1 @@ -829,7 +834,7 @@ (new 'static 'talker-speech-class :name "peck131" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x4c :text-duration (seconds 1) :neg #x1 @@ -840,7 +845,7 @@ (new 'static 'talker-speech-class :name "peck131m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #x4d :text-duration (seconds 1) :neg #x1 @@ -851,7 +856,7 @@ (new 'static 'talker-speech-class :name "peck126" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x4e :text-duration (seconds 1) :neg #x1 @@ -862,7 +867,7 @@ (new 'static 'talker-speech-class :name "peck126m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #x4f :text-duration (seconds 1) :neg #x1 @@ -873,7 +878,7 @@ (new 'static 'talker-speech-class :name "dax126" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x50 :text-duration (seconds 1) :neg #x1 @@ -883,7 +888,7 @@ (new 'static 'talker-speech-class :name "gun-fire" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x51 :text-duration (seconds 5) :neg #x1 @@ -894,7 +899,7 @@ (new 'static 'talker-speech-class :name "klev002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x52 :neg #x1 :on-close #f @@ -903,7 +908,7 @@ (new 'static 'talker-speech-class :name "ash001" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x53 :neg #x1 :on-close #f @@ -932,7 +937,7 @@ (new 'static 'talker-speech-class :name "leaper02" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x56 :text-duration (seconds 5) :neg #x1 @@ -1003,7 +1008,7 @@ (new 'static 'talker-speech-class :name "sig001" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf8) + :flags (talker-flags play-only-once long-timeout) :speech #x5d :neg #x1 :on-close #f @@ -1012,7 +1017,7 @@ (new 'static 'talker-speech-class :name "torn002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x5e :delay (seconds 2) :neg #x1 @@ -1022,7 +1027,7 @@ (new 'static 'talker-speech-class :name "dax133" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5f :text-duration (seconds 5) :neg #x1 @@ -1033,7 +1038,7 @@ (new 'static 'talker-speech-class :name "mine001" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x60 :text-duration (seconds 3) :neg #x1 @@ -1044,7 +1049,7 @@ (new 'static 'talker-speech-class :name "klev004" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x61 :neg #x1 :on-close '(kiosk-complete) @@ -1053,7 +1058,7 @@ (new 'static 'talker-speech-class :name "gun001" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x62 :text-duration (seconds 5) :neg #x1 @@ -1064,7 +1069,7 @@ (new 'static 'talker-speech-class :name "dam003" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x63 :neg #x1 :on-close '(kiosk-complete) @@ -1091,7 +1096,7 @@ (new 'static 'talker-speech-class :name "sam003" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x66 :neg #x1 :on-close #f @@ -1100,7 +1105,7 @@ (new 'static 'talker-speech-class :name "keir002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf8) + :flags (talker-flags play-only-once long-timeout) :speech #x67 :neg #x1 :on-close #f @@ -1109,7 +1114,7 @@ (new 'static 'talker-speech-class :name "sam002" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x68 :neg #x1 :on-close #f @@ -1118,7 +1123,7 @@ (new 'static 'talker-speech-class :name "for001" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x69 :text-duration (seconds 5) :neg #x1 @@ -1129,7 +1134,7 @@ (new 'static 'talker-speech-class :name "keir004" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf8) + :flags (talker-flags play-only-once long-timeout) :speech #x6a :delay (seconds 8) :neg #x1 @@ -1139,7 +1144,7 @@ (new 'static 'talker-speech-class :name "sam006" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x6b :delay (seconds 5) :neg #x1 @@ -1149,7 +1154,7 @@ (new 'static 'talker-speech-class :name "powup001" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x6c :text-duration (seconds 5) :delay (seconds 1) @@ -1161,7 +1166,7 @@ (new 'static 'talker-speech-class :name "powup002" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x6d :text-duration (seconds 5) :delay (seconds 1) @@ -1173,7 +1178,7 @@ (new 'static 'talker-speech-class :name "powup003" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x6e :text-duration (seconds 5) :delay (seconds 1) @@ -1185,7 +1190,7 @@ (new 'static 'talker-speech-class :name "powup004" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x6f :text-duration (seconds 5) :delay (seconds 1) @@ -1197,7 +1202,7 @@ (new 'static 'talker-speech-class :name "powup005" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x70 :text-duration (seconds 5) :delay (seconds 1) @@ -1209,7 +1214,7 @@ (new 'static 'talker-speech-class :name "powup006" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x71 :text-duration (seconds 5) :delay (seconds 1) @@ -1221,7 +1226,7 @@ (new 'static 'talker-speech-class :name "powup007" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x72 :text-duration (seconds 5) :delay (seconds 1) @@ -1233,7 +1238,7 @@ (new 'static 'talker-speech-class :name "powup008" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x73 :text-duration (seconds 5) :delay (seconds 1) @@ -1245,7 +1250,7 @@ (new 'static 'talker-speech-class :name "powup009" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x74 :text-duration (seconds 5) :delay (seconds 1) @@ -1257,7 +1262,7 @@ (new 'static 'talker-speech-class :name "powup010" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x75 :text-duration (seconds 5) :delay (seconds 1) @@ -1269,7 +1274,7 @@ (new 'static 'talker-speech-class :name "powup011" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x76 :text-duration (seconds 5) :delay (seconds 1) @@ -1281,7 +1286,7 @@ (new 'static 'talker-speech-class :name "powup012" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x77 :text-duration (seconds 5) :delay (seconds 1) @@ -1293,7 +1298,7 @@ (new 'static 'talker-speech-class :name "powup013" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x78 :text-duration (seconds 5) :delay (seconds 1) @@ -1305,7 +1310,7 @@ (new 'static 'talker-speech-class :name "powup014" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x79 :text-duration (seconds 5) :delay (seconds 1) @@ -1317,7 +1322,7 @@ (new 'static 'talker-speech-class :name "powup015" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7a :text-duration (seconds 5) :delay (seconds 1) @@ -1329,7 +1334,7 @@ (new 'static 'talker-speech-class :name "powup016" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7b :text-duration (seconds 5) :delay (seconds 1) @@ -1341,7 +1346,7 @@ (new 'static 'talker-speech-class :name "powup017" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7c :text-duration (seconds 5) :delay (seconds 1) @@ -1353,7 +1358,7 @@ (new 'static 'talker-speech-class :name "powup018" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7d :text-duration (seconds 5) :delay (seconds 1) @@ -1365,7 +1370,7 @@ (new 'static 'talker-speech-class :name "powup019" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7e :text-duration (seconds 5) :delay (seconds 1) @@ -1377,7 +1382,7 @@ (new 'static 'talker-speech-class :name "powup020" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7f :text-duration (seconds 5) :delay (seconds 1) @@ -1389,7 +1394,7 @@ (new 'static 'talker-speech-class :name "powup021" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x80 :text-duration (seconds 5) :delay (seconds 1) @@ -1401,7 +1406,7 @@ (new 'static 'talker-speech-class :name "powup022" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x81 :text-duration (seconds 5) :delay (seconds 1) @@ -1413,7 +1418,7 @@ (new 'static 'talker-speech-class :name "powup023" :channel (gui-channel alert) - :flags (talker-flags tf1 tf3 tf6) + :flags (talker-flags reduce-volume auto-save-once-on-exit slide-in) :speech #x82 :text-duration (seconds 5) :delay (seconds 1) @@ -1425,7 +1430,7 @@ (new 'static 'talker-speech-class :name "powup024" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x83 :text-duration (seconds 5) :delay (seconds 1) @@ -1437,7 +1442,7 @@ (new 'static 'talker-speech-class :name "powup025" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x84 :text-duration (seconds 5) :delay (seconds 1) @@ -1449,7 +1454,7 @@ (new 'static 'talker-speech-class :name "powup026" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x85 :text-duration (seconds 5) :delay (seconds 1) @@ -1472,7 +1477,7 @@ (new 'static 'talker-speech-class :name "powup028" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x87 :text-duration (seconds 5) :delay (seconds 1) @@ -1484,7 +1489,7 @@ (new 'static 'talker-speech-class :name "powup029" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x88 :text-duration (seconds 5) :delay (seconds 1) @@ -1496,7 +1501,7 @@ (new 'static 'talker-speech-class :name "powup030" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x89 :text-duration (seconds 5) :delay (seconds 1) @@ -1508,7 +1513,7 @@ (new 'static 'talker-speech-class :name "powup031" :channel (gui-channel alert) - :flags (talker-flags tf0 tf1 tf6) + :flags (talker-flags play-only-once reduce-volume slide-in) :speech #x8a :text-duration (seconds 10) :delay (seconds 1) @@ -1530,7 +1535,7 @@ (new 'static 'talker-speech-class :name "torn001" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf2) + :flags (talker-flags play-only-once auto-save-on-each-start) :speech #x8c :neg #x1 :on-close #f @@ -1539,7 +1544,7 @@ (new 'static 'talker-speech-class :name "jak112" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x8d :neg #x1 :on-close #f @@ -1548,7 +1553,7 @@ (new 'static 'talker-speech-class :name "torn008" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x8e :neg #x1 :on-close #f @@ -1721,7 +1726,7 @@ (new 'static 'talker-speech-class :name "ash004" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xa2 :delay (seconds 2) :neg #x1 @@ -1747,7 +1752,7 @@ (new 'static 'talker-speech-class :name "dam004" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xa5 :neg #x1 :on-close #f @@ -1796,7 +1801,7 @@ (new 'static 'talker-speech-class :name "dax586" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xab :neg #x1 :on-close #f @@ -1813,7 +1818,7 @@ (new 'static 'talker-speech-class :name "seem003" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3 tf8) + :flags (talker-flags play-only-once auto-save-once-on-exit long-timeout) :speech #xad :neg #x1 :on-close #f @@ -1886,7 +1891,7 @@ (new 'static 'talker-speech-class :name "seem002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3 tf8) + :flags (talker-flags play-only-once auto-save-once-on-exit long-timeout) :speech #xb6 :neg #x1 :on-close #f @@ -1895,7 +1900,7 @@ (new 'static 'talker-speech-class :name "darkjak1" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xb7 :text-duration (seconds 5) :neg #x1 @@ -1906,7 +1911,7 @@ (new 'static 'talker-speech-class :name "bb10win" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #xb8 :neg #x1 :on-close #f @@ -2291,7 +2296,7 @@ (new 'static 'talker-speech-class :name "light001" :channel (gui-channel alert) - :flags (talker-flags tf0 tf6) + :flags (talker-flags play-only-once slide-in) :speech #xe8 :text-duration (seconds 5) :delay (seconds 1) @@ -2303,7 +2308,7 @@ (new 'static 'talker-speech-class :name "light002" :channel (gui-channel alert) - :flags (talker-flags tf0 tf6) + :flags (talker-flags play-only-once slide-in) :speech #xe9 :text-duration (seconds 5) :delay (seconds 1) @@ -2315,7 +2320,7 @@ (new 'static 'talker-speech-class :name "keir003" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #xea :neg #x1 :on-close #f @@ -2324,7 +2329,7 @@ (new 'static 'talker-speech-class :name "ash002" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xeb :neg #x1 :on-close #f @@ -3045,7 +3050,7 @@ (new 'static 'talker-speech-class :name "tor062" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x145 :neg #x1 :on-close #f @@ -3134,7 +3139,7 @@ (new 'static 'talker-speech-class :name "ash132" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x150 :neg #x1 :on-close #f @@ -3231,7 +3236,7 @@ (new 'static 'talker-speech-class :name "teach-pickup" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15c :text-duration (seconds 5) :neg #x1 @@ -3242,7 +3247,7 @@ (new 'static 'talker-speech-class :name "teach-place" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15d :text-duration (seconds 5) :neg #x1 @@ -3253,7 +3258,7 @@ (new 'static 'talker-speech-class :name "teach-shield" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15e :text-duration (seconds 5) :neg #x1 @@ -3294,7 +3299,7 @@ (new 'static 'talker-speech-class :name "redhint1" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x162 :text-duration (seconds 5) :neg #x1 @@ -3305,7 +3310,7 @@ (new 'static 'talker-speech-class :name "redhint2" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x163 :text-duration (seconds 5) :neg #x1 @@ -3316,7 +3321,7 @@ (new 'static 'talker-speech-class :name "dax619" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x164 :neg #x1 :on-close #f @@ -3325,7 +3330,7 @@ (new 'static 'talker-speech-class :name "dax613" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x165 :neg #x1 :on-close #f @@ -3334,7 +3339,7 @@ (new 'static 'talker-speech-class :name "dax615" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x166 :neg #x1 :on-close #f @@ -3343,7 +3348,7 @@ (new 'static 'talker-speech-class :name "dax624" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x167 :neg #x1 :on-close #f @@ -3352,7 +3357,7 @@ (new 'static 'talker-speech-class :name "dax623" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x168 :neg #x1 :on-close #f @@ -3361,7 +3366,7 @@ (new 'static 'talker-speech-class :name "dax622" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x169 :neg #x1 :on-close #f @@ -3370,7 +3375,7 @@ (new 'static 'talker-speech-class :name "hellcat-fire" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16a :text-duration (seconds 5) :neg #x1 @@ -3381,7 +3386,7 @@ (new 'static 'talker-speech-class :name "seem005" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3 tf8) + :flags (talker-flags play-only-once auto-save-once-on-exit long-timeout) :speech #x16b :neg #x1 :on-close #f @@ -3390,7 +3395,7 @@ (new 'static 'talker-speech-class :name "yellow3hint" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16c :text-duration (seconds 5) :neg #x1 diff --git a/goal_src/jak3/engine/ambient/ambient.gc b/goal_src/jak3/engine/ambient/ambient.gc index c38ebe4c9ac..c22fc7ccca1 100644 --- a/goal_src/jak3/engine/ambient/ambient.gc +++ b/goal_src/jak3/engine/ambient/ambient.gc @@ -125,47 +125,50 @@ (-> *talker-speech* 0) ) -(defmethod talker-speech-class-method-9 ((this talker-speech-class)) - (and (>= (-> *game-info* unknown-arr4 (* (-> this speech) 2)) (-> this pos)) - (>= (-> this neg) (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) +(defmethod should-play? ((this talker-speech-class)) + "Return if the talker is in a state where it should play." + (and (>= (-> *game-info* talker-state (* (-> this speech) 2)) (-> this pos)) + (>= (-> this neg) (-> *game-info* talker-state (+ (* (-> this speech) 2) 1))) ) ) -(defmethod play-communicator-speech! ((this talker-speech-class)) - (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) +(defmethod mark-played! ((this talker-speech-class)) + "Mark something as played by making its state UINT16_MAX" + (set! (-> *game-info* talker-state (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) 0 (none) ) -(defmethod talker-speech-class-method-11 ((this talker-speech-class)) - (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) (the-as uint 0)) +(defmethod reset-state! ((this talker-speech-class)) + "Reset the state of this talker to 0 (the initial value)" + (set! (-> *game-info* talker-state (+ (* (-> this speech) 2) 1)) (the-as uint 0)) 0 (none) ) -(defmethod talker-speech-class-method-12 ((this talker-speech-class) (arg0 int)) +(defmethod yes-play! ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) - (set! (-> *game-info* unknown-arr4 (* (-> this speech) 2)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (* (-> this speech) 2))) #xfff0 arg0)) + (set! (-> *game-info* talker-state (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* talker-state (* (-> this speech) 2))) #xfff0 arg0)) ) - (set! (-> *game-info* unknown-arr4 (* (-> this speech) 2)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (* (-> this speech) 2))) 0 (- arg0))) + (set! (-> *game-info* talker-state (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* talker-state (* (-> this speech) 2))) 0 (- arg0))) ) ) - (if (talker-speech-class-method-9 this) + (if (should-play? this) (talker-spawn-func this *entity-pool* (target-pos 0) (the-as region #f)) ) 0 (none) ) -(defmethod talker-speech-class-method-13 ((this talker-speech-class) (arg0 int)) +(defmethod no-play! ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) - (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) + (set! (-> *game-info* talker-state (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* talker-state (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) ) - (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) 0 (- arg0))) + (set! (-> *game-info* talker-state (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* talker-state (+ (* (-> this speech) 2) 1))) 0 (- arg0))) ) ) 0 @@ -175,16 +178,16 @@ ;; WARN: Return type mismatch int vs sound-id. (defun talker-spawn-func ((arg0 talker-speech-class) (arg1 process-tree) (arg2 vector) (arg3 region)) (local-vars (s2-0 int)) - (when (or (not arg0) (zero? (-> arg0 speech)) (not (talker-speech-class-method-9 arg0))) + (when (or (not arg0) (zero? (-> arg0 speech)) (not (should-play? arg0))) (set! s2-0 0) (goto cfg-27) ) (if (and (or (not (-> *setting-control* user-current play-hints)) (= (-> *setting-control* user-current dialog-volume) 0.0) ) - (logtest? (-> arg0 flags) (talker-flags tf0)) + (logtest? (-> arg0 flags) (talker-flags play-only-once)) ) - (play-communicator-speech! arg0) + (mark-played! arg0) ) (set! s2-0 (the-as int (lookup-gui-connection-id *gui-control* (-> arg0 name) (-> arg0 channel) (gui-action none))) @@ -217,7 +220,7 @@ ) (defbehavior talker-init talker ((arg0 talker-speech-class) (arg1 vector) (arg2 region)) - (set! (-> self trans quad) (-> arg1 quad)) + (vector-copy! (-> self trans) arg1) (let ((v1-2 (shr (the-as int (-> arg0 channel)) 4))) (when (not (or (or (= v1-2 4) (= v1-2 5)) (or (not (-> *setting-control* user-current play-hints)) @@ -268,7 +271,7 @@ (set! (-> self voicebox) (the-as handle #f)) (set! (-> self save?) #f) (set! (-> self grab?) #f) - (if (logtest? (-> self message flags) (talker-flags tf5 tf6)) + (if (logtest? (-> self message flags) (talker-flags fade-in slide-in)) (set! (-> self interp) 0.0) (set! (-> self interp) 1.0) ) @@ -296,7 +299,7 @@ (case (-> this message channel) (((gui-channel notice)) (cond - ((logtest? (-> this message flags) (talker-flags tf7)) + ((logtest? (-> this message flags) (talker-flags bigger-font)) (let ((v1-9 gp-0) (a1-1 36) (a0-4 140) @@ -328,11 +331,11 @@ (set! (-> v1-15 height) (the float 140)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) - (if (logtest? (-> this message flags) (talker-flags tf5)) + (if (logtest? (-> this message flags) (talker-flags fade-in)) (set! (-> gp-0 alpha) (-> this interp)) (set! (-> gp-0 alpha) 1.0) ) - (when (logtest? (-> this message flags) (talker-flags tf6)) + (when (logtest? (-> this message flags) (talker-flags slide-in)) (let ((s4-0 gp-0) (s3-0 36) (v1-27 (the int (lerp-scale 400.0 f0-0 (-> this interp) 0.0 1.0))) @@ -382,9 +385,10 @@ (defstate idle (talker) :virtual #t :code (behavior () - (suspend-for (the-as time-frame (-> self message delay))) + (suspend-for (the-as time-frame (-> self message delay)) + ) (while (or (not (time-elapsed? (-> self start-time) (the-as time-frame (+ (-> self message delay) 300)))) - (and (logtest? (-> self message flags) (talker-flags tf8)) + (and (logtest? (-> self message flags) (talker-flags long-timeout)) (not (time-elapsed? (-> self start-time) (seconds 180))) ) ) @@ -410,8 +414,8 @@ :virtual #t :enter (behavior () (set-time! (-> self state-time)) - (if (logtest? (-> self message flags) (talker-flags tf0)) - (play-communicator-speech! (-> self message)) + (if (logtest? (-> self message flags) (talker-flags play-only-once)) + (mark-played! (-> self message)) ) (set-setting! 'hint (process->ppointer self) 0.0 0) (set-setting! 'speech-control #f 0.0 0) @@ -427,12 +431,12 @@ (the-as process #f) ) ) - (when (and (nonzero? (-> self voice-id)) (logtest? (-> self message flags) (talker-flags tf1))) + (when (and (nonzero? (-> self voice-id)) (logtest? (-> self message flags) (talker-flags reduce-volume))) (add-setting! 'music-volume 'rel 0.25 0) (add-setting! 'sfx-volume 'rel 0.75 0) (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-talker) 0) ) - (if (logtest? (-> self message flags) (talker-flags tf2)) + (if (logtest? (-> self message flags) (talker-flags auto-save-on-each-start)) (auto-save-user) ) (apply-settings *setting-control*) @@ -456,7 +460,7 @@ ) ) ) - (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) + (when (and (logtest? (-> self message flags) (talker-flags auto-save-once-on-exit)) (not (-> self save?))) (set! (-> self save?) #t) (auto-save-user) ) @@ -517,7 +521,7 @@ (and (nonzero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (or (not (time-elapsed? (-> self state-time) (the-as time-frame (-> self message text-duration)))) - (and (logtest? (-> self message flags) (talker-flags tf4)) + (and (logtest? (-> self message flags) (talker-flags only-play-in-region)) (-> self region) (point-in-region-debug! (-> self region) (target-pos 0)) ) @@ -541,7 +545,7 @@ (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (not (paused?)) ) - (if (logtest? (-> self message flags) (talker-flags tf5)) + (if (logtest? (-> self message flags) (talker-flags fade-in)) (seek! (-> self interp) 1.0 (* 0.5 (seconds-per-frame))) (seek! (-> self interp) 1.0 (* 4.0 (seconds-per-frame))) ) @@ -550,9 +554,9 @@ (suspend) ) ) - (when (and (nonzero? (-> self message-id)) (logtest? (-> self message flags) (talker-flags tf5 tf6))) + (when (and (nonzero? (-> self message-id)) (logtest? (-> self message flags) (talker-flags fade-in slide-in))) (while (!= (-> self interp) 0.0) - (if (logtest? (-> self message flags) (talker-flags tf5)) + (if (logtest? (-> self message flags) (talker-flags fade-in)) (seek! (-> self interp) 0.0 (* 0.5 (seconds-per-frame))) (seek! (-> self interp) 0.0 (* 4.0 (seconds-per-frame))) ) @@ -562,8 +566,9 @@ (suspend) ) ) - (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) - (suspend-for (seconds 1)) + (when (and (logtest? (-> self message flags) (talker-flags auto-save-once-on-exit)) (not (-> self save?))) + (suspend-for (seconds 1) + ) (set! (-> self save?) #t) (auto-save-user) ) diff --git a/goal_src/jak3/engine/anim/aligner-h.gc b/goal_src/jak3/engine/anim/aligner-h.gc index 605bfdc09b1..48c9c0f9cbb 100644 --- a/goal_src/jak3/engine/anim/aligner-h.gc +++ b/goal_src/jak3/engine/anim/aligner-h.gc @@ -5,17 +5,6 @@ ;; name in dgo: aligner-h ;; dgos: GAME -(defenum align-flags - :bitfield #t - :type uint32 - (disabled) ;; keep object velocity - (af01) - (af02) - (af03) - (af04) - (af05) - ) - ;; +++align-opts (defenum align-opts :bitfield #t @@ -42,11 +31,6 @@ :bitfield #t :type uint32 (disabled) ;; keep object velocity - (af01) - (af02) - (af03) - (af04) - (af05) ) ;; ---align-flags diff --git a/goal_src/jak3/engine/anim/aligner.gc b/goal_src/jak3/engine/anim/aligner.gc index 62769d3d931..fc6751bd29a 100644 --- a/goal_src/jak3/engine/anim/aligner.gc +++ b/goal_src/jak3/engine/anim/aligner.gc @@ -66,7 +66,7 @@ ) (mem-copy! (the-as pointer (-> this transform 1)) (the-as pointer (-> this transform)) 48) (quaternion-copy! (the-as quaternion (-> this transform 1 rot)) (-> this align quat)) - (set! (-> this transform 1 scale quad) (-> this align scale quad)) + (vector-copy! (-> this transform 1 scale) (-> this align scale)) (let* ((a2-5 (-> this matrix 1)) (a3-0 (-> this matrix)) (v1-21 (-> a3-0 0 rvec quad)) diff --git a/goal_src/jak3/engine/anim/fma-sphere.gc b/goal_src/jak3/engine/anim/fma-sphere.gc index fe20c2459d4..e6b4015f061 100644 --- a/goal_src/jak3/engine/anim/fma-sphere.gc +++ b/goal_src/jak3/engine/anim/fma-sphere.gc @@ -109,7 +109,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (when a2-0 - (set! (-> gp-0 quad) (-> self sphere quad)) + (vector-copy! gp-0 (-> self sphere)) (set! (-> gp-0 w) 1.0) (vector-matrix*! gp-0 gp-0 (-> (the-as process-drawable a2-0) node-list data v1-5 bone transform)) (let ((v1-9 (-> self root))) @@ -221,7 +221,7 @@ (let ((s5-1 (-> self root))) (set! (-> s5-1 nav-radius) (-> self sphere r)) (set! (-> s5-1 root-prim local-sphere w) (-> self sphere r)) - (set! (-> s5-1 trans quad) (-> self sphere quad)) + (vector-copy! (-> s5-1 trans) (-> self sphere)) (set! (-> s5-1 trans w) 1.0) (vector-identity! (-> s5-1 scale)) (quaternion-identity! (-> s5-1 quat)) diff --git a/goal_src/jak3/engine/anim/joint-exploder.gc b/goal_src/jak3/engine/anim/joint-exploder.gc index 6ca1b8f08ce..05d64168d50 100644 --- a/goal_src/jak3/engine/anim/joint-exploder.gc +++ b/goal_src/jak3/engine/anim/joint-exploder.gc @@ -155,17 +155,13 @@ ) ) ) - (let ((s4-2 (new 'stack-no-clear 'matrix))) - (set! (-> s4-2 rvec quad) (the-as uint128 0)) - (set! (-> s4-2 uvec quad) (the-as uint128 0)) - (set! (-> s4-2 fvec quad) (the-as uint128 0)) - (set! (-> s4-2 trans quad) (the-as uint128 0)) - (let ((f30-0 (-> arg0 bounds w))) - (matrix-4x4-inverse! s4-2 (-> arg1 data 0 bone transform)) - (set! (-> arg0 bounds w) 1.0) - (vector-matrix*! (-> arg0 bounds) (-> arg0 bounds) s4-2) - (set! (-> arg0 bounds w) f30-0) - ) + (let ((s4-2 (new-stack-matrix0)) + (f30-0 (-> arg0 bounds w)) + ) + (matrix-4x4-inverse! s4-2 (-> arg1 data 0 bone transform)) + (set! (-> arg0 bounds w) 1.0) + (vector-matrix*! (-> arg0 bounds) (-> arg0 bounds) s4-2) + (set! (-> arg0 bounds w) f30-0) ) 0 (none) @@ -179,7 +175,7 @@ (set! (-> v1-2 mat rvec quad) (the-as uint128 0)) (set! (-> v1-2 mat uvec quad) (the-as uint128 0)) (set! (-> v1-2 mat fvec quad) (the-as uint128 0)) - (set! (-> v1-2 mat trans quad) (-> this root trans quad)) + (vector-copy! (-> v1-2 mat trans) (-> this root trans)) ) v0-0 ) @@ -240,7 +236,7 @@ (else (set! (-> arg0 bbox-valid?) #t) (set! (-> arg0 bbox min quad) (-> a1-1 quad)) - (set! (-> arg0 bbox max quad) (-> a1-1 quad)) + (vector-copy! (-> arg0 bbox max) a1-1) ) ) ) @@ -382,8 +378,8 @@ (let ((s1-0 (new 'stack-no-clear 'bounding-box)) (s0-0 (-> arg0 bbox-valid?)) ) - (set! (-> s1-0 min quad) (-> arg0 bbox min quad)) - (set! (-> s1-0 max quad) (-> arg0 bbox max quad)) + (vector-copy! (-> s1-0 min) (-> arg0 bbox min)) + (vector-copy! (-> s1-0 max) (-> arg0 bbox max)) (update-bbox-for-joint this arg0 sv-80) (let* ((v1-7 arg1) (v1-8 (cond @@ -408,7 +404,7 @@ (update-bbox-for-joint this (the-as joint-exploder-list sv-64) sv-80) (set! (-> arg0 bbox-valid?) s0-0) (set! (-> arg0 bbox min quad) (-> s1-0 min quad)) - (set! (-> arg0 bbox max quad) (-> s1-0 max quad)) + (vector-copy! (-> arg0 bbox max) (-> s1-0 max)) s2-0 ) (else @@ -469,7 +465,7 @@ (let* ((s2-0 (-> s4-0 joint s3-0)) (s1-0 (-> s2-0 mat trans)) ) - (set! (-> s2-0 prev-pos quad) (-> s1-0 quad)) + (vector-copy! (-> s2-0 prev-pos) s1-0) (+! (-> s2-0 transv y) f30-0) (when (< 0.0 (-> this tuning friction)) (.lvf vf1 (&-> (-> s2-0 transv) quad)) @@ -531,7 +527,7 @@ (s2-0 (new 'stack-no-clear 'collide-query)) ) (vector-! (-> s2-0 move-dist) s3-0 (-> s4-1 prev-pos)) - (set! (-> s2-0 start-pos quad) (-> s4-1 prev-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s4-1 prev-pos)) (let ((v1-11 s2-0)) (set! (-> v1-11 radius) 40.96) (set! (-> v1-11 collide-with) (-> this static-params collide-spec)) @@ -543,7 +539,7 @@ (set! (-> v1-11 action-mask) (collide-action solid)) ) (when (>= (probe-using-line-sphere *collide-cache* s2-0) 0.0) - (set! (-> s3-0 quad) (-> s2-0 best-other-tri intersect quad)) + (vector-copy! s3-0 (-> s2-0 best-other-tri intersect)) (let* ((v1-16 (-> s4-1 transv)) (f28-0 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z))))) ) @@ -614,8 +610,8 @@ ) (let ((gp-1 (new 'stack-no-clear 'bounding-box))) (let ((v1-31 (-> self root trans))) - (set! (-> gp-1 min quad) (-> v1-31 quad)) - (set! (-> gp-1 max quad) (-> v1-31 quad)) + (vector-copy! (-> gp-1 min) v1-31) + (vector-copy! (-> gp-1 max) v1-31) ) (dotimes (s5-1 (the-as int (+ (-> self tuning max-probes) 1))) (let ((s4-0 (-> self lists data s5-1))) @@ -659,32 +655,14 @@ (if (zero? a0-6) (set! a0-6 (-> v1-2 joint-index)) ) - (let* ((a3-0 (-> this parent 0 node-list data a0-6 bone transform)) - (a2-0 (-> s3-0 mat)) - (v1-9 (-> a3-0 rvec quad)) - (a0-8 (-> a3-0 uvec quad)) - (a1-4 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-9) - (set! (-> a2-0 uvec quad) a0-8) - (set! (-> a2-0 fvec quad) a1-4) - (set! (-> a2-0 trans quad) a3-1) + (let ((a3-0 (-> this parent 0 node-list data a0-6 bone transform))) + (matrix-copy! (-> s3-0 mat) a3-0) ) (matrix-identity! (-> s3-0 rmat)) ) (else - (let* ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform)) - (a2-1 (-> s3-0 mat)) - (v1-15 (-> a3-2 rvec quad)) - (a0-11 (-> a3-2 uvec quad)) - (a1-5 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-15) - (set! (-> a2-1 uvec quad) a0-11) - (set! (-> a2-1 fvec quad) a1-5) - (set! (-> a2-1 trans quad) a3-3) + (let ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform))) + (matrix-copy! (-> s3-0 mat) a3-2) ) (matrix-identity! (-> s3-0 rmat)) ) @@ -734,8 +712,8 @@ (set! (-> v1-33 head) 0) (let ((s5-1 (-> v1-33 bbox))) (let ((v1-34 (-> gp-0 joint 0 mat trans))) - (set! (-> s5-1 min quad) (-> v1-34 quad)) - (set! (-> s5-1 max quad) (-> v1-34 quad)) + (vector-copy! (-> s5-1 min) v1-34) + (vector-copy! (-> s5-1 max) v1-34) ) (dotimes (s4-1 (-> gp-0 num-joints)) (add-point! s5-1 (the-as vector (+ (the-as uint (-> gp-0 joint 0 mat trans)) (* 240 s4-1)))) @@ -779,9 +757,9 @@ (set! (-> v1-8 0 probeless?) #t) ) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> self parent 0 root trans quad)) + (vector-copy! (-> self root trans) (-> self parent 0 root trans)) (quaternion-copy! (-> self root quat) (-> self parent 0 root quat)) - (set! (-> self root scale quad) (-> self parent 0 root scale quad)) + (vector-copy! (-> self root scale) (-> self parent 0 root scale)) (when (-> arg3 art-level) (let ((a1-8 (entity-actor-from-level-name (-> arg3 art-level)))) (if a1-8 diff --git a/goal_src/jak3/engine/anim/joint-mod-h.gc b/goal_src/jak3/engine/anim/joint-mod-h.gc index 9f3e324ffbb..077817132e7 100644 --- a/goal_src/jak3/engine/anim/joint-mod-h.gc +++ b/goal_src/jak3/engine/anim/joint-mod-h.gc @@ -190,7 +190,7 @@ This is used to make jak look toward an enemy, for example." (defmethod new joint-mod-spinner ((allocation symbol) (type-to-make type) (proc process-drawable) (bone-idx int) (axis vector) (rate float)) "Create and attach a joint-mod-spinner to a joint." (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> v0-0 spin-axis quad) (-> axis quad)) + (vector-copy! (-> v0-0 spin-axis) axis) (set! (-> v0-0 spin-rate) rate) (set! (-> v0-0 enable) #t) (set! (-> v0-0 angle) 0.0) @@ -306,7 +306,7 @@ This is used to make jak look toward an enemy, for example." (cspace<-parented-transformq-joint! bone-cspace joint-transform) (let ((s4-0 (vector<-cspace2! (new 'stack-no-clear 'vector) bone-cspace))) (quaternion*! (-> joint-transform quat) (-> joint-transform quat) (-> s3-0 rotation)) - (set! (-> joint-transform trans quad) (-> s4-0 quad)) + (vector-copy! (-> joint-transform trans) s4-0) ) ) (cspace<-transformq! bone-cspace joint-transform) @@ -340,7 +340,7 @@ This is used to make jak look toward an enemy, for example." (set! (-> v1-0 transform quat quad) (-> joint-transform quat quad)) ) (if (not (logtest? (-> v1-0 flags) (joint-mod-base-flags scale))) - (set! (-> v1-0 transform scale quad) (-> joint-transform scale quad)) + (vector-copy! (-> v1-0 transform scale) (-> joint-transform scale)) ) (cspace<-parented-transformq-joint! bone-cspace (-> v1-0 transform)) ) @@ -467,8 +467,8 @@ The translation is kept from the result of the normal parented value." (cspace<-parented-transformq-joint! bone-cspace joint-transform) (matrix<-transformq! gp-0 (-> s4-0 transform)) (set! (-> bone-cspace bone transform rvec quad) (-> gp-0 rvec quad)) - (set! (-> bone-cspace bone transform uvec quad) (-> gp-0 uvec quad)) - (set! (-> bone-cspace bone transform fvec quad) (-> gp-0 fvec quad)) + (vector-copy! (-> bone-cspace bone transform uvec) (-> gp-0 uvec)) + (vector-copy! (-> bone-cspace bone transform fvec) (-> gp-0 fvec)) ) (none) ) diff --git a/goal_src/jak3/engine/anim/joint-mod.gc b/goal_src/jak3/engine/anim/joint-mod.gc index d1762fd923c..3d40b4dd1cc 100644 --- a/goal_src/jak3/engine/anim/joint-mod.gc +++ b/goal_src/jak3/engine/anim/joint-mod.gc @@ -66,34 +66,12 @@ (new 'stack-no-clear 'matrix) (let ((s3-0 (new 'stack-no-clear 'vector))) (matrix->trans s5-0 s3-0) - (set! (-> s5-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s5-0 trans) s3-0) (matrix->trans s4-1 s3-0) - (set! (-> s4-1 trans quad) (-> s3-0 quad)) - ) - (let* ((a2-0 (-> gp-0 shoulder-matrix-no-ik)) - (a3-0 s5-0) - (v1-22 (-> a3-0 rvec quad)) - (a0-7 (-> a3-0 uvec quad)) - (a1-3 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-22) - (set! (-> a2-0 uvec quad) a0-7) - (set! (-> a2-0 fvec quad) a1-3) - (set! (-> a2-0 trans quad) a3-1) - ) - (let* ((a2-1 (-> gp-0 elbow-matrix-no-ik)) - (a3-2 s4-1) - (v1-23 (-> a3-2 rvec quad)) - (a0-8 (-> a3-2 uvec quad)) - (a1-4 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-23) - (set! (-> a2-1 uvec quad) a0-8) - (set! (-> a2-1 fvec quad) a1-4) - (set! (-> a2-1 trans quad) a3-3) + (vector-copy! (-> s4-1 trans) s3-0) ) + (matrix-copy! (-> gp-0 shoulder-matrix-no-ik) s5-0) + (matrix-copy! (-> gp-0 elbow-matrix-no-ik) s4-1) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! sv-784 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) @@ -102,8 +80,8 @@ ) 0.0 0.0 - (set! (-> s2-0 quad) (-> s5-0 trans quad)) - (set! (-> sv-784 quad) (-> s4-1 trans quad)) + (vector-copy! s2-0 (-> s5-0 trans)) + (vector-copy! sv-784 (-> s4-1 trans)) (let ((a1-5 s0-0)) (let ((v1-27 sv-784)) (let ((a0-13 (-> s4-1 uvec))) @@ -122,7 +100,7 @@ (if (-> gp-0 callback) ((-> gp-0 callback) gp-0 s5-0 s4-1 s0-0) ) - (set! (-> s1-0 quad) (-> gp-0 handle-pos quad)) + (vector-copy! s1-0 (-> gp-0 handle-pos)) (let ((f30-0 (vector-vector-distance s2-0 sv-784)) (f0-12 (vector-vector-distance sv-784 s0-0)) ) @@ -253,7 +231,7 @@ ) (set! (-> gp-1 rvec quad) (-> s4-1 trans quad)) (matrix*! s4-1 s4-1 a2-20) - (set! (-> s4-1 trans quad) (-> gp-1 rvec quad)) + (vector-copy! (-> s4-1 trans) (-> gp-1 rvec)) ) (let ((s3-2 (quaternion->matrix (new 'stack-no-clear 'matrix) sv-372)) (a2-21 (matrix-4x4-inverse! (new 'stack-no-clear 'matrix) s5-0)) @@ -262,7 +240,7 @@ (set! (-> gp-2 rvec quad) (-> s5-0 trans quad)) (matrix*! s4-1 s4-1 a2-21) (matrix*! s5-0 s5-0 s3-2) - (set! (-> s5-0 trans quad) (-> gp-2 rvec quad)) + (vector-copy! (-> s5-0 trans) (-> gp-2 rvec)) ) (matrix*! s4-1 s4-1 s5-0) ) @@ -292,7 +270,7 @@ ) (defmethod set-ik-target! ((this joint-mod-ik) (pos vector)) - (set! (-> this handle-pos quad) (-> pos quad)) + (vector-copy! (-> this handle-pos) pos) 0 (none) ) @@ -501,13 +479,13 @@ (f30-1 (lerp-scale 0.0 1.0 f0-4 0.85 1.0)) ) (vector-deg-slerp (-> s5-0 twist) (-> s5-0 twist) s4-0 0.3) - (set! (-> s4-0 quad) (-> s5-0 twist quad)) + (vector-copy! s4-0 (-> s5-0 twist)) (seek! (-> s5-0 blend) (-> s5-0 flex-blend) (* 4.0 (seconds-per-frame))) (let ((s3-1 (matrix->scale gp-0 (new 'stack-no-clear 'vector)))) (let ((s2-0 (matrix->quat gp-0 (new 'stack-no-clear 'quaternion))) (s0-0 (matrix->trans gp-0 (new 'stack-no-clear 'vector))) ) - (set! (-> gp-0 uvec quad) (-> s5-0 twist-max quad)) + (vector-copy! (-> gp-0 uvec) (-> s5-0 twist-max)) (vector-cross! (-> gp-0 fvec) (-> gp-0 rvec) (-> gp-0 uvec)) (vector-cross! (-> gp-0 rvec) (-> gp-0 uvec) (-> gp-0 fvec)) (set! (-> gp-0 rvec w) 0.0) @@ -680,13 +658,13 @@ (defmethod trs-set! ((this joint-mod) (trans vector) (quat quaternion) (scale vector)) "Set translation, quaternion, scale. A value of #f will skip the set." (if trans - (set! (-> this trans quad) (-> trans quad)) + (vector-copy! (-> this trans) trans) ) (if quat (quaternion-copy! (-> this quat) quat) ) (if scale - (set! (-> this scale quad) (-> scale quad)) + (vector-copy! (-> this scale) scale) ) 0 (none) @@ -699,7 +677,7 @@ ) (let ((f0-0 (vector-vector-distance (-> this process root trans) pos))) (set! (-> this shutting-down?) #f) - (set! (-> this target quad) (-> pos quad)) + (vector-copy! (-> this target) pos) (if (< f0-0 (-> this max-dist)) (set! (-> this blend) 1.0) (set! (-> this blend) 0.0) @@ -755,7 +733,7 @@ (if (= (-> this mode) (joint-mod-mode reset)) (mode-set! this (joint-mod-mode look-at)) ) - (set! (-> this target quad) (-> target quad)) + (vector-copy! (-> this target) target) (set! (-> this blend) 1.0) (set! (-> this shutting-down?) #f) ) @@ -1130,13 +1108,13 @@ "Callback for set joint mod." (let ((s4-0 (the-as joint-mod (-> arg0 param1)))) (if (not (logtest? (-> s4-0 track-mode) (track-mode no-trans))) - (set! (-> arg1 trans quad) (-> s4-0 trans quad)) + (vector-copy! (-> arg1 trans) (-> s4-0 trans)) ) (if (not (logtest? (-> s4-0 track-mode) (track-mode no-rotate))) (quaternion-copy! (-> arg1 quat) (-> s4-0 quat)) ) (if (not (logtest? (-> s4-0 track-mode) (track-mode no-scale))) - (set! (-> arg1 scale quad) (-> s4-0 scale quad)) + (vector-copy! (-> arg1 scale) (-> s4-0 scale)) ) ) (cspace<-parented-transformq-joint! arg0 arg1) @@ -1156,10 +1134,10 @@ ) (cond ((logtest? (-> s5-0 track-mode) (track-mode no-scale)) - (set! (-> s3-0 quad) (-> arg1 scale quad)) + (vector-copy! s3-0 (-> arg1 scale)) ) ((>= (-> s5-0 flex-blend) 1.0) - (set! (-> s3-0 quad) (-> s5-0 scale quad)) + (vector-copy! s3-0 (-> s5-0 scale)) ) (else (vector-lerp! s3-0 (-> arg1 scale) (-> s5-0 scale) (-> s5-0 flex-blend)) @@ -1173,7 +1151,7 @@ ) (else (let ((v1-15 (new 'stack-no-clear 'vector))) - (set! (-> v1-15 quad) (-> arg1 scale quad)) + (vector-copy! v1-15 (-> arg1 scale)) (set! (-> v1-15 x) (/ 1.0 (-> v1-15 x))) (set! (-> v1-15 y) (/ 1.0 (-> v1-15 y))) (set! (-> v1-15 z) (/ 1.0 (-> v1-15 z))) @@ -1211,10 +1189,10 @@ (set! (-> arg0 bone transform fvec w) 0.0) (cond ((logtest? (-> s5-0 track-mode) (track-mode no-trans)) - (set! (-> arg0 bone transform trans quad) (-> s4-0 quad)) + (vector-copy! (-> arg0 bone transform trans) s4-0) ) ((>= (-> s5-0 flex-blend) 1.0) - (set! (-> arg0 bone transform trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> arg0 bone transform trans) (-> s5-0 trans)) (set! (-> arg0 bone transform trans w) 1.0) ) (else @@ -1336,7 +1314,7 @@ (defmethod set-target! ((this joint-mod-polar-look-at) (pos vector)) "Update the target position." - (set! (-> this target quad) (-> pos quad)) + (vector-copy! (-> this target) pos) 0 (none) ) @@ -1460,7 +1438,7 @@ (if (logtest? (-> s5-0 flags) (joint-mod-polar-flags negate-up)) (vector-negate! (-> s4-1 uvec) (-> s4-1 uvec)) ) - (set! (-> s4-1 fvec quad) (-> s3-0 quad)) + (vector-copy! (-> s4-1 fvec) s3-0) (set-vector! (-> s4-1 trans) 0.0 0.0 0.0 1.0) (matrix-transpose! s4-1 s4-1) (set-vector! (-> s4-1 trans) 0.0 0.0 0.0 1.0) @@ -1556,7 +1534,7 @@ (matrix-remove-z-rot (-> arg0 bone transform) a1-25) ) ) - (set! (-> arg0 bone transform trans quad) (-> s3-1 quad)) + (vector-copy! (-> arg0 bone transform trans) s3-1) ) ) ) diff --git a/goal_src/jak3/engine/anim/joint.gc b/goal_src/jak3/engine/anim/joint.gc index e7137a8edec..6cf9d3e85e0 100644 --- a/goal_src/jak3/engine/anim/joint.gc +++ b/goal_src/jak3/engine/anim/joint.gc @@ -1814,17 +1814,7 @@ ) (cond ((= (the float (the int f0-1)) f0-1) - (let* ((mat (matrix-from-joint-anim-frame (-> jacc frames) joint-num (the int frame-num))) - (v1-7 (-> mat rvec quad)) - (a0-3 (-> mat uvec quad)) - (a1-3 (-> mat fvec quad)) - (a2-4 (-> mat trans quad)) - ) - (set! (-> dest-mat rvec quad) v1-7) - (set! (-> dest-mat uvec quad) a0-3) - (set! (-> dest-mat fvec quad) a1-3) - (set! (-> dest-mat trans quad) a2-4) - ) + (matrix-copy! dest-mat (matrix-from-joint-anim-frame (-> jacc frames) joint-num (the int frame-num))) dest-mat ) (else @@ -1939,36 +1929,12 @@ (defun cspace<-cspace! ((dst cspace) (src cspace)) "Set one cspace's bone from another" - (let ((v0-0 (-> dst bone transform))) - (let* ((a2-0 (-> src bone transform)) - (v1-2 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> v0-0 rvec quad) v1-2) - (set! (-> v0-0 uvec quad) a0-1) - (set! (-> v0-0 fvec quad) a1-1) - (set! (-> v0-0 trans quad) a2-1) - ) - v0-0 - ) + (matrix-copy! (-> dst bone transform) (-> src bone transform)) ) (defun cspace<-cspace-normalized! ((dst cspace) (src cspace)) "Set one cspace's bone from another, and normalize the rows of the matrix." - (let ((gp-0 (-> dst bone transform))) - (let* ((a2-0 (-> src bone transform)) - (v1-2 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-2) - (set! (-> gp-0 uvec quad) a0-1) - (set! (-> gp-0 fvec quad) a1-1) - (set! (-> gp-0 trans quad) a2-1) - ) + (let ((gp-0 (matrix-copy! (-> dst bone transform) (-> src bone transform)))) (vector-normalize! (-> gp-0 rvec) 1.0) (vector-normalize! (-> gp-0 uvec) 1.0) (vector-normalize! (-> gp-0 fvec) 1.0) @@ -1978,20 +1944,7 @@ (defun cspace<-parent-joint! ((dst cspace) (proc (pointer process-drawable)) (parent-idx int)) "Set one cspace's bone to another from the given process-drawable" - (let ((v0-0 (-> dst bone transform))) - (let* ((a2-1 (-> proc 0 node-list data parent-idx bone transform)) - (v1-5 (-> a2-1 rvec quad)) - (a0-2 (-> a2-1 uvec quad)) - (a1-1 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> v0-0 rvec quad) v1-5) - (set! (-> v0-0 uvec quad) a0-2) - (set! (-> v0-0 fvec quad) a1-1) - (set! (-> v0-0 trans quad) a2-2) - ) - v0-0 - ) + (matrix-copy! (-> dst bone transform) (-> proc 0 node-list data parent-idx bone transform)) ) (defun cspace<-rot-yxy! ((dst cspace) (src transform)) @@ -2045,39 +1998,14 @@ (defun cspace<-matrix-no-push-joint! ((dst cspace) (jc joint-control)) "Compute animated matrix, using the special 'no-push mode." - (let ((v1-2 (matrix-from-control! (scratchpad-object matrix-stack :offset 64) (-> dst joint) jc 'no-push)) - (v0-1 (-> dst bone transform)) - ) - (let ((a0-4 (-> v1-2 rvec quad)) - (a1-2 (-> v1-2 uvec quad)) - (a2-1 (-> v1-2 fvec quad)) - (v1-3 (-> v1-2 trans quad)) - ) - (set! (-> v0-1 rvec quad) a0-4) - (set! (-> v0-1 uvec quad) a1-2) - (set! (-> v0-1 fvec quad) a2-1) - (set! (-> v0-1 trans quad) v1-3) - ) - v0-1 + (let ((v1-2 (matrix-from-control! (scratchpad-object matrix-stack :offset 64) (-> dst joint) jc 'no-push))) + (matrix-copy! (-> dst bone transform) v1-2) ) ) (defun cspace<-matrix-joint! ((dst cspace) (src matrix)) "Set the cspace from a matrix." - (let ((v0-0 (-> dst bone transform))) - (let* ((a2-0 src) - (v1-1 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> v0-0 rvec quad) v1-1) - (set! (-> v0-0 uvec quad) a0-1) - (set! (-> v0-0 fvec quad) a1-1) - (set! (-> v0-0 trans quad) a2-1) - ) - v0-0 - ) + (matrix-copy! (-> dst bone transform) src) ) (defun cspace<-parented-matrix-joint! ((dst cspace) (joint-mat matrix)) diff --git a/goal_src/jak3/engine/camera/cam-combiner.gc b/goal_src/jak3/engine/camera/cam-combiner.gc index b67e42ed4cc..4fe4aed4495 100644 --- a/goal_src/jak3/engine/camera/cam-combiner.gc +++ b/goal_src/jak3/engine/camera/cam-combiner.gc @@ -49,11 +49,7 @@ 0.0 (let ((s4-0 (new-stack-vector0))) 0.0 - (let ((s3-0 (new 'stack-no-clear 'matrix))) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) + (let ((s3-0 (new-stack-matrix0))) (vector-! (-> s2-0 0) (the-as vector (-> sv-144 inv-mat)) (the-as vector (-> gp-0 inv-mat))) (vector-! (-> s2-0 1) (-> sv-144 inv-mat uvec) (-> gp-0 inv-mat uvec)) (vector-! (-> s2-0 2) (-> sv-144 inv-mat fvec) (-> gp-0 inv-mat fvec)) @@ -121,7 +117,7 @@ (logxor! (-> *camera* master-options) (cam-master-options-u32 FLIP_COMBINER)) ) ) - (set! (-> self flip-control-axis quad) (-> s4-0 quad)) + (vector-copy! (-> self flip-control-axis) s4-0) (when (logtest? (-> *camera* master-options) (cam-master-options-u32 FLIP_COMBINER)) (set! f30-0 (- 65536.0 f30-0)) (vector-negate! s4-0 s4-0) @@ -252,8 +248,8 @@ (set! (-> self tracking no-follow) (-> (the-as camera-slave gp-3) tracking no-follow)) (copy-to (-> self tracking tilt-adjust) (the-as cam-float-seeker (+ (the-as uint gp-3) 320))) (copy-to (-> self tracking underwater-blend) (the-as cam-float-seeker (+ (the-as uint gp-3) 368))) - (set! (-> self tracking follow-off quad) (-> (the-as camera-slave gp-3) tracking follow-off quad)) - (set! (-> self tracking follow-pt quad) (-> (the-as camera-slave gp-3) tracking follow-pt quad)) + (vector-copy! (-> self tracking follow-off) (-> (the-as camera-slave gp-3) tracking follow-off)) + (vector-copy! (-> self tracking follow-pt) (-> (the-as camera-slave gp-3) tracking follow-pt)) (let* ((a2-23 (-> self tracking)) (a3-7 (-> (the-as camera-slave gp-3) tracking)) (v1-37 (-> a3-7 inv-mat rvec quad)) @@ -267,7 +263,7 @@ (set! (-> a2-23 inv-mat trans quad) a3-8) ) (copy-to (-> self tracking point-of-interest-blend) (the-as cam-float-seeker (+ (the-as uint gp-3) 344))) - (set! (-> self tracking looking-at quad) (-> (the-as camera-slave gp-3) tracking looking-at quad)) + (vector-copy! (-> self tracking looking-at) (-> (the-as camera-slave gp-3) tracking looking-at)) (set! v0-0 (-> self tracking looking-interesting)) (set! (-> (the-as vector v0-0) quad) (-> (the-as camera-slave gp-3) tracking looking-interesting quad)) ) @@ -291,7 +287,7 @@ (f30-0 (parameter-ease-sin-clamp (-> self interp-val))) (gp-0 (new-stack-vector0)) ) - (set! (-> gp-0 quad) (-> self trans quad)) + (vector-copy! gp-0 (-> self trans)) (when s5-0 (cond ((< (-> self interp-val) 1.0) diff --git a/goal_src/jak3/engine/camera/cam-interface.gc b/goal_src/jak3/engine/camera/cam-interface.gc index c17e4c46855..d791ad5f43f 100644 --- a/goal_src/jak3/engine/camera/cam-interface.gc +++ b/goal_src/jak3/engine/camera/cam-interface.gc @@ -77,7 +77,7 @@ ;; WARN: Return type mismatch object vs symbol. (defbehavior camera-teleport-to-entity process ((arg0 entity-actor)) (let ((gp-0 (new 'stack 'transformq))) - (set! (-> gp-0 trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> gp-0 trans) (-> arg0 extra trans)) (quaternion-copy! (-> gp-0 quat) (-> arg0 quat)) (vector-identity! (-> gp-0 scale)) (the-as symbol (send-event *camera* 'teleport-to-transformq gp-0)) diff --git a/goal_src/jak3/engine/camera/cam-layout.gc b/goal_src/jak3/engine/camera/cam-layout.gc index 95e918b380d..713fd6c1d3c 100644 --- a/goal_src/jak3/engine/camera/cam-layout.gc +++ b/goal_src/jak3/engine/camera/cam-layout.gc @@ -267,7 +267,7 @@ (set! sv-164 (the-as float 0.0)) (set! sv-168 0) (set! sv-176 (new-stack-vector0)) - (set! (-> sv-160 quad) (-> sv-240 quad)) + (vector-copy! sv-160 sv-240) (set! sv-288 0) (while (< sv-288 (the-as int (-> sv-16 elt-count))) (when (and (!= sv-288 s1-0) (!= sv-288 sv-272)) @@ -277,7 +277,7 @@ ) ((zero? sv-168) (vector+float*! sv-160 sv-160 sv-208 f0-8) - (set! (-> sv-176 quad) (-> s3-0 sv-288 quad)) + (vector-copy! sv-176 (-> s3-0 sv-288)) (set! sv-164 (the-as float 8192000.0)) (set! sv-168 1) ) @@ -291,7 +291,7 @@ ) (else (vector+float*! sv-160 sv-160 sv-208 f0-8) - (set! (-> sv-176 quad) (-> s3-0 sv-288 quad)) + (vector-copy! sv-176 (-> s3-0 sv-288)) (set! sv-168 (+ sv-168 1)) (if (< (fabs f0-8) (fabs sv-164)) (set! sv-164 (- sv-164 f0-8)) @@ -322,8 +322,8 @@ (format 0 "ERROR : camera editing out of volume points~%") ) (else - (set! (-> *volume-point* data *volume-point-current* quad) (-> sv-160 quad)) - (set! (-> *volume-point* data (+ *volume-point-current* 1) quad) (-> sv-240 quad)) + (vector-copy! (-> *volume-point* data *volume-point-current*) sv-160) + (vector-copy! (-> *volume-point* data (+ *volume-point-current* 1)) sv-240) (set! *volume-point-current* (+ *volume-point-current* 2)) (+! (-> s2-0 point-count) 2) ) @@ -347,8 +347,8 @@ (format 0 "ERROR : camera editing out of volume normals~%") ) (else - (set! (-> *volume-normal* data *volume-normal-current* quad) (-> s0-0 quad)) - (set! (-> *volume-normal* data (+ *volume-normal-current* 1) quad) (-> s3-0 s1-0 quad)) + (vector-copy! (-> *volume-normal* data *volume-normal-current*) s0-0) + (vector-copy! (-> *volume-normal* data (+ *volume-normal-current* 1)) (-> s3-0 s1-0)) (set! *volume-normal-current* (+ *volume-normal-current* 2)) (set! (-> s2-0 normal-count) (+ (-> s2-0 normal-count) 2)) ) @@ -461,7 +461,7 @@ (arg0 s3-0 (-> arg1 from) (-> arg1 to) 0.0 (-> arg1 axis) 65536.0) (vector+! s3-0 s3-0 (-> arg1 origin)) (dotimes (s2-0 10) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) (arg0 s3-0 (-> arg1 from) (-> arg1 to) (* 0.1 (+ 1.0 (the float s2-0))) (-> arg1 axis) 65536.0) (vector+! s3-0 s3-0 (-> arg1 origin)) (camera-line s3-0 s5-0 (-> arg1 color)) @@ -482,7 +482,7 @@ (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) 0.0) (vector+! s3-0 s3-0 (-> arg1 origin)) (dotimes (s2-0 10) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (* 182.04445 (* 18.0 (+ 1.0 (the float s2-0))))) (vector+! s3-0 s3-0 (-> arg1 origin)) (camera-line s3-0 s5-0 (-> arg1 color)) @@ -501,18 +501,14 @@ (if (not arg0) (return #f) ) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (let ((s4-0 (new-stack-vector0))) - (when (and (cam-slave-get-vector-with-offset arg0 s4-0 'trans) - (or (!= *camera-layout-blink* 'camera) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) - ) - (cam-slave-get-rot arg0 s5-0) - (camera-fov-frame s5-0 s4-0 (* 0.5 (cam-slave-get-fov arg0)) 0.75 1.0 (new 'static 'vector4w :z #xff :w #x80)) + (let ((s5-0 (new-stack-matrix0)) + (s4-0 (new-stack-vector0)) ) + (when (and (cam-slave-get-vector-with-offset arg0 s4-0 'trans) + (or (!= *camera-layout-blink* 'camera) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cam-slave-get-rot arg0 s5-0) + (camera-fov-frame s5-0 s4-0 (* 0.5 (cam-slave-get-fov arg0)) 0.75 1.0 (new 'static 'vector4w :z #xff :w #x80)) ) ) (let ((s5-1 (new-stack-vector0))) @@ -570,28 +566,27 @@ (vector-! s4-1 s4-1 s5-4) ) (else - (set! (-> s4-1 quad) - (-> (the-as - vector - ((method-of-type res-lump get-property-struct) - arg0 - 'spline-offset - 'interp - -1000000000.0 - s4-1 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - quad - ) - ) + (vector-copy! + s4-1 + (the-as + vector + ((method-of-type res-lump get-property-struct) + arg0 + 'spline-offset + 'interp + -1000000000.0 + s4-1 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) ) ) (curve-get-pos! s5-4 0.0 s3-1) (vector+! s5-4 s5-4 s4-1) (dotimes (s1-1 8) - (set! (-> s2-0 quad) (-> s5-4 quad)) + (vector-copy! s2-0 s5-4) (curve-get-pos! s5-4 (* 0.125 (the float (+ s1-1 1))) s3-1) (vector+! s5-4 s5-4 s4-1) (camera-line s2-0 s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80)) @@ -634,7 +629,7 @@ (curve-get-pos! s5-5 0.0 s3-2) (vector+! s5-5 s5-5 s4-2) (dotimes (s1-3 8) - (set! (-> s2-1 quad) (-> s5-5 quad)) + (vector-copy! s2-1 s5-5) (curve-get-pos! s5-5 (* 0.125 (the float (+ s1-3 1))) s3-2) (vector+! s5-5 s5-5 s4-2) (camera-line s2-1 s5-5 (new 'static 'vector4w :z #xff :w #x80)) @@ -818,11 +813,7 @@ ) ) ) - (let ((s5-1 (new 'stack-no-clear 'matrix))) - (set! (-> s5-1 rvec quad) (the-as uint128 0)) - (set! (-> s5-1 uvec quad) (the-as uint128 0)) - (set! (-> s5-1 fvec quad) (the-as uint128 0)) - (set! (-> s5-1 trans quad) (the-as uint128 0)) + (let ((s5-1 (new-stack-matrix0))) (let ((a2-8 (new-stack-vector0))) (set! (-> a2-8 y) -1.0) (forward-down-nopitch->inv-matrix s5-1 (-> *math-camera* inv-camera-rot fvec) a2-8) @@ -1062,7 +1053,7 @@ (defbehavior clmf-look-through cam-layout () (set! (-> *camera-other-fov* data) (cam-slave-get-fov (-> self cam-entity))) (cam-slave-get-vector-with-offset (the-as entity-actor (-> self cam-entity)) *camera-other-trans* 'trans) - (set! (-> *camera-other-root* quad) (-> *camera-other-trans* quad)) + (vector-copy! *camera-other-root* *camera-other-trans*) (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) *camera-other-matrix*) (set! *camera-look-through-other* 10) (set-setting! 'master-options 'set 0.0 32) @@ -1126,7 +1117,7 @@ (if arg0 (format #t "setup trans ~M ~M ~M (maya)~%" (-> s1-0 x) (-> s1-0 y) (-> s1-0 z)) ) - (set! (-> s3-1 quad) (-> s1-0 quad)) + (vector-copy! s3-1 s1-0) (when (the-as vector s5-1) (if arg0 (format @@ -1193,7 +1184,7 @@ (when s2-0 (if s5-1 (vector+! s4-1 s2-0 s5-1) - (set! (-> s4-1 quad) (-> s2-0 quad)) + (vector-copy! s4-1 s2-0) ) (if arg0 (format #t "setup pivot ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) @@ -1239,7 +1230,7 @@ (when s2-0 (if s5-1 (vector+! s4-1 s2-0 s5-1) - (set! (-> s4-1 quad) (-> s2-0 quad)) + (vector-copy! s4-1 s2-0) ) (if arg0 (format #t "setup align ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) @@ -1285,7 +1276,7 @@ (when s2-0 (if s5-1 (vector+! s4-1 s2-0 s5-1) - (set! (-> s4-1 quad) (-> s2-0 quad)) + (vector-copy! s4-1 s2-0) ) (if arg0 (format #t "setup interesting ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) diff --git a/goal_src/jak3/engine/camera/cam-master.gc b/goal_src/jak3/engine/camera/cam-master.gc index 15453677165..2206da29577 100644 --- a/goal_src/jak3/engine/camera/cam-master.gc +++ b/goal_src/jak3/engine/camera/cam-master.gc @@ -35,20 +35,20 @@ (set! (-> self tpos-old y) (lerp (-> self tpos-old y) (-> v1-5 y) (* 3.0 (seconds-per-frame)))) (set! (-> self tpos-old y) (lerp (-> self tpos-old y) (-> v1-5 y) (* 8.0 (seconds-per-frame)))) ) - (set! (-> self tpos-curr quad) (-> self tpos-old quad)) - (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) + (vector-copy! (-> self tpos-curr) (-> self tpos-old)) + (vector-copy! (-> self tpos-old-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-curr-adj) (-> self tpos-old)) (let ((v0-0 (the-as object (-> self tpos-tgt)))) (set! (-> (the-as vector v0-0) quad) (-> self tpos-old quad)) v0-0 ) ) (else - (set! (-> self tpos-old quad) (-> v1-5 quad)) - (set! (-> self tpos-curr quad) (-> self tpos-old quad)) - (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) + (vector-copy! (-> self tpos-old) v1-5) + (vector-copy! (-> self tpos-curr) (-> self tpos-old)) + (vector-copy! (-> self tpos-old-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-curr-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-tgt) (-> self tpos-old)) (set! (-> self upspeed) 0.0) ) ) @@ -61,11 +61,11 @@ (defbehavior reset-target-tracking camera-master () (let ((gp-0 (handle->process (-> self focus handle)))) (when gp-0 - (set! (-> self tpos-old quad) (-> (get-trans (the-as process-focusable gp-0) 4) quad)) - (set! (-> self tpos-curr quad) (-> self tpos-old quad)) - (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) + (vector-copy! (-> self tpos-old) (get-trans (the-as process-focusable gp-0) 4)) + (vector-copy! (-> self tpos-curr) (-> self tpos-old)) + (vector-copy! (-> self tpos-old-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-curr-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-tgt) (-> self tpos-old)) (quaternion->matrix (-> self tgt-rot-mat) (get-quat (the-as process-focusable gp-0) 2)) (quaternion->matrix (-> self tgt-face-mat) (get-quat (the-as process-focusable gp-0) 1)) (vector-reset! (-> self pitch-off)) @@ -114,7 +114,7 @@ (let ((gp-0 (handle->process (-> self focus handle)))) (cond ((and *target* (not gp-0)) - (try-update-focus (-> self focus) *target*) + (focus-on! (-> self focus) *target*) (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) (reset-target-tracking) ) @@ -153,8 +153,8 @@ (+! (-> self under-water) -1) ) ) - (set! (-> self tpos-old quad) (-> self tpos-curr quad)) - (set! (-> self tpos-old-adj quad) (-> self tpos-curr-adj quad)) + (vector-copy! (-> self tpos-old) (-> self tpos-curr)) + (vector-copy! (-> self tpos-old-adj) (-> self tpos-curr-adj)) (quaternion->matrix (-> self tgt-rot-mat) (get-quat (the-as process-focusable gp-0) 2)) (quaternion->matrix (-> self tgt-face-mat) (get-quat (the-as process-focusable gp-0) 1)) (cond @@ -182,7 +182,7 @@ (+! (-> self ease-t) (-> self ease-step)) ) (else - (set! (-> self tpos-curr quad) (-> (get-trans (the-as process-focusable gp-0) 4) quad)) + (vector-copy! (-> self tpos-curr) (get-trans (the-as process-focusable gp-0) 4)) ) ) (when (focus-test? (the-as process-focusable gp-0) edge-grab) @@ -277,7 +277,7 @@ ) ) ) - (set! (-> self tpos-tgt quad) (-> self tpos-curr quad)) + (vector-copy! (-> self tpos-tgt) (-> self tpos-curr)) (vector-! s5-7 (-> self tpos-curr-adj) (-> self tpos-curr)) (let* ((f0-38 (vector-dot s5-7 (-> self local-down))) (f0-39 (cond @@ -642,7 +642,7 @@ (deactivate (-> self slave 0)) (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) - (set! (-> *camera-combiner* trans quad) (-> (the-as matrix gp-1) rvec quad)) + (vector-copy! (-> *camera-combiner* trans) (-> (the-as matrix gp-1) rvec)) (quaternion->matrix (-> *camera-combiner* inv-camera-rot) (the-as quaternion (+ (the-as uint gp-1) 16))) ) (send-event self 'teleport) @@ -656,7 +656,7 @@ (deactivate (-> self slave 0)) (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) - (set! (-> *camera-combiner* trans quad) (-> *camera-other-trans* quad)) + (vector-copy! (-> *camera-combiner* trans) *camera-other-trans*) (vector-! gp-2 (-> self tpos-curr-adj) *camera-other-trans*) (vector-normalize! gp-2 1.0) (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-2 (new 'static 'vector :y -1.0)) @@ -673,7 +673,7 @@ (deactivate (-> self slave 0)) (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) - (set! (-> *camera-combiner* trans quad) (-> (the-as vector s5-0) quad)) + (vector-copy! (-> *camera-combiner* trans) (the-as vector s5-0)) (vector-! gp-3 (-> self tpos-curr-adj) (the-as vector s5-0)) (vector-normalize! gp-3 1.0) (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-3 (new 'static 'vector :y -1.0)) @@ -690,7 +690,7 @@ (logclear! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) ) (else - (try-update-focus (-> self focus) (the-as process-focusable a1-15)) + (focus-on! (-> self focus) (the-as process-focusable a1-15)) (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) (reset-target-tracking) ) @@ -834,7 +834,7 @@ (if (< (the-as float (-> block param 0)) (-> self ease-t)) (set! (-> self ease-t) (the-as float (-> block param 0))) ) - (set! (-> self ease-to quad) (-> (the-as vector (-> block param 1)) quad)) + (vector-copy! (-> self ease-to) (the-as vector (-> block param 1))) (logior! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) ) ) @@ -1074,7 +1074,7 @@ (defmethod camera-master-method-15 ((this camera-master) (arg0 vector)) (if (and (-> this slave) (-> this slave 0 next-state) (= (-> this slave 0 next-state name) 'cam-string)) - (set! (-> arg0 quad) (-> this slave 0 view-flat quad)) + (vector-copy! arg0 (-> this slave 0 view-flat)) (vector-reset! arg0) ) arg0 diff --git a/goal_src/jak3/engine/camera/cam-states-dbg.gc b/goal_src/jak3/engine/camera/cam-states-dbg.gc index 986a8ccb026..9a9d6334082 100644 --- a/goal_src/jak3/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak3/engine/camera/cam-states-dbg.gc @@ -61,11 +61,7 @@ ) ) (let ((s4-0 (new-stack-vector0))) - (let ((s3-0 (new 'stack-no-clear 'matrix))) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) + (let ((s3-0 (new-stack-matrix0))) (matrix-axis-angle! s3-0 (the-as vector (-> self tracking)) (- (-> s5-0 x))) (vector-matrix*! s4-0 (-> self tracking inv-mat fvec) s3-0) (matrix-axis-angle! s3-0 (-> *camera* local-down) (- (-> s5-0 y))) diff --git a/goal_src/jak3/engine/camera/cam-states.gc b/goal_src/jak3/engine/camera/cam-states.gc index 2776f902888..905adcc88cd 100644 --- a/goal_src/jak3/engine/camera/cam-states.gc +++ b/goal_src/jak3/engine/camera/cam-states.gc @@ -44,7 +44,7 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 @@ -71,7 +71,7 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 @@ -82,7 +82,7 @@ (when (not (paused?)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> self fov) (-> *camera* slave 0 fov)) - (set! (-> self trans quad) (-> self saved-pt quad)) + (vector-copy! (-> self trans) (-> self saved-pt)) (cam-curve-pos (-> self trans) gp-0 (the-as curve #f) #f) (when (!= (-> gp-0 w) 0.0) (vector-normalize! gp-0 1.0) @@ -274,9 +274,9 @@ (set! s4-0 (cond ((and (< (vector-vector-distance s2-0 gp-0) 40960.0) (< (cos 3640.889) (vector-dot s5-0 s3-0))) - (set! (-> self trans quad) (-> s2-0 quad)) + (vector-copy! (-> self trans) s2-0) (vector-negate! (the-as vector (-> self tracking)) (-> s0-0 rvec)) - (set! (-> self tracking inv-mat uvec quad) (-> s0-0 uvec quad)) + (vector-copy! (-> self tracking inv-mat uvec) (-> s0-0 uvec)) (vector-negate! (-> self tracking inv-mat fvec) (-> s0-0 fvec)) (set! (-> self fov) (* 2.0 (atan (/ 12.700255 (* 20.3 (-> s1-0 x))) 1.0))) (vector-float*! (the-as vector (-> self tracking)) (the-as vector (-> self tracking)) (/ 1.0 (-> s1-0 x))) @@ -291,9 +291,9 @@ ) ) ) - (set! (-> gp-0 quad) (-> s2-0 quad)) + (vector-copy! gp-0 s2-0) ) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) ) ) (suspend) @@ -330,25 +330,14 @@ ) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (new 'stack-no-clear 'matrix))) - (let* ((v1-8 a2-0) - (t0-0 (-> (the-as process-drawable (-> *camera* settings pov-handle process 0)) - node-list - data - (-> *camera* settings pov-bone) - bone - transform - ) - ) - (a0-9 (-> t0-0 rvec quad)) - (a1-11 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-8 rvec quad) a0-9) - (set! (-> v1-8 uvec quad) a1-11) - (set! (-> v1-8 fvec quad) a3-0) - (set! (-> v1-8 trans quad) t0-1) - ) + (matrix-copy! a2-0 (-> (the-as process-drawable (-> *camera* settings pov-handle process 0)) + node-list + data + (-> *camera* settings pov-bone) + bone + transform + ) + ) (vector-reset! (-> a2-0 trans)) (vector-matrix*! gp-0 (-> *camera* settings pov-offset) a2-0) ) @@ -520,12 +509,8 @@ (until #f (when (not (paused?)) (let ((s4-0 (vector-reset! (new-stack-vector0))) - (s5-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new-stack-matrix0)) ) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f30-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) @@ -716,7 +701,7 @@ ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *camera* tpos-curr quad)) + (vector-copy! s4-0 (-> *camera* tpos-curr)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -779,7 +764,7 @@ (vector+! (-> self spline-offset) (-> self spline-offset) (the-as vector a0-8)) ) ) - (set! (-> self trans quad) (-> self saved-pt quad)) + (vector-copy! (-> self trans) (-> self saved-pt)) (cam-calc-follow! (-> self tracking) (-> self trans) #f) (set! (-> self spline-follow-dist) (cam-slave-get-float (-> self cam-entity) 'spline-follow-dist 0.0)) (cond @@ -837,7 +822,7 @@ (when (not (paused?)) (cam-calc-follow! (-> self tracking) (-> self trans) #t) (new 'stack 'curve) - (set! (-> self trans quad) (-> self saved-pt quad)) + (vector-copy! (-> self trans) (-> self saved-pt)) (cam-curve-pos (-> self trans) (the-as vector #f) (the-as curve #f) #t) ) (suspend) @@ -859,7 +844,7 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) @@ -923,9 +908,9 @@ (let ((a1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> self trans quad)) + (vector-copy! a1-0 (-> self trans)) (set! (-> a1-0 y) 0.0) - (set! (-> s5-0 quad) (-> self velocity quad)) + (vector-copy! s5-0 (-> self velocity)) (set! (-> s5-0 y) 0.0) (init gp-0 a1-0 81.92 (fmax 819.2 (vector-length s5-0)) 0.75) (set! (-> gp-0 vel quad) (-> s5-0 quad)) @@ -967,12 +952,8 @@ (f1-2 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 32.0 110.0 (* 8192.0 (seconds-per-frame))) ) - (s2-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new-stack-matrix0)) ) - (set! (-> s2-0 rvec quad) (the-as uint128 0)) - (set! (-> s2-0 uvec quad) (the-as uint128 0)) - (set! (-> s2-0 fvec quad) (the-as uint128 0)) - (set! (-> s2-0 trans quad) (the-as uint128 0)) (let ((v1-15 (new 'stack-no-clear 'vector))) 0.0 (if (-> *camera* settings flip-horizontal) @@ -1050,7 +1031,7 @@ (vector-matrix*! arg0 arg1 s4-0) ) (else - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (if (logtest? (-> self options) (cam-slave-options-u32 SHRINK_MAX_ANGLE)) (set! (-> self max-angle-curr) f28-0) ) @@ -1129,7 +1110,7 @@ ) (defbehavior cam-circular-code camera-slave () - (set! (-> self pivot-pt quad) (-> self saved-pt quad)) + (vector-copy! (-> self pivot-pt) (-> self saved-pt)) (cam-curve-pos (-> self pivot-pt) (the-as vector #f) (the-as curve #f) #f) (let ((a2-1 (new-stack-vector0)) (f0-0 182.04445) @@ -1176,7 +1157,7 @@ #f ) (('outro-done) - (set! (-> self trans quad) (-> *camera-combiner* trans quad)) + (vector-copy! (-> self trans) (-> *camera-combiner* trans)) (cam-circular-position #f) ) (else @@ -1192,7 +1173,7 @@ (let ((gp-0 (new-stack-vector0))) (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (set! (-> self view-off-param) 1.0) - (set! (-> self circular-follow quad) (-> *camera* tpos-curr-adj quad)) + (vector-copy! (-> self circular-follow) (-> *camera* tpos-curr-adj)) (set! (-> self max-angle-offset) 0.0) (cond ((-> self cam-entity) @@ -1248,7 +1229,7 @@ ) (else (set! (-> self spline-follow-dist) 0.0) - (set! (-> self pivot-pt quad) (-> self saved-pt quad)) + (vector-copy! (-> self pivot-pt) (-> self saved-pt)) (cam-curve-pos (-> self pivot-pt) (the-as vector #f) (the-as curve #f) #f) ) ) @@ -1257,8 +1238,8 @@ (vector-! (-> self pivot-pt) (-> *camera* tpos-curr-adj) (-> self trans)) (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) (set! (-> self pivot-rad) (vector-length (-> self pivot-pt))) - (set! (-> self pivot-pt quad) (-> self trans quad)) - (set! (-> self saved-pt quad) (-> self pivot-pt quad)) + (vector-copy! (-> self pivot-pt) (-> self trans)) + (vector-copy! (-> self saved-pt) (-> self pivot-pt)) ) (else (vector-! (-> self pivot-pt) (-> *camera* tpos-curr-adj) (-> self trans)) @@ -1266,7 +1247,7 @@ (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) (set! (-> self pivot-rad) (vector-length (-> self pivot-pt))) (vector+! (-> self pivot-pt) (-> self trans) (-> self pivot-pt)) - (set! (-> self saved-pt quad) (-> self pivot-pt quad)) + (vector-copy! (-> self saved-pt) (-> self pivot-pt)) ) ) ) @@ -1352,18 +1333,18 @@ (set! (-> s5-0 z) (+ 1024.0 (-> *CAMERA-bank* default-string-min-z))) ) (vector--float*! s5-0 s5-0 (-> *camera* local-down) (-> *CAMERA-bank* default-string-min-y)) - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) (until #f (vector--float*! s4-0 arg0 (-> *camera* local-down) (-> *camera* settings target-height)) - (set! (-> s3-0 start-pos quad) (-> *camera* tpos-curr-adj quad)) - (set! (-> s3-0 move-dist quad) (-> arg0 quad)) + (vector-copy! (-> s3-0 start-pos) (-> *camera* tpos-curr-adj)) + (vector-copy! (-> s3-0 move-dist) arg0) (if (< (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) (return #t) ) (set! f30-0 (cond ((>= -32768.0 f30-0) (format #t "cam-string didn't find a spot~%") - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) (return #f) f30-0 ) @@ -1387,7 +1368,7 @@ (vector-flatten! (-> self view-flat) arg0 (-> *camera* local-down)) (set! (-> self min-z-override) (vector-length (-> self view-flat))) (vector+! (-> self desired-pos) arg0 (-> *camera* tpos-curr-adj)) - (set! (-> self string-trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self string-trans) (-> self desired-pos)) (tracking-spline-method-10 (-> self position-spline) (-> self desired-pos)) (vector-reset! (-> self velocity)) (let ((v0-2 (logclear (-> self options) (cam-slave-options-u32 GOTO_GOOD_POINT)))) @@ -1650,7 +1631,7 @@ (f30-0 2.0) ) 0.0 - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-! (-> s5-0 move-dist) arg1 arg0) (let ((v1-4 s5-0)) (set! (-> v1-4 radius) (-> *CAM_STRING-bank* los-coll-rad2)) @@ -1873,8 +1854,8 @@ (f26-0 (vector-length arg1)) (f30-0 (vector-normalize-ret-len! s4-0 1.0)) ) - (set! (-> s1-0 start-pos quad) (-> arg0 quad)) - (set! (-> s1-0 move-dist quad) (-> arg1 quad)) + (vector-copy! (-> s1-0 start-pos) arg0) + (vector-copy! (-> s1-0 move-dist) arg1) (let ((v1-5 s1-0)) (set! (-> v1-5 radius) (-> *CAM_STRING-bank* los-coll-rad)) (set! (-> v1-5 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -2016,18 +1997,19 @@ (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) ) (logior! (-> self options) (cam-slave-options-u32 GOTO_GOOD_POINT)) - (set! (-> self good-point quad) - (-> *camera* target-spline point (-> *camera* target-spline used-point) position quad) - ) - (set! (-> self los-last-pos quad) (-> self good-point quad)) + (vector-copy! + (-> self good-point) + (-> *camera* target-spline point (-> *camera* target-spline used-point) position) + ) + (vector-copy! (-> self los-last-pos) (-> self good-point)) (when *debug-segment* (let ((a1-22 (new 'stack-no-clear 'vector))) (vector-! a1-22 (-> self good-point) (-> self string-trans)) (cam-collision-record-save (-> self string-trans) a1-22 -3 'jump self) ) ) - (set! (-> self desired-pos quad) (-> self good-point quad)) - (set! (-> self string-trans quad) (-> self good-point quad)) + (vector-copy! (-> self desired-pos) (-> self good-point)) + (vector-copy! (-> self string-trans) (-> self good-point)) (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) (vector-reset! (-> self velocity)) @@ -2055,7 +2037,7 @@ (set! (-> self los-tgt-spline-pt-incarnation) (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) ) - (set! (-> self los-last-pos quad) (-> arg0 quad)) + (vector-copy! (-> self los-last-pos) arg0) ) ((begin (if *display-cam-los-debug* @@ -2097,16 +2079,16 @@ (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) ) (logior! (-> self options) (cam-slave-options-u32 GOTO_GOOD_POINT)) - (set! (-> self good-point quad) (-> *camera* target-spline point s2-2 position quad)) - (set! (-> self los-last-pos quad) (-> self good-point quad)) + (vector-copy! (-> self good-point) (-> *camera* target-spline point s2-2 position)) + (vector-copy! (-> self los-last-pos) (-> self good-point)) (when *debug-segment* (let ((a1-40 (new 'stack-no-clear 'vector))) (vector-! a1-40 (-> self good-point) (-> self string-trans)) (cam-collision-record-save (-> self string-trans) a1-40 -3 'jump self) ) ) - (set! (-> self desired-pos quad) (-> self good-point quad)) - (set! (-> self string-trans quad) (-> self good-point quad)) + (vector-copy! (-> self desired-pos) (-> self good-point)) + (vector-copy! (-> self string-trans) (-> self good-point)) (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) (vector-reset! (-> self velocity)) @@ -2124,7 +2106,7 @@ (set! (-> self los-tgt-spline-pt-incarnation) (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) ) - (set! (-> self los-last-pos quad) (-> arg0 quad)) + (vector-copy! (-> self los-last-pos) arg0) ) (else (if *display-cam-los-debug* @@ -2190,7 +2172,7 @@ (-> self good-point) (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> self los-tgt-spline-pt)))) ) - (set! (-> self los-last-pos quad) (-> self good-point quad)) + (vector-copy! (-> self los-last-pos) (-> self good-point)) (when *display-cam-los-debug* (format 0 "going because u(~f) > 0 frame ~D~%" f30-2 (current-time)) (format *stdcon* " going because u(~f) > 0 frame ~D~%" f30-2 (current-time)) @@ -2787,7 +2769,7 @@ (-> *camera* settings target-height) ) (vector-! (-> s5-0 move-dist) (-> s5-0 move-dist) (-> self string-trans)) - (set! (-> s5-0 start-pos quad) (-> self string-trans quad)) + (vector-copy! (-> s5-0 start-pos) (-> self string-trans)) (let ((s4-0 s5-0)) (set! (-> s4-0 radius) 409.6) (set! (-> s4-0 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -2883,7 +2865,7 @@ (let ((f28-0 (cond ((logtest? (-> self options) (cam-slave-options-u32 COLLIDE)) - (set! (-> s5-1 start-pos quad) (-> self string-trans quad)) + (vector-copy! (-> s5-1 start-pos) (-> self string-trans)) (let ((s2-0 s5-1)) (set! (-> s2-0 radius) (-> *CAMERA-bank* collide-move-rad)) (set! (-> s2-0 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -3003,7 +2985,7 @@ ) ) (logclear! (-> self options) (cam-slave-options-u32 GOTO_GOOD_POINT)) - (set! (-> self desired-pos quad) (-> self good-point quad)) + (vector-copy! (-> self desired-pos) (-> self good-point)) (cam-string-move) (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) @@ -3084,8 +3066,8 @@ (the-as vector (when (not (or (-> self string-val-locked) (logtest? (cam-slave-options-u32 GUN_CAM) (-> self options)))) - (set! (-> self string-min-val quad) (-> *camera* string-min value quad)) - (set! (-> self string-max-val quad) (-> *camera* string-max value quad)) + (vector-copy! (-> self string-min-val) (-> *camera* string-min value)) + (vector-copy! (-> self string-max-val) (-> *camera* string-max value)) (set! (-> self slope-adjust target) 0.0) (when (-> *camera* settings cam-slope) (let ((gp-0 (the-as entity-camera (entity-by-name (-> *camera* settings cam-slope))))) @@ -3186,8 +3168,8 @@ (cond ((-> block param 0) (set! (-> self string-val-locked) (the-as basic #t)) - (set! (-> self string-min-val quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self string-max-val quad) (-> (the-as vector (-> block param 1)) quad)) + (vector-copy! (-> self string-min-val) (the-as vector (-> block param 0))) + (vector-copy! (-> self string-max-val) (the-as vector (-> block param 1))) (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) @@ -3310,7 +3292,7 @@ (+ (-> *camera* settings target-height) (-> self view-off y)) ) (vector+! (-> self desired-pos) (-> self desired-pos) (-> *camera* tpos-curr-adj)) - (set! (-> self string-trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self string-trans) (-> self desired-pos)) (vector-reset! (-> self velocity)) (let ((gp-2 (new 'stack-no-clear 'collide-query))) (vector--float*! @@ -3365,7 +3347,7 @@ (+ (-> *camera* settings target-height) (-> self view-off y)) ) (vector+! (-> self desired-pos) (-> self desired-pos) (-> *camera* tpos-curr-adj)) - (set! (-> self string-trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self string-trans) (-> self desired-pos)) (vector-reset! (-> self velocity)) ) ) @@ -3373,8 +3355,8 @@ ) ) ) - (set! (-> self trans quad) (-> self string-trans quad)) - (set! (-> self los-last-pos quad) (-> self string-trans quad)) + (vector-copy! (-> self trans) (-> self string-trans)) + (vector-copy! (-> self los-last-pos) (-> self string-trans)) (tracking-spline-method-10 (-> self position-spline) (-> self string-trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) @@ -3447,7 +3429,7 @@ (let ((f28-0 (cond ((logtest? (-> self options) (cam-slave-options-u32 COLLIDE)) - (set! (-> gp-2 start-pos quad) (-> self trans quad)) + (vector-copy! (-> gp-2 start-pos) (-> self trans)) (let ((s1-0 gp-2)) (set! (-> s1-0 radius) (-> *CAMERA-bank* collide-move-rad)) (set! (-> s1-0 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -3467,7 +3449,7 @@ (cond ((>= f28-0 0.0) (vector+float*! (-> self trans) (-> self trans) s5-0 f28-0) - (set! (-> s4-0 quad) (-> gp-2 best-other-tri normal quad)) + (vector-copy! s4-0 (-> gp-2 best-other-tri normal)) (vector-flatten! (-> self velocity) (-> self velocity) s4-0) (set! f30-0 (- f30-0 (* f30-0 f28-0))) (set! s2-0 1) @@ -3533,7 +3515,7 @@ (vector-normalize! (-> self view-flat) (-> self view-off z)) (vector--float*! (-> self desired-pos) (-> self view-flat) (-> *camera* local-down) (-> self view-off y)) (vector+! (-> self desired-pos) (-> self desired-pos) (-> self tracking follow-pt)) - (set! (-> self trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self trans) (-> self desired-pos)) (vector-reset! (-> self velocity)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) @@ -3570,36 +3552,30 @@ (let ((f0-16 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 32.0 110.0 (* 21845.334 (seconds-per-frame))) ) - (gp-0 (new 'stack-no-clear 'matrix)) - ) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) - (let ((s3-0 (new-stack-vector0)) - (s5-0 (new-stack-vector0)) - (s4-0 (new-stack-vector0)) - ) - (if (-> *camera* settings flip-horizontal) - (set! f0-16 (- f0-16)) - ) - (cond - ((!= f0-16 0.0) - (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-16) - (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) - ) - ((logtest? (-> self options) (cam-slave-options-u32 BUTT_CAM)) - (set-vector! s5-0 0.0 0.0 1.0 1.0) - (vector-normalize-copy! s5-0 (-> self view-flat) 1.0) - (set! (-> s3-0 quad) (-> *camera* tgt-rot-mat fvec quad)) - (vector-flatten! s3-0 s3-0 (-> *camera* local-down)) - (vector-negate! s3-0 s3-0) - (set! (-> s4-0 quad) (-> s5-0 quad)) - (vector-normalize-copy! s4-0 s3-0 1.0) - (matrix-from-two-vectors-max-angle-partial! gp-0 s5-0 s4-0 (* 10922.667 (seconds-per-frame)) 0.05) - (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) - ) + (gp-0 (new-stack-matrix0)) + (s3-0 (new-stack-vector0)) + (s5-0 (new-stack-vector0)) + (s4-0 (new-stack-vector0)) ) + (if (-> *camera* settings flip-horizontal) + (set! f0-16 (- f0-16)) + ) + (cond + ((!= f0-16 0.0) + (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-16) + (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) + ) + ((logtest? (-> self options) (cam-slave-options-u32 BUTT_CAM)) + (set-vector! s5-0 0.0 0.0 1.0 1.0) + (vector-normalize-copy! s5-0 (-> self view-flat) 1.0) + (vector-copy! s3-0 (-> *camera* tgt-rot-mat fvec)) + (vector-flatten! s3-0 s3-0 (-> *camera* local-down)) + (vector-negate! s3-0 s3-0) + (vector-copy! s4-0 s5-0) + (vector-normalize-copy! s4-0 s3-0 1.0) + (matrix-from-two-vectors-max-angle-partial! gp-0 s5-0 s4-0 (* 10922.667 (seconds-per-frame)) 0.05) + (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) + ) ) ) ) @@ -3642,11 +3618,7 @@ ) (defbehavior cam-bike-code camera-slave () - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 rvec quad) (the-as uint128 0)) - (set! (-> s4-0 uvec quad) (the-as uint128 0)) - (set! (-> s4-0 fvec quad) (the-as uint128 0)) - (set! (-> s4-0 trans quad) (the-as uint128 0)) + (let ((s4-0 (new-stack-matrix0))) (let ((gp-0 (new-stack-vector0)) (s5-0 (new-stack-vector0)) ) @@ -3704,7 +3676,7 @@ (let ((f28-0 (cond ((logtest? (-> self options) (cam-slave-options-u32 COLLIDE)) - (set! (-> gp-3 start-pos quad) (-> self trans quad)) + (vector-copy! (-> gp-3 start-pos) (-> self trans)) (let ((s3-2 gp-3)) (set! (-> s3-2 radius) 4096.0) (set! (-> s3-2 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -3760,7 +3732,7 @@ (vector-normalize! (-> self view-flat) (-> self view-off z)) (vector--float*! (-> self desired-pos) (-> self view-flat) (-> *camera* local-down) (-> self view-off y)) (vector+! (-> self desired-pos) (-> self desired-pos) (-> *camera* tpos-curr-adj)) - (set! (-> self trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self trans) (-> self desired-pos)) (vector-reset! (-> self velocity)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-0)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) diff --git a/goal_src/jak3/engine/camera/cam-update.gc b/goal_src/jak3/engine/camera/cam-update.gc index 71fe8351abf..0d42583bd9e 100644 --- a/goal_src/jak3/engine/camera/cam-update.gc +++ b/goal_src/jak3/engine/camera/cam-update.gc @@ -224,9 +224,9 @@ (let ((v1-109 (-> s4-1 bsp nodes (-> s4-1 bsp cam-box-idx))) (a2-7 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-7 quad) (-> s4-1 bsp bsp-offset quad)) + (vector-copy! a2-7 (-> s4-1 bsp bsp-offset)) (let ((a3-6 (new 'stack-no-clear 'vector))) - (set! (-> a3-6 quad) (-> s4-1 bsp bsp-offset quad)) + (vector-copy! a3-6 (-> s4-1 bsp bsp-offset)) (cond ((zero? (-> s4-1 bsp cam-using-back)) (+! (-> a2-7 x) (the float (* (-> v1-109 front-box-min x) (the int (-> s4-1 bsp bsp-scale x))))) @@ -294,18 +294,7 @@ ) ) ) - (let* ((a2-2 (-> *math-camera* inv-camera-rot)) - (a3-1 *save-camera-inv-rot*) - (v1-14 (-> a3-1 rvec quad)) - (a0-13 (-> a3-1 uvec quad)) - (a1-2 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> a2-2 rvec quad) v1-14) - (set! (-> a2-2 uvec quad) a0-13) - (set! (-> a2-2 fvec quad) a1-2) - (set! (-> a2-2 trans quad) a3-2) - ) + (matrix-copy! (-> *math-camera* inv-camera-rot) *save-camera-inv-rot*) arg0 ) @@ -314,19 +303,8 @@ (vector-reset! (-> *math-camera* trans)) (matrix-identity! (-> *math-camera* inv-camera-rot)) (when *camera-combiner* - (let* ((v1-7 (-> *math-camera* inv-camera-rot)) - (a3-0 (-> *camera-combiner* inv-camera-rot)) - (a0-2 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-2) - (set! (-> v1-7 uvec quad) a1-0) - (set! (-> v1-7 fvec quad) a2-0) - (set! (-> v1-7 trans quad) a3-1) - ) - (set! (-> *math-camera* trans quad) (-> *camera-combiner* trans quad)) + (matrix-copy! (-> *math-camera* inv-camera-rot) (-> *camera-combiner* inv-camera-rot)) + (vector-copy! (-> *math-camera* trans) (-> *camera-combiner* trans)) ) ) 0 @@ -342,19 +320,8 @@ (defun update-camera () (with-pp (let ((gp-0 *math-camera*)) - (let* ((a2-0 (-> gp-0 prev-inv-camera-rot)) - (a3-0 (-> gp-0 inv-camera-rot)) - (v1-0 (-> a3-0 rvec quad)) - (a0-0 (-> a3-0 uvec quad)) - (a1-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-0) - (set! (-> a2-0 uvec quad) a0-0) - (set! (-> a2-0 fvec quad) a1-0) - (set! (-> a2-0 trans quad) a3-1) - ) - (set! (-> gp-0 prev-trans quad) (-> gp-0 trans quad)) + (matrix-copy! (-> gp-0 prev-inv-camera-rot) (-> gp-0 inv-camera-rot)) + (vector-copy! (-> gp-0 prev-trans) (-> gp-0 trans)) (when *start-timer* (when (= *timer-value* 180) (format @@ -364,7 +331,7 @@ (-> *target* control trans y) (-> *target* control trans z) ) - (set! (-> *start-pos* quad) (-> *target* control trans quad)) + (vector-copy! *start-pos* (-> *target* control trans)) ) (when (= *timer-value* 480) (format @@ -434,61 +401,17 @@ ) ((nonzero? *camera-look-through-other*) (set! (-> gp-0 fov) (-> *camera-other-fov* data)) - (set! (-> gp-0 trans quad) (-> *camera-other-trans* quad)) + (vector-copy! (-> gp-0 trans) *camera-other-trans*) (+! (-> gp-0 trans y) f28-0) - (let* ((a2-6 (-> gp-0 inv-camera-rot)) - (a3-5 *camera-other-matrix*) - (v1-76 (-> a3-5 rvec quad)) - (a0-34 (-> a3-5 uvec quad)) - (a1-7 (-> a3-5 fvec quad)) - (a3-6 (-> a3-5 trans quad)) - ) - (set! (-> a2-6 rvec quad) v1-76) - (set! (-> a2-6 uvec quad) a0-34) - (set! (-> a2-6 fvec quad) a1-7) - (set! (-> a2-6 trans quad) a3-6) - ) - (let* ((a2-7 *save-camera-inv-rot*) - (a3-7 *camera-other-matrix*) - (v1-77 (-> a3-7 rvec quad)) - (a0-35 (-> a3-7 uvec quad)) - (a1-8 (-> a3-7 fvec quad)) - (a3-8 (-> a3-7 trans quad)) - ) - (set! (-> a2-7 rvec quad) v1-77) - (set! (-> a2-7 uvec quad) a0-35) - (set! (-> a2-7 fvec quad) a1-8) - (set! (-> a2-7 trans quad) a3-8) - ) + (matrix-copy! (-> gp-0 inv-camera-rot) *camera-other-matrix*) + (matrix-copy! *save-camera-inv-rot* *camera-other-matrix*) ) ((and *camera-combiner* (not *external-cam-mode*)) (set! (-> gp-0 fov) (-> *camera-combiner* fov)) - (set! (-> gp-0 trans quad) (-> *camera-combiner* trans quad)) + (vector-copy! (-> gp-0 trans) (-> *camera-combiner* trans)) (+! (-> gp-0 trans y) f28-0) - (let* ((v1-84 (-> gp-0 inv-camera-rot)) - (a3-9 (-> *camera-combiner* inv-camera-rot)) - (a0-40 (-> a3-9 rvec quad)) - (a1-9 (-> a3-9 uvec quad)) - (a2-8 (-> a3-9 fvec quad)) - (a3-10 (-> a3-9 trans quad)) - ) - (set! (-> v1-84 rvec quad) a0-40) - (set! (-> v1-84 uvec quad) a1-9) - (set! (-> v1-84 fvec quad) a2-8) - (set! (-> v1-84 trans quad) a3-10) - ) - (let* ((v1-85 *save-camera-inv-rot*) - (a3-11 (-> *camera-combiner* inv-camera-rot)) - (a0-42 (-> a3-11 rvec quad)) - (a1-10 (-> a3-11 uvec quad)) - (a2-9 (-> a3-11 fvec quad)) - (a3-12 (-> a3-11 trans quad)) - ) - (set! (-> v1-85 rvec quad) a0-42) - (set! (-> v1-85 uvec quad) a1-10) - (set! (-> v1-85 fvec quad) a2-9) - (set! (-> v1-85 trans quad) a3-12) - ) + (matrix-copy! (-> gp-0 inv-camera-rot) (-> *camera-combiner* inv-camera-rot)) + (matrix-copy! *save-camera-inv-rot* (-> *camera-combiner* inv-camera-rot)) ) (*camera* (move-camera-from-pad gp-0) @@ -527,18 +450,7 @@ ) ) (else - (let* ((a2-12 (-> gp-0 inv-camera-rot-smooth)) - (a3-14 (-> gp-0 inv-camera-rot)) - (v1-106 (-> a3-14 rvec quad)) - (a0-51 (-> a3-14 uvec quad)) - (a1-16 (-> a3-14 fvec quad)) - (a3-15 (-> a3-14 trans quad)) - ) - (set! (-> a2-12 rvec quad) v1-106) - (set! (-> a2-12 uvec quad) a0-51) - (set! (-> a2-12 fvec quad) a1-16) - (set! (-> a2-12 trans quad) a3-15) - ) + (matrix-copy! (-> gp-0 inv-camera-rot-smooth) (-> gp-0 inv-camera-rot)) ) ) (when (and (!= *master-mode* 'menu) *display-camera-info*) @@ -566,20 +478,9 @@ ) ) ) - (when (zero? (-> gp-0 reset)) - (let* ((a2-16 (-> gp-0 prev-camera-temp)) - (a3-19 (-> gp-0 camera-temp)) - (v1-119 (-> a3-19 rvec quad)) - (a0-58 (-> a3-19 uvec quad)) - (a1-20 (-> a3-19 fvec quad)) - (a3-20 (-> a3-19 trans quad)) - ) - (set! (-> a2-16 rvec quad) v1-119) - (set! (-> a2-16 uvec quad) a0-58) - (set! (-> a2-16 fvec quad) a1-20) - (set! (-> a2-16 trans quad) a3-20) + (if (zero? (-> gp-0 reset)) + (matrix-copy! (-> gp-0 prev-camera-temp) (-> gp-0 camera-temp)) ) - ) (let ((s3-1 (-> gp-0 camera-temp)) (s2-0 (-> gp-0 camera-rot)) (s5-3 (-> gp-0 inv-camera-rot)) @@ -597,18 +498,7 @@ (set! (-> s5-3 trans quad) (-> s4-2 quad)) ) (when (nonzero? (-> gp-0 reset)) - (let* ((a2-19 (-> gp-0 prev-camera-temp)) - (a3-21 (-> gp-0 camera-temp)) - (v1-125 (-> a3-21 rvec quad)) - (a0-61 (-> a3-21 uvec quad)) - (a1-23 (-> a3-21 fvec quad)) - (a3-22 (-> a3-21 trans quad)) - ) - (set! (-> a2-19 rvec quad) v1-125) - (set! (-> a2-19 uvec quad) a0-61) - (set! (-> a2-19 fvec quad) a1-23) - (set! (-> a2-19 trans quad) a3-22) - ) + (matrix-copy! (-> gp-0 prev-camera-temp) (-> gp-0 camera-temp)) (set! (-> gp-0 reset) 0) 0 ) @@ -651,7 +541,7 @@ ) (quaternion->matrix s0-0 (-> gp-0 quat-other)) (mem-copy! (the-as pointer s5-4) (the-as pointer s0-0) 64) - (set! (-> s5-4 trans quad) (-> gp-0 trans-other quad)) + (vector-copy! (-> s5-4 trans) (-> gp-0 trans-other)) (set! (-> s5-4 trans w) 1.0) (matrix*! s3-2 s5-4 s4-3) (matrix-inverse-of-rot-trans! s2-1 s3-2) diff --git a/goal_src/jak3/engine/camera/camera-h.gc b/goal_src/jak3/engine/camera/camera-h.gc index 6cde45fbbae..f3fcaa4877c 100644 --- a/goal_src/jak3/engine/camera/camera-h.gc +++ b/goal_src/jak3/engine/camera/camera-h.gc @@ -269,8 +269,8 @@ (defmethod init ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> this target quad) (-> arg0 quad)) - (set! (-> this value quad) (-> arg0 quad)) + (vector-copy! (-> this target) arg0) + (vector-copy! (-> this value) arg0) ) (else (vector-reset! (-> this target)) diff --git a/goal_src/jak3/engine/camera/camera.gc b/goal_src/jak3/engine/camera/camera.gc index aa5b7e161b9..d517fa7388d 100644 --- a/goal_src/jak3/engine/camera/camera.gc +++ b/goal_src/jak3/engine/camera/camera.gc @@ -60,7 +60,7 @@ #t ) (s3-0 - (set! (-> arg1 quad) (-> (the-as vector s3-0) quad)) + (vector-copy! arg1 (the-as vector s3-0)) #t ) (else @@ -453,7 +453,7 @@ ) (arg3 (set! (-> this vec 0 quad) (-> arg3 cverts 0 quad)) - (set! (-> this vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) + (vector-copy! (-> this vec 1) (-> arg3 cverts (+ (-> arg3 num-cverts) -1))) ) (else (return #f) @@ -519,7 +519,7 @@ (set! (-> this max-move) 0.0) (set! (-> this sample-len) 0.0) (set! (-> this used-count) 1) - (set! (-> this old-position quad) (-> arg0 quad)) + (vector-copy! (-> this old-position) arg0) (let ((v1-6 1)) (while (!= v1-6 31) (set! (-> this point v1-6 next) (+ v1-6 1)) @@ -901,8 +901,8 @@ (let ((a2-3 (-> s3-0 cur-pt))) (set! (-> this debug-last-point) a2-3) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> this debug-old-position quad) (-> this old-position quad)) - (set! (-> this debug-out-position quad) (-> arg0 quad)) + (vector-copy! (-> this debug-old-position) (-> this old-position)) + (vector-copy! (-> this debug-out-position) arg0) (vector-! s4-1 arg0 (-> this old-position)) (tracking-spline-method-20 this s4-1 a2-3) (vector+! arg0 (-> this old-position) s4-1) @@ -910,7 +910,7 @@ ) ) ) - (set! (-> this old-position quad) (-> arg0 quad)) + (vector-copy! (-> this old-position) arg0) arg0 ) ) @@ -1013,7 +1013,7 @@ ) ) (set! (-> self fov) (-> *camera-combiner* fov)) - (set! (-> self velocity quad) (-> *camera-combiner* velocity quad)) + (vector-copy! (-> self velocity) (-> *camera-combiner* velocity)) ) (else (vector-reset! (-> self trans)) @@ -1159,8 +1159,8 @@ (let ((s3-1 (new 'stack-no-clear 'vector))) (curve-length (-> self spline-curve)) (if arg3 - (set! (-> s3-1 quad) (-> self tracking follow-pt quad)) - (set! (-> s3-1 quad) (-> *camera* tpos-curr-adj quad)) + (vector-copy! s3-1 (-> self tracking follow-pt)) + (vector-copy! s3-1 (-> *camera* tpos-curr-adj)) ) (let ((f0-22 (curve-closest-point (-> self spline-curve) s3-1 (-> self spline-tt) 40960.0 10 (-> self spline-follow-dist)) @@ -1232,7 +1232,7 @@ (update! (-> arg0 underwater-blend) 0.0) ) (else - (set! (-> arg0 old-cam-trans quad) (-> arg1 quad)) + (vector-copy! (-> arg0 old-cam-trans) arg1) (jump-to-target! (-> arg0 tilt-adjust) 0.0) (jump-to-target! (-> arg0 point-of-interest-blend) 0.0) (jump-to-target! (-> arg0 underwater-blend) 0.0) @@ -1240,7 +1240,7 @@ ) (set! (-> arg0 follow-height-extra target) (-> *camera* settings extra-follow-height)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> arg0 follow-pt quad)) + (vector-copy! s4-0 (-> arg0 follow-pt)) (cond ((logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) (let ((s1-0 (new 'stack-no-clear 'vector)) @@ -1287,7 +1287,7 @@ (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s2-0) ) (else - (set! (-> arg0 follow-off quad) (-> s2-0 quad)) + (vector-copy! (-> arg0 follow-off) s2-0) ) ) ) @@ -1355,7 +1355,7 @@ ) ) (else - (set! (-> arg0 follow-off quad) (-> s2-1 quad)) + (vector-copy! (-> arg0 follow-off) s2-1) (jump-to-target! (-> arg0 follow-height-extra) 0.0) ) ) @@ -1388,7 +1388,7 @@ (vector-! (-> arg0 follow-off) (-> arg0 follow-off) (-> *camera* tpos-curr-adj)) ) ) - (set! (-> arg0 old-cam-trans quad) (-> arg1 quad)) + (vector-copy! (-> arg0 old-cam-trans) arg1) (-> arg0 follow-pt) ) ) @@ -1397,11 +1397,7 @@ (let ((s4-0 (new-stack-vector0))) 0.0 0.0 - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (vector-negate! s4-0 arg1) (vector-flatten! s4-0 s4-0 (-> arg0 fvec)) (vector-normalize! s4-0 1.0) @@ -1497,11 +1493,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (let ((s3-0 (new-stack-vector0)) (s2-0 (new-stack-vector0)) ) @@ -1845,8 +1837,8 @@ ) ) (else - (set! (-> s0-0 quad) (-> arg1 quad)) - (set! (-> sv-160 quad) (-> arg2 quad)) + (vector-copy! s0-0 arg1) + (vector-copy! sv-160 arg2) (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) @@ -1916,11 +1908,7 @@ (f30-0 1.0) ) 0.0 - (let ((s0-0 (new 'stack-no-clear 'matrix))) - (set! (-> s0-0 rvec quad) (the-as uint128 0)) - (set! (-> s0-0 uvec quad) (the-as uint128 0)) - (set! (-> s0-0 fvec quad) (the-as uint128 0)) - (set! (-> s0-0 trans quad) (the-as uint128 0)) + (let ((s0-0 (new-stack-matrix0))) (cond (arg3 (vector-flatten! s1-0 arg1 arg3) @@ -1936,8 +1924,8 @@ ) ) (else - (set! (-> s1-0 quad) (-> arg1 quad)) - (set! (-> sv-160 quad) (-> arg2 quad)) + (vector-copy! s1-0 arg1) + (vector-copy! sv-160 arg2) (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) diff --git a/goal_src/jak3/engine/camera/pov-camera.gc b/goal_src/jak3/engine/camera/pov-camera.gc index ddbb0085660..a4b8cff8726 100644 --- a/goal_src/jak3/engine/camera/pov-camera.gc +++ b/goal_src/jak3/engine/camera/pov-camera.gc @@ -188,7 +188,7 @@ (set-time! (-> self debounce-start-time)) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (when (and (logtest? (-> self flags) (pov-camera-flag inherit-orientation)) arg4) (let ((v1-22 (if (type? arg4 process-drawable) arg4 @@ -326,7 +326,7 @@ (format #t "ERROR: othercam parent invalid~%") (deactivate self) ) - (set! (-> *camera-other-root* quad) (-> (the-as process-drawable s2-0) root trans quad)) + (vector-copy! *camera-other-root* (-> (the-as process-drawable s2-0) root trans)) (let ((s4-0 (-> (the-as process-drawable s2-0) node-list data (-> self cam-joint-index) bone transform)) (s3-0 (-> (the-as process-drawable s2-0) node-list data (-> self cam-joint-index) bone scale)) (gp-0 (new 'stack-no-clear 'vector)) @@ -349,10 +349,10 @@ (s1-0 (when (not (-> self had-valid-frame)) (set! (-> self had-valid-frame) #t) - (set! (-> self old-pos quad) (-> s5-0 quad)) - (set! (-> self old-mat-z quad) (-> gp-0 quad)) + (vector-copy! (-> self old-pos) s5-0) + (vector-copy! (-> self old-mat-z) gp-0) ) - (set! (-> *camera-other-trans* quad) (-> s5-0 quad)) + (vector-copy! *camera-other-trans* s5-0) (vector-normalize-copy! (-> *camera-other-matrix* rvec) (-> s4-0 rvec) -1.0) (set! (-> *camera-other-matrix* rvec w) 0.0) (vector-normalize-copy! (-> *camera-other-matrix* uvec) (-> s4-0 uvec) 1.0) @@ -362,8 +362,8 @@ (vector-reset! (-> *camera-other-matrix* trans)) (set! (-> self fov) (othercam-calc (-> s3-0 x))) (set! *camera-look-through-other* 2) - (set! (-> self old-pos quad) (-> s5-0 quad)) - (set! (-> self old-mat-z quad) (-> gp-0 quad)) + (vector-copy! (-> self old-pos) s5-0) + (vector-copy! (-> self old-mat-z) gp-0) ) ) ) diff --git a/goal_src/jak3/engine/collide/collide-debug.gc b/goal_src/jak3/engine/collide/collide-debug.gc index 51c6bac1d87..61f605b4641 100644 --- a/goal_src/jak3/engine/collide/collide-debug.gc +++ b/goal_src/jak3/engine/collide/collide-debug.gc @@ -68,7 +68,7 @@ ;; WARN: Return type mismatch symbol vs none. (defun col-rend-draw ((arg0 col-rend) (arg1 col-rend-filter)) (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 rvec quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! (-> s4-0 rvec) (-> (math-camera-matrix) fvec)) (vector-normalize! (-> s4-0 rvec) 1.0) (let ((s3-1 (the-as collide-cache-tri (-> *collide-cache* tris)))) (countdown (s2-0 (-> *collide-cache* num-tris)) @@ -174,7 +174,7 @@ (let ((v1-0 (-> this track))) (cond ((zero? v1-0) - (set! (-> this bbox-center quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this bbox-center) (target-pos 0)) (+! (-> this bbox-center y) (* 0.7 f30-0)) ) ((= v1-0 1) @@ -190,7 +190,7 @@ (set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0)) (set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0)) (set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0)) - (set! (-> s5-0 bbox max quad) (-> this bbox-center quad)) + (vector-copy! (-> s5-0 bbox max) (-> this bbox-center)) (+! (-> s5-0 bbox max x) f30-0) (+! (-> s5-0 bbox max y) f30-0) (+! (-> s5-0 bbox max z) f30-0) diff --git a/goal_src/jak3/engine/collide/collide-edge-grab.gc b/goal_src/jak3/engine/collide/collide-edge-grab.gc index 917ff6f5500..679632d15bb 100644 --- a/goal_src/jak3/engine/collide/collide-edge-grab.gc +++ b/goal_src/jak3/engine/collide/collide-edge-grab.gc @@ -60,9 +60,9 @@ (when (nonzero? (-> s5-0 num-tris)) (find-grabbable-edges s5-0) (when (nonzero? (-> s5-0 num-edges)) - (set! (-> s5-0 search-pt quad) (-> this control midpoint-of-hands quad)) + (vector-copy! (-> s5-0 search-pt) (-> this control midpoint-of-hands)) (when (!= (-> *cpad-list* cpads (-> this control cpad number) stick0-speed) 0.0) - (set! (-> s5-0 search-dir-vec quad) (-> this control to-target-pt-xz quad)) + (vector-copy! (-> s5-0 search-dir-vec) (-> this control to-target-pt-xz)) (search-for-edges s5-0 (-> s5-0 hold-list)) (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) (set! (-> *edge-grab-info* found-edge?) #t) @@ -186,15 +186,16 @@ ) ) (set! (-> arg1 tri-vertex 0 quad) (-> s1-0 vertex 0 quad)) - (set! (-> arg1 world-vertex 4 quad) (-> s1-0 vertex 1 quad)) - (set! (-> arg1 world-vertex 5 quad) (-> s1-0 vertex 2 quad)) + (vector-copy! (-> arg1 world-vertex 4) (-> s1-0 vertex 1)) + (vector-copy! (-> arg1 world-vertex 5) (-> s1-0 vertex 2)) (set! (-> arg1 edge-tri-pat) (-> s1-0 pat)) - (set! (-> arg1 center-hold quad) (-> arg0 center-pt quad)) + (vector-copy! (-> arg1 center-hold) (-> arg0 center-pt)) (set! (-> arg1 world-vertex 0 quad) (-> s2-0 vertex-ptr 0 0 quad)) - (set! (-> arg1 world-vertex 1 quad) (-> s2-0 vertex-ptr 1 0 quad)) - (set! (-> arg1 hanging-matrix uvec quad) - (-> (the-as collide-shape-moving (-> this process 0 root)) dynam gravity-normal quad) - ) + (vector-copy! (-> arg1 world-vertex 1) (-> s2-0 vertex-ptr 1 0)) + (vector-copy! + (-> arg1 hanging-matrix uvec) + (-> (the-as collide-shape-moving (-> this process 0 root)) dynam gravity-normal) + ) (vector-normalize! (vector-! (-> arg1 hanging-matrix fvec) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) 1.0 @@ -212,7 +213,7 @@ (the-as vector (-> arg1 hanging-matrix)) (-> arg1 hanging-matrix uvec) ) - (set! (-> arg1 hanging-matrix trans quad) (-> arg1 center-hold quad)) + (vector-copy! (-> arg1 hanging-matrix trans) (-> arg1 center-hold)) (transform-vectors! (-> arg1 hanging-matrix) (-> this world-player-spheres) @@ -287,9 +288,7 @@ (dotimes (s2-0 6) ((method-of-type sphere new) (the-as symbol (-> s5-0 s2-0)) sphere) ) - (set! (-> s4-0 uvec quad) - (-> (the-as collide-shape-moving (-> arg0 process 0 root)) dynam gravity-normal quad) - ) + (vector-copy! (-> s4-0 uvec) (-> (the-as collide-shape-moving (-> arg0 process 0 root)) dynam gravity-normal)) (vector-normalize! (vector-! (-> s4-0 fvec) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) 1.0) (vector-normalize! (vector-cross! (-> s4-0 rvec) (-> s4-0 fvec) (-> s4-0 uvec)) 1.0) (vector-cross! (-> s4-0 fvec) (-> s4-0 rvec) (-> s4-0 uvec)) @@ -336,7 +335,7 @@ ) (set! (-> s5-0 left-dot) f30-0) (set! (-> s5-0 found-left?) #t) - (set! (-> arg1 adjacent-edge-left-vertex quad) (-> s1-0 vertex-ptr 0 0 quad)) + (vector-copy! (-> arg1 adjacent-edge-left-vertex) (-> s1-0 vertex-ptr 0 0)) 0 ) ) @@ -352,7 +351,7 @@ ) (set! (-> s5-0 right-dot) f30-1) (set! (-> s5-0 found-right?) #t) - (set! (-> arg1 adjacent-edge-right-vertex quad) (-> s1-0 vertex-ptr 1 0 quad)) + (vector-copy! (-> arg1 adjacent-edge-right-vertex) (-> s1-0 vertex-ptr 1 0)) 0 ) ) @@ -392,7 +391,7 @@ (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-4 vertex-ptr 0 0) (-> v1-4 vertex-ptr 1 0) s2-0))) (when (or (< f30-0 0.0) (< f0-0 f30-0)) (set! f30-0 f0-0) - (set! (-> arg0 quad) (-> s2-0 quad)) + (vector-copy! arg0 s2-0) ) ) ) @@ -620,7 +619,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s2-0 #t) ) - (set! (-> s3-0 quad) (-> *target* control midpoint-of-hands quad)) + (vector-copy! s3-0 (-> *target* control midpoint-of-hands)) (while s4-0 (+! s5-0 1) (set! (-> s3-0 y) (-> s4-0 center-pt y)) diff --git a/goal_src/jak3/engine/collide/collide-shape-h.gc b/goal_src/jak3/engine/collide/collide-shape-h.gc index 80f512e4429..ba70c18acfd 100644 --- a/goal_src/jak3/engine/collide/collide-shape-h.gc +++ b/goal_src/jak3/engine/collide/collide-shape-h.gc @@ -531,7 +531,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (defmethod new collide-shape-moving ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) (let ((v0-0 ((method-of-type collide-shape new) allocation type-to-make arg0 arg1))) (set! (-> (the-as collide-shape-moving v0-0) gspot-pos y) -40959590.0) - (set! (-> (the-as collide-shape-moving v0-0) gspot-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> (the-as collide-shape-moving v0-0) gspot-normal) *y-vector*) (set! (-> (the-as collide-shape-moving v0-0) surf) *standard-ground-surface*) (the-as collide-shape-moving v0-0) ) diff --git a/goal_src/jak3/engine/collide/collide-shape-rider.gc b/goal_src/jak3/engine/collide/collide-shape-rider.gc index a44f183413f..5334b9292c5 100644 --- a/goal_src/jak3/engine/collide/collide-shape-rider.gc +++ b/goal_src/jak3/engine/collide/collide-shape-rider.gc @@ -361,7 +361,7 @@ (let ((s2-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> gp-0 trans quad)) + (vector-copy! s3-0 (-> gp-0 trans)) (vector-! s2-0 (-> arg0 rider-dest) s3-0) (cond ((logtest? (-> this root-prim prim-core action) (collide-action pull-rider-can-collide)) @@ -378,7 +378,7 @@ (set! (-> this root-prim prim-core collide-as) s1-0) ) (let ((s1-1 (new 'stack-no-clear 'vector))) - (set! (-> s1-1 quad) (-> s2-0 quad)) + (vector-copy! s1-1 s2-0) (let ((v1-19 s1-1)) (.lvf vf1 (&-> s1-1 quad)) (let ((f0-2 (-> pp clock frames-per-second))) diff --git a/goal_src/jak3/engine/collide/collide-shape.gc b/goal_src/jak3/engine/collide/collide-shape.gc index 949e38493b9..611ead993b3 100644 --- a/goal_src/jak3/engine/collide/collide-shape.gc +++ b/goal_src/jak3/engine/collide/collide-shape.gc @@ -653,7 +653,7 @@ ) (and (= (-> s1-0 best-other-tri pat event) (pat-event none)) (< 0.7 (-> s1-0 best-other-tri normal y))) ) - (set! (-> arg1 quad) (-> s1-0 best-other-tri intersect quad)) + (vector-copy! arg1 (-> s1-0 best-other-tri intersect)) (set! sv-560 (+ sv-560 1)) (if (>= sv-560 2) (return arg1) @@ -937,7 +937,7 @@ ) (defun collide-shape-moving-angle-set! ((arg0 collide-shape-moving) (arg1 vector) (arg2 vector)) - (set! (-> arg0 surface-normal quad) (-> arg1 quad)) + (vector-copy! (-> arg0 surface-normal) arg1) (set! (-> arg0 surface-angle) (vector-dot arg1 (-> arg0 dynam gravity-normal))) (set! (-> arg0 poly-angle) (vector-dot (-> arg0 poly-normal) (-> arg0 dynam gravity-normal))) (set! (-> arg0 touch-angle) @@ -965,7 +965,7 @@ ((and (= (-> arg1 best-dist) 0.0) (< (vector-length sv-48) (+ -40.96 (-> arg1 best-my-prim prim-core world-sphere w))) ) - (set! (-> sv-48 quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! sv-48 (-> arg1 best-other-tri normal)) (set! (-> arg0 coverage) 0.0) ) (else @@ -985,7 +985,7 @@ (if (= (-> arg1 best-dist) 0.0) (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-52 6.0)) ) - (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! (-> arg0 poly-normal) (-> arg1 best-other-tri normal)) (collide-shape-moving-angle-set! arg0 sv-52 arg2) (if (< (-> arg0 poly-angle) -0.2) (set! sv-56 (logior sv-56 (collide-status touch-ceiling))) @@ -1002,12 +1002,12 @@ ) (else (set! sv-56 (logior sv-56 (collide-status on-surface))) - (set! (-> arg0 local-normal quad) (-> sv-52 quad)) + (vector-copy! (-> arg0 local-normal) sv-52) ) ) (when (and (not sv-96) (>= (-> arg0 coverage) 0.9)) (set! sv-56 (logior sv-56 (collide-status on-ground))) - (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) + (vector-copy! (-> arg0 ground-poly-normal) (-> arg0 poly-normal)) (when (!= (-> arg0 poly-pat mode) (pat-mode wall)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) (set! (-> arg0 ground-touch-point quad) (-> arg1 best-other-tri intersect quad)) @@ -1025,7 +1025,7 @@ (defun cshape-reaction-default ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) (cshape-reaction-update-state arg0 arg1 arg3) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> arg3 quad)) + (vector-copy! a1-1 arg3) (when (and (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) (not (logtest? (-> arg0 status) (collide-status touch-wall))) ) @@ -1080,7 +1080,7 @@ (s2-0 (new 'stack-no-clear 'vector)) ) (vector-float*! s2-0 arg1 (* arg2 (seconds-per-frame))) - (set! (-> s5-0 move-dist quad) (-> s2-0 quad)) + (vector-copy! (-> s5-0 move-dist) s2-0) (set! (-> s5-0 best-dist) -100000000.0) (set! (-> s5-0 best-my-prim) #f) (set! (-> s5-0 best-other-prim) #f) @@ -1105,7 +1105,7 @@ ((>= f30-0 0.0) (let ((s2-1 (new 'stack-no-clear 'vector))) (if *display-collision-marks* - (set! (-> s2-1 quad) (-> arg1 quad)) + (vector-copy! s2-1 arg1) ) (set! (-> this prev-status) ((-> this reaction) (the-as control-info this) s5-0 arg0 arg1)) (when *display-collision-marks* @@ -1154,7 +1154,7 @@ ((-> this no-reaction) this s5-0 arg0 arg1) (set! (-> this prev-status) (collide-status)) (move-by-vector! this s2-0) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) 1.0 ) ) @@ -1213,9 +1213,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-13 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-13 quad)) - (set! (-> this surface-normal quad) (-> v1-13 quad)) - (set! (-> this poly-normal quad) (-> v1-13 quad)) + (vector-copy! (-> this local-normal) v1-13) + (vector-copy! (-> this surface-normal) v1-13) + (vector-copy! (-> this poly-normal) v1-13) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -1270,29 +1270,29 @@ (let ((s2-0 (-> this max-iteration-count)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (let ((s4-0 (-> this status))) (let ((t9-4 (method-of-type collide-shape-moving integrate-and-collide!))) (t9-4 this a1-8) ) (set! (-> this max-iteration-count) s2-0) - (set! (-> arg0 quad) (-> s3-0 quad)) + (vector-copy! arg0 s3-0) (logior! (-> this status) s4-0) ) ) ) ) (let ((s3-1 (new-stack-vector0))) - (set! (-> s3-1 quad) (-> arg0 quad)) + (vector-copy! s3-1 arg0) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> arg0 quad)) + (vector-copy! s4-1 arg0) (let ((t9-5 (method-of-type collide-shape-moving integrate-and-collide!))) (t9-5 this s3-1) ) (let ((s1-0 (new-stack-vector0))) - (set! (-> s1-0 quad) (-> s4-1 quad)) + (vector-copy! s1-0 s4-1) (let ((s2-1 (new-stack-vector0))) - (set! (-> s2-1 quad) (-> s3-1 quad)) + (vector-copy! s2-1 s3-1) (let ((v1-32 (new-stack-vector0))) (let ((f0-6 (vector-dot (-> this dynam gravity-normal) s1-0))) 0.0 @@ -1354,13 +1354,13 @@ ) ) ) - (set! (-> arg0 quad) (-> s3-1 quad)) + (vector-copy! arg0 s3-1) (if (and (logtest? (-> this status) (collide-status on-surface)) (and (not (logtest? (-> this status) (collide-status touch-wall blocked))) (< (vector-length (-> this btransv)) (vector-length s4-1)) ) ) - (set! (-> this btransv quad) (-> s4-1 quad)) + (vector-copy! (-> this btransv) s4-1) ) ) ) @@ -1389,7 +1389,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> this trans quad)) + (vector-copy! gp-0 (-> this trans)) (vector-normalize-copy! (-> this trans) arg0 arg1) (vector+! (-> this trans) (-> this trans) gp-0) (update-transforms this) @@ -1424,9 +1424,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-13 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-13 quad)) - (set! (-> this surface-normal quad) (-> v1-13 quad)) - (set! (-> this poly-normal quad) (-> v1-13 quad)) + (vector-copy! (-> this local-normal) v1-13) + (vector-copy! (-> this surface-normal) v1-13) + (vector-copy! (-> this poly-normal) v1-13) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -1470,11 +1470,11 @@ (defmethod move-to-ground-point ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) (move-to-point! this arg0) (set! (-> arg1 y) 0.0) - (set! (-> this ground-touch-point quad) (-> arg0 quad)) - (set! (-> this poly-normal quad) (-> arg2 quad)) - (set! (-> this surface-normal quad) (-> arg2 quad)) - (set! (-> this local-normal quad) (-> arg2 quad)) - (set! (-> this ground-poly-normal quad) (-> arg2 quad)) + (vector-copy! (-> this ground-touch-point) arg0) + (vector-copy! (-> this poly-normal) arg2) + (vector-copy! (-> this surface-normal) arg2) + (vector-copy! (-> this local-normal) arg2) + (vector-copy! (-> this ground-poly-normal) arg2) (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) (set! (-> this ground-impact-vel) (- (vector-dot arg1 (-> this dynam gravity-normal)))) 0 @@ -1512,9 +1512,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-13 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-13 quad)) - (set! (-> this surface-normal quad) (-> v1-13 quad)) - (set! (-> this poly-normal quad) (-> v1-13 quad)) + (vector-copy! (-> this local-normal) v1-13) + (vector-copy! (-> this surface-normal) v1-13) + (vector-copy! (-> this poly-normal) v1-13) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -1555,8 +1555,8 @@ (arg4 float) (arg5 process) ) - (set! (-> this gspot-pos quad) (-> this trans quad)) - (set! (-> arg0 start-pos quad) (-> this trans quad)) + (vector-copy! (-> this gspot-pos) (-> this trans)) + (vector-copy! (-> arg0 start-pos) (-> this trans)) (vector-reset! (-> arg0 move-dist)) (let ((f0-0 (-> this transv y))) (if (< f0-0 0.0) @@ -1585,7 +1585,7 @@ ) (else (set! (-> this gspot-pos y) -40959590.0) - (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> this gspot-normal) *y-vector*) #f ) ) @@ -1600,7 +1600,7 @@ (arg4 float) (arg5 float) ) - (set! (-> arg0 start-pos quad) (-> arg1 quad)) + (vector-copy! (-> arg0 start-pos) arg1) (+! (-> arg0 start-pos y) arg3) (vector-reset! (-> arg0 move-dist)) (set! (-> arg0 move-dist y) (- (+ arg3 arg4))) @@ -1640,14 +1640,14 @@ ) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) - (set! (-> arg1 old-gspot-pos quad) (-> this gspot-pos quad)) - (set! (-> arg1 old-gspot-normal quad) (-> this gspot-normal quad)) + (vector-copy! (-> arg1 old-gspot-pos) (-> this gspot-pos)) + (vector-copy! (-> arg1 old-gspot-normal) (-> this gspot-normal)) (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) (set! (-> this trans-old-old quad) (-> this trans-old quad)) (set! (-> this trans-old quad) (-> this trans quad)) (set! (-> this prev-status) (-> this status)) (vector-v+! (-> this trans) (-> this trans) arg0) - (set! (-> arg1 new-pos quad) (-> this trans quad)) + (vector-copy! (-> arg1 new-pos) (-> this trans)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) (cond ((find-ground this s3-1 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0 (the-as process #f)) @@ -1666,7 +1666,7 @@ ) ) ) - (set! (-> this trans quad) (-> this trans-old quad)) + (vector-copy! (-> this trans) (-> this trans-old)) (move-to-point! this (-> arg1 new-pos)) (when (logtest? (logand (-> arg1 overlaps-params collide-with-filter) (collide-spec hit-by-player-list hit-by-others-list player-list) @@ -1677,8 +1677,8 @@ (when (-> arg1 dont-move-if-overlaps?) (set! (-> arg1 do-move?) #f) (move-to-point! this (-> this trans-old)) - (set! (-> this gspot-pos quad) (-> arg1 old-gspot-pos quad)) - (set! (-> this gspot-normal quad) (-> arg1 old-gspot-normal quad)) + (vector-copy! (-> this gspot-pos) (-> arg1 old-gspot-pos)) + (vector-copy! (-> this gspot-normal) (-> arg1 old-gspot-normal)) ) ) ) @@ -1689,11 +1689,11 @@ (a0-31 (-> this gspot-normal)) (v1-59 (-> arg1 pat)) ) - (set! (-> this ground-touch-point quad) (-> a1-8 quad)) - (set! (-> this poly-normal quad) (-> a0-31 quad)) - (set! (-> this surface-normal quad) (-> a0-31 quad)) - (set! (-> this local-normal quad) (-> a0-31 quad)) - (set! (-> this ground-poly-normal quad) (-> a0-31 quad)) + (vector-copy! (-> this ground-touch-point) a1-8) + (vector-copy! (-> this poly-normal) a0-31) + (vector-copy! (-> this surface-normal) a0-31) + (vector-copy! (-> this local-normal) a0-31) + (vector-copy! (-> this ground-poly-normal) a0-31) (set! (-> this poly-pat) v1-59) (set! (-> this cur-pat) v1-59) (set! (-> this ground-pat) v1-59) @@ -1720,9 +1720,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-69 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-69 quad)) - (set! (-> this surface-normal quad) (-> v1-69 quad)) - (set! (-> this poly-normal quad) (-> v1-69 quad)) + (vector-copy! (-> this local-normal) v1-69) + (vector-copy! (-> this surface-normal) v1-69) + (vector-copy! (-> this poly-normal) v1-69) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -1778,7 +1778,7 @@ (cond ((find-ground this s1-1 arg3 arg0 arg1 1024.0 (the-as process #f)) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> this trans quad)) + (vector-copy! a1-4 (-> this trans)) (set! (-> a1-4 y) (-> s1-1 best-other-tri intersect y)) (move-to-point! this a1-4) ) @@ -1786,11 +1786,11 @@ (a0-21 (-> s1-1 best-other-tri normal)) (v1-25 (-> s1-1 best-other-tri pat)) ) - (set! (-> this ground-touch-point quad) (-> a1-5 quad)) - (set! (-> this poly-normal quad) (-> a0-21 quad)) - (set! (-> this surface-normal quad) (-> a0-21 quad)) - (set! (-> this local-normal quad) (-> a0-21 quad)) - (set! (-> this ground-poly-normal quad) (-> a0-21 quad)) + (vector-copy! (-> this ground-touch-point) a1-5) + (vector-copy! (-> this poly-normal) a0-21) + (vector-copy! (-> this surface-normal) a0-21) + (vector-copy! (-> this local-normal) a0-21) + (vector-copy! (-> this ground-poly-normal) a0-21) (set! (-> this poly-pat) v1-25) (set! (-> this cur-pat) v1-25) (set! (-> this ground-pat) v1-25) @@ -1818,9 +1818,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-36 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-36 quad)) - (set! (-> this surface-normal quad) (-> v1-36 quad)) - (set! (-> this poly-normal quad) (-> v1-36 quad)) + (vector-copy! (-> this local-normal) v1-36) + (vector-copy! (-> this surface-normal) v1-36) + (vector-copy! (-> this poly-normal) v1-36) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -2193,7 +2193,7 @@ (defmethod move-to-point! ((this collide-shape) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this trans)) - (set! (-> this trans quad) (-> arg0 quad)) + (vector-copy! (-> this trans) arg0) (let ((a1-2 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (vector+! (the-as vector (-> a1-2 prim-core)) (the-as vector (-> a1-2 prim-core)) v1-0) @@ -2485,7 +2485,7 @@ (fill-cache-for-shape s1-0 8192.0 (-> gp-0 cquery)) (let ((s4-1 3)) (until (or (<= s4-1 0) (not (should-push-away this s1-0 (-> gp-0 cquery)))) - (set! (-> gp-0 vec33 quad) (-> s1-0 trans quad)) + (vector-copy! (-> gp-0 vec33) (-> s1-0 trans)) (let* ((f0-4 (+ 2867.2 (-> gp-0 vec33 y))) (f2-2 (+ 5734.4 f0-4)) (f1-11 (-> gp-0 cquery best-other-tri intersect y)) @@ -2979,12 +2979,12 @@ ) ) (let ((s2-1 (new 'stack-no-clear 'vector))) - (set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root transv quad)) + (vector-copy! s2-1 (-> (the-as process-focusable gp-0) root transv)) (let* ((v1-26 (-> (the-as process-focusable gp-0) root transv)) (f30-0 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) ) (if (= f30-0 0.0) - (set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat)) quad)) + (vector-copy! s2-1 (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat))) ) (vector-xz-normalize! s2-1 (fmax f30-0 arg4)) ) @@ -3031,7 +3031,7 @@ (let ((f0-3 (vector-vector-distance-squared s4-0 s1-0))) (when (or (< f30-0 0.0) (< f0-3 f30-0)) (set! f30-0 f0-3) - (set! (-> s5-0 quad) (-> s1-0 quad)) + (vector-copy! s5-0 s1-0) ) ) ) diff --git a/goal_src/jak3/engine/collide/collide-target-h.gc b/goal_src/jak3/engine/collide/collide-target-h.gc index d01e7183e50..ddff9401ac5 100644 --- a/goal_src/jak3/engine/collide/collide-target-h.gc +++ b/goal_src/jak3/engine/collide/collide-target-h.gc @@ -165,8 +165,8 @@ (unknown-float37 float :offset 5636) (unknown-vector37 vector :inline :offset 5648) (unknown-vector38 vector :inline :offset 5664) - (unknown-vector39 vector :inline :offset 5680) - (unknown-vector40 vector :inline :offset 5696) + (unknown-quat39 quaternion :inline :offset 5680) + (unknown-quat40 quaternion :inline :offset 5696) (sliding-start-time time-frame :offset 5712) (unknown-time-frame18 time-frame :offset 5720) (unknown-sound-id00 sound-id :offset 5776) diff --git a/goal_src/jak3/engine/collide/collide-touch.gc b/goal_src/jak3/engine/collide/collide-touch.gc index 592fd009f6a..9065fe1fa96 100644 --- a/goal_src/jak3/engine/collide/collide-touch.gc +++ b/goal_src/jak3/engine/collide/collide-touch.gc @@ -509,7 +509,7 @@ (when arg1 (let ((a0-2 (get-touched-tri arg1 arg2 arg3))) (if a0-2 - (set! (-> arg0 quad) (-> a0-2 intersect quad)) + (vector-copy! arg0 (-> a0-2 intersect)) (touching-prims-entry-method-9 arg1 arg0) ) ) diff --git a/goal_src/jak3/engine/collide/find-nearest.gc b/goal_src/jak3/engine/collide/find-nearest.gc index 5ade3c4703b..44db9fc63f0 100644 --- a/goal_src/jak3/engine/collide/find-nearest.gc +++ b/goal_src/jak3/engine/collide/find-nearest.gc @@ -66,16 +66,16 @@ (init-vf0-vector) (let ((gp-0 *search-info*)) (set! (-> gp-0 match) #f) - (set! (-> gp-0 point quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 point) arg1) (set! (-> gp-0 radius) arg2) (set! (-> gp-0 best) 1000000000000000000000.0) (set! (-> gp-0 rating) (search-info-flag)) (set! (-> gp-0 require) arg4) (set! (-> gp-0 mask) arg3) - (set! (-> gp-0 rot-base quad) (-> arg5 quad)) + (vector-copy! (-> gp-0 rot-base) arg5) (if arg6 - (set! (-> gp-0 back-point quad) (-> arg6 quad)) - (set! (-> gp-0 back-point quad) (-> gp-0 rot-base quad)) + (vector-copy! (-> gp-0 back-point) arg6) + (vector-copy! (-> gp-0 back-point) (-> gp-0 rot-base)) ) (set! arg7 (cond ((= arg7 65536.0) @@ -99,7 +99,7 @@ ) ) (when s3-0 - (let ((s1-0 (process-mask->search-info-flag (the-as process-focusable s3-0)))) + (let ((s1-0 (get-search-info-flag (the-as process-focusable s3-0)))) (when (and (and s3-0 (not (logtest? (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead)))) (logtest? s1-0 (search-info-flag crate guard attackable enemy attackable-priority high-priority)) ) @@ -245,7 +245,7 @@ ) (when (logtest? (search-info-flag probe) (-> gp-0 mask)) (let ((a1-13 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-13 start-pos quad) (-> gp-0 back-point quad)) + (vector-copy! (-> a1-13 start-pos) (-> gp-0 back-point)) (vector-! (-> a1-13 move-dist) s2-1 (-> gp-0 back-point)) (let ((v1-124 a1-13)) (set! (-> v1-124 radius) 1228.8) diff --git a/goal_src/jak3/engine/collide/los-control.gc b/goal_src/jak3/engine/collide/los-control.gc index a79959080d3..99760dee480 100644 --- a/goal_src/jak3/engine/collide/los-control.gc +++ b/goal_src/jak3/engine/collide/los-control.gc @@ -10,7 +10,7 @@ (define *los-time-offset* (the-as time-frame 0)) (defmethod los-control-method-13 ((this los-control) (arg0 collide-query) (arg1 vector) (arg2 int) (arg3 float)) - (set! (-> arg0 move-dist quad) (-> arg1 quad)) + (vector-copy! (-> arg0 move-dist) arg1) (vector-length-max! (-> arg0 move-dist) (-> this max-check-distance)) (set! (-> arg0 radius) arg3) (set! (-> arg0 collide-with) (the-as collide-spec (logand (the-as collide-spec arg2) (-> this collide-with)))) @@ -84,7 +84,7 @@ (if (not arg1) (set! arg1 (get-trans arg0 3)) ) - (set! (-> s0-2 start-pos quad) (-> sv-592 quad)) + (vector-copy! (-> s0-2 start-pos) sv-592) (set! (-> s0-2 ignore-process0) s1-0) (set! (-> s0-2 ignore-process1) (the-as process arg0)) (set! (-> s0-2 ignore-pat) (-> (the-as process-focusable s1-0) root pat-ignore-mask)) diff --git a/goal_src/jak3/engine/common-obs/airlock.gc b/goal_src/jak3/engine/common-obs/airlock.gc index cc2779338cc..dcb4ba2df93 100644 --- a/goal_src/jak3/engine/common-obs/airlock.gc +++ b/goal_src/jak3/engine/common-obs/airlock.gc @@ -391,7 +391,7 @@ (level-status (let ((a1-3 (car s5-1))) (while (not (null? s5-1)) - (let ((v1-4 (status-of-level-and-borrows *level* (the-as symbol a1-3) level-status))) + (let ((v1-4 (level-status? *level* (the-as symbol a1-3) level-status))) (case level-status (('display) (if (!= v1-4 'active) @@ -1024,6 +1024,7 @@ (defmethod init-from-entity! ((this com-airlock-outer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1082,6 +1083,7 @@ (defmethod init-from-entity! ((this com-airlock-inner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1156,6 +1158,7 @@ (defmethod init-from-entity! ((this cty-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1209,6 +1212,7 @@ (defmethod init-from-entity! ((this vin-door-ctyinda) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1263,6 +1267,7 @@ (defmethod init-from-entity! ((this com-airlock-outer-mhcity) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1326,6 +1331,7 @@ (defmethod init-from-entity! ((this hip-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/goal_src/jak3/engine/common-obs/base-plat.gc b/goal_src/jak3/engine/common-obs/base-plat.gc index 30a8d75aea6..63b8688a2c8 100644 --- a/goal_src/jak3/engine/common-obs/base-plat.gc +++ b/goal_src/jak3/engine/common-obs/base-plat.gc @@ -44,7 +44,7 @@ ) (defmethod init-bounce-params! ((this base-plat)) - (set! (-> this basetrans quad) (-> this root trans quad)) + (vector-copy! (-> this basetrans) (-> this root trans)) (set! (-> this bouncing) #f) (set! (-> this bounce-scale) 819.2) 0 @@ -88,7 +88,7 @@ (cond ((-> self bouncing) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self basetrans quad)) + (vector-copy! gp-0 (-> self basetrans)) (+! (-> gp-0 y) (* (-> self bounce-scale) (update! (-> self smush)))) (move-to-point! (-> self root) gp-0) ) @@ -119,7 +119,7 @@ (spawn (-> this part) (-> this root trans)) ) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -339,6 +339,7 @@ ) (defmethod init-from-entity! ((this eco-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) diff --git a/goal_src/jak3/engine/common-obs/basebutton.gc b/goal_src/jak3/engine/common-obs/basebutton.gc index 4306b570454..b0534377835 100644 --- a/goal_src/jak3/engine/common-obs/basebutton.gc +++ b/goal_src/jak3/engine/common-obs/basebutton.gc @@ -59,8 +59,8 @@ (defmethod move-to! ((this basebutton) (arg0 vector) (arg1 quaternion)) (logclear! (-> this button-status) (button-status button-status-2)) (if arg0 - (set! (-> this move-to-pos quad) (-> arg0 quad)) - (set! (-> this move-to-pos quad) (-> this root trans quad)) + (vector-copy! (-> this move-to-pos) arg0) + (vector-copy! (-> this move-to-pos) (-> this root trans)) ) (if arg1 (quaternion-copy! (-> this move-to-quat) arg1) @@ -122,7 +122,7 @@ :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) (logclear! (-> self button-status) (button-status button-status-2)) - (set! (-> self root trans quad) (-> self move-to-pos quad)) + (vector-copy! (-> self root trans) (-> self move-to-pos)) (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) @@ -162,7 +162,7 @@ :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) (logclear! (-> self button-status) (button-status button-status-2)) - (set! (-> self root trans quad) (-> self move-to-pos quad)) + (vector-copy! (-> self root trans) (-> self move-to-pos)) (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) @@ -208,7 +208,7 @@ :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) (logclear! (-> self button-status) (button-status button-status-2)) - (set! (-> self root trans quad) (-> self move-to-pos quad)) + (vector-copy! (-> self root trans) (-> self move-to-pos)) (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) @@ -243,7 +243,7 @@ :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) (logclear! (-> self button-status) (button-status button-status-2)) - (set! (-> self root trans quad) (-> self move-to-pos quad)) + (vector-copy! (-> self root trans) (-> self move-to-pos)) (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) @@ -387,6 +387,7 @@ ) (defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (init! this) (set! (-> this button-id) -1) @@ -441,7 +442,7 @@ (set! (-> self actor-group) (the-as (pointer actor-group) #f)) (set! (-> self actor-group-count) 0) (init-collision! self) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (quaternion-copy! (-> self root quat) arg2) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (prepare-trigger-event! self) diff --git a/goal_src/jak3/engine/common-obs/blocking-plane.gc b/goal_src/jak3/engine/common-obs/blocking-plane.gc index 18d1affbafa..2d1f6447cba 100644 --- a/goal_src/jak3/engine/common-obs/blocking-plane.gc +++ b/goal_src/jak3/engine/common-obs/blocking-plane.gc @@ -160,7 +160,7 @@ (set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH)) (set! (-> s2-1 scale y) (/ arg1 METER_LENGTH)) (set! (-> s2-1 scale z) 0.0) - (set! (-> s1-0 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-copy! (-> s1-0 uvec) (new 'static 'vector :y 1.0 :w 1.0)) (vector-cross! (-> s1-0 fvec) (-> s1-0 rvec) (-> s1-0 uvec)) (vector-normalize! (-> s1-0 fvec) 1.0) (matrix->quaternion (-> s2-1 quat) s1-0) @@ -199,6 +199,7 @@ ) (defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this current-attack-mode) #f) (let ((s5-0 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) diff --git a/goal_src/jak3/engine/common-obs/bouncer.gc b/goal_src/jak3/engine/common-obs/bouncer.gc index e6aaf502a10..2520d19bc9f 100644 --- a/goal_src/jak3/engine/common-obs/bouncer.gc +++ b/goal_src/jak3/engine/common-obs/bouncer.gc @@ -238,6 +238,7 @@ ) (defmethod init-from-entity! ((this bouncer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this mods) #f) (init-collision! this) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak3/engine/common-obs/collectables-part.gc b/goal_src/jak3/engine/common-obs/collectables-part.gc index 5350e7160a9..1d1ab780ec5 100644 --- a/goal_src/jak3/engine/common-obs/collectables-part.gc +++ b/goal_src/jak3/engine/common-obs/collectables-part.gc @@ -1984,7 +1984,7 @@ (let ((a0-1 (math-camera-matrix)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> a0-1 rvec quad)) + (vector-copy! s5-0 (-> a0-1 rvec)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (let ((a1-3 (matrix-fr-compose (new 'stack-no-clear 'matrix) *up-vector* s5-0)) diff --git a/goal_src/jak3/engine/common-obs/collectables.gc b/goal_src/jak3/engine/common-obs/collectables.gc index c0b2c851ef0..de31b64f034 100644 --- a/goal_src/jak3/engine/common-obs/collectables.gc +++ b/goal_src/jak3/engine/common-obs/collectables.gc @@ -159,8 +159,8 @@ ) (set! (-> this collect-timeout) (seconds 0.33)) (set-time! (-> this birth-time)) - (set! (-> this base quad) (-> this root trans quad)) - (set! (-> this old-base quad) (-> this root trans quad)) + (vector-copy! (-> this base) (-> this root trans)) + (vector-copy! (-> this old-base) (-> this root trans)) (set! (-> this pickup-handle) (the-as handle #f)) (case (-> this fact pickup-type) (((pickup-type eco-pill-green) @@ -317,8 +317,8 @@ (set! (-> self fact pickup-amount) f30-0) ) (set! (-> self fact options) (-> arg2 options)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root transv) arg1) (initialize-effects self (-> self fact pickup-type)) (set! (-> self notify) (the-as handle #f)) (case (-> self fact pickup-type) @@ -355,7 +355,7 @@ (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize-allocations this) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (initialize-effects this (-> this fact pickup-type)) (initialize-options this 0 1024.0 (the-as fact-info #f)) (update-transforms (-> this root)) @@ -466,7 +466,7 @@ (when (nonzero? (-> this collect-effect)) (cond ((logtest? (-> this collect-effect flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to s5-1 @@ -475,7 +475,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to s5-1 :group (-> this collect-effect) :callback part-tracker-track-target) ) ) @@ -483,7 +483,7 @@ (when (nonzero? (-> this collect-effect2)) (cond ((logtest? (-> this collect-effect2 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to this @@ -516,7 +516,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to this @@ -702,13 +702,13 @@ ) (cond ((= arg2 'trans) - (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self root trans) (the-as vector (-> arg3 param 0))) (update-transforms (-> self root)) (ja-post) ) ((= arg2 'jump) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self jump-pos) (the-as vector (-> arg3 param 0))) (go-virtual jump) ) ((= arg2 'pickup) @@ -862,8 +862,8 @@ ) ) ) - (set! (-> self root trans quad) (-> self jump-pos quad)) - (set! (-> self base quad) (-> self root trans quad)) + (vector-copy! (-> self root trans) (-> self jump-pos)) + (vector-copy! (-> self base) (-> self root trans)) (vector-reset! (-> self root transv)) (update-transforms (-> self root)) (logclear! (-> self flags) (collectable-flag bounce)) @@ -904,7 +904,7 @@ (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (set! (-> self base quad) (-> self root trans quad)) + (vector-copy! (-> self base) (-> self root trans)) (logclear! (-> self root root-prim prim-core action) (collide-action solid)) (set! (-> self root root-prim prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) (set! (-> self root root-prim prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) @@ -967,7 +967,7 @@ (if (and *target* (focus-test? *target* dead)) (go-virtual fade) ) - (set! (-> self root trans quad) (-> self base quad)) + (vector-copy! (-> self root trans) (-> self base)) (add-blue-motion #t #f #f #f) (update-transforms (-> self root)) (common-post self) @@ -1118,7 +1118,7 @@ ) :code (behavior ((arg0 handle)) (until #f - (set! (-> self root trans quad) (-> self base quad)) + (vector-copy! (-> self root trans) (-> self base)) (add-blue-motion #t #f #t #f) (update-transforms (-> self root)) (common-post self) @@ -1248,8 +1248,8 @@ ) ) ) - (set! (-> self base quad) (-> self old-base quad)) - (set! (-> self root trans quad) (-> self base quad)) + (vector-copy! (-> self base) (-> self old-base)) + (vector-copy! (-> self root trans) (-> self base)) (let ((v1-26 (-> self root root-prim))) (set! (-> v1-26 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-26 prim-core collide-with) (-> self root backup-collide-with)) @@ -1281,6 +1281,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) ) @@ -1291,6 +1292,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) ) @@ -1301,6 +1303,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) ) @@ -1311,6 +1314,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-green) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) ) @@ -1321,6 +1325,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this health) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) ) @@ -1359,6 +1364,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) ) @@ -1476,7 +1482,7 @@ :code (behavior ((arg0 handle)) (until #f (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) - (set! (-> self root trans quad) (-> self base quad)) + (vector-copy! (-> self root trans) (-> self base)) (add-blue-motion #t #t #t #f) (let ((f30-0 (-> self bob-amount))) (if (< 0.0 f30-0) @@ -1560,6 +1566,7 @@ ) (defmethod init-from-entity! ((this money) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (initialize-allocations this) (process-drawable-from-entity! this (-> this entity)) (initialize-options this 0 1024.0 (the-as fact-info #f)) @@ -1586,9 +1593,9 @@ ) ) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root transv) arg1) (initialize-options self (the-as int (cond @@ -1623,9 +1630,9 @@ ) ) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root transv) arg1) (initialize-options self 4500 0.0 (the-as fact-info #f)) (logior! (-> self flags) (collectable-flag no-eco-blue)) (update-transforms (-> self root)) @@ -1713,13 +1720,13 @@ (set! (-> gp-2 y) 0.0) (let ((f30-0 (vector-normalize-ret-len! gp-2 1.0))) (let ((a0-6 gp-2)) - (set! (-> a0-6 quad) (-> gp-2 quad)) + (vector-copy! a0-6 gp-2) (set! (-> a0-6 y) 0.0) (vector-normalize! a0-6 1.0) ) (vector-float*! gp-2 gp-2 (rand-vu-float-range (/ f30-0 4) (* 0.75 f30-0))) ) - (set! (-> self root transv quad) (-> gp-2 quad)) + (vector-copy! (-> self root transv) gp-2) ) (set! (-> self root transv y) 81920.0) ) @@ -2041,6 +2048,7 @@ ) (defmethod init-from-entity! ((this trick-point) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (initialize-allocations this) (process-drawable-from-entity! this (-> this entity)) (initialize-options this 0 1024.0 (the-as fact-info #f)) @@ -2210,8 +2218,8 @@ (set! (-> self fact pickup-amount) f30-0) ) (set! (-> self fact options) (-> arg2 options)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root transv) arg1) (initialize-effects self (-> self fact pickup-type)) (set! (-> self notify) (the-as handle #f)) (initialize-options self 4500 1024.0 arg2) @@ -2225,7 +2233,7 @@ (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize-allocations this) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (initialize-effects this (-> this fact pickup-type)) (initialize-options this 0 1024.0 (the-as fact-info #f)) (update-transforms (-> this root)) @@ -2274,8 +2282,8 @@ (set! (-> self fact pickup-amount) f30-0) ) (set! (-> self fact options) (-> arg2 options)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root transv) arg1) (initialize-effects self (-> self fact pickup-type)) (set! (-> self notify) (the-as handle #f)) (initialize-options @@ -2294,6 +2302,7 @@ ) (defmethod init-from-entity! ((this eco) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0))) (set! (-> this type) (cond ((= (the-as uint v1-1) 3) @@ -2893,7 +2902,7 @@ (return (the-as (pointer process) #f)) ) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) + (vector-copy! (-> s3-1 start-pos) (-> (the-as process-drawable (-> this process)) root trans)) (set-vector! (-> s3-1 move-dist) 0.0 -81920.0 0.0 1.0) (+! (-> s3-1 start-pos y) 12288.0) (let ((v1-33 s3-1)) @@ -2907,8 +2916,8 @@ (set! (-> v1-33 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) - (set! (-> s3-1 start-pos quad) (-> s3-1 best-other-tri intersect quad)) - (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) + (vector-copy! (-> s3-1 start-pos) (-> s3-1 best-other-tri intersect)) + (vector-copy! (-> s3-1 start-pos) (-> (the-as process-drawable (-> this process)) root trans)) ) (if (= sv-16 (pickup-type fuel-cell)) (+! (-> s3-1 start-pos y) 6144.0) diff --git a/goal_src/jak3/engine/common-obs/crates.gc b/goal_src/jak3/engine/common-obs/crates.gc index 10a3ea1d5ae..b9ffd040d7e 100644 --- a/goal_src/jak3/engine/common-obs/crates.gc +++ b/goal_src/jak3/engine/common-obs/crates.gc @@ -487,7 +487,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this crate)) +(defmethod get-search-info-flag ((this crate)) + "Get search-info-flag for this process." (the-as search-info-flag (if (logtest? (actor-option no-track) (-> this fact options)) 0 2 @@ -644,7 +645,7 @@ ) (('fall) (when (not (and (-> self next-state) (= (-> self next-state name) 'fall))) - (set! (-> self root transv quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self root transv) (the-as vector (-> arg3 param 0))) (go-virtual fall) ) ) @@ -714,7 +715,7 @@ (-> self carry) ) (('drop) - (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) + (vector-copy! (-> self root transv) (the-as vector (-> block param 1))) (go-virtual fall) ) ) @@ -759,7 +760,7 @@ (vector-reset! (-> self root transv)) (when (= (vector-length (-> self root transv)) 0.0) (set! (-> self root root-prim local-sphere w) (-> self carry backup-radius)) - (set! (-> self base quad) (-> self root trans quad)) + (vector-copy! (-> self base) (-> self root trans)) (let ((v1-16 (-> self root root-prim))) (set! (-> v1-16 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-16 prim-core collide-with) (-> self root backup-collide-with)) @@ -960,11 +961,11 @@ ((= v1-55 'darkeco) (cond ((logtest? (-> *part-group-id-table* 197 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 197)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 197)) ) ) @@ -972,21 +973,21 @@ ((or (= v1-55 'steel) (= v1-55 'iron)) (cond ((logtest? (-> *part-group-id-table* 196 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 196)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 196)) ) ) ) ((logtest? (-> *part-group-id-table* 195 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 195)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 195)) ) ) @@ -1104,7 +1105,7 @@ (defbehavior crate-init-by-other crate ((arg0 entity) (arg1 vector) (arg2 symbol) (arg3 fact-info-crate)) (process-entity-set! self arg0) (init! self (the-as entity-actor arg0)) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (set! (-> self look) arg2) (set! (-> self defense) arg2) (init-skel! self) @@ -1119,6 +1120,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this crate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init! this arg0) (init-skel! this) (set! (-> this draw light-index) (the-as uint 10)) @@ -1303,7 +1305,7 @@ ) ) ) - (set! (-> this base quad) (-> this root trans quad)) + (vector-copy! (-> this base) (-> this root trans)) (crate-post) (nav-mesh-connect-from-ent this) (none) diff --git a/goal_src/jak3/engine/common-obs/debris.gc b/goal_src/jak3/engine/common-obs/debris.gc index 5b68a6a6093..88b6f67d5aa 100644 --- a/goal_src/jak3/engine/common-obs/debris.gc +++ b/goal_src/jak3/engine/common-obs/debris.gc @@ -204,7 +204,7 @@ (let ((f0-9 (* (-> s1-0 gravity) (seconds-per-frame))) (s0-0 (new 'stack-no-clear 'quaternion)) ) - (set! (-> s1-0 prev-pos quad) (-> s1-0 root trans quad)) + (vector-copy! (-> s1-0 prev-pos) (-> s1-0 root trans)) (+! (-> s1-0 transv y) f0-9) (vector-v+! (the-as vector (-> s1-0 root)) (the-as vector (-> s1-0 root)) (-> s1-0 transv)) (quaternion-vector-angle! s0-0 (-> s1-0 rot-axis) (* (-> s1-0 rot-angle) (seconds-per-frame))) @@ -215,7 +215,7 @@ (when (nonzero? (-> s1-0 params collide-spec)) (let ((s0-1 (new 'stack-no-clear 'vector))) (vector-! (-> cquery move-dist) (the-as vector (-> s1-0 root)) (-> s1-0 prev-pos)) - (set! (-> cquery start-pos quad) (-> s1-0 prev-pos quad)) + (vector-copy! (-> cquery start-pos) (-> s1-0 prev-pos)) (let ((v1-34 cquery)) (set! (-> v1-34 radius) 2048.0) (set! (-> v1-34 collide-with) (-> s1-0 params collide-spec)) @@ -431,7 +431,7 @@ (let ((joint-transform (-> pdraw node-list data (-> params joints i parent-joint-index) bone transform))) (matrix->quaternion (-> debris root quat) joint-transform) (matrix->trans joint-transform (the-as vector (-> debris root))) - (set! (-> debris root scale quad) (-> pdraw root scale quad)) + (vector-copy! (-> debris root scale) (-> pdraw root scale)) (if (nonzero? (-> params joints i offset)) (vector-matrix*! (the-as vector (-> debris root)) (-> params joints i offset) joint-transform) ) @@ -478,7 +478,7 @@ (let ((s0-5 (new 'stack-no-clear 'vector))) (rand-vu-sphere-point-uniform! s0-5 1.0) (vector-normalize! s0-5 1.0) - (set! (-> debris rot-axis quad) (-> s0-5 quad)) + (vector-copy! (-> debris rot-axis) s0-5) ) (set! (-> debris rot-angle) (* 182.04445 (-> tuning rot-speed))) (set! (-> debris duration) (the float (-> tuning duration))) @@ -494,7 +494,7 @@ ) ) (set! (-> debris draw) draw) - (set! (-> draw skeleton bones 0 transform trans quad) (-> *null-vector* quad)) + (vector-copy! (-> draw skeleton bones 0 transform trans) *null-vector*) ) ) (else diff --git a/goal_src/jak3/engine/common-obs/elevator.gc b/goal_src/jak3/engine/common-obs/elevator.gc index e5fd2e5e3c6..e62ab98be9e 100644 --- a/goal_src/jak3/engine/common-obs/elevator.gc +++ b/goal_src/jak3/engine/common-obs/elevator.gc @@ -123,7 +123,7 @@ (let ((s4-0 (-> gp-0 control collision-spheres 0)) (s5-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s5-0 start-pos quad) (-> s4-0 prim-core world-sphere quad)) + (vector-copy! (-> s5-0 start-pos) (-> s4-0 prim-core world-sphere)) (+! (-> s5-0 start-pos y) 8192.0) (set! (-> s5-0 start-pos w) 1.0) (vector-reset! (-> s5-0 move-dist)) @@ -150,6 +150,7 @@ (none) ) +;; WARN: Return type mismatch object vs none. (defmethod toggle-fence-collision ((this elevator) (arg0 symbol)) (when (and (logtest? (-> this params flags) (elevator-flags fence)) (nonzero? (-> this fence-prim-index))) (let ((v1-7 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child (-> this fence-prim-index)))) @@ -725,7 +726,7 @@ (f0-9 (+ f30-0 (* (ease-value-in-out (-> self path-pos) 0.08) (- f28-0 f30-0)))) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self basetrans quad)) + (vector-copy! gp-0 (-> self basetrans)) (get-point-in-path! (-> self path) (-> self basetrans) f0-9 'interp) (set! (-> self speed) (* (- (-> self basetrans y) (-> gp-0 y)) (-> self clock frames-per-second))) ) @@ -855,6 +856,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this elevator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-32 float) (sv-36 path-control) (sv-40 target)) (stack-size-set! (-> this main-thread) 1024) (set! (-> this sound-running-loop) #f) diff --git a/goal_src/jak3/engine/common-obs/enemy-states.gc b/goal_src/jak3/engine/common-obs/enemy-states.gc index db1a23ffe50..abc86314634 100644 --- a/goal_src/jak3/engine/common-obs/enemy-states.gc +++ b/goal_src/jak3/engine/common-obs/enemy-states.gc @@ -72,7 +72,7 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (set! (-> self draw origin quad) (-> self root trans quad)) + (vector-copy! (-> self draw origin) (-> self root trans)) (if (logtest? (enemy-flag directed) (-> self enemy-flags)) (logior! (-> self enemy-flags) (enemy-flag directed-ready)) ) @@ -99,7 +99,7 @@ :trans (behavior () (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0)) (if (logtest? (enemy-option ambush) (-> self fact enemy-options)) - (go-ambush-delay self) + (go-ambush self) (go-virtual active) ) ) @@ -218,10 +218,10 @@ (let ((gp-1 (-> self focus aware))) (when (logtest? (-> self enemy-flags) (enemy-flag alert)) (cond - ((and (= gp-1 (enemy-aware ea3)) (get-focus! self)) + ((and (= gp-1 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) - ((= gp-1 (enemy-aware ea4)) + ((= gp-1 (enemy-aware flee)) (go-flee self) ) (else @@ -248,7 +248,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post enemy-simple-post ) @@ -281,7 +281,7 @@ ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) (go-stare self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -318,10 +318,10 @@ ((>= 1 (the-as int gp-0)) (go-virtual active) ) - ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + ((and (= gp-0 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -365,7 +365,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post enemy-simple-post ) @@ -381,7 +381,7 @@ ) :trans (behavior () (when (time-elapsed? (-> self state-time) (-> self reaction-time)) - (if (!= (-> self focus aware) (enemy-aware ea4)) + (if (!= (-> self focus aware) (enemy-aware flee)) (go-stare self) ) ) @@ -427,17 +427,17 @@ (init-jump-info! self gp-0) (if (and (-> self enemy-info use-jump-blocked) (logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags)) - (enemy-method-91 self gp-0) + (check-jump-blocked? self gp-0) ) (go-virtual jump-blocked) ) (when (logtest? (-> gp-0 flags) (enemy-jump-flags ejf0)) (until #f - (if (jump-anim-handler self s5-0 gp-0) + (if (jump-anim-handler self (the-as jump-stage s5-0) gp-0) (goto cfg-12) ) - (in-jump-handler self s5-0 gp-0) - (enemy-method-101 self s5-0 gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-0) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-0) gp-0) (suspend) (set! s5-0 1) ) @@ -448,11 +448,11 @@ (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) (let ((s5-1 2)) (logior! (-> self focus-status) (focus-status in-air)) - (until (on-ground? self gp-0) + (until (landed-jump-yet? self gp-0) (+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter))) - (jump-anim-handler self s5-1 gp-0) - (in-jump-handler self s5-1 gp-0) - (enemy-method-101 self s5-1 gp-0) + (jump-anim-handler self (the-as jump-stage s5-1) gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-1) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-1) gp-0) (suspend) (set! s5-1 3) ) @@ -461,11 +461,11 @@ (move-to-gspot! self) (let ((s5-2 4)) (until #f - (if (jump-anim-handler self s5-2 gp-0) + (if (jump-anim-handler self (the-as jump-stage s5-2) gp-0) (goto cfg-19) ) - (in-jump-handler self s5-2 gp-0) - (enemy-method-101 self s5-2 gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-2) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-2) gp-0) (suspend) (set! s5-2 5) ) @@ -476,7 +476,7 @@ (if (logtest? (enemy-flag directed) (-> self enemy-flags)) ((lambda :behavior enemy () (send-event (ppointer->process (-> self parent)) 'child-jumped))) ) - (go-directed2 self) + (go-next-state-auto self) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) @@ -500,7 +500,7 @@ (when (time-elapsed? (-> self state-time) (seconds 0.5)) (if (logtest? (enemy-flag directed) (-> self enemy-flags)) (go-virtual jump) - (go-directed2 self) + (go-next-state-auto self) ) ) ) @@ -610,7 +610,7 @@ (if (logtest? (enemy-option knocked-into-water) (-> self fact enemy-options)) (logior! (-> self enemy-flags) (enemy-flag check-water)) ) - (if (and (enemy-method-123 self) (-> self enemy-info ragdoll-info)) + (if (and (allow-ragdoll? self) (-> self enemy-info ragdoll-info)) (set! (-> self root transv y) 0.0) ) (let ((v1-43 (-> self root))) @@ -633,9 +633,9 @@ ) (when (not (logtest? (-> v1-43 root-prim prim-core action) (collide-action no-normal-reset))) (let ((a0-25 (-> v1-43 dynam gravity-normal))) - (set! (-> v1-43 local-normal quad) (-> a0-25 quad)) - (set! (-> v1-43 surface-normal quad) (-> a0-25 quad)) - (set! (-> v1-43 poly-normal quad) (-> a0-25 quad)) + (vector-copy! (-> v1-43 local-normal) a0-25) + (vector-copy! (-> v1-43 surface-normal) a0-25) + (vector-copy! (-> v1-43 poly-normal) a0-25) ) (set! (-> v1-43 coverage) 0.0) (set! (-> v1-43 touch-angle) 0.0) @@ -654,8 +654,8 @@ (logclear! (-> self enemy-flags) (enemy-flag trackable)) ) (set! (-> self root penetrate-using) (penetrate lunge vehicle knocked)) - (reset-penetrate! self) - (enemy-method-50 self 1) + (reset-penetrate-later! self) + (update-collision-action self 1) (ragdoll-spawn! self #t #f) ) :exit (behavior () @@ -672,12 +672,12 @@ (suspend-for (seconds 0.2) ) (until (ragdoll-settled? self) - (if (or (time-elapsed? (-> self state-time) (seconds 4)) (enemy-method-109 self)) + (if (or (time-elapsed? (-> self state-time) (seconds 4)) (out-of-bounds? self)) (go-die self) ) (suspend) ) - (if (within-gspot-range? self) + (if (invalid-height? self) (go-die self) ) ) @@ -687,7 +687,7 @@ (set! (-> gp-1 anim-speed) (rnd-float-range self 0.9 1.1)) (set! (-> gp-1 on-surface-count) 0) (set! (-> gp-1 move-count) 0) - (until (enemy-method-88 self gp-1) + (until (done-being-knocked? self gp-1) (if (time-elapsed? (-> self state-time) (seconds 2)) (go-die self) ) @@ -712,7 +712,7 @@ (suspend) (+! (-> gp-1 move-count) 1) (set! s5-1 3) - (if (enemy-method-88 self gp-1) + (if (done-being-knocked? self gp-1) (set-time! (-> gp-1 land-can-land-time)) ) ) @@ -720,8 +720,8 @@ #f (label cfg-33) (if (and (not (logtest? (enemy-flag death-start) (-> self enemy-flags))) - (or (within-gspot-range? self) - (enemy-method-109 self) + (or (invalid-height? self) + (out-of-bounds? self) (time-elapsed? (-> gp-1 land-can-land-time) (-> self enemy-info knocked-can-land-timeout)) ) ) @@ -792,7 +792,7 @@ (set! (-> self root penetrate-using) (the-as penetrate (logclear (-> self root penetrate-using) (penetrate knocked))) ) - (enemy-method-50 self 2) + (update-collision-action self 2) (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -825,9 +825,7 @@ :trans (behavior () (if (and (time-elapsed? (-> self state-time) (seconds 0.01)) (and (not (handle->process (-> self ragdoll-proc))) - (or (within-gspot-range? self) - (time-elapsed? (-> self state-time) (-> self enemy-info knocked-recover-timeout)) - ) + (or (invalid-height? self) (time-elapsed? (-> self state-time) (-> self enemy-info knocked-recover-timeout))) ) ) (go-die self) @@ -858,7 +856,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -867,7 +865,7 @@ (when (not (handle->process (-> self ragdoll-proc))) (let ((gp-0 (-> self root))) (if (focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 (new 'stack-no-clear 'vector) (-> self enemy-info slip-factor)) @@ -888,12 +886,12 @@ (a1-5 (new 'stack-no-clear 'collide-query)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> gp-1 gspot-pos quad)) + (vector-copy! s5-1 (-> gp-1 gspot-pos)) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> gp-1 gspot-normal quad)) + (vector-copy! s4-1 (-> gp-1 gspot-normal)) (when (not (find-ground gp-1 a1-5 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f))) - (set! (-> gp-1 gspot-pos quad) (-> s5-1 quad)) - (set! (-> gp-1 gspot-normal quad) (-> s4-1 quad)) + (vector-copy! (-> gp-1 gspot-pos) s5-1) + (vector-copy! (-> gp-1 gspot-normal) s4-1) ) ) ) @@ -1314,7 +1312,7 @@ (set! (-> self root transv quad) (the-as uint128 0)) (gun-dark-2-ragdoll-start self) (let* ((s4-1 self) - (s1-0 (method-of-object s4-1 get-incoming-attack!)) + (s1-0 (method-of-object s4-1 handle-incoming-attack!)) (s0-0 proc) ) (set! sv-112 block) @@ -1331,7 +1329,7 @@ ) ) ) - (damage-enemy! self proc block) + (damage-enemy-from-attack! self proc block) (set! (-> self incoming penetrate-using) (penetrate vehicle)) (set! (-> self incoming knocked-type) (knocked-type vehicle)) (set! (-> self incoming attack-direction quad) (the-as uint128 0)) @@ -1352,7 +1350,7 @@ (else (when (!= (-> (the-as attack-info s5-0) id) (-> self incoming attack-id)) (let* ((s2-1 self) - (s1-1 (method-of-object s2-1 get-incoming-attack!)) + (s1-1 (method-of-object s2-1 handle-incoming-attack!)) (s0-1 proc) ) (set! sv-128 block) @@ -1491,8 +1489,8 @@ (let ((s3-0 (new 'stack 'collide-query)) (gp-2 (vector-float*! (new 'stack-no-clear 'vector) (-> self root transv) (seconds-per-frame))) ) - (set! (-> s3-0 start-pos quad) (-> (get-trans self 3) quad)) - (set! (-> s3-0 move-dist quad) (-> gp-2 quad)) + (vector-copy! (-> s3-0 start-pos) (get-trans self 3)) + (vector-copy! (-> s3-0 move-dist) gp-2) (let ((v1-26 s3-0)) (set! (-> v1-26 radius) (* 0.7 (-> self root root-prim prim-core world-sphere w))) (set! (-> v1-26 collide-with) @@ -1515,8 +1513,8 @@ (v1-31 (-> s3-0 best-other-tri)) (f28-0 0.9) ) - (set! (-> s5-1 quad) (-> v1-31 normal quad)) - (set! (-> s4-0 quad) (-> v1-31 intersect quad)) + (vector-copy! s5-1 (-> v1-31 normal)) + (vector-copy! s4-0 (-> v1-31 intersect)) (let ((v1-32 (and (-> v1-31 collide-ptr) (let ((s2-0 (-> v1-31 collide-ptr))) (if (type? s2-0 collide-shape-prim-sphere) s2-0 @@ -1528,7 +1526,7 @@ (when v1-32 (let ((s2-1 (-> (the-as collide-shape-prim-sphere v1-32) cshape process))) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> self root transv quad)) + (vector-copy! s1-0 (-> self root transv)) (let* ((s0-0 s2-1) (v1-37 (if (type? s0-0 process-focusable) s0-0 diff --git a/goal_src/jak3/engine/common-obs/generic-obs.gc b/goal_src/jak3/engine/common-obs/generic-obs.gc index 286a7f33257..8eae8b1164d 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs.gc @@ -140,7 +140,7 @@ ) (if a0-7 (move-to-point! (the-as collide-shape a0-7) (-> (the-as process-drawable gp-0) root trans)) - (set! (-> self root trans quad) (-> (the-as process-drawable gp-0) root trans quad)) + (vector-copy! (-> self root trans) (-> (the-as process-drawable gp-0) root trans)) ) ) (quaternion-copy! (-> self root quat) (-> (the-as process-drawable gp-0) root quat)) @@ -226,7 +226,7 @@ ) ) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (let ((f30-0 (lerp-scale -0.1 -0.05 (-> this speed) 8192.0 20480.0)) (f0-6 (lerp-scale 0.7 1.0 (-> this speed) 8192.0 20480.0)) ) @@ -290,7 +290,9 @@ (swingpole-method-22 self) (suspend) ) - (suspend-for (seconds 0.5) (swingpole-method-22 self)) + (suspend-for (seconds 0.5) + (swingpole-method-22 self) + ) (go-virtual idle) ) ) @@ -320,10 +322,11 @@ ) (defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." "Copy defaults from the entity." (stack-size-set! (-> this main-thread) 128) (init-collision! this) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (quaternion-copy! (-> this root quat) (-> arg0 quat)) (vector-identity! (-> this root scale)) (vector-y-quaternion! (-> this dir) (-> this root quat)) @@ -380,7 +383,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (vector-copy! (-> self root trans) (-> (the-as process-drawable (-> self parent 0)) root trans)) (quaternion-identity! (-> self root quat)) (vector-identity! (-> self root scale)) (set! (-> self joint-track) arg0) @@ -395,6 +398,7 @@ ) (defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." "Copy defaults from the entity." (process-entity-status! this (entity-perm-status dead) #t) (go (method-of-object this die)) @@ -565,7 +569,7 @@ (s3-0 (new 'stack-no-clear 'collide-query)) (f28-0 122880.0) ) - (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) + (vector-copy! (-> s3-0 start-pos) s4-1) (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) (let ((v1-91 s3-0)) (set! (-> v1-91 radius) 1638.4) @@ -898,7 +902,7 @@ (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self old-grab-pos)) ) ) - (set! (-> self old-grab-pos quad) (-> gp-1 quad)) + (vector-copy! (-> self old-grab-pos) gp-1) ) ) ) @@ -1061,7 +1065,7 @@ (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) ) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self arg2 (the-as pair 0)) (if (type? (-> self root) collide-shape) (update-transforms (-> self root)) @@ -1221,11 +1225,11 @@ (nonzero? (-> (the-as process-drawable v1-15) node-list)) ) (spawn-from-cspace (-> self part) (-> (the-as process-drawable v1-15) node-list data (-> self target-joint))) - (set! (-> self root trans quad) (-> self part origin trans quad)) + (vector-copy! (-> self root trans) (-> self part origin trans)) ) (else (let ((a0-11 (-> self root trans))) - (set! (-> self mat trans quad) (-> a0-11 quad)) + (vector-copy! (-> self mat trans) a0-11) ) (spawn-from-mat (-> self part) (-> self mat)) ) @@ -1302,11 +1306,11 @@ (-> self subsampler) (-> (the-as process-drawable v1-15) node-list data (-> self target-joint) bone transform) ) - (set! (-> self root trans quad) (-> self subsampler spawn-mat trans quad)) + (vector-copy! (-> self root trans) (-> self subsampler spawn-mat trans)) ) (else (let ((a0-11 (-> self root trans))) - (set! (-> self mat trans quad) (-> a0-11 quad)) + (vector-copy! (-> self mat trans) a0-11) ) (init-with-mat! (-> self subsampler) (-> self mat)) ) @@ -1334,39 +1338,17 @@ (set! (-> self target-joint) (the-as int arg5)) ) ((logtest? (-> arg0 flags) (sp-group-flag sp5)) - (let* ((s1-1 (-> self mat)) - (a2-1 (math-camera-matrix)) - (v1-18 (-> a2-1 rvec quad)) - (a0-10 (-> a2-1 uvec quad)) - (a1-2 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> s1-1 rvec quad) v1-18) - (set! (-> s1-1 uvec quad) a0-10) - (set! (-> s1-1 fvec quad) a1-2) - (set! (-> s1-1 trans quad) a2-2) - ) - (set! (-> self mat trans quad) (-> (the-as matrix arg5) trans quad)) - (set! (-> self offset quad) (-> self mat trans quad)) + (matrix-copy! (-> self mat) (math-camera-matrix)) + (vector-copy! (-> self mat trans) (-> (the-as matrix arg5) trans)) + (vector-copy! (-> self offset) (-> self mat trans)) ) (else - (let* ((v1-21 (-> self mat)) - (a3-1 (the-as matrix arg5)) - (a0-15 (-> a3-1 rvec quad)) - (a1-3 (-> a3-1 uvec quad)) - (a2-3 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-21 rvec quad) a0-15) - (set! (-> v1-21 uvec quad) a1-3) - (set! (-> v1-21 fvec quad) a2-3) - (set! (-> v1-21 trans quad) a3-2) - ) - (set! (-> self offset quad) (-> self mat trans quad)) + (matrix-copy! (-> self mat) (the-as matrix arg5)) + (vector-copy! (-> self offset) (-> self mat trans)) ) ) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> self mat trans quad)) + (vector-copy! (-> self root trans) (-> self mat trans)) (if (zero? arg0) (go process-drawable-art-error "null group") ) @@ -1506,7 +1488,7 @@ ) (v0-1 (-> arg0 root trans)) ) - (set! (-> v0-1 quad) (-> v1-2 quad)) + (vector-copy! v0-1 v1-2) v0-1 ) ) @@ -1605,7 +1587,7 @@ (let ((a0-26 (-> this lightning)) (v1-44 (-> this offset1)) ) - (set! (-> a0-26 state meet data (+ (-> a0-26 state points-to-draw) -1) quad) (-> v1-44 quad)) + (vector-copy! (-> a0-26 state meet data (+ (-> a0-26 state points-to-draw) -1)) v1-44) ) ) ) @@ -1616,14 +1598,14 @@ (let ((gp-1 (-> this lightning)) (v1-51 (get-trans a0-22 3)) ) - (set! (-> gp-1 state meet data (+ (-> gp-1 state points-to-draw) -1) quad) (-> v1-51 quad)) + (vector-copy! (-> gp-1 state meet data (+ (-> gp-1 state points-to-draw) -1)) v1-51) ) ) (else (let ((s5-4 (-> this lightning)) (v1-54 (vector<-cspace! (new 'stack-no-clear 'vector) (-> a0-22 node-list data (-> this target-joint1)))) ) - (set! (-> s5-4 state meet data (+ (-> s5-4 state points-to-draw) -1) quad) (-> v1-54 quad)) + (vector-copy! (-> s5-4 state meet data (+ (-> s5-4 state points-to-draw) -1)) v1-54) ) ) ) @@ -1673,7 +1655,7 @@ (let ((gp-1 (-> self lightning spec sound))) (when gp-1 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> self offset1 quad)) + (vector-copy! s5-1 (-> self offset1)) (when (and (>= (-> self target-joint1) 0) (< (-> self target-joint1) 256)) (let* ((s4-0 (handle->process (-> self target1))) (v1-28 (if (type? s4-0 process-drawable) @@ -1682,9 +1664,10 @@ ) ) (if (and v1-28 (nonzero? (-> v1-28 root))) - (set! (-> s5-1 quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-28 node-list data (-> self target-joint1))) quad) - ) + (vector-copy! + s5-1 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-28 node-list data (-> self target-joint1))) + ) ) ) ) @@ -1997,6 +1980,7 @@ ) (defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (res-lump-struct arg0 'art-name structure)) (s3-0 (res-lump-struct (-> this entity) 'level structure)) @@ -2085,6 +2069,7 @@ ) (defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 string)) (stack-size-set! (-> this main-thread) 64) (logior! (-> this mask) (process-mask ambient)) @@ -2092,7 +2077,7 @@ (+! (-> *display* part-clock ref-count) 1) (set! (-> this clock) (-> *display* part-clock)) (set! (-> this root) (new 'process 'trsqv)) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (quaternion-copy! (-> this root quat) (-> arg0 quat)) (vector-identity! (-> this root scale)) (set! (-> this radius) 12288.0) @@ -2429,22 +2414,18 @@ (defbehavior cam-launcher-joystick camera-slave () (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (let ((gp-0 (vector-reset! (new 'stack-no-clear 'vector)))) - (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) - (f0-1 (* -546.13336 f0-0)) - (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) - ) - (matrix-axis-angle! s5-0 (-> *camera* local-down) f0-3) + (let ((s5-0 (new-stack-matrix0)) + (gp-0 (vector-reset! (new 'stack-no-clear 'vector))) ) - (vector-! gp-0 (-> self trans) (-> *camera* tpos-curr)) - (vector-matrix*! gp-0 gp-0 s5-0) - (vector+! (-> self trans) gp-0 (-> *camera* tpos-curr)) + (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) + (f0-1 (* -546.13336 f0-0)) + (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) + ) + (matrix-axis-angle! s5-0 (-> *camera* local-down) f0-3) ) + (vector-! gp-0 (-> self trans) (-> *camera* tpos-curr)) + (vector-matrix*! gp-0 gp-0 s5-0) + (vector+! (-> self trans) gp-0 (-> *camera* tpos-curr)) ) ) ) @@ -2466,7 +2447,7 @@ (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) (vector-flatten! gp-0 (-> self tracking inv-mat fvec) (-> *camera* local-down)) (vector-normalize! gp-0 1.0) - (set! (-> self pivot-pt quad) (-> gp-0 quad)) + (vector-copy! (-> self pivot-pt) gp-0) (vector+float*! gp-0 gp-0 (-> *camera* local-down) 1000.0) (vector-normalize-copy! (-> self tracking inv-mat fvec) gp-0 1.0) ) @@ -2504,11 +2485,7 @@ (defbehavior cam-launcher-long-joystick camera-slave () (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) + (let ((gp-0 (new-stack-matrix0))) (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) (f0-1 (* -546.13336 f0-0)) (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) @@ -2722,6 +2699,7 @@ ) (defmethod init-from-entity! ((this launcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -2803,7 +2781,7 @@ ) (set! (-> self root) s2-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (set-vector! (-> self root quat) 0.0 0.0 0.0 1.0) (update-transforms (the-as collide-shape (-> self root))) @@ -2930,9 +2908,10 @@ ) ) (if a0-6 - (set! (-> (the-as collide-shape (-> self root)) trans quad) - (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad) - ) + (vector-copy! + (-> (the-as collide-shape (-> self root)) trans) + (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere) + ) ) ) ) @@ -2994,7 +2973,7 @@ (set! (-> s4-0 event-self) 'touched) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self duration) arg2) (set! (-> self target) (the-as handle #f)) (set! (-> self event) #f) @@ -3031,7 +3010,7 @@ (set! (-> self root) s5-0) ) (set! (-> (the-as collide-shape (-> self root)) event-self) 'touched) - (set! (-> self root trans quad) (-> arg0 spawn-point quad)) + (vector-copy! (-> self root trans) (-> arg0 spawn-point)) (quaternion-copy! (-> self root quat) (-> arg0 spawn-quat)) (vector-identity! (-> self root scale)) (vector-float*! (-> self root scale) (-> self root scale) (-> arg0 scale)) @@ -3144,9 +3123,10 @@ (case message (('touched) (let ((s4-0 (new 'stack-no-clear 'mystery-cquery-type0))) - (set! (-> s4-0 explosion-trans quad) - (-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere quad) - ) + (vector-copy! + (-> s4-0 explosion-trans) + (-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere) + ) (let* ((s2-0 proc) (s3-0 (if (type? s2-0 process-drawable) s2-0 @@ -3163,7 +3143,7 @@ ) (cond (v1-6 - (set! (-> s4-0 proc-trans quad) (-> v1-6 prim-core world-sphere quad)) + (vector-copy! (-> s4-0 proc-trans) (-> v1-6 prim-core world-sphere)) ) ((begin (let ((s2-2 proc)) @@ -3174,7 +3154,7 @@ ) a0-13 ) - (set! (-> s4-0 proc-trans quad) (-> (get-trans (the-as process-focusable a0-13) 3) quad)) + (vector-copy! (-> s4-0 proc-trans) (get-trans (the-as process-focusable a0-13) 3)) ) (else (let* ((s2-4 (-> (the-as process-focusable s3-0) root)) @@ -3184,8 +3164,8 @@ ) ) (if v1-12 - (set! (-> s4-0 proc-trans quad) (-> v1-12 root-prim prim-core world-sphere quad)) - (set! (-> s4-0 proc-trans quad) (-> (the-as process-focusable s3-0) root trans quad)) + (vector-copy! (-> s4-0 proc-trans) (-> v1-12 root-prim prim-core world-sphere)) + (vector-copy! (-> s4-0 proc-trans) (-> (the-as process-focusable s3-0) root trans)) ) ) ) @@ -3195,7 +3175,7 @@ (set! (-> s4-0 dist) (fmax 0.0 (- (-> s4-0 dist) (-> s4-0 proc-trans w)))) (set! (-> s4-0 probe) -1.0) (when (< 0.0 (-> s4-0 dist)) - (set! (-> s4-0 cquery start-pos quad) (-> s4-0 explosion-trans quad)) + (vector-copy! (-> s4-0 cquery start-pos) (-> s4-0 explosion-trans)) (vector-! (-> s4-0 cquery move-dist) (-> s4-0 proc-trans) (-> s4-0 explosion-trans)) (let ((v1-23 (-> s4-0 cquery))) (set! (-> v1-23 radius) 40.96) @@ -3318,6 +3298,7 @@ (defmethod init-from-entity! ((this simple-prim) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (allocate-trans-and-strip! this) (process-entity-set! this arg0) (process-drawable-from-entity! this arg0) @@ -3360,8 +3341,8 @@ (defbehavior simple-prim-init-by-other simple-prim ((arg0 vector) (arg1 vector) (arg2 texture-id)) (allocate-trans-and-strip! self) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root scale quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root scale) arg1) (set! (-> self strip tex-id) arg2) (go-virtual active) ) @@ -3415,7 +3396,7 @@ (let ((v1-8 (-> this strip data))) (vector+! s4-0 (-> this root trans) s2-0) (vector+! s4-0 s4-0 s3-0) - (set! (-> v1-8 0 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-8 0 pos) s4-0) (set! (-> v1-8 0 stq z) 0.0) (set! (-> v1-8 0 stq x) 0.0) (set! (-> v1-8 0 stq y) 0.0) @@ -3424,7 +3405,7 @@ (let ((v1-9 (-> v1-8 1))) (vector+float*! s4-0 (-> this root trans) s2-0 -1.0) (vector+! s4-0 s4-0 s3-0) - (set! (-> v1-9 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-9 pos) s4-0) (set! (-> v1-9 stq z) 0.0) (set! (-> v1-9 stq x) 1.0) (set! (-> v1-9 stq y) 0.0) @@ -3433,7 +3414,7 @@ (let ((v1-10 (&+ v1-9 32))) (vector+! s4-0 (-> this root trans) s2-0) (vector+float*! s4-0 s4-0 s3-0 -1.0) - (set! (-> v1-10 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-10 pos) s4-0) (set! (-> v1-10 stq z) 0.0) (set! (-> v1-10 stq x) 0.0) (set! (-> v1-10 stq y) 1.0) @@ -3442,7 +3423,7 @@ (let ((v1-11 (&+ v1-10 32))) (vector+float*! s4-0 (-> this root trans) s2-0 -1.0) (vector+float*! s4-0 s4-0 s3-0 -1.0) - (set! (-> v1-11 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-11 pos) s4-0) (set! (-> v1-11 stq z) 0.0) (set! (-> v1-11 stq x) 1.0) (set! (-> v1-11 stq y) 1.0) @@ -3618,6 +3599,7 @@ ) (defmethod init-from-entity! ((this part-controller) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag) (sv-32 string)) (stack-size-set! (-> this main-thread) 32) (set! sv-16 (new 'static 'res-tag)) @@ -3712,7 +3694,7 @@ (sound-play-by-name (-> self spawn-sound) (new-sound-id) 1024 0 0 (sound-group) gp-1) (cond ((logtest? (-> self particle-launchers (-> self current-part-index) 0 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -3720,7 +3702,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* @@ -3751,6 +3733,7 @@ (defmethod init-from-entity! ((this sound-controller) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (let ((a0-3 (the-as string ((method-of-type res-lump get-property-struct) arg0 @@ -3766,7 +3749,7 @@ ) (set! (-> this spawn-sound) (string->sound-name a0-3)) ) - (set! (-> this pos quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this pos) (-> arg0 extra trans)) (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) (let ((v1-5 0)) (if #f @@ -3859,6 +3842,7 @@ ) (defmethod init-from-entity! ((this sound-on-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -3936,7 +3920,7 @@ (gp-1 (new 'stack-no-clear 'vector)) ) (get-point-at-percent-along-path! (-> self path) gp-1 f0-0 'interp) - (set! (-> self root trans quad) (-> gp-1 quad)) + (vector-copy! (-> self root trans) gp-1) (cond ((-> self is-spooling?) (case (get-status *gui-control* (the-as sound-id (-> self loop-sound))) @@ -3978,19 +3962,22 @@ (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 450.0 0) (set-setting! 'entity-name (res-lump-struct (-> self entity) 'camera-name structure) 0.0 0) - (suspend-for (-> self pause-time)) + (suspend-for (-> self pause-time) + ) (if (-> self blur) (set-setting! 'blur-a 'abs 0.5 0) ) (remove-setting! 'mode-name) (remove-setting! 'entity-name) (remove-setting! 'interp-time) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (while (not (process-release? *target*)) (suspend) ) (remove-setting! 'interp-time) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (remove-setting! 'blur-a) (process-entity-status! self (entity-perm-status no-kill) #f) ) @@ -4015,6 +4002,7 @@ (defmethod init-from-entity! ((this level-exit) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this minimap) #f) diff --git a/goal_src/jak3/engine/common-obs/guard-projectile.gc b/goal_src/jak3/engine/common-obs/guard-projectile.gc index ff84924366d..3af3ceba570 100644 --- a/goal_src/jak3/engine/common-obs/guard-projectile.gc +++ b/goal_src/jak3/engine/common-obs/guard-projectile.gc @@ -327,7 +327,7 @@ (a1-4 (-> *part-id-table* 855)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -377,7 +377,7 @@ (f28-1 (-> *part-id-table* 853 init-specs 4 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 853 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 853 init-specs 4 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 853) s4-1 :origin-is-matrix #t) @@ -395,27 +395,27 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) (v1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-1 quad) (-> s5-0 trans quad)) + (vector-copy! v1-1 (-> s5-0 trans)) (vector+! v1-1 v1-1 a0-3) (cond ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) ) ) ) ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) ) ) @@ -575,7 +575,7 @@ (defmethod init-proj-settings! ((this guard-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'guard-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) guard-shot-move) @@ -607,8 +607,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) diff --git a/goal_src/jak3/engine/common-obs/metalhead-projectile.gc b/goal_src/jak3/engine/common-obs/metalhead-projectile.gc index 5201d11fdd5..97bfab60bfb 100644 --- a/goal_src/jak3/engine/common-obs/metalhead-projectile.gc +++ b/goal_src/jak3/engine/common-obs/metalhead-projectile.gc @@ -323,7 +323,7 @@ (a1-4 (-> *part-id-table* 867)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -372,7 +372,7 @@ (f28-1 (-> *part-id-table* 865 init-specs 5 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 865 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 865 init-specs 5 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 865) s4-1 :origin-is-matrix #t) @@ -390,15 +390,15 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector-copy! v1-2 (-> gp-0 trans)) (vector+! v1-2 v1-2 a0-3) (cond ((logtest? (-> *part-group-id-table* 214 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 214)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 214)) ) ) @@ -511,7 +511,7 @@ ) (defmethod init-proj-settings! ((this metalhead-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'metalhead-shot) (set! (-> this max-speed) 532480.0) (set! (-> this move) metalhead-shot-move) @@ -540,7 +540,7 @@ (set! (-> gp-0 attack-id) a2-12) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) (the-as (pointer metalhead-shot) (spawn-projectile metalhead-shot gp-0 arg0 *default-dead-pool*)) @@ -639,11 +639,11 @@ (defmethod projectile-method-26 ((this metalhead-grenade-shot)) (cond ((logtest? (-> *part-group-id-table* 104 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 104)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 104)) ) ) @@ -693,7 +693,7 @@ (a1-3 (new 'stack 'collide-query)) ) 0.0 - (set! (-> a1-3 start-pos quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> a1-3 start-pos) (-> self root root-prim prim-core world-sphere)) (vector-! (-> a1-3 move-dist) (the-as vector (-> s4-1 root-prim prim-core)) (-> a1-3 start-pos)) (let ((v1-6 a1-3)) (set! (-> v1-6 radius) 40.96) @@ -876,7 +876,7 @@ (set! (-> gp-0 attack-id) a2-12) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) (the-as (pointer metalhead-grenade-shot) (spawn-projectile metalhead-shot gp-0 arg0 *default-dead-pool*)) diff --git a/goal_src/jak3/engine/common-obs/particle-curves.gc b/goal_src/jak3/engine/common-obs/particle-curves.gc index c35c297a209..bf31c89777c 100644 --- a/goal_src/jak3/engine/common-obs/particle-curves.gc +++ b/goal_src/jak3/engine/common-obs/particle-curves.gc @@ -162,7 +162,7 @@ (set! (-> a3-0 y) 40960.0) (set! (-> a3-0 z) 0.0) (set! (-> a3-0 w) 1.0) - (set! (-> v1-1 quad) (-> a3-0 quad)) + (vector-copy! v1-1 a3-0) ) (t9-0 a0-0 a1-0 a2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) diff --git a/goal_src/jak3/engine/common-obs/plat.gc b/goal_src/jak3/engine/common-obs/plat.gc index 080a65f68e4..5eedf9c7a7c 100644 --- a/goal_src/jak3/engine/common-obs/plat.gc +++ b/goal_src/jak3/engine/common-obs/plat.gc @@ -134,6 +134,7 @@ ) (defmethod init-from-entity! ((this plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logior! (-> this mask) (process-mask platform)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -235,13 +236,13 @@ ) ) ) - (set! (-> self hit-point quad) (-> self root trans quad)) + (vector-copy! (-> self hit-point) (-> self root trans)) (let ((a0-13 (if (type? proc process-focusable) proc ) ) ) - (set! (-> self hit-point quad) (-> (get-trans (the-as process-focusable a0-13) 0) quad)) + (vector-copy! (-> self hit-point) (get-trans (the-as process-focusable a0-13) 0)) ) (if (zero? (-> self bounce-time)) (start-bounce! self) diff --git a/goal_src/jak3/engine/common-obs/powerups.gc b/goal_src/jak3/engine/common-obs/powerups.gc index ab925e655e1..6373b472572 100644 --- a/goal_src/jak3/engine/common-obs/powerups.gc +++ b/goal_src/jak3/engine/common-obs/powerups.gc @@ -20,8 +20,7 @@ (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (suspend-for - (+ arg3 arg4) + (suspend-for (+ arg3 arg4) (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) (if v1-8 (deactivate self) @@ -47,8 +46,7 @@ #f ) (else - (suspend-for - arg5 + (suspend-for arg5 (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) (arg2 a0-21) ) @@ -550,9 +548,7 @@ ) (s2-0 *launch-matrix*) ) - (set! (-> s2-0 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-0)) quad) - ) + (vector-copy! (-> s2-0 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-0))) (gp-1 s5-0 s4-0 s2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (dotimes (gp-2 2) @@ -562,9 +558,7 @@ (s3-1 (-> *part-id-table* 800)) (s1-1 *launch-matrix*) ) - (set! (-> s1-1 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-58)) quad) - ) + (vector-copy! (-> s1-1 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-58))) (s5-1 s4-1 s3-1 s1-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -592,9 +586,7 @@ ) (s2-2 *launch-matrix*) ) - (set! (-> s2-2 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-2)) quad) - ) + (vector-copy! (-> s2-2 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-2))) (gp-3 s5-2 s4-2 s2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (dotimes (gp-4 2) @@ -604,9 +596,7 @@ (s3-3 (-> *part-id-table* 804)) (s1-3 *launch-matrix*) ) - (set! (-> s1-3 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-91)) quad) - ) + (vector-copy! (-> s1-3 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-91))) (s5-3 s4-3 s3-3 s1-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -653,9 +643,7 @@ (s4-7 (-> *part-id-table* 789)) (s2-7 *launch-matrix*) ) - (set! (-> s2-7 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-128)) quad) - ) + (vector-copy! (-> s2-7 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-128))) (gp-7 s5-7 s4-7 s2-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1)) @@ -673,9 +661,7 @@ ) (s2-8 *launch-matrix*) ) - (set! (-> s2-8 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-6)) quad) - ) + (vector-copy! (-> s2-8 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-6))) (gp-8 s5-8 s4-8 s2-8 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (dotimes (gp-9 2) @@ -685,9 +671,7 @@ (s3-9 (-> *part-id-table* 808)) (s1-7 *launch-matrix*) ) - (set! (-> s1-7 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-152)) quad) - ) + (vector-copy! (-> s1-7 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-152))) (s5-9 s4-9 s3-9 s1-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) diff --git a/goal_src/jak3/engine/common-obs/projectile.gc b/goal_src/jak3/engine/common-obs/projectile.gc index 04f22f5bee9..e7876e89657 100644 --- a/goal_src/jak3/engine/common-obs/projectile.gc +++ b/goal_src/jak3/engine/common-obs/projectile.gc @@ -193,7 +193,7 @@ (let ((gp-0 (-> arg0 root))) (let ((a1-0 (new 'stack-no-clear 'collide-query))) (let ((a2-0 (-> gp-0 root-prim))) - (set! (-> a1-0 start-pos quad) (-> gp-0 trans quad)) + (vector-copy! (-> a1-0 start-pos) (-> gp-0 trans)) (let ((v1-1 (-> a1-0 move-dist))) (.lvf vf1 (&-> (-> gp-0 transv) quad)) (let ((f0-0 (seconds-per-frame))) @@ -300,9 +300,9 @@ ) ) (let ((gp-0 (-> self root))) - (set! (-> self pre-move-transv quad) (-> gp-0 transv quad)) + (vector-copy! (-> self pre-move-transv) (-> gp-0 transv)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ((-> self move) self) (projectile-method-39 self) (set! (-> self old-dist (-> self old-dist-count)) (* 0.0625 (vector-vector-distance s5-0 (-> gp-0 trans)))) @@ -471,7 +471,7 @@ (set! (-> self pick-target) #f) (set! (-> self stop-speed) 204.8) (set! (-> self desired-target) (-> arg0 target-handle)) - (set! (-> self desired-target-pos quad) (-> arg0 target-pos quad)) + (vector-copy! (-> self desired-target-pos) (-> arg0 target-pos)) (countdown (v1-29 16) (set! (-> self old-dist v1-29) 4095996000.0) ) @@ -496,12 +496,12 @@ ;; of the address, loading a junk value instead. (quaternion-copy! (-> s5-0 quat) (the quaternion (logand (the int (-> self parent 0 root quat)) #xffffffff0))) (vector-identity! (-> s5-0 scale)) - (set! (-> s5-0 transv quad) (-> arg0 vel quad)) - (set! (-> self pre-move-transv quad) (-> arg0 vel quad)) + (vector-copy! (-> s5-0 transv) (-> arg0 vel)) + (vector-copy! (-> self pre-move-transv) (-> arg0 vel)) (vector-normalize-copy! (-> self starting-dir) (-> arg0 vel) 1.0) (vector+float*! (-> self base-target-pos) (-> s5-0 trans) (-> self starting-dir) 2048000.0) ) - (set! (-> self target-pos quad) (-> self base-target-pos quad)) + (vector-copy! (-> self target-pos) (-> self base-target-pos)) (set! (-> self event-hook) projectile-event-handler) (init-proj-settings! self) (update-transforms (-> self root)) @@ -537,7 +537,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (projectile-bounce-update-velocity self) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) (vector-v++! s5-0 (-> gp-0 transv)) (when (find-ground gp-0 diff --git a/goal_src/jak3/engine/common-obs/ragdoll-test.gc b/goal_src/jak3/engine/common-obs/ragdoll-test.gc index e368f85bcbd..d8ed53f584c 100644 --- a/goal_src/jak3/engine/common-obs/ragdoll-test.gc +++ b/goal_src/jak3/engine/common-obs/ragdoll-test.gc @@ -262,7 +262,7 @@ (when (cpad-pressed? 0 l2) (cond ((-> self entity) - (set! (-> self root trans quad) (-> self entity trans quad)) + (vector-copy! (-> self root trans) (-> self entity trans)) ) (else (vector-reset! (-> self root trans)) @@ -295,9 +295,10 @@ ) ) ) - (set! (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)) trans quad) - (-> self root trans quad) - ) + (vector-copy! + (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)) trans) + (-> self root trans) + ) ) ) (ja :num! (loop!)) @@ -331,7 +332,7 @@ (set! (-> s5-0 event-self) 'touched) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 orient-tform quad)) + (vector-copy! (-> self root trans) (-> arg0 orient-tform)) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-ragdoll-test" (the-as (pointer level) #f))) diff --git a/goal_src/jak3/engine/common-obs/rigid-body-plat.gc b/goal_src/jak3/engine/common-obs/rigid-body-plat.gc index 12e4b5667c3..fbc7f565052 100644 --- a/goal_src/jak3/engine/common-obs/rigid-body-plat.gc +++ b/goal_src/jak3/engine/common-obs/rigid-body-plat.gc @@ -197,7 +197,7 @@ (let ((v1-1 (the-as object (-> arg3 param 0)))) (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> this flags) (rigid-body-object-flag player-contact-force)) - (set! (-> this player-force-position quad) (-> (the-as rigid-body-control-point v1-1) velocity quad)) + (vector-copy! (-> this player-force-position) (-> (the-as rigid-body-control-point v1-1) velocity)) (vector-reset! (-> this player-force)) (set! (-> this player-force y) (* -1.0 (-> this info player-weight))) ) @@ -218,7 +218,7 @@ ) (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> this flags) (rigid-body-object-flag player-contact-force)) - (set! (-> this player-force-position quad) (-> (the-as process-focusable v1-11) root trans quad)) + (vector-copy! (-> this player-force-position) (-> (the-as process-focusable v1-11) root trans)) (vector-reset! (-> this player-force)) (let* ((a1-5 (-> this player-force-position)) (f30-0 0.0) @@ -247,7 +247,7 @@ ) (when v1-31 (logior! (-> this flags) (rigid-body-object-flag player-impulse-force)) - (set! (-> this player-force-position quad) (-> (the-as process-focusable v1-31) root trans quad)) + (vector-copy! (-> this player-force-position) (-> (the-as process-focusable v1-31) root trans)) (let ((f0-14 (fmin (* 0.00012207031 (the-as float (-> arg3 param 1)) @@ -297,7 +297,7 @@ (the-as (function rigid-body-object float) (method-of-object this apply-gravity!)) ) (set-time! (-> this player-bonk-timeout)) - (set! (-> this player-force quad) (-> *null-vector* quad)) + (vector-copy! (-> this player-force) *null-vector*) (set! (-> this root max-iteration-count) (the-as uint 4)) (set! (-> this max-time-step) (-> arg0 extra max-time-step)) (set! (-> this water-anim) (entity-actor-lookup (-> this entity) 'water-actor 0)) @@ -388,6 +388,7 @@ ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this rigid-body-platform) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logior! (-> this mask) (process-mask platform)) (init-collision! this) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak3/engine/common-obs/shield-sphere.gc b/goal_src/jak3/engine/common-obs/shield-sphere.gc index 25f10c763dd..948ae64270e 100644 --- a/goal_src/jak3/engine/common-obs/shield-sphere.gc +++ b/goal_src/jak3/engine/common-obs/shield-sphere.gc @@ -408,7 +408,7 @@ (set! (-> self sphere-size) (-> arg0 sphere-size)) (set! (-> self owner) (-> arg0 owner)) (set! (-> self track-joint) (-> arg0 track-joint)) - (set! (-> self offset-vec quad) (-> arg0 offset-vec quad)) + (vector-copy! (-> self offset-vec) (-> arg0 offset-vec)) (init-collision! self) (initialize-skeleton self @@ -666,7 +666,7 @@ :trans (behavior () (let ((v1-1 (handle->process (-> self owner)))) (when v1-1 - (set! (-> self root trans quad) (-> (the-as process-drawable v1-1) root trans quad)) + (vector-copy! (-> self root trans) (-> (the-as process-drawable v1-1) root trans)) (quaternion-copy! (-> self root quat) (-> (the-as process-drawable v1-1) root quat)) ) ) diff --git a/goal_src/jak3/engine/common-obs/vent.gc b/goal_src/jak3/engine/common-obs/vent.gc index c0d91cebf2e..0a08c539905 100644 --- a/goal_src/jak3/engine/common-obs/vent.gc +++ b/goal_src/jak3/engine/common-obs/vent.gc @@ -46,7 +46,7 @@ ) (set! (-> this root) s3-0) ) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (update-transforms (-> this root)) (set! (-> this root pause-adjust-distance) 409600.0) (set! (-> this fact) (new 'process 'fact-info this arg1 (-> *FACT-bank* eco-full-inc))) @@ -214,7 +214,7 @@ (when v1-9 (cond ((logtest? (-> self collect-effect flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-9 root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> v1-9 root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to gp-0 @@ -223,13 +223,13 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-9 root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> v1-9 root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to gp-0 :group (-> self collect-effect) :callback part-tracker-track-target) ) ) (cond ((logtest? (-> self collect-effect2 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to self @@ -238,7 +238,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to self @@ -265,6 +265,7 @@ (defmethod init-from-entity! ((this ecovent) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init! this arg0 (pickup-type eco-green)) ) @@ -413,6 +414,7 @@ ) (defmethod init-from-entity! ((this light-eco-vent) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -618,6 +620,7 @@ ) (defmethod init-from-entity! ((this dark-eco-vent) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) diff --git a/goal_src/jak3/engine/common-obs/voicebox.gc b/goal_src/jak3/engine/common-obs/voicebox.gc index a64bbdb5758..ab1f1c3e71e 100644 --- a/goal_src/jak3/engine/common-obs/voicebox.gc +++ b/goal_src/jak3/engine/common-obs/voicebox.gc @@ -88,7 +88,7 @@ (defmethod get-track-pt-and-scale ((this remote) (arg0 vector)) (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 - (set! (-> arg0 quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (vector-copy! arg0 (get-trans (the-as process-focusable s4-0) 3)) (let ((a0-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s4-0) 0)))) (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> this blend)))) ) @@ -152,10 +152,10 @@ (let ((gp-0 (handle->process (-> self focus handle))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self parent 0 trans quad)) + (vector-copy! s5-0 (-> self parent 0 trans)) (let ((f30-0 (get-track-pt-and-scale self s5-0))) (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self parent 0 trans quad)) + (vector-copy! a1-2 (-> self parent 0 trans)) (vector-lerp! (-> self root trans) a1-2 s5-0 (-> self blend)) ) (+! (-> self root trans y) (* 1638.4 (sin (* 54.613335 (the float (mod (current-time) 1200)))))) @@ -230,7 +230,7 @@ ) ) (if a1-1 - (try-update-focus (-> self focus) (the-as process-focusable a1-1)) + (focus-on! (-> self focus) (the-as process-focusable a1-1)) ) ) ) @@ -367,8 +367,8 @@ (defbehavior voicebox-init-by-other voicebox ((arg0 vector) (arg1 handle)) (set! (-> self hint) arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self base-trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self base-trans) arg0) (init self) (set! (-> self event-hook) (-> (method-of-object self enter) event)) (go-virtual enter) @@ -415,7 +415,7 @@ (defmethod get-track-pt-and-scale ((this judge) (arg0 vector)) - (set! (-> arg0 quad) (-> this base-trans quad)) + (vector-copy! arg0 (-> this base-trans)) 1.0 ) @@ -472,7 +472,7 @@ ) (when s4-0 (change-parent self (ppointer->process s4-0)) - (try-update-focus (-> self focus) (the-as process-focusable s5-2)) + (focus-on! (-> self focus) (the-as process-focusable s5-2)) (go-virtual enter) ) ) @@ -573,11 +573,12 @@ ) (defmethod init-from-entity! ((this judge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (setup-collision! this) (init this) (process-drawable-from-entity! this arg0) (+! (-> this root trans y) 4096.0) - (set! (-> this base-trans quad) (-> this root trans quad)) + (vector-copy! (-> this base-trans) (-> this root trans)) (set! (-> this total-time) (seconds 90)) (go (method-of-object this wait)) ) @@ -589,8 +590,8 @@ (init self) (vector-identity! (-> self root scale)) (quaternion-identity! (-> self root quat)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self base-trans quad) (-> self root trans quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self base-trans) (-> self root trans)) (set! (-> self total-time) (seconds 90)) (set! (-> self timer?) arg2) (go-virtual wait) diff --git a/goal_src/jak3/engine/common-obs/warp-gate.gc b/goal_src/jak3/engine/common-obs/warp-gate.gc index 45cfef14ce8..1c2539b80c5 100644 --- a/goal_src/jak3/engine/common-obs/warp-gate.gc +++ b/goal_src/jak3/engine/common-obs/warp-gate.gc @@ -650,7 +650,7 @@ (set! (-> s5-0 message) 'change-state) (set! (-> s5-0 param 0) (the-as uint target-warp-out)) (let ((v1-22 (new 'static 'vector))) - (set! (-> v1-22 quad) (-> self center quad)) + (vector-copy! v1-22 (-> self center)) (set! (-> s5-0 param 1) (the-as uint v1-22)) ) (set! (-> s5-0 param 2) (the-as uint (target-pos 0))) @@ -659,22 +659,21 @@ ) (script-eval (-> self on-activate)) (while (begin - (set! v1-38 - (when (-> self wait-for) - (let* ((s5-1 (-> self wait-for)) - (a1-8 (car s5-1)) - ) - (while (not (null? s5-1)) - (when (not (member (status-of-level-and-borrows *level* (the-as symbol a1-8) #f) '(loaded active))) - (set! v1-38 #t) - (goto cfg-21) + (set! v1-38 (when (-> self wait-for) + (let* ((s5-1 (-> self wait-for)) + (a1-8 (car s5-1)) + ) + (while (not (null? s5-1)) + (when (not (member (level-status? *level* (the-as symbol a1-8) #f) '(loaded active))) + (set! v1-38 #t) + (goto cfg-21) + ) + (set! s5-1 (cdr s5-1)) + (set! a1-8 (car s5-1)) + ) + ) + #f ) - (set! s5-1 (cdr s5-1)) - (set! a1-8 (car s5-1)) - ) - ) - #f - ) ) (label cfg-21) (or v1-38 (not (time-elapsed? (-> self state-time) (seconds 2)))) @@ -688,7 +687,8 @@ (set-blackout-frames (seconds 0.05)) ) (start 'play arg0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (while (and *target* (and (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) @@ -738,7 +738,7 @@ (set! (-> this continue) #f) (set! (-> this on-close) #f) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 202) this)) - (set! (-> this center quad) (-> this root trans quad)) + (vector-copy! (-> this center) (-> this root trans)) (+! (-> this center y) 13516.8) (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "warpgate" :group 0 :fo-max 30) (-> this root trans) 0.0) @@ -755,7 +755,7 @@ (process-drawable-from-entity! self arg0) ) (if arg1 - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) ) (logior! (-> self mask) (process-mask actor-pause)) (init-defaults! self) @@ -765,6 +765,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this warp-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (warp-gate-init arg0 (the-as vector #f)) ) @@ -819,14 +820,14 @@ (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *warp-jump-mods*) - (set! (-> self control unknown-vector37 quad) (-> arg0 quad)) - (set! (-> self control unknown-vector38 quad) (-> arg1 quad)) + (vector-copy! (-> self control unknown-vector37) arg0) + (vector-copy! (-> self control unknown-vector38) arg1) (+! (-> self control unknown-vector37 y) -4096.0) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control unknown-handle02) arg2) (vector-reset! (-> self control transv)) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> arg1 quad)) + (vector-copy! (-> self alt-cam-pos) arg1) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) arg1 (-> self control trans)) @@ -1155,7 +1156,7 @@ (let ((t9-0 (method-of-type warp-gate init-defaults!))) (t9-0 this) ) - (set! (-> this base-pos quad) (-> this root trans quad)) + (vector-copy! (-> this base-pos) (-> this root trans)) (let ((v1-2 (-> this level-name))) (set! (-> this dust-y) (cond ((= v1-2 'nest) @@ -1196,7 +1197,7 @@ (let ((f0-9 (-> self dust-y))) (when (!= f0-9 (the-as float #x7f800000)) (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self root trans quad)) + (vector-copy! a1-2 (-> self root trans)) (set! (-> a1-2 y) f0-9) (spawn (-> self part-dust) a1-2) ) diff --git a/goal_src/jak3/engine/common-obs/water-anim.gc b/goal_src/jak3/engine/common-obs/water-anim.gc index 49ca43dbb58..4b31a334070 100644 --- a/goal_src/jak3/engine/common-obs/water-anim.gc +++ b/goal_src/jak3/engine/common-obs/water-anim.gc @@ -152,7 +152,7 @@ ) (('move-to-y) (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self root trans quad)) + (vector-copy! a1-2 (-> self root trans)) (set! (-> a1-2 y) (the-as float (-> arg3 param 0))) (move-to-point! self a1-2) ) @@ -273,7 +273,7 @@ ) (defmethod move-to-point! ((this water-anim) (arg0 vector)) - (set! (-> this root trans quad) (-> arg0 quad)) + (vector-copy! (-> this root trans) arg0) (set! (-> this water-height) (-> this root trans y)) (if (nonzero? (-> this sound)) (update-trans! (-> this sound) (-> this root trans)) @@ -430,6 +430,7 @@ ) (defmethod init-from-entity! ((this water-anim) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stub this) (alloc-root! this) (water-anim-init! this) diff --git a/goal_src/jak3/engine/common-obs/water-flow.gc b/goal_src/jak3/engine/common-obs/water-flow.gc index 9bbca299f56..6593e800a6b 100644 --- a/goal_src/jak3/engine/common-obs/water-flow.gc +++ b/goal_src/jak3/engine/common-obs/water-flow.gc @@ -85,7 +85,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (set! (-> s5-0 w) 1.0) (when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0) (let* ((s1-0 (-> this sections)) @@ -172,7 +172,7 @@ (let ((s2-1 (new 'stack-no-clear 'vector)) (s1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-1 quad) (-> s3-0 pull-dir quad)) + (vector-copy! s2-1 (-> s3-0 pull-dir)) (vector-normalize! s2-1 1.0) (vector-cross! s1-1 s2-1 *y-vector*) (vector-normalize! s1-1 1.0) @@ -218,7 +218,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (get-trans arg0 0) quad)) + (vector-copy! s5-0 (get-trans arg0 0)) (set! (-> s5-0 w) 1.0) (when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0) (let* ((v1-7 (-> this sections)) @@ -461,7 +461,7 @@ (set! (-> sv-80 speed) (-> this speed)) ) ) - (set! (-> sv-80 start quad) (-> s3-0 quad)) + (vector-copy! (-> sv-80 start) s3-0) (get-point-in-path! s5-0 s3-0 (the float (+ sv-64 1)) 'interp) (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (vector-! (-> sv-80 pull-dir) s3-0 (-> sv-80 start)) @@ -611,6 +611,7 @@ ) (defmethod init-from-entity! ((this water-flow) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) (process-drawable-from-entity! (the-as process-drawable this) arg0) (set! (-> this flow) (new 'process 'flow-control (the-as process-drawable this) (the-as res-lump #f))) diff --git a/goal_src/jak3/engine/common-obs/water.gc b/goal_src/jak3/engine/common-obs/water.gc index 77e2ee1082f..c0d1e0bb686 100644 --- a/goal_src/jak3/engine/common-obs/water.gc +++ b/goal_src/jak3/engine/common-obs/water.gc @@ -174,7 +174,7 @@ (set! (-> *water-wake-trail* zbuffer?) #f) -(set! (-> *water-wake-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *water-wake-trail* lie-vector) *up-vector*) (set! (-> *water-wake-trail* use-tape-mode?) #t) @@ -237,7 +237,7 @@ ) ) (set! (-> this base-height) (-> s5-0 base-height)) - (set! (-> this normal quad) (-> s5-0 normal quad)) + (vector-copy! (-> this normal) (-> s5-0 normal)) (set! (-> this base-ocean-offset) (- (-> s5-0 trans y) (-> s5-0 base-height))) ) (cond @@ -256,10 +256,10 @@ (logclear! (-> this flags) (water-flag break-surface)) ) ((begin - (set! (-> this top 1 quad) (-> this top 0 quad)) + (vector-copy! (-> this top 1) (-> this top 0)) (vector<-cspace! (the-as vector (-> this top)) (-> this process node-list data (-> this joint-index))) (+! (-> this top 0 y) (-> this top-y-offset)) - (set! (-> this bottom 1 quad) (-> this bottom 0 quad)) + (vector-copy! (-> this bottom 1) (-> this bottom 0)) (set! (-> this bottom 0 quad) (-> this process control trans quad)) (logclear! (-> this flags) (water-flag under-water head-under-water bouncing wading swimming break-surface)) (set! (-> this bob-offset) (update! (-> this bob))) @@ -317,7 +317,7 @@ (cond ((>= (-> this top 0 y) (-> this height)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this bottom 0 quad)) + (vector-copy! s3-0 (-> this bottom 0)) (let ((v1-82 (-> this process control transv))) (sqrtf (+ (* (-> v1-82 x) (-> v1-82 x)) (* (-> v1-82 z) (-> v1-82 z)))) ) @@ -345,7 +345,7 @@ (s1-0 s0-0 (sv-336 sv-352 a1-11 a2-2) (-> s5-0 normal)) ) ) - (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s2-0 trans) s3-0) (set! (-> *part-id-table* 762 init-specs 1 initial-valuef) (* 0.000004150391 f30-0)) (set! (-> *part-id-table* 762 init-specs 16 initial-valuef) 0.0) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 762) s2-0 :origin-is-matrix #t) @@ -445,7 +445,7 @@ (not (logtest? (water-flag jump-out) (-> this flags))) ) (let ((v1-191 (new 'stack-no-clear 'vector))) - (set! (-> v1-191 quad) (-> this bottom 0 quad)) + (vector-copy! v1-191 (-> this bottom 0)) (set! (-> v1-191 y) (- (-> this height) (-> this swim-height))) (let ((s3-3 (-> this process control))) (when (and (not (logtest? (-> s3-3 status) (collide-status touch-background))) @@ -489,7 +489,7 @@ ) (logior! (-> this flags) (water-flag swimming)) (let ((a1-42 (new 'stack-no-clear 'vector))) - (set! (-> a1-42 quad) (-> this bottom 0 quad)) + (vector-copy! a1-42 (-> this bottom 0)) (let ((s4-1 (-> this process control))) (set! (-> a1-42 y) f30-1) (when (not (logtest? (focus-status board pilot) (-> this process focus-status))) @@ -610,7 +610,7 @@ (< (-> this height) (-> v0-32 y)) ) (set! (-> this drip-joint-index) s5-1) - (set! (-> this drip-old-pos quad) (-> v0-32 quad)) + (vector-copy! (-> this drip-old-pos) v0-32) (logior! (-> this flags) (water-flag spawn-drip)) ) ) @@ -696,7 +696,7 @@ ) (sp-group-flag sp13) ) - (set! (-> *launch-matrix* trans quad) (-> arg1 quad)) + (vector-copy! (-> *launch-matrix* trans) arg1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -709,7 +709,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg1 quad)) + (vector-copy! (-> *launch-matrix* trans) arg1) (part-tracker-spawn part-tracker :to *entity-pool* @@ -833,7 +833,7 @@ ) ) (when s1-0 - (set! (-> arg0 trans quad) (-> arg2 (+ arg3 -1) sphere quad)) + (vector-copy! (-> arg0 trans) (-> arg2 (+ arg3 -1) sphere)) (set-vector! (-> arg0 normal) 0.0 1.0 0.0 1.0) (case (-> (the-as pair (-> (the-as pair s1-0) cdr)) car) (('height) diff --git a/goal_src/jak3/engine/debug/collision-editor.gc b/goal_src/jak3/engine/debug/collision-editor.gc index 14c090e04c0..7039acdbb0e 100644 --- a/goal_src/jak3/engine/debug/collision-editor.gc +++ b/goal_src/jak3/engine/debug/collision-editor.gc @@ -220,8 +220,8 @@ (s1-0 (new 'stack-no-clear 'vector)) ) (when (nonzero? (-> *collide-cache* num-tris)) - (set! (-> v1-41 quad) (-> (the-as (inline-array collide-cache-tri) a0-26) 0 vertex 0 quad)) - (set! (-> s2-0 quad) (-> (the-as (inline-array collide-cache-tri) a0-26) 0 vertex 0 quad)) + (vector-copy! v1-41 (-> (the-as (inline-array collide-cache-tri) a0-26) 0 vertex 0)) + (vector-copy! s2-0 (-> (the-as (inline-array collide-cache-tri) a0-26) 0 vertex 0)) ) (countdown (a1-27 (-> *collide-cache* num-tris)) (set! (-> v1-41 x) (fmin @@ -771,45 +771,24 @@ (let ((s4-2 (collision-edit-get-prim arg0 (-> this current-prim)))) (when s4-2 (set! (-> s4-2 local-sphere w) (* (-> s4-2 local-sphere w) f24-0)) - (let ((s3-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-17 (matrix-local->world #f #f)) - (v1-107 (-> a2-17 rvec quad)) - (a0-58 (-> a2-17 uvec quad)) - (a1-37 (-> a2-17 fvec quad)) - (a2-18 (-> a2-17 trans quad)) - ) - (set! (-> s3-1 rvec quad) v1-107) - (set! (-> s3-1 uvec quad) a0-58) - (set! (-> s3-1 fvec quad) a1-37) - (set! (-> s3-1 trans quad) a2-18) - ) - (let ((s2-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-19 (-> arg0 node-list data (-> s4-2 transform-index) bone transform)) - (v1-111 (-> a2-19 rvec quad)) - (a0-61 (-> a2-19 uvec quad)) - (a1-38 (-> a2-19 fvec quad)) - (a2-20 (-> a2-19 trans quad)) - ) - (set! (-> s2-1 rvec quad) v1-111) - (set! (-> s2-1 uvec quad) a0-61) - (set! (-> s2-1 fvec quad) a1-38) - (set! (-> s2-1 trans quad) a2-20) - ) - (let ((s1-1 (new 'stack-no-clear 'vector))) - (set! (-> s1-1 x) f30-0) - (set! (-> s1-1 y) f28-0) - (set! (-> s1-1 z) f26-0) - (set! (-> s1-1 w) 1.0) - (vector-reset! (-> s3-1 trans)) - (vector-matrix*! s1-1 s1-1 s3-1) - (vector-reset! (-> s2-1 trans)) - (matrix-transpose! s2-1 s2-1) - (vector-matrix*! s1-1 s1-1 s2-1) - (+! (-> s4-2 local-sphere x) (-> s1-1 x)) - (+! (-> s4-2 local-sphere y) (-> s1-1 y)) - (+! (-> s4-2 local-sphere z) (-> s1-1 z)) + (let ((s3-1 (matrix-copy! (new 'stack-no-clear 'matrix) (matrix-local->world #f #f))) + (s2-1 + (matrix-copy! (new 'stack-no-clear 'matrix) (-> arg0 node-list data (-> s4-2 transform-index) bone transform)) + ) + (s1-1 (new 'stack-no-clear 'vector)) ) - ) + (set! (-> s1-1 x) f30-0) + (set! (-> s1-1 y) f28-0) + (set! (-> s1-1 z) f26-0) + (set! (-> s1-1 w) 1.0) + (vector-reset! (-> s3-1 trans)) + (vector-matrix*! s1-1 s1-1 s3-1) + (vector-reset! (-> s2-1 trans)) + (matrix-transpose! s2-1 s2-1) + (vector-matrix*! s1-1 s1-1 s2-1) + (+! (-> s4-2 local-sphere x) (-> s1-1 x)) + (+! (-> s4-2 local-sphere y) (-> s1-1 y)) + (+! (-> s4-2 local-sphere z) (-> s1-1 z)) ) ) ) diff --git a/goal_src/jak3/engine/debug/debug-sphere.gc b/goal_src/jak3/engine/debug/debug-sphere.gc index deaefee0ff1..c639f2951b2 100644 --- a/goal_src/jak3/engine/debug/debug-sphere.gc +++ b/goal_src/jak3/engine/debug/debug-sphere.gc @@ -35,9 +35,9 @@ (set! (-> sv-80 z) (+ (-> s2-0 z) (* (sin (* (the float (+ sv-112 1)) (/ 65536.0 arg1))) f28-0))) (set! (-> sv-96 x) (+ (-> s2-0 x) (* (cos (* (the float sv-112) (/ 65536.0 arg1))) f26-0))) (set! (-> sv-96 z) (+ (-> s2-0 z) (* (sin (* (the float sv-112) (/ 65536.0 arg1))) f26-0))) - (set! (-> arg0 data s5-0 quad) (-> s0-0 quad)) - (set! (-> arg0 data (+ s5-0 1) quad) (-> sv-80 quad)) - (set! (-> arg0 data (+ s5-0 2) quad) (-> sv-96 quad)) + (vector-copy! (-> arg0 data s5-0) s0-0) + (vector-copy! (-> arg0 data (+ s5-0 1)) sv-80) + (vector-copy! (-> arg0 data (+ s5-0 2)) sv-96) (+! s5-0 3) (set! sv-112 (+ sv-112 1)) ) diff --git a/goal_src/jak3/engine/debug/debug.gc b/goal_src/jak3/engine/debug/debug.gc index b6ef731b4f2..3d544aa3aeb 100644 --- a/goal_src/jak3/engine/debug/debug.gc +++ b/goal_src/jak3/engine/debug/debug.gc @@ -57,7 +57,7 @@ (let ((s5-0 (new 'stack 'vector4w-2)) (a1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-2 quad) (-> pt quad)) + (vector-copy! a1-2 pt) (set! (-> a1-2 w) 1.0) (when (transform-point-qword! (the-as vector4w (-> s5-0 vector)) a1-2) (with-dma-buffer-add-bucket ((v1-11 (-> *display* frames (-> *display* on-screen) debug-buf)) @@ -368,9 +368,9 @@ (s2-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-3 quad) (-> sv-160 quad)) - (set! (-> s2-0 quad) (-> sv-176 quad)) - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! a1-3 sv-160) + (vector-copy! s2-0 sv-176) + (vector-copy! s1-0 s0-0) (set! (-> a1-3 w) 1.0) (set! (-> s2-0 w) 1.0) (set! (-> s1-0 w) 1.0) @@ -564,8 +564,8 @@ (let ((v1-4 (get-debug-line))) (when v1-4 (set! (-> v1-4 bucket) bucket) - (set! (-> v1-4 v1 quad) (-> p0 quad)) - (set! (-> v1-4 v2 quad) (-> p1 quad)) + (vector-copy! (-> v1-4 v1) p0) + (vector-copy! (-> v1-4 v2) p1) (set! (-> v1-4 color) color) (set! (-> v1-4 color2) color2) (set! (-> v1-4 mode) mode) @@ -662,9 +662,9 @@ (defun-debug add-debug-box ((enable symbol) (bucket bucket-id) (p0 vector) (p1 vector) (color rgba)) "Draw an axis-aligned box." (let ((s5-0 (new-stack-vector0))) - (set! (-> s5-0 quad) (-> p0 quad)) + (vector-copy! s5-0 p0) (let ((s1-0 (new-stack-vector0))) - (set! (-> s1-0 quad) (-> p0 quad)) + (vector-copy! s1-0 p0) (when (and enable (not *display-capture-mode*)) (set! (-> s1-0 x) (-> p1 x)) (add-debug-line #t bucket s5-0 s1-0 color #f (the-as rgba -1)) @@ -683,8 +683,8 @@ (set! (-> s1-0 y) (-> p0 y)) (set! (-> s5-0 x) (-> p1 x)) (add-debug-line #t bucket s5-0 s1-0 color #f (the-as rgba -1)) - (set! (-> s5-0 quad) (-> p1 quad)) - (set! (-> s1-0 quad) (-> p1 quad)) + (vector-copy! s5-0 p1) + (vector-copy! s1-0 p1) (set! (-> s1-0 x) (-> p0 x)) (add-debug-line #t bucket s5-0 s1-0 color #f (the-as rgba -1)) (set! (-> s1-0 x) (-> p1 x)) @@ -716,8 +716,8 @@ (let ((s2-0 (new 'stack-no-clear 'inline-array 'vector 2)) (s1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 0 quad) (-> box min quad)) - (set! (-> s2-0 1 quad) (-> box max quad)) + (vector-copy! (-> s2-0 0) (-> box min)) + (vector-copy! (-> s2-0 1) (-> box max)) (set! (-> s1-0 w) 1.0) (dotimes (s0-0 8) (set! (-> s1-0 x) (-> s2-0 (logand s0-0 1) x)) @@ -846,7 +846,7 @@ (when v1-4 (set! (-> v1-4 flags) 0) (set! (-> v1-4 bucket) bucket) - (set! (-> v1-4 pos quad) (-> pos quad)) + (vector-copy! (-> v1-4 pos) pos) (cond (offset (set! (-> v1-4 offset x) (-> offset x)) @@ -985,7 +985,7 @@ ) (forward-down->inv-matrix sv-112 gp-0 s5-0) ) - (set! (-> sv-112 trans quad) (-> sv-24 quad)) + (vector-copy! (-> sv-112 trans) sv-24) (set! (-> sv-112 trans w) 1.0) (let ((gp-1 (new 'static 'inline-array vector 3 (new 'static 'vector :y 0.5877 :z 0.951 :w 0.951) @@ -1010,7 +1010,7 @@ (set! (-> s1-0 y) (* sv-32 (-> gp-1 2 y))) (vector-matrix*! s3-0 s1-0 sv-112) (dotimes (s0-0 10) - (set! (-> s4-0 quad) (-> s3-0 quad)) + (vector-copy! s4-0 s3-0) (set! (-> s1-0 x) (* sv-32 (-> (&-> s5-1 0 data s0-0) 0))) (set! (-> s1-0 y) (* sv-32 (-> (&-> gp-1 0 data s0-0) 0))) (vector-matrix*! s3-0 s1-0 sv-112) @@ -1202,7 +1202,7 @@ (curve-evaluate! sv-48 (-> arg4 0) arg2 arg3 arg4 arg5) (set! sv-80 0) (while (< sv-80 sv-64) - (set! (-> s0-0 quad) (-> sv-48 quad)) + (vector-copy! s0-0 sv-48) (curve-evaluate! sv-48 (/ (the float (+ sv-80 1)) (the float sv-64)) arg2 arg3 arg4 arg5) (add-debug-line #t arg1 s0-0 sv-48 arg6 #f (the-as rgba -1)) (set! sv-80 (+ sv-80 1)) @@ -1230,7 +1230,7 @@ (dotimes (s0-0 arg3) (set! sv-96 (new 'stack-no-clear 'vector)) (set! (-> sv-96 quad) (the-as uint128 0)) - (set! (-> sv-96 quad) (-> arg2 s0-0 quad)) + (vector-copy! sv-96 (-> arg2 s0-0)) (if (!= arg5 0.0) (set! (-> sv-96 y) arg5) ) @@ -1445,7 +1445,7 @@ (set! (-> arg0 points) (the-as (inline-array vector) (malloc 'debug (* (-> arg0 num-points) 16)))) ) (when (-> arg0 points) - (set! (-> arg0 points (-> arg0 h-first) quad) (-> arg2 quad)) + (vector-copy! (-> arg0 points (-> arg0 h-first)) arg2) (+! (-> arg0 h-first) 1) (when (>= (-> arg0 h-first) (-> arg0 num-points)) (set! (-> arg0 h-first) 0) @@ -1472,12 +1472,8 @@ (defun-debug dma-timeout-cam () (let ((a0-0 (new-stack-vector0)) - (a1-0 (new 'stack-no-clear 'matrix)) + (a1-0 (new-stack-matrix0)) ) - (set! (-> a1-0 rvec quad) (the-as uint128 0)) - (set! (-> a1-0 uvec quad) (the-as uint128 0)) - (set! (-> a1-0 fvec quad) (the-as uint128 0)) - (set! (-> a1-0 trans quad) (the-as uint128 0)) (set! (-> a0-0 x) -666764.4) (set! (-> a0-0 y) 21102.984) (set! (-> a0-0 z) 51613.348) @@ -1660,16 +1656,16 @@ ((not (logtest? s3-0 1)) (dotimes (v1-10 3) (set! (-> *boundary-polygon* v1-10 pos quad) (-> arg1 (+ s3-0 v1-10) quad)) - (set! (-> *boundary-polygon* v1-10 stq quad) (-> s2-0 (+ s3-0 v1-10) quad)) + (vector-copy! (-> *boundary-polygon* v1-10 stq) (-> s2-0 (+ s3-0 v1-10))) ) ) (else (set! (-> *boundary-polygon* 0 pos quad) (-> arg1 (+ s3-0 1) quad)) (set! (-> *boundary-polygon* 1 pos quad) (-> arg1 s3-0 quad)) (set! (-> *boundary-polygon* 2 pos quad) (-> arg1 (+ s3-0 2) quad)) - (set! (-> *boundary-polygon* 0 stq quad) (-> s2-0 (+ s3-0 1) quad)) - (set! (-> *boundary-polygon* 1 stq quad) (-> s2-0 s3-0 quad)) - (set! (-> *boundary-polygon* 2 stq quad) (-> s2-0 (+ s3-0 2) quad)) + (vector-copy! (-> *boundary-polygon* 0 stq) (-> s2-0 (+ s3-0 1))) + (vector-copy! (-> *boundary-polygon* 1 stq) (-> s2-0 s3-0)) + (vector-copy! (-> *boundary-polygon* 2 stq) (-> s2-0 (+ s3-0 2))) ) ) (render-boundary-tri (-> *boundary-polygon* 0) arg0) diff --git a/goal_src/jak3/engine/debug/editable-h.gc b/goal_src/jak3/engine/debug/editable-h.gc index f7fc0e4fa0e..95ceb247649 100644 --- a/goal_src/jak3/engine/debug/editable-h.gc +++ b/goal_src/jak3/engine/debug/editable-h.gc @@ -607,7 +607,7 @@ ) (s2-0) ) - (set! (-> gp-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 trans) arg0) (set! (-> gp-0 radius) 2048.0) (set! (-> gp-0 owner) '()) gp-0 @@ -642,7 +642,7 @@ ) (s1-0) ) - (set! (-> s5-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 trans) arg0) (set! (-> s5-0 radius) arg1) (set! (-> s5-0 owner) '()) s5-0 @@ -692,7 +692,7 @@ ) (s1-0) ) - (set! (-> gp-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 trans) arg0) (set! (-> gp-0 radius) arg1) (set! (-> gp-0 owner) '()) (set! (-> gp-0 prefix) (new 'debug 'string 32 *editable-default-name*)) @@ -744,7 +744,7 @@ ) (s1-0) ) - (set! (-> gp-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 trans) arg0) (set! (-> gp-0 radius) arg1) (set! (-> gp-0 owner) '()) (set! (-> gp-0 prefix) (new 'debug 'string 32 "entity")) diff --git a/goal_src/jak3/engine/debug/manipulator.gc b/goal_src/jak3/engine/debug/manipulator.gc index 06f9c8c343b..1da638cfedc 100644 --- a/goal_src/jak3/engine/debug/manipulator.gc +++ b/goal_src/jak3/engine/debug/manipulator.gc @@ -274,7 +274,7 @@ (.svf (&-> a0-14 quad) vf6) ) (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! s1-0 s0-0) (let ((a0-18 s0-0)) (let ((v1-29 s0-0)) (let ((a1-12 (-> *math-camera* inv-camera-rot))) @@ -291,7 +291,7 @@ (.svf (&-> a0-18 quad) vf6) ) (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! s1-0 s0-0) (let ((a0-22 s0-0)) (let ((v1-31 s0-0)) (let ((a1-15 (-> *math-camera* inv-camera-rot uvec))) @@ -308,7 +308,7 @@ (.svf (&-> a0-22 quad) vf6) ) (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! s1-0 s0-0) (let ((a0-26 s0-0)) (let ((v1-33 s0-0)) (let ((a1-18 (-> *math-camera* inv-camera-rot))) @@ -464,8 +464,8 @@ (defmethod manipulator-method-12 ((this manipulator) (arg0 vector)) (set! (-> this rotate-ref) (the int (-> *mouse* posx))) - (set! (-> this mouse-ref-position quad) (-> arg0 quad)) - (set! (-> this drag-ref-position quad) (-> this position quad)) + (vector-copy! (-> this mouse-ref-position) arg0) + (vector-copy! (-> this drag-ref-position) (-> this position)) (set! (-> this dragging?) #t) (set! (-> this speed quad) (the-as uint128 0)) 0 @@ -483,7 +483,7 @@ (init-vf0-vector) (cond ((= (-> this mode) (manipulator-mode mm0)) - (set! (-> this speed quad) (-> this position quad)) + (vector-copy! (-> this speed) (-> this position)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this mouse-ref-position) arg0)) ) @@ -501,36 +501,36 @@ ((= (-> this action) (manipulator-action ma1)) (cond ((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat fvec)))) - (set! (-> s2-0 quad) (-> this mat fvec quad)) - (set! (-> s1-0 quad) (-> this mat uvec quad)) + (vector-copy! s2-0 (-> this mat fvec)) + (vector-copy! s1-0 (-> this mat uvec)) ) (else - (set! (-> s2-0 quad) (-> this mat uvec quad)) - (set! (-> s1-0 quad) (-> this mat fvec quad)) + (vector-copy! s2-0 (-> this mat uvec)) + (vector-copy! s1-0 (-> this mat fvec)) ) ) ) ((= (-> this action) (manipulator-action ma2)) (cond ((< (fabs (vector-dot s5-1 (the-as vector (-> this mat)))) (fabs (vector-dot s5-1 (-> this mat fvec)))) - (set! (-> s2-0 quad) (-> this mat fvec quad)) - (set! (-> s1-0 quad) (-> this mat rvec quad)) + (vector-copy! s2-0 (-> this mat fvec)) + (vector-copy! s1-0 (-> this mat rvec)) ) (else - (set! (-> s2-0 quad) (-> this mat rvec quad)) - (set! (-> s1-0 quad) (-> this mat fvec quad)) + (vector-copy! s2-0 (-> this mat rvec)) + (vector-copy! s1-0 (-> this mat fvec)) ) ) ) ((= (-> this action) (manipulator-action ma3)) (cond ((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (the-as vector (-> this mat))))) - (set! (-> s2-0 quad) (-> this mat rvec quad)) - (set! (-> s1-0 quad) (-> this mat uvec quad)) + (vector-copy! s2-0 (-> this mat rvec)) + (vector-copy! s1-0 (-> this mat uvec)) ) (else - (set! (-> s2-0 quad) (-> this mat uvec quad)) - (set! (-> s1-0 quad) (-> this mat rvec quad)) + (vector-copy! s2-0 (-> this mat uvec)) + (vector-copy! s1-0 (-> this mat rvec)) ) ) ) @@ -581,16 +581,16 @@ ) (cond ((= (-> this action) (manipulator-action ma4)) - (set! (-> s2-0 quad) (-> *z-vector* quad)) + (vector-copy! s2-0 *z-vector*) ) ((= (-> this action) (manipulator-action ma5)) - (set! (-> s2-0 quad) (-> *y-vector* quad)) + (vector-copy! s2-0 *y-vector*) ) ((= (-> this action) (manipulator-action ma6)) - (set! (-> s2-0 quad) (-> *x-vector* quad)) + (vector-copy! s2-0 *x-vector*) ) ((= (-> this action) (manipulator-action ma7)) - (set! (-> s2-0 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! s2-0 (-> *math-camera* inv-camera-rot fvec)) ) ) (vector-normalize! s2-0 1.0) diff --git a/goal_src/jak3/engine/debug/viewer.gc b/goal_src/jak3/engine/debug/viewer.gc index 64677fd32e6..61acf4cc4df 100644 --- a/goal_src/jak3/engine/debug/viewer.gc +++ b/goal_src/jak3/engine/debug/viewer.gc @@ -201,6 +201,7 @@ ) (defmethod init-from-entity! ((this viewer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! *viewer* this) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -216,7 +217,7 @@ (set! *viewer* self) (process-entity-set! self arg2) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (init-viewer arg0 arg0) diff --git a/goal_src/jak3/engine/draw/drawable.gc b/goal_src/jak3/engine/draw/drawable.gc index 8098ac5a9ce..22fbad74ff6 100644 --- a/goal_src/jak3/engine/draw/drawable.gc +++ b/goal_src/jak3/engine/draw/drawable.gc @@ -851,7 +851,7 @@ ) (cond ((logtest? (-> arg1 shadow-ctrl settings flags) (shadow-flags shdf08)) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) ) (else (when (not (paused?)) diff --git a/goal_src/jak3/engine/entity/entity-h.gc b/goal_src/jak3/engine/entity/entity-h.gc index 1256f196e9f..216fffaa4fe 100644 --- a/goal_src/jak3/engine/entity/entity-h.gc +++ b/goal_src/jak3/engine/entity/entity-h.gc @@ -16,7 +16,7 @@ (bit-4 4) (bit-5 5) (subtask-complete 6) - (bit-7 7) + (special 7) (complete 8) (bit-9 9) (bit-10 10) diff --git a/goal_src/jak3/engine/entity/entity.gc b/goal_src/jak3/engine/entity/entity.gc index e25075470b7..4afe743ae35 100644 --- a/goal_src/jak3/engine/entity/entity.gc +++ b/goal_src/jak3/engine/entity/entity.gc @@ -693,7 +693,7 @@ ) ) (set! (-> arg0 entity-link) v1-4) - (set! (-> v1-4 trans quad) (-> this trans quad)) + (vector-copy! (-> v1-4 trans) (-> this trans)) ) (set! (-> this extra perm aid) arg2) (set! (-> this extra level) arg1) @@ -889,14 +889,14 @@ (let ((enemy-option (res-lump-value sv-40 'enemy-options enemy-option :time -1000000000.0))) (cond ((logtest? (enemy-option spawner) (the-as uint128 enemy-option)) - (set! (-> sv-20 quad) (-> sv-36 quad)) - (set! (-> sv-24 quad) (-> sv-36 quad)) + (vector-copy! sv-20 sv-36) + (vector-copy! sv-24 sv-36) (set! sv-28 (the-as float -409.6)) (set! sv-32 (the-as float 409.6)) ) ((string-prefix= "battle" (res-lump-struct sv-40 'name string)) - (set! (-> sv-20 quad) (-> sv-36 quad)) - (set! (-> sv-24 quad) (-> sv-36 quad)) + (vector-copy! sv-20 sv-36) + (vector-copy! sv-24 sv-36) (set! sv-48 (new 'static 'res-tag)) (let ((v1-29 (res-lump-data sv-40 'actor-groups (pointer actor-group) :tag-ptr (& sv-48)))) (when (and v1-29 (nonzero? (-> sv-48 elt-count))) @@ -919,8 +919,8 @@ ) ) (else - (set! (-> sv-20 quad) (-> sv-36 quad)) - (set! (-> sv-24 quad) (-> sv-36 quad)) + (vector-copy! sv-20 sv-36) + (vector-copy! sv-24 sv-36) ) ) (+! (-> sv-20 x) sv-28) @@ -1946,7 +1946,7 @@ (defun process-drawable-scale-from-entity! ((arg0 process-drawable) (arg1 entity)) (let ((v1-1 (res-lump-struct arg1 'scale vector))) (if v1-1 - (set! (-> arg0 root scale quad) (-> v1-1 quad)) + (vector-copy! (-> arg0 root scale) v1-1) (vector-identity! (-> arg0 root scale)) ) ) @@ -1957,7 +1957,7 @@ ;; WARN: Return type mismatch process-drawable vs none. (defun process-drawable-from-entity! ((arg0 process-drawable) (arg1 entity-actor)) (logior! (-> arg0 mask) (process-mask actor-pause)) - (set! (-> arg0 root trans quad) (-> arg1 extra trans quad)) + (vector-copy! (-> arg0 root trans) (-> arg1 extra trans)) (quaternion-copy! (-> arg0 root quat) (-> arg1 quat)) (vector-identity! (-> arg0 root scale)) (none) diff --git a/goal_src/jak3/engine/game/effect-control.gc b/goal_src/jak3/engine/game/effect-control.gc index b593a11c50c..3af18a3427f 100644 --- a/goal_src/jak3/engine/game/effect-control.gc +++ b/goal_src/jak3/engine/game/effect-control.gc @@ -397,15 +397,17 @@ ) (cond ((logtest? (-> s2-1 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) + ) (part-tracker-spawn part-tracker-subsampler :to (-> this process) :group s2-1) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) + ) (part-tracker-spawn part-tracker :to (-> this process) :group s2-1) ) ) diff --git a/goal_src/jak3/engine/game/game-h.gc b/goal_src/jak3/engine/game/game-h.gc index eec1957d5ae..f0502a73a66 100644 --- a/goal_src/jak3/engine/game/game-h.gc +++ b/goal_src/jak3/engine/game/game-h.gc @@ -44,9 +44,9 @@ (sf23 23) (sf24 24) (sf25 25) - (sf26 26) + (hang 26) (sf27 27) - (sf28 28) + (invisible 28) (sf29 29) (sf30 30) (sf31 31) diff --git a/goal_src/jak3/engine/game/game-info-h.gc b/goal_src/jak3/engine/game/game-info-h.gc index 8a7626b1d94..068f8c0a997 100644 --- a/goal_src/jak3/engine/game/game-info-h.gc +++ b/goal_src/jak3/engine/game/game-info-h.gc @@ -354,7 +354,7 @@ (task-node-commands (array game-task-node-command)) (task-node-exclusive (array uint16)) (task-counter uint32) - (unknown-arr4 (array uint16)) + (talker-state (array uint16)) (level-opened uint8 32) (total-deaths int32) (continue-deaths int32) diff --git a/goal_src/jak3/engine/game/game-info.gc b/goal_src/jak3/engine/game/game-info.gc index 22b0344fe38..284d9a7f3e8 100644 --- a/goal_src/jak3/engine/game/game-info.gc +++ b/goal_src/jak3/engine/game/game-info.gc @@ -186,7 +186,7 @@ (dotimes (ii 3) (set! (-> this want-sound ii) (-> arg0 want-sound ii name)) ) - (set! (-> this camera-trans quad) (-> *camera-combiner* trans quad)) + (vector-copy! (-> this camera-trans) (-> *camera-combiner* trans)) (when *camera-combiner* (let ((rot (-> *camera-combiner* inv-camera-rot)) (continue-rot (-> this camera-rot)) @@ -207,7 +207,7 @@ ) (defmethod move-camera! ((this continue-point)) - (set! (-> *camera-combiner* trans quad) (-> this camera-trans quad)) + (vector-copy! (-> *camera-combiner* trans) (-> this camera-trans)) (let ((gp-0 (-> *camera-combiner* inv-camera-rot)) (s5-0 (-> this camera-rot)) ) @@ -382,7 +382,7 @@ (when (or (and (-> subtask manager) (handle->process (-> subtask manager manager))) (and (-> subtask manager) (-> subtask manager level) - (= (status-of-level-and-borrows *level* (-> subtask manager level) #f) 'active) + (= (level-status? *level* (-> subtask manager level) #f) 'active) ) (and (not (-> subtask manager)) (= (-> level info taskname) (-> subtask level))) ) @@ -515,8 +515,8 @@ (set! (-> this dark-crystal) 0.0) (set! (-> this karma) 0.0) (set! (-> this perm-list length) 0) - (dotimes (v1-57 (-> this unknown-arr4 allocated-length)) - (set! (-> this unknown-arr4 v1-57) (the-as uint 0)) + (dotimes (v1-57 (-> this talker-state allocated-length)) + (set! (-> this talker-state v1-57) (the-as uint 0)) ) (set! (-> this death-movie-tick) (rand-vu-int-count 10)) (set! (-> this gun-type) (pickup-type gun-red-1)) @@ -2081,8 +2081,8 @@ (set! (-> gp-0 perm-list length) 0) 0 ) - (if (zero? (-> gp-0 unknown-arr4)) - (set! (-> gp-0 unknown-arr4) (new 'global 'boxed-array uint16 1460)) + (if (zero? (-> gp-0 talker-state)) + (set! (-> gp-0 talker-state) (new 'global 'boxed-array uint16 1460)) ) (when (zero? (-> gp-0 death-pos)) (set! (-> gp-0 death-pos) (new 'global 'vector-array 64)) diff --git a/goal_src/jak3/engine/game/game-save.gc b/goal_src/jak3/engine/game/game-save.gc index 81df73c9955..4b438dc615e 100644 --- a/goal_src/jak3/engine/game/game-save.gc +++ b/goal_src/jak3/engine/game/game-save.gc @@ -1159,7 +1159,7 @@ (mem-copy! (the-as pointer (+ s2-12 (* s1-6 16))) (the-as pointer (-> this task-perm-list data s1-6)) 16) ) (let ((a0-111 (+ s2-12 (logand -16 (+ (* s3-4 16) 15)))) - (v1-187 (-> this unknown-arr4 allocated-length)) + (v1-187 (-> this talker-state allocated-length)) ) (let ((a1-118 (the-as object (+ a0-111 0)))) (set! (-> (the-as (inline-array game-save-tag) a1-118) 0 elt-type) (game-save-elt talker-state)) @@ -1168,7 +1168,7 @@ ) (let ((a0-112 (+ a0-111 16))) (dotimes (a1-119 v1-187) - (set! (-> (the-as (pointer uint16) (+ a0-112 (* a1-119 2))) 0) (-> this unknown-arr4 a1-119)) + (set! (-> (the-as (pointer uint16) (+ a0-112 (* a1-119 2))) 0) (-> this talker-state a1-119)) ) (let ((a0-113 (+ a0-112 (logand -16 (+ (* v1-187 2) 15)))) (v1-193 (-> this game-score allocated-length)) @@ -1989,17 +1989,17 @@ ) ) (((game-save-elt talker-state)) - (let ((v1-116 (-> this unknown-arr4 allocated-length)) + (let ((v1-116 (-> this talker-state allocated-length)) (a0-153 (-> (the-as game-save-tag s4-0) elt-count)) ) (dotimes (a1-82 v1-116) (cond ((>= a1-82 a0-153) - (set! (-> this unknown-arr4 a1-82) (the-as uint 0)) + (set! (-> this talker-state a1-82) (the-as uint 0)) 0 ) (else - (set! (-> this unknown-arr4 a1-82) (-> (&+ (the-as game-save-tag s4-0) 16) user-uint16 a1-82)) + (set! (-> this talker-state a1-82) (-> (&+ (the-as game-save-tag s4-0) 16) user-uint16 a1-82)) ) ) ) diff --git a/goal_src/jak3/engine/game/main.gc b/goal_src/jak3/engine/game/main.gc index 94f61eb2ac2..28b9a37f2c9 100644 --- a/goal_src/jak3/engine/game/main.gc +++ b/goal_src/jak3/engine/game/main.gc @@ -392,9 +392,9 @@ ) "Initialize the screen-filter with the given settings." (set! (-> this draw?) #t) - (set! (-> this color quad) (-> arg0 quad)) - (set! (-> this color-src quad) (-> arg0 quad)) - (set! (-> this color-dest quad) (-> arg1 quad)) + (vector-copy! (-> this color) arg0) + (vector-copy! (-> this color-src) arg0) + (vector-copy! (-> this color-dest) arg1) (set! (-> this extra x) arg2) (set! (-> this extra y) 0.0) (set! (-> this bucket) arg3) diff --git a/goal_src/jak3/engine/game/settings.gc b/goal_src/jak3/engine/game/settings.gc index 7bbd395e791..0a417719159 100644 --- a/goal_src/jak3/engine/game/settings.gc +++ b/goal_src/jak3/engine/game/settings.gc @@ -944,7 +944,7 @@ ) ) (('pov-offset) - (set! (-> this pov-offset quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this pov-offset) (the-as vector arg2)) ) (('string-max-length) (case arg1 @@ -1161,20 +1161,20 @@ ) (('string-startup-vector) (set! (-> this use-string-startup-vector) #t) - (set! (-> this string-startup-vector quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this string-startup-vector) (the-as vector arg2)) ) (('look-at-point) (set! (-> this use-look-at-point) #t) - (set! (-> this look-at-point quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this look-at-point) (the-as vector arg2)) ) (('point-of-interest) (set! (-> this use-point-of-interest) #t) - (set! (-> this point-of-interest quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this point-of-interest) (the-as vector arg2)) (set! (-> this handle-of-interest) (the-as handle #f)) ) (('mouse-tumble-point) (set! (-> this use-mouse-tumble-point) #t) - (set! (-> this mouse-tumble-point quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this mouse-tumble-point) (the-as vector arg2)) ) (('handle-of-interest) (let ((a0-128 (new 'static 'handle :process arg1 :pid arg3))) @@ -1425,7 +1425,7 @@ (set! (-> s5-0 allow-error) (-> s4-0 allow-error)) (set! (-> s5-0 under-water-pitch-mod) (-> s4-0 under-water-pitch-mod)) (set! (-> s5-0 slow-time) (-> s4-0 slow-time)) - (if (and (-> s4-0 mirror) (= (status-of-level-and-borrows *level* 'ctywide #f) 'active)) + (if (and (-> s4-0 mirror) (= (level-status? *level* 'ctywide #f) 'active)) (set! (-> s5-0 mirror) #f) (set! (-> s5-0 mirror) (-> s4-0 mirror)) ) @@ -1919,7 +1919,7 @@ (set! (-> s5-1 fov-priority) (-> s4-1 fov-priority)) (set! (-> s5-1 pov-handle) (-> s4-1 pov-handle)) (set! (-> s5-1 pov-bone) (-> s4-1 pov-bone)) - (set! (-> s5-1 pov-offset quad) (-> s4-1 pov-offset quad)) + (vector-copy! (-> s5-1 pov-offset) (-> s4-1 pov-offset)) (set! (-> s5-1 string-default) (-> s4-1 string-default)) (set! (-> s5-1 string-max-length-default) (-> s4-1 string-max-length-default)) (set! (-> s5-1 string-min-length-default) (-> s4-1 string-min-length-default)) @@ -1942,7 +1942,7 @@ (set! (-> s5-1 gun-max-height) (-> s4-1 string-max-height)) ) ) - (set! (-> s5-1 string-local-down quad) (-> s4-1 string-local-down quad)) + (vector-copy! (-> s5-1 string-local-down) (-> s4-1 string-local-down)) (set! (-> s5-1 slave-options) (-> s4-1 slave-options)) (seek! (-> s5-1 matrix-blend-max-angle) (-> s4-1 matrix-blend-max-angle) 182.04445) (seek! (-> s5-1 matrix-blend-max-partial) (-> s4-1 matrix-blend-max-partial) 0.05) @@ -1967,13 +1967,13 @@ (set! (-> s5-1 interp-time) (-> s4-1 interp-time)) (set! (-> s5-1 interp-time-priority) (-> s4-1 interp-time-priority)) (set! (-> s5-1 use-string-startup-vector) (-> s4-1 use-string-startup-vector)) - (set! (-> s5-1 string-startup-vector quad) (-> s4-1 string-startup-vector quad)) + (vector-copy! (-> s5-1 string-startup-vector) (-> s4-1 string-startup-vector)) (set! (-> s5-1 use-look-at-point) (-> s4-1 use-look-at-point)) - (set! (-> s5-1 look-at-point quad) (-> s4-1 look-at-point quad)) + (vector-copy! (-> s5-1 look-at-point) (-> s4-1 look-at-point)) (set! (-> s5-1 use-point-of-interest) (-> s4-1 use-point-of-interest)) - (set! (-> s5-1 point-of-interest quad) (-> s4-1 point-of-interest quad)) + (vector-copy! (-> s5-1 point-of-interest) (-> s4-1 point-of-interest)) (set! (-> s5-1 use-mouse-tumble-point) (-> s4-1 use-mouse-tumble-point)) - (set! (-> s5-1 mouse-tumble-point quad) (-> s4-1 mouse-tumble-point quad)) + (vector-copy! (-> s5-1 mouse-tumble-point) (-> s4-1 mouse-tumble-point)) (set! (-> s5-1 handle-of-interest) (-> s4-1 handle-of-interest)) (let* ((s3-11 (handle->process (-> s5-1 handle-of-interest))) (a0-159 (if (type? s3-11 process-focusable) @@ -1983,10 +1983,10 @@ ) (when a0-159 (set! (-> s5-1 use-point-of-interest) #t) - (set! (-> s5-1 point-of-interest quad) (-> (get-trans (the-as process-focusable a0-159) 4) quad)) + (vector-copy! (-> s5-1 point-of-interest) (get-trans (the-as process-focusable a0-159) 4)) ) ) - (set! (-> this cam-default point-of-interest quad) (-> s5-1 point-of-interest quad)) + (vector-copy! (-> this cam-default point-of-interest) (-> s5-1 point-of-interest)) (set! (-> s5-1 butt-handle) (-> s4-1 butt-handle)) (set! (-> s5-1 butt-angle) (-> s4-1 butt-angle)) (set! (-> s5-1 extra-follow-height) (-> s4-1 extra-follow-height)) diff --git a/goal_src/jak3/engine/game/task/task-arrow.gc b/goal_src/jak3/engine/game/task/task-arrow.gc index 5af437c1eaf..1a4bd9dda5b 100644 --- a/goal_src/jak3/engine/game/task/task-arrow.gc +++ b/goal_src/jak3/engine/game/task/task-arrow.gc @@ -66,8 +66,8 @@ (defmethod task-arrow-method-23 ((this task-arrow) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> s5-0 vec0 quad) (-> arg0 quad)) - (set! (-> s5-0 cquery start-pos quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec0) arg0) + (vector-copy! (-> s5-0 cquery start-pos) (-> s5-0 vec0)) (+! (-> s5-0 cquery start-pos y) 20480.0) (set-vector! (-> s5-0 cquery move-dist) 0.0 -81920.0 0.0 1.0) (let ((v1-4 (-> s5-0 cquery))) @@ -85,7 +85,7 @@ (vector+float*! (-> s5-0 vec0) (-> s5-0 cquery start-pos) (-> s5-0 cquery move-dist) f0-7) ) ) - (set! (-> arg0 quad) (-> s5-0 vec0 quad)) + (vector-copy! arg0 (-> s5-0 vec0)) ) 0 (none) @@ -142,7 +142,7 @@ ((-> this moving) (cond ((logtest? (-> this flags) (task-arrow-flags taf6)) - (set! (-> this root trans quad) (-> this pos quad)) + (vector-copy! (-> this root trans) (-> this pos)) (if (logtest? (-> this flags) (task-arrow-flags taf4)) (seek! (-> this rod-of-god-scale) 0.0 (* 8.0 (seconds-per-frame))) (seek! (-> this rod-of-god-scale) 1.0 (* 8.0 (seconds-per-frame))) @@ -157,13 +157,13 @@ (cond ((< (* f0-26 f0-26) (vector-vector-xz-distance-squared (-> this pos) (-> this root trans))) (kill-callback (-> *minimap* engine) (-> this minimap)) - (set! (-> this root trans quad) (-> this pos quad)) + (vector-copy! (-> this root trans) (-> this pos)) (if (not (logtest? (-> this flags) (task-arrow-flags taf5))) (set! (-> this minimap) (add-icon! *minimap* this (-> this map-icon) (the-as int #f) (the-as vector #t) 0)) ) ) (else - (set! (-> this root trans quad) (-> this pos quad)) + (vector-copy! (-> this root trans) (-> this pos)) ) ) ) @@ -172,7 +172,7 @@ ) ) (else - (set! (-> this pos quad) (-> this root trans quad)) + (vector-copy! (-> this pos) (-> this root trans)) (if (logtest? (-> this flags) (task-arrow-flags taf4)) (seek! (-> this rod-of-god-scale) 0.0 (* 8.0 (seconds-per-frame))) (seek! (-> this rod-of-god-scale) 1.0 (* 8.0 (seconds-per-frame))) @@ -218,7 +218,7 @@ (else (+! (-> this theta) (* 32768.0 (seconds-per-frame))) (+! (-> this phi) (* 9102.223 (seconds-per-frame))) - (set! (-> this root trans quad) (-> this pos quad)) + (vector-copy! (-> this root trans) (-> this pos)) (set! (-> this root trans y) (+ 28672.0 (* 4096.0 (cos (-> this theta))) (-> this pos y))) ) ) @@ -238,7 +238,7 @@ (case message (('set-position) (let ((a0-3 (the-as object (-> block param 0)))) - (set! (-> self pos quad) (-> (the-as vector a0-3) quad)) + (vector-copy! (-> self pos) (the-as vector a0-3)) ) (if (logtest? (-> self flags) (task-arrow-flags taf3)) (task-arrow-method-23 self (-> self pos)) @@ -317,7 +317,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! gp-1 (-> (math-camera-matrix) fvec)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (math-camera-pos) (-> self root trans)))) (set! (-> gp-1 y) 0.0) (set! (-> s5-1 y) 0.0) @@ -380,11 +380,11 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self pos quad) (-> arg0 pos quad)) + (vector-copy! (-> self pos) (-> arg0 pos)) (if (logtest? (-> self flags) (task-arrow-flags taf3)) (task-arrow-method-23 self (-> self pos)) ) - (set! (-> self root trans quad) (-> self pos quad)) + (vector-copy! (-> self root trans) (-> self pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (quaternion-copy! (-> self base-quat) (-> arg0 quat)) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) diff --git a/goal_src/jak3/engine/game/task/task-control.gc b/goal_src/jak3/engine/game/task/task-control.gc index 33c517d775f..8acfd053141 100644 --- a/goal_src/jak3/engine/game/task/task-control.gc +++ b/goal_src/jak3/engine/game/task/task-control.gc @@ -781,7 +781,7 @@ (spawn-resetter! *resetter-control* (-> s4-1 reset fail-info) (the-as game-task-node-info #f)) (return 0) ) - ((= (status-of-level-and-borrows *level* 'wasall #f) 'active) + ((= (level-status? *level* 'wasall #f) 'active) (set! gp-1 "wasdoors-desert") (if (and (-> *game-info* current-continue) (logtest? (continue-flags race) (-> *game-info* current-continue flags)) @@ -2537,14 +2537,15 @@ (process-release? *target*) ) :code (behavior () - (suspend-for (seconds 1) (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 300.0))) - (set-filter-color! - (lerp-scale 1.0 1.25 f30-0 0.0 1.0) - (lerp-scale 1.0 0.875 f30-0 0.0 1.0) - (lerp-scale 1.0 0.25 f30-0 0.0 1.0) - ) - ) - ) + (suspend-for (seconds 1) + (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) time)) 0.0 300.0))) + (set-filter-color! + (lerp-scale 1.0 1.25 f30-0 0.0 1.0) + (lerp-scale 1.0 0.875 f30-0 0.0 1.0) + (lerp-scale 1.0 0.25 f30-0 0.0 1.0) + ) + ) + ) (let ((gp-1 (if (-> self retry?) (-> self params retry) (-> self params fail) diff --git a/goal_src/jak3/engine/geometry/bounding-box.gc b/goal_src/jak3/engine/geometry/bounding-box.gc index 97de288e63d..6a4214e090b 100644 --- a/goal_src/jak3/engine/geometry/bounding-box.gc +++ b/goal_src/jak3/engine/geometry/bounding-box.gc @@ -112,8 +112,8 @@ (defmethod set-to-point! ((this bounding-box) (arg0 vector)) "Set the box to be a single point." - (set! (-> this min quad) (-> arg0 quad)) - (set! (-> this max quad) (-> arg0 quad)) + (vector-copy! (-> this min) arg0) + (vector-copy! (-> this max) arg0) 0 (none) ) diff --git a/goal_src/jak3/engine/geometry/geometry-h.gc b/goal_src/jak3/engine/geometry/geometry-h.gc index 47aff72fe1a..42c043b3370 100644 --- a/goal_src/jak3/engine/geometry/geometry-h.gc +++ b/goal_src/jak3/engine/geometry/geometry-h.gc @@ -42,6 +42,8 @@ (deftype lissajous (structure) + "A curve where the x and y position are set by two different sinusoids. +This stores the parameters and state for evaluating this curve." ((x-mag float) (y-mag float) (theta float) @@ -52,18 +54,20 @@ ) :pack-me (:methods - (lissajous-method-9 (_type_ vector) vector) + (evaluate! (_type_ vector) vector) ) ) (deftype lissajous-interp (structure) + "Handles interpolating between two different lissajous parameters, and also +stepping forward the dynamics." ((current lissajous :inline) (dest lissajous :inline) (rate lissajous :inline) ) (:methods - (lissajous-interp-method-9 (_type_ vector) vector) - (lissajous-interp-method-10 (_type_) float) + (evaluate! (_type_ vector) vector) + (update! (_type_) float) ) ) diff --git a/goal_src/jak3/engine/geometry/geometry.gc b/goal_src/jak3/engine/geometry/geometry.gc index 24a2b9b393d..4e440f0a966 100644 --- a/goal_src/jak3/engine/geometry/geometry.gc +++ b/goal_src/jak3/engine/geometry/geometry.gc @@ -107,7 +107,7 @@ (defun vector-reflect-flat-gravity! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> arg1 quad)) + (vector-copy! s4-0 arg1) (vector-reflect-flat! arg0 s4-0 arg2) ;; og:preserve-this (let* ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 1.0)) ;; src normalized @@ -698,7 +698,7 @@ arg0 ) -(defun matrix-rot-diff! ((arg0 vector) (arg1 matrix) (arg2 matrix)) +(defun matrix-rot-diff! ((arg0 quaternion) (arg1 matrix) (arg2 matrix)) "Get the difference of rotation between two matrices, expressed as a quaternion." (let ((s3-0 (new-stack-quaternion0)) (s2-0 (new-stack-quaternion0)) @@ -715,8 +715,8 @@ ) (let ((f30-1 (* 2.0 (acos (-> s5-0 w))))) (set! (-> arg0 quad) (-> s5-0 quad)) - (vector-negate! arg0 arg0) - (if (= (vector-normalize-ret-len! arg0 1.0) 0.0) + (vector-negate! (the-as vector arg0) (the-as vector arg0)) + (if (= (vector-normalize-ret-len! (the-as vector arg0) 1.0) 0.0) (set! (-> arg0 y) 1.0) ) f30-1 @@ -750,11 +750,11 @@ "Slerp for vectors. (imagine that they are the z axis of two frames)" (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) arg0 ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) arg0 ) (else @@ -775,10 +775,10 @@ (local-vars (sv-112 (function float float float float))) (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (let* ((s0-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) @@ -1433,7 +1433,7 @@ (-> arg0 num-knots) ) (dotimes (s2-0 s3-0) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) (curve-evaluate! s4-0 (/ (the float (+ s2-0 1)) (the float s3-0)) @@ -1601,11 +1601,13 @@ (vector-normalize! arg0 1.0) ) -(defmethod lissajous-interp-method-9 ((this lissajous-interp) (arg0 vector)) - (lissajous-method-9 (-> this current) arg0) +(defmethod evaluate! ((this lissajous-interp) (arg0 vector)) + "Set the x and y component of the vector to the current point on the curve." + (evaluate! (-> this current) arg0) ) -(defmethod lissajous-interp-method-10 ((this lissajous-interp)) +(defmethod update! ((this lissajous-interp)) + "Update both the interpolation, and the curves themselves." (seek! (-> this current x-mag) (-> this dest x-mag) (-> this rate x-mag)) (seek! (-> this current y-mag) (-> this dest y-mag) (-> this rate y-mag)) (seek! (-> this current theta-rate) (-> this dest theta-rate) (-> this rate theta-rate)) @@ -1617,7 +1619,8 @@ ) ) -(defmethod lissajous-method-9 ((this lissajous) (arg0 vector)) +(defmethod evaluate! ((this lissajous) (arg0 vector)) + "Set the x and y component of the vector to the current point on the curve." 0.0 0.0 (let ((f30-0 (* (cos (* (-> this theta) (-> this wx))) (-> this x-mag))) diff --git a/goal_src/jak3/engine/geometry/path.gc b/goal_src/jak3/engine/geometry/path.gc index a62afb8a159..e5a28528cd0 100644 --- a/goal_src/jak3/engine/geometry/path.gc +++ b/goal_src/jak3/engine/geometry/path.gc @@ -108,13 +108,13 @@ ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this curve cverts (the int (the float (the int f24-0))) quad)) + (vector-copy! s4-0 (-> this curve cverts (the int (the float (the int f24-0))))) 0.0 (let ((f0-16 (vector-vector-distance s5-0 s4-0))) (cond ((< f0-16 f26-0) (set! f26-0 (- f26-0 f0-16)) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) f24-0 ) (else @@ -148,13 +148,13 @@ ) (cond ((< arg1 0.0) - (set! (-> arg0 quad) (-> this curve cverts 0 quad)) + (vector-copy! arg0 (-> this curve cverts 0)) ) ((>= f0-3 (the float (+ a1-1 -1))) - (set! (-> arg0 quad) (-> this curve cverts (+ a1-1 -1) quad)) + (vector-copy! arg0 (-> this curve cverts (+ a1-1 -1))) ) ((or (= arg2 'exact) (= f0-3 arg1)) - (set! (-> arg0 quad) (-> this curve cverts (the int f0-3) quad)) + (vector-copy! arg0 (-> this curve cverts (the int f0-3))) ) (else (vector-lerp! @@ -174,7 +174,7 @@ (cond ((> (-> this curve num-cverts) 0) (let ((a0-2 (rand-vu-int-count (-> this curve num-cverts)))) - (set! (-> arg0 quad) (-> this curve cverts a0-2 quad)) + (vector-copy! arg0 (-> this curve cverts a0-2)) ) ) (else @@ -182,7 +182,7 @@ (if pp (format #t "current process is ~A~%" (-> pp name)) ) - (set! (-> arg0 quad) (-> *null-vector* quad)) + (vector-copy! arg0 *null-vector*) ) ) arg0 @@ -381,7 +381,7 @@ (vector+float*! sv-116 arg0 arg1 (-> s1-0 x)) (cond ((and s0-0 (not sv-120)) - (set! (-> sv-108 quad) (-> sv-116 quad)) + (vector-copy! sv-108 sv-116) (set! sv-112 (vector-vector-distance-squared sv-116 arg0)) (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) (set! sv-120 #t) @@ -389,7 +389,7 @@ ((and s0-0 sv-120) (let ((f0-22 (vector-vector-distance-squared sv-116 arg0))) (when (< f0-22 (the-as float sv-112)) - (set! (-> sv-108 quad) (-> sv-116 quad)) + (vector-copy! sv-108 sv-116) (set! sv-112 f0-22) (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) ) @@ -405,7 +405,7 @@ (f0-33 (* f0-32 f0-32)) ) (when (< f0-33 (the-as float sv-112)) - (set! (-> sv-108 quad) (-> s0-1 quad)) + (vector-copy! sv-108 s0-1) (set! sv-112 f0-33) (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) ) @@ -416,7 +416,7 @@ ) ) ) - (set! (-> sv-96 quad) (-> sv-100 quad)) + (vector-copy! sv-96 sv-100) ) ) (set! sv-124 (/ sv-124 (the float (+ (-> this curve num-cverts) -1)))) @@ -439,12 +439,12 @@ (f28-0 0.0) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (set! (-> s3-0 y) 0.0) (get-point-in-path! this s4-0 0.0 'interp) (set! (-> s4-0 y) 0.0) (dotimes (s1-0 (+ (-> this curve num-cverts) -1)) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) (get-point-in-path! this s4-0 (the float (+ s1-0 1)) 'interp) (set! (-> s4-0 y) 0.0) (let ((f0-5 (vector-segment-distance-point! s3-0 s5-0 s4-0 s2-0))) @@ -469,10 +469,10 @@ (f28-0 0.0) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (get-point-in-path! this s4-0 0.0 'interp) (dotimes (s1-0 (+ (-> this curve num-cverts) -1)) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) (get-point-in-path! this s4-0 (the float (+ s1-0 1)) 'interp) (let ((f0-2 (vector-segment-distance-point! s3-0 s5-0 s4-0 s2-0))) (when (< f0-2 f30-0) diff --git a/goal_src/jak3/engine/geometry/vol.gc b/goal_src/jak3/engine/geometry/vol.gc index 0444dd36173..1cfbb429251 100644 --- a/goal_src/jak3/engine/geometry/vol.gc +++ b/goal_src/jak3/engine/geometry/vol.gc @@ -68,7 +68,7 @@ (set! sv-148 (the-as float 0.0)) (set! sv-152 0) (set! sv-160 (new-stack-vector0)) - (set! (-> sv-144 quad) (-> sv-224 quad)) + (vector-copy! sv-144 sv-224) (set! sv-256 0) (while (< sv-256 (-> this num-planes)) (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) @@ -78,7 +78,7 @@ ) ((zero? sv-152) (vector+float*! sv-144 sv-144 sv-192 f0-6) - (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (vector-copy! sv-160 (-> s2-0 sv-256)) (set! sv-148 (the-as float 8192000.0)) (set! sv-152 1) ) @@ -92,7 +92,7 @@ ) (else (vector+float*! sv-144 sv-144 sv-192 f0-6) - (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (vector-copy! sv-160 (-> s2-0 sv-256)) (set! sv-152 (+ sv-152 1)) (if (< (fabs f0-6) (fabs sv-148)) (set! sv-148 (- sv-148 f0-6)) @@ -123,8 +123,8 @@ (format 0 "ERROR : vol-control #x~X out of volume points~%" this) ) (else - (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) - (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) + (vector-copy! (-> arg1 data (-> arg1 length)) sv-144) + (vector-copy! (-> arg1 data (+ (-> arg1 length) 1)) sv-224) (+! (-> arg1 length) 2) (+! (-> this point-count) 2) ) @@ -147,8 +147,8 @@ (format 0 "ERROR : vol-control #x~X out of volume normals~%" this) ) (else - (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) - (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) + (vector-copy! (-> arg2 data (-> arg2 length)) s1-0) + (vector-copy! (-> arg2 data (+ (-> arg2 length) 1)) (-> s2-0 s3-0)) (+! (-> arg2 length) 2) (set! (-> this normal-count) (+ (-> this normal-count) 2)) ) diff --git a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-vu1.gc b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-vu1.gc index 969a660636f..34cf8cddbf1 100644 --- a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-vu1.gc +++ b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-vu1.gc @@ -30,7 +30,7 @@ (let ((gp-0 *math-camera*)) (let ((v1-0 *hfrag-vu1-constants-base*)) (dotimes (a0-1 81) - (set! (-> arg0 base far-verts a0-1 quad) (-> v1-0 far-verts a0-1 quad)) + (vector-copy! (-> arg0 base far-verts a0-1) (-> v1-0 far-verts a0-1)) ) ) (case *subdivide-draw-mode* @@ -231,8 +231,8 @@ (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) ) (mem-copy! (the-as pointer (-> arg0 matrix)) (the-as pointer (-> gp-0 camera-temp)) 64) - (set! (-> arg0 hvdf-offset quad) (-> gp-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> gp-0 hmge-scale quad)) + (vector-copy! (-> arg0 hvdf-offset) (-> gp-0 hvdf-off)) + (vector-copy! (-> arg0 hmge-scale) (-> gp-0 hmge-scale)) (set-vector! (-> arg0 fog) (-> gp-0 pfog0) (-> gp-0 fog-min) (-> gp-0 fog-max) 3072.0) ) (none) diff --git a/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc b/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc index 4b0d9b23dda..b641f89c641 100644 --- a/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc +++ b/goal_src/jak3/engine/gfx/background/hfrag/hfrag.gc @@ -816,9 +816,9 @@ ((< (fabs (-> sv-72 z)) (fabs (-> sv-72 x))) (when (< (-> sv-72 x) 0.0) (let ((v1-15 (new 'stack-no-clear 'vector))) - (set! (-> v1-15 quad) (-> sv-64 quad)) - (set! (-> sv-64 quad) (-> sv-68 quad)) - (set! (-> sv-68 quad) (-> v1-15 quad)) + (vector-copy! v1-15 sv-64) + (vector-copy! sv-64 sv-68) + (vector-copy! sv-68 v1-15) ) (vector-negate! sv-72 sv-72) ) @@ -883,9 +883,9 @@ (else (when (< (-> sv-72 z) 0.0) (let ((v1-42 (new 'stack-no-clear 'vector))) - (set! (-> v1-42 quad) (-> sv-64 quad)) - (set! (-> sv-64 quad) (-> sv-68 quad)) - (set! (-> sv-68 quad) (-> v1-42 quad)) + (vector-copy! v1-42 sv-64) + (vector-copy! sv-64 sv-68) + (vector-copy! sv-68 v1-42) ) (vector-negate! sv-72 sv-72) ) diff --git a/goal_src/jak3/engine/gfx/background/tfrag/tfrag-near.gc b/goal_src/jak3/engine/gfx/background/tfrag/tfrag-near.gc index d5fb0a3ea46..9dfd7811092 100644 --- a/goal_src/jak3/engine/gfx/background/tfrag/tfrag-near.gc +++ b/goal_src/jak3/engine/gfx/background/tfrag/tfrag-near.gc @@ -46,12 +46,8 @@ ;; WARN: Return type mismatch vector vs none. (defun-debug clip-restore () (let ((a0-0 (new-stack-vector0)) - (a1-0 (new 'stack-no-clear 'matrix)) + (a1-0 (new-stack-matrix0)) ) - (set! (-> a1-0 rvec quad) (the-as uint128 0)) - (set! (-> a1-0 uvec quad) (the-as uint128 0)) - (set! (-> a1-0 fvec quad) (the-as uint128 0)) - (set! (-> a1-0 trans quad) (the-as uint128 0)) (set! (-> a0-0 x) 92648.22) (set! (-> a0-0 y) 238025.03) (set! (-> a0-0 z) 199836.31) diff --git a/goal_src/jak3/engine/gfx/background/tfrag/tfrag.gc b/goal_src/jak3/engine/gfx/background/tfrag/tfrag.gc index fda1b6d14d2..53caec2aea3 100644 --- a/goal_src/jak3/engine/gfx/background/tfrag/tfrag.gc +++ b/goal_src/jak3/engine/gfx/background/tfrag/tfrag.gc @@ -271,10 +271,10 @@ ) (set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) (set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 guard quad) (-> v1-0 guard quad)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) + (vector-copy! (-> arg0 invh-scale) (-> v1-0 inv-hmge-scale)) + (vector-copy! (-> arg0 guard) (-> v1-0 guard)) ) (set-tfrag-dists! (-> arg0 dists)) (none) diff --git a/goal_src/jak3/engine/gfx/blit-displays.gc b/goal_src/jak3/engine/gfx/blit-displays.gc index be6b7eda1be..84179f4202d 100644 --- a/goal_src/jak3/engine/gfx/blit-displays.gc +++ b/goal_src/jak3/engine/gfx/blit-displays.gc @@ -401,7 +401,7 @@ ) (cond ((-> this zoom-blur-2d) - (set! (-> s5-0 quad) (-> this zoom-blur-pos quad)) + (vector-copy! s5-0 (-> this zoom-blur-pos)) (let* ((f2-0 (* (/ f28-0 512) (-> s5-0 x))) (f0-6 (- f26-0 (- f28-0 f2-0))) (f3-1 (* (/ f28-0 416) (-> s5-0 y))) @@ -483,7 +483,7 @@ (defmethod setup-zoom-blur-2d ((this blit-displays-work) (arg0 vector) (arg1 int) (arg2 float) (arg3 symbol)) (set! (-> this zoom-blur-2d) arg3) - (set! (-> this zoom-blur-pos quad) (-> arg0 quad)) + (vector-copy! (-> this zoom-blur-pos) arg0) (set! (-> this zoom-blur-texels) arg1) (set! (-> this zoom-blur-alpha-target) arg2) 0 diff --git a/goal_src/jak3/engine/gfx/foreground/merc/emerc.gc b/goal_src/jak3/engine/gfx/foreground/merc/emerc.gc index 04a595c7ab4..ec5d326c846 100644 --- a/goal_src/jak3/engine/gfx/foreground/merc/emerc.gc +++ b/goal_src/jak3/engine/gfx/foreground/merc/emerc.gc @@ -30,7 +30,7 @@ (set! (-> s5-0 tri-strip-gif word 3) (shr (make-u128 0 (shl #x303e4000 32)) 32)) (set! (-> s5-0 ad-gif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) (set! (-> s5-0 ad-gif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> s5-0 hvdf-offset quad) (-> *math-camera* hvdf-off quad)) + (vector-copy! (-> s5-0 hvdf-offset) (-> *math-camera* hvdf-off)) (quad-copy! (the-as pointer (-> s5-0 perspective)) (the-as pointer (-> *math-camera* perspective)) 4) (set-vector! (-> s5-0 fog) (-> *math-camera* pfog0) (-> *math-camera* fog-min) (-> *math-camera* fog-max) 0.0) (set-vector! diff --git a/goal_src/jak3/engine/gfx/foreground/merc/merc.gc b/goal_src/jak3/engine/gfx/foreground/merc/merc.gc index cb23baba768..124397af270 100644 --- a/goal_src/jak3/engine/gfx/foreground/merc/merc.gc +++ b/goal_src/jak3/engine/gfx/foreground/merc/merc.gc @@ -500,7 +500,7 @@ ) (set! (-> s5-0 ad-gif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) (set! (-> s5-0 ad-gif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> s5-0 hvdf-offset quad) (-> *math-camera* hvdf-off quad)) + (vector-copy! (-> s5-0 hvdf-offset) (-> *math-camera* hvdf-off)) (quad-copy! (-> s5-0 perspective) (the-as pointer (-> *math-camera* perspective)) 4) (set-vector! (-> s5-0 fog) (-> *math-camera* pfog0) (-> *math-camera* fog-min) (-> *math-camera* fog-max) 0.0) ) diff --git a/goal_src/jak3/engine/gfx/generic/generic-vu1.gc b/goal_src/jak3/engine/gfx/generic/generic-vu1.gc index 9b929578a0a..a46f06050d4 100644 --- a/goal_src/jak3/engine/gfx/generic/generic-vu1.gc +++ b/goal_src/jak3/engine/gfx/generic/generic-vu1.gc @@ -17,10 +17,10 @@ (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) (set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x7 :nreg #x1)) (set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 guard quad) (-> v1-0 guard quad)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) + (vector-copy! (-> arg0 invh-scale) (-> v1-0 inv-hmge-scale)) + (vector-copy! (-> arg0 guard) (-> v1-0 guard)) ) (set! (-> arg0 flush dword 0) (the-as uint #x3f80000080808080)) (set! (-> arg0 flush dword 1) (the-as uint 1)) diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning-h.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning-h.gc index 696b5122e06..b31d1c9b231 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning-h.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning-h.gc @@ -151,7 +151,7 @@ (defmethod set-point! ((this lightning-control) (arg0 int) (arg1 vector)) (let ((v1-0 (-> this state))) (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) - (set! (-> v1-0 path data arg0 quad) (-> arg1 quad)) + (vector-copy! (-> v1-0 path data arg0) arg1) (when (and (< (+ (-> v1-0 points-to-draw) -1) arg0) (case (-> v1-0 mode) ((2 3) #t @@ -161,8 +161,8 @@ ) ) ) - (set! (-> v1-0 line data arg0 quad) (-> arg1 quad)) - (set! (-> v1-0 meet data arg0 quad) (-> arg1 quad)) + (vector-copy! (-> v1-0 line data arg0) arg1) + (vector-copy! (-> v1-0 meet data arg0) arg1) ) ) ) @@ -178,7 +178,7 @@ ;; WARN: Return type mismatch vector vs none. (defmethod set-last-meet-point ((this lightning-control) (arg0 vector)) - (set! (-> this state meet data (+ (-> this state points-to-draw) -1) quad) (-> arg0 quad)) + (vector-copy! (-> this state meet data (+ (-> this state points-to-draw) -1)) arg0) (none) ) diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc index c57a4db05d9..e65712f5e7c 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new.gc @@ -94,7 +94,7 @@ ) (set! (-> s3-0 z) (the float (-> arg1 index))) (set! (-> s3-0 w) 1.0) - (set! (-> this desired-points data arg0 quad) (-> s3-0 quad)) + (vector-copy! (-> this desired-points data arg0) s3-0) ) (set! (-> this current-points data arg0 z) (the float (-> arg1 index))) (-> this desired-points data arg0) @@ -285,7 +285,7 @@ (and (logtest? (-> a2-13 span-flags) 2) (not (logtest? (-> a2-13 span-flags) 1))) ) (dotimes (v1-55 s3-0) - (set! (-> this current-points data (+ v1-55 s5-0) quad) (-> this desired-points data (+ v1-55 s5-0) quad)) + (vector-copy! (-> this current-points data (+ v1-55 s5-0)) (-> this desired-points data (+ v1-55 s5-0))) ) ) (lightning-bolt-method-20 this s5-0 a2-13) @@ -296,7 +296,7 @@ (when (time-elapsed? (-> this last-generate-time) (-> this new-inner-point-generate-time)) (lightning-bolt-method-20 this s5-0 (-> this spans-internal data (-> this num-active-spans))) (if (-> this snap-inner-points?) - (set! (-> this current-points data s5-0 quad) (-> this desired-points data s5-0 quad)) + (vector-copy! (-> this current-points data s5-0) (-> this desired-points data s5-0)) ) (set-time! (-> this last-generate-time)) (set! (-> this new-inner-point-generate-time) (rand-vu-int-range @@ -414,7 +414,7 @@ ) (defun matrix<-vector-yz2! ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (vector-cross! (-> arg0 rvec) arg2 arg1) (vector-normalize! (-> arg0 rvec) 1.0) (vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec)) @@ -555,7 +555,7 @@ (matrix<-vector-yz2! sv-224 sv-240 (choose-nice-perp sv-240)) (let ((f30-0 (-> sv-96 random-offset-size-start))) (lightning-bolt-method-19 this sv-104 sv-48 (+ sv-48 1) sv-224 f30-0 sv-236) - (set! (-> sv-232 quad) (-> this current-points data sv-48 quad)) + (vector-copy! sv-232 (-> this current-points data sv-48)) (set! (-> sv-232 x) (* (-> sv-232 x) f30-0)) (set! (-> sv-232 y) (* (-> sv-232 y) f30-0)) ) @@ -568,7 +568,7 @@ (dotimes (s4-1 (-> sv-100 num-inner-points)) (set! sv-256 (+ sv-48 1 s4-1)) (lightning-bolt-method-19 this sv-104 (+ sv-256 -1) sv-256 sv-224 sv-248 sv-236) - (set! (-> sv-232 quad) (-> this current-points data sv-256 quad)) + (vector-copy! sv-232 (-> this current-points data sv-256)) (set! (-> sv-232 x) (* (-> sv-232 x) sv-248)) (set! (-> sv-232 y) (* (-> sv-232 y) sv-248)) (set! (-> sv-232 z) (- (-> sv-232 z) sv-244)) @@ -598,7 +598,7 @@ (vector-normalize! sv-428 1.0) (matrix<-vector-yz2! sv-416 sv-428 (choose-nice-perp sv-428)) (let ((f0-33 (-> sv-288 random-offset-size-start))) - (set! (-> sv-424 quad) (-> this current-points data sv-48 quad)) + (vector-copy! sv-424 (-> this current-points data sv-48)) (set! (-> sv-424 x) (* (-> sv-424 x) f0-33)) (set! (-> sv-424 y) (* (-> sv-424 y) f0-33)) ) @@ -766,7 +766,7 @@ (defmethod lightning-bolt-method-18 ((this lightning-bolt) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) (when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts)) (let ((v1-5 (-> arg0 data (-> arg0 num-verts)))) - (set! (-> v1-5 pos quad) (-> arg1 quad)) + (vector-copy! (-> v1-5 pos) arg1) (set! (-> v1-5 col) arg2) (set! (-> v1-5 stq x) arg3) (set! (-> v1-5 stq y) arg4) @@ -782,7 +782,7 @@ (init! (-> self bolt) 2 (+ (-> arg0 num-inner-points) 2) (-> arg0 appearance)) (set! (-> self lifetime) (-> arg0 lifetime)) (set! (-> self bolt span-pts-start data 0 quad) (-> arg0 start-pt quad)) - (set! (-> self bolt span-pts-start data 1 quad) (-> arg0 end-pt quad)) + (vector-copy! (-> self bolt span-pts-start data 1) (-> arg0 end-pt)) (set! (-> self bolt spans-internal data 0 num-inner-points) (-> arg0 num-inner-points)) (set! (-> self bolt spans data 0 inner-random-offset-size) (-> arg0 inner-random-offset-size)) (set! (-> self bolt spans data 0 random-offset-size-start) (-> arg0 random-offset-size-start)) diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning.gc index 1ffc7f6d314..b714e013ef0 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning.gc @@ -374,7 +374,7 @@ ) (when sv-32 (dotimes (v1-43 gp-0) - (set! (-> sv-20 data v1-43 quad) (-> sv-24 data v1-43 quad)) + (vector-copy! (-> sv-20 data v1-43) (-> sv-24 data v1-43)) ) ) ) @@ -382,7 +382,7 @@ (case (-> sv-16 rand-func) ((2) (set! (-> sv-24 data 0 quad) (-> sv-28 data 0 quad)) - (set! (-> sv-24 data s4-0 quad) (-> sv-28 data s4-0 quad)) + (vector-copy! (-> sv-24 data s4-0) (-> sv-28 data s4-0)) (lightning-trail-fractal-gen (-> sv-24 data) (-> sv-28 data) 0 s4-0 (-> s5-0 box-size) sv-16) ) (else @@ -391,7 +391,7 @@ ) (when sv-32 (dotimes (v1-63 gp-0) - (set! (-> sv-20 data v1-63 quad) (-> sv-28 data v1-63 quad)) + (vector-copy! (-> sv-20 data v1-63) (-> sv-28 data v1-63)) ) ) ) @@ -642,18 +642,7 @@ (set! (-> v1-81 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-73) 16)))) ) (set! sv-176 (the-as gcf-control (-> arg0 base))) - (let* ((v1-84 (-> sv-176 matrix)) - (a3-31 (-> sv-16 perspective)) - (a0-76 (-> a3-31 rvec quad)) - (a1-88 (-> a3-31 uvec quad)) - (a2-58 (-> a3-31 fvec quad)) - (a3-32 (-> a3-31 trans quad)) - ) - (set! (-> v1-84 rvec quad) a0-76) - (set! (-> v1-84 uvec quad) a1-88) - (set! (-> v1-84 fvec quad) a2-58) - (set! (-> v1-84 trans quad) a3-32) - ) + (matrix-copy! (-> sv-176 matrix) (-> sv-16 perspective)) (quad-copy! (the-as pointer (-> sv-176 giftag)) (the-as pointer (-> s1-0 giftag)) 3) (set! (-> sv-176 giftag num-strips) (the-as uint 1)) (set! (-> sv-176 num-dps) (the-as uint (* sv-144 2))) diff --git a/goal_src/jak3/engine/gfx/math-camera.gc b/goal_src/jak3/engine/gfx/math-camera.gc index f69f106a669..0a4d928c8f6 100644 --- a/goal_src/jak3/engine/gfx/math-camera.gc +++ b/goal_src/jak3/engine/gfx/math-camera.gc @@ -228,7 +228,7 @@ Without this corrector, the fogginess of the world would change as the FOV chang (set-vector! (-> arg0 sprite-2d fvec) 0.0 0.0 (- f0-48) 0.0) (set-vector! (-> arg0 sprite-2d trans) 0.0 0.0 (* 500000000.0 f0-48) (* 60.0 f0-48 (-> arg0 pfog0))) ) - (set! (-> arg0 sprite-2d-hvdf quad) (-> arg0 hvdf-off quad)) + (vector-copy! (-> arg0 sprite-2d-hvdf) (-> arg0 hvdf-off)) (set! (-> arg0 sprite-2d-hvdf x) 2048.0) (set! (-> arg0 sprite-2d-hvdf y) 2048.0) (set! (-> arg0 sprite-2d-hvdf z) (-> arg0 hvdf-off z)) @@ -354,12 +354,8 @@ Without this corrector, the fogginess of the world would change as the FOV chang ) (set! (-> s4-0 w) 1.0) (let ((a0-5 (new-stack-vector0)) - (s3-0 (new 'stack-no-clear 'matrix)) + (s3-0 (new-stack-matrix0)) ) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) (vector-negate! a0-5 (-> arg0 rot)) (matrix-rotate-zyx! s3-0 (-> arg0 rot)) (vector-matrix*! s4-0 s4-0 s3-0) diff --git a/goal_src/jak3/engine/gfx/mood/mood-funcs.gc b/goal_src/jak3/engine/gfx/mood/mood-funcs.gc index ad34916b282..81ee741ef5c 100644 --- a/goal_src/jak3/engine/gfx/mood/mood-funcs.gc +++ b/goal_src/jak3/engine/gfx/mood/mood-funcs.gc @@ -42,7 +42,7 @@ (defun get-sphere-interp ((arg0 sphere) (arg1 vector) (arg2 float) (arg3 float)) (let ((v1-0 (new 'stack-no-clear 'vector))) 0.0 - (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-copy! v1-0 arg0) (vector-! v1-0 arg1 v1-0) (let ((f1-0 (vector-length v1-0))) (/ (fmax 0.0 (fmin (- f1-0 arg2) arg3)) arg3) diff --git a/goal_src/jak3/engine/gfx/mood/mood.gc b/goal_src/jak3/engine/gfx/mood/mood.gc index 33598815eac..7bc307c41a5 100644 --- a/goal_src/jak3/engine/gfx/mood/mood.gc +++ b/goal_src/jak3/engine/gfx/mood/mood.gc @@ -13,7 +13,7 @@ (cond ((logtest? (-> *time-of-day-context* mode) (ash 16 v1-0)) (if (-> *time-of-day-context* overide-enable) - (set! (-> arg0 times v1-0 quad) (-> *time-of-day-context* times v1-0 quad)) + (vector-copy! (-> arg0 times v1-0) (-> *time-of-day-context* times v1-0)) (set! (-> arg0 times v1-0 w) 1.0) ) ) @@ -234,13 +234,13 @@ (a0-16 (-> arg0 light-group)) ) (set! (-> v1-26 0 quad) (-> a2-1 amb-color quad)) - (set! (-> a1-2 quad) (-> a2-1 lgt-color quad)) - (set! (-> arg0 times 2 quad) (-> a1-2 quad)) - (set! (-> arg0 times 3 quad) (-> a1-2 quad)) - (set! (-> arg0 times 4 quad) (-> a1-2 quad)) + (vector-copy! a1-2 (-> a2-1 lgt-color)) + (vector-copy! (-> arg0 times 2) a1-2) + (vector-copy! (-> arg0 times 3) a1-2) + (vector-copy! (-> arg0 times 4) a1-2) (set! (-> a0-16 0 ambi color quad) (-> v1-26 0 quad)) ) - (set! (-> arg0 current-sky-color quad) (-> arg1 mood-sky-table data s3-0 quad)) + (vector-copy! (-> arg0 current-sky-color) (-> arg1 mood-sky-table data s3-0)) (mem-copy! (the-as pointer (-> arg0 current-fog)) (the-as pointer (-> arg1 mood-fog-table data s3-0)) 48) ) (else @@ -251,9 +251,9 @@ (let ((s0-0 (-> arg0 light-group))) (vector4-lerp! (the-as vector s1-0) (-> sv-32 amb-color) (-> sv-48 amb-color) f30-0) (vector4-lerp! sv-64 (-> sv-32 lgt-color) (-> sv-48 lgt-color) f30-0) - (set! (-> arg0 times 2 quad) (-> sv-64 quad)) - (set! (-> arg0 times 3 quad) (-> sv-64 quad)) - (set! (-> arg0 times 4 quad) (-> sv-64 quad)) + (vector-copy! (-> arg0 times 2) sv-64) + (vector-copy! (-> arg0 times 3) sv-64) + (vector-copy! (-> arg0 times 4) sv-64) (set! (-> s0-0 0 ambi color quad) (-> s1-0 0 quad)) ) ) @@ -350,7 +350,7 @@ (-> *level* level-default mood-context times 1) ) (when arg1 - (set! (-> arg0 times 1 quad) (-> *level* level-default mood-context times 1 quad)) + (vector-copy! (-> arg0 times 1) (-> *level* level-default mood-context times 1)) (set! (-> arg0 times 1 w) 1.0) ) ) @@ -764,10 +764,10 @@ (v1-7 (-> arg0 times 1)) ) (set! (-> a1-7 0 quad) (-> (the-as (inline-array vector) (+ a0-6 16)) 0 quad)) - (set! (-> v1-7 quad) (-> (the-as (inline-array vector) (+ a0-6 0)) 0 quad)) - (set! (-> arg0 times 2 quad) (-> v1-7 quad)) - (set! (-> arg0 times 3 quad) (-> v1-7 quad)) - (set! (-> arg0 times 4 quad) (-> v1-7 quad)) + (vector-copy! v1-7 (-> (the-as (inline-array vector) (+ a0-6 0)) 0)) + (vector-copy! (-> arg0 times 2) v1-7) + (vector-copy! (-> arg0 times 3) v1-7) + (vector-copy! (-> arg0 times 4) v1-7) ) ) (else @@ -778,9 +778,9 @@ ) (vector4-lerp! (the-as vector a0-14) (the-as vector (+ s3-0 16)) (the-as vector (+ s2-0 16)) f30-0) (vector4-lerp! s4-0 (the-as vector (+ s3-0 0)) (the-as vector (+ s2-0 0)) f30-0) - (set! (-> arg0 times 2 quad) (-> s4-0 quad)) - (set! (-> arg0 times 3 quad) (-> s4-0 quad)) - (set! (-> arg0 times 4 quad) (-> s4-0 quad)) + (vector-copy! (-> arg0 times 2) s4-0) + (vector-copy! (-> arg0 times 3) s4-0) + (vector-copy! (-> arg0 times 4) s4-0) ) ) ) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean-mid.gc b/goal_src/jak3/engine/gfx/ocean/ocean-mid.gc index efedd149da0..e9bce76cfaa 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean-mid.gc @@ -11,9 +11,9 @@ (defmethod ocean-mid-setup-constants ((this ocean) (arg0 ocean-mid-constants)) (let ((v1-0 *math-camera*)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) + (vector-copy! (-> arg0 inv-hmge-scale) (-> v1-0 inv-hmge-scale)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) ) (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) @@ -399,18 +399,7 @@ (set! (-> a0-1 base) (&+ (the-as pointer a1-1) 16)) ) (let ((s3-0 (the-as object (-> arg0 base)))) - (let* ((t0-4 (the-as matrix s3-0)) - (t1-2 v1-3) - (a0-2 (-> t1-2 rvec quad)) - (a1-3 (-> t1-2 uvec quad)) - (a3-4 (-> t1-2 fvec quad)) - (t1-3 (-> t1-2 trans quad)) - ) - (set! (-> t0-4 rvec quad) a0-2) - (set! (-> t0-4 uvec quad) a1-3) - (set! (-> t0-4 fvec quad) a3-4) - (set! (-> t0-4 trans quad) t1-3) - ) + (matrix-copy! (the-as matrix s3-0) v1-3) (let ((s2-0 (the-as object (&+ (the-as pointer s3-0) 48)))) (vector-matrix*! s4-0 arg1 v1-3) (set! (-> (the-as vector s2-0) x) (-> s4-0 x)) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean-near.gc b/goal_src/jak3/engine/gfx/ocean/ocean-near.gc index 579ae0321ec..8582dced73f 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean-near.gc @@ -37,9 +37,9 @@ (defmethod ocean-near-setup-constants ((this ocean) (arg0 ocean-near-constants)) (let ((v1-0 *math-camera*)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) + (vector-copy! (-> arg0 inv-hmge-scale) (-> v1-0 inv-hmge-scale)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) ) (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) @@ -432,18 +432,7 @@ (set! (-> v1-6 base) (&+ (the-as pointer a0-1) 16)) ) (let ((s3-0 (the-as object (-> arg0 base)))) - (let* ((v1-7 (the-as matrix s3-0)) - (t0-2 (-> *math-camera* camera-rot)) - (a0-4 (-> t0-2 rvec quad)) - (a1-5 (-> t0-2 uvec quad)) - (a3-4 (-> t0-2 fvec quad)) - (t0-3 (-> t0-2 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-4) - (set! (-> v1-7 uvec quad) a1-5) - (set! (-> v1-7 fvec quad) a3-4) - (set! (-> v1-7 trans quad) t0-3) - ) + (matrix-copy! (the-as matrix s3-0) (-> *math-camera* camera-rot)) (let ((s2-0 (the-as object (&+ (the-as pointer s3-0) 48)))) (vector-matrix*! s4-0 arg1 (-> *math-camera* camera-rot)) (set! (-> (the-as vector s2-0) x) (-> s4-0 x)) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean-texture.gc b/goal_src/jak3/engine/gfx/ocean/ocean-texture.gc index 8fb25396f15..3a602043132 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean-texture.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean-texture.gc @@ -738,7 +738,7 @@ (f30-0 0.015625) ) (let ((s3-0 (-> this cloud-lights))) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (vector--float*! s5-0 arg2 (-> s3-0 sun0-normal) 9.0) (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) diff --git a/goal_src/jak3/engine/gfx/ocean/ocean.gc b/goal_src/jak3/engine/gfx/ocean/ocean.gc index eac2328daa0..366fdb1bb7b 100644 --- a/goal_src/jak3/engine/gfx/ocean/ocean.gc +++ b/goal_src/jak3/engine/gfx/ocean/ocean.gc @@ -119,7 +119,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (-> this haze-lights)) ) - (set! (-> s3-0 quad) (-> arg1 pos quad)) + (vector-copy! s3-0 (-> arg1 pos)) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (+! (-> s3-0 y) 0.1) @@ -179,11 +179,11 @@ (set! (-> s4-0 3 pos x) f0-8) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-0 colors) (* (+ s1-0 1) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-56 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-52 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-56) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-52) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-0 #t) @@ -225,9 +225,9 @@ (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-1 colors) (* (+ s1-1 1) 4)))) (add-colors! this (-> s4-0 0 col) (-> s4-0 0)) (add-colors! this (-> s4-0 1 col) (-> s4-0 1)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-52 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-52) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-1 #t) @@ -279,11 +279,11 @@ (set! (-> s4-0 3 pos x) f0-9) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-56 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-52 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-56) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-52) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-0 #t) @@ -323,11 +323,11 @@ (set! (-> s4-0 3 pos x) f0-18) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-56) (add-colors! this (-> s4-0 2 col) (-> s4-0 2)) (add-colors! this (-> s4-0 3 col) (-> s4-0 3)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-1 #t) @@ -379,11 +379,11 @@ (set! (-> s4-0 3 pos z) f1-6) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-0 colors) (* 208 (+ s1-0 1))))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-52 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-56 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-52) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-56) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-0 #t) @@ -424,10 +424,10 @@ ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-1 colors) (* 208 (+ s1-1 1))))) (add-colors! this (-> s4-0 0 col) (-> s4-0 0)) - (set! (-> s4-0 1 col quad) (-> sv-52 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 1 col) sv-52) + (vector-copy! (-> s4-0 2 col) sv-56) (add-colors! this (-> s4-0 3 col) (-> s4-0 3)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-1 #t) @@ -479,11 +479,11 @@ (set! (-> s4-0 3 pos z) f1-7) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-52 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-56 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-52) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-56) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-0 #t) @@ -523,11 +523,11 @@ (set! (-> s4-0 3 pos z) f1-15) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) (add-colors! this (-> s4-0 1 col) (-> s4-0 1)) (add-colors! this (-> s4-0 2 col) (-> s4-0 2)) - (set! (-> s4-0 3 col quad) (-> sv-56 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 3 col) sv-56) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-1 #t) @@ -570,10 +570,10 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 1.0) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s4-0 quad)) - (set! (-> gp-0 1 col quad) (-> s4-0 quad)) - (set! (-> gp-0 2 col quad) (-> s4-0 quad)) - (set! (-> gp-0 3 col quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 0 col) s4-0) + (vector-copy! (-> gp-0 1 col) s4-0) + (vector-copy! (-> gp-0 2 col) s4-0) + (vector-copy! (-> gp-0 3 col) s4-0) (render-ocean-quad gp-0 arg0) (let ((f0-7 (+ -5898240.0 (-> this start-corner x))) (f1-1 (-> this start-corner z)) @@ -596,8 +596,8 @@ (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 0.0) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) - (set! (-> gp-0 1 col quad) (-> s4-0 quad)) - (set! (-> gp-0 2 col quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 1 col) s4-0) + (vector-copy! (-> gp-0 2 col) s4-0) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) (let ((f0-13 (+ -5898240.0 (-> this start-corner x))) @@ -622,7 +622,7 @@ (set! (-> gp-0 3 pos w) 0.0) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) - (set! (-> gp-0 2 col quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 2 col) s4-0) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) (let ((f0-18 (-> this start-corner x)) @@ -647,8 +647,8 @@ (set! (-> gp-0 3 pos w) 0.5) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) (add-colors! this (-> gp-0 1 col) (-> gp-0 2)) - (set! (-> gp-0 2 col quad) (-> s4-0 quad)) - (set! (-> gp-0 3 col quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 2 col) s4-0) + (vector-copy! (-> gp-0 3 col) s4-0) ) (render-ocean-quad gp-0 arg0) ) @@ -679,10 +679,10 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 1.0) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) + (vector-copy! (-> gp-0 2 col) s3-0) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let ((f0-8 (+ 24772608.0 (-> this start-corner x))) (f1-2 (-> this start-corner z)) @@ -704,10 +704,10 @@ (set! (-> gp-0 1 pos w) 0.0) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let ((f0-14 (+ 18874368.0 (-> this start-corner x))) (f1-5 (+ -5898240.0 (-> this start-corner z))) @@ -731,8 +731,8 @@ (set! (-> gp-0 3 pos w) 0.5) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 2 col) s3-0) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let ((f0-20 (+ 24772608.0 (-> this start-corner x))) (f1-8 (+ -5898240.0 (-> this start-corner z))) @@ -757,7 +757,7 @@ (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 3 col) s3-0) ) (render-ocean-quad gp-0 arg0) ) @@ -788,10 +788,10 @@ (set! (-> gp-0 1 pos w) 1.0) (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) + (vector-copy! (-> gp-0 2 col) s3-0) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let* ((f0-8 (+ -5898240.0 (-> this start-corner x))) (f1-3 (+ 18874368.0 (-> this start-corner z))) @@ -812,8 +812,8 @@ (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 0.0) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 1 col) s3-0) + (vector-copy! (-> gp-0 2 col) s3-0) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) (let* ((f0-14 (+ -5898240.0 (-> this start-corner x))) @@ -835,7 +835,7 @@ (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.0) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 1 col) s3-0) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) @@ -857,8 +857,8 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.0) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) ) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) @@ -891,10 +891,10 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) + (vector-copy! (-> gp-0 2 col) s3-0) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let* ((f0-9 (+ 24772608.0 (-> this start-corner x))) (f1-4 (+ 18874368.0 (-> this start-corner z))) @@ -914,10 +914,10 @@ (set! (-> gp-0 1 pos w) 0.0) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let* ((f0-15 (+ 18874368.0 (-> this start-corner x))) (f1-7 (+ 24772608.0 (-> this start-corner z))) @@ -937,8 +937,8 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.0) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) @@ -960,7 +960,7 @@ (set! (-> gp-0 1 pos w) 0.0) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.0) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) ) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) @@ -1307,8 +1307,8 @@ ) (let ((v1-20 (new 'stack-no-clear 'vector))) (if (-> *time-of-day-context* use-camera-other) - (set! (-> v1-20 quad) (-> *math-camera* inv-camera-rot-other fvec quad)) - (set! (-> v1-20 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! v1-20 (-> *math-camera* inv-camera-rot-other fvec)) + (vector-copy! v1-20 (-> *math-camera* inv-camera-rot fvec)) ) (cond ((< (fabs (-> v1-20 z)) (fabs (-> v1-20 x))) diff --git a/goal_src/jak3/engine/gfx/shrub/shrubbery.gc b/goal_src/jak3/engine/gfx/shrub/shrubbery.gc index aeab9eebd2f..807495eec4a 100644 --- a/goal_src/jak3/engine/gfx/shrub/shrubbery.gc +++ b/goal_src/jak3/engine/gfx/shrub/shrubbery.gc @@ -307,18 +307,7 @@ (defun shrub-make-perspective-matrix ((arg0 matrix) (arg1 matrix)) "Create shrub drawing matrix." - (let* ((v1-0 arg0) - (t0-0 arg1) - (a1-1 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a1-1) - (set! (-> v1-0 uvec quad) a2-0) - (set! (-> v1-0 fvec quad) a3-0) - (set! (-> v1-0 trans quad) t0-1) - ) + (matrix-copy! arg0 arg1) (let ((f0-1 (/ 1.0 (-> *math-camera* pfog0)))) (set! (-> arg0 rvec w) (* (-> arg0 rvec w) f0-1)) (set! (-> arg0 uvec w) (* (-> arg0 uvec w) f0-1)) diff --git a/goal_src/jak3/engine/gfx/sky/sky-data.gc b/goal_src/jak3/engine/gfx/sky/sky-data.gc index 3508f98cebd..98b63f48caf 100644 --- a/goal_src/jak3/engine/gfx/sky/sky-data.gc +++ b/goal_src/jak3/engine/gfx/sky/sky-data.gc @@ -926,7 +926,7 @@ (fmin (cos (* 182.04445 (* 10.0 (-> s3-0 pos x)))) (cos (* 182.04445 (* 10.0 (-> s3-0 pos z))))) ) (set-vector! (-> s3-0 stq) (* 0.25 (the float (+ s4-0 -4))) (* 0.25 (the float (+ s5-0 -4))) 1.0 1.0) - (set! (-> s3-0 nrm quad) (-> s3-0 pos quad)) + (vector-copy! (-> s3-0 nrm) (-> s3-0 pos)) (+! (-> s3-0 nrm y) 1.0) (vector-normalize! (-> s3-0 nrm) 1.0) (vector-negate! (-> s3-0 nrm2) (-> s3-0 nrm)) @@ -1110,7 +1110,7 @@ (set! (-> s4-0 pos x) (* 9.0 (sin (* 182.04445 (* 10.0 (the float s5-0)))))) (set! (-> s4-0 pos z) (* 9.0 (cos (* 182.04445 (* 10.0 (the float s5-0)))))) (set! (-> s4-0 pos y) 0.0) - (set! (-> s4-0 nrm quad) (-> s4-0 pos quad)) + (vector-copy! (-> s4-0 nrm) (-> s4-0 pos)) (+! (-> s4-0 nrm y) 1.0) (vector-normalize! (-> s4-0 nrm) 1.0) ) diff --git a/goal_src/jak3/engine/gfx/sky/sky-tng.gc b/goal_src/jak3/engine/gfx/sky/sky-tng.gc index cb9fa4ba295..13c015f36c9 100644 --- a/goal_src/jak3/engine/gfx/sky/sky-tng.gc +++ b/goal_src/jak3/engine/gfx/sky/sky-tng.gc @@ -68,18 +68,7 @@ (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((v1-0 (-> this cam-mat))) - (let* ((a0-1 v1-0) - (t0-0 arg0) - (a1-1 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> a0-1 rvec quad) a1-1) - (set! (-> a0-1 uvec quad) a2-0) - (set! (-> a0-1 fvec quad) a3-0) - (set! (-> a0-1 trans quad) t0-1) - ) + (matrix-copy! v1-0 arg0) (.svf (&-> v1-0 trans quad) vf0) (matrix*! v1-0 v1-0 (-> *math-camera* perspective)) ) @@ -94,8 +83,8 @@ (a0-2 (-> *level* level-default mood-context current-sky-color)) ) (dotimes (a1-1 12) - (set! (-> sky-base-polygons a1-1 col quad) (-> v1-1 quad)) - (set! (-> sky-roof-polygons a1-1 col quad) (-> a0-2 quad)) + (vector-copy! (-> sky-base-polygons a1-1 col) v1-1) + (vector-copy! (-> sky-roof-polygons a1-1 col) a0-2) ) ) 0 @@ -140,7 +129,7 @@ ) (cond ((= a0-7 v1-7) - (set! (-> this sun0-color quad) (-> s5-0 data a0-7 lgt-color quad)) + (vector-copy! (-> this sun0-color) (-> s5-0 data a0-7 lgt-color)) ) (else (let ((a1-5 (-> s5-0 data a0-7)) @@ -151,14 +140,14 @@ ) ) ) - (set! (-> this sun0-color-lower quad) (-> s3-0 times 1 quad)) - (set! (-> this ambi-color-lower quad) (-> s3-0 times 0 quad)) + (vector-copy! (-> this sun0-color-lower) (-> s3-0 times 1)) + (vector-copy! (-> this ambi-color-lower) (-> s3-0 times 0)) (set-vector! s4-0 1.9921875 1.9921875 1.9921875 1.0) (vector4-lerp! (-> this ambi-color) (-> this ambi-color-lower) s4-0 (-> *mood-control* lightning-flash)) ) - (set! (-> this sun0-color quad) (-> this sun0-color quad)) - (set! (-> this sun1-color quad) (-> s5-0 data 7 lgt-color quad)) - (set! (-> this moon-color quad) (-> s5-0 data 6 lgt-color quad)) + (vector-copy! (-> this sun0-color) (-> this sun0-color)) + (vector-copy! (-> this sun1-color) (-> s5-0 data 7 lgt-color)) + (vector-copy! (-> this moon-color) (-> s5-0 data 6 lgt-color)) ) 0 (none) @@ -194,12 +183,12 @@ (f28-0 0.00390625) (f30-0 0.015625) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (vector--float*! (the-as vector s5-0) arg2 (-> arg3 sun0-normal) 9.0) (vector--float*! (the-as vector s2-0) arg2 (-> arg3 sun1-normal) 9.0) (vector--float*! (the-as vector s4-0) arg2 (-> arg3 moon-normal) 9.0) (vector4-scale! s5-0 s5-0 (* (-> arg3 sun0-scale) f28-0)) - (vector4-madd! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> arg3 sun1-scale))) + (vector4-madd! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> arg3 sun1-scale))) (vector4-madd! s5-0 s5-0 s4-0 (* (-> arg3 moon-scale) f28-0)) (+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0))) (+! (-> arg0 y) (fmax (fmin (-> s5-0 z) f30-0) (- f30-0))) @@ -214,7 +203,7 @@ ) (set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0)) (set! (-> s4-0 sun1-normal quad) (-> (&-> this upload-data data 4) 0)) - (set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad)) + (vector-copy! (-> s4-0 moon-normal) (-> this upload-data moon pos)) (vector-normalize! (-> s4-0 sun0-normal) 1.0) (vector-normalize! (-> s4-0 sun1-normal) 1.0) (vector-normalize! (-> s4-0 moon-normal) 1.0) @@ -241,7 +230,7 @@ (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) (the-as vector4 (-> this sun1-color)) - (* 0.5 (-> s4-0 sun1-scale)) + (/ (-> s4-0 sun1-scale) 2) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) @@ -392,7 +381,7 @@ ) (set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0)) (set! (-> s4-0 sun1-normal quad) (-> (&-> this upload-data data 4) 0)) - (set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad)) + (vector-copy! (-> s4-0 moon-normal) (-> this upload-data moon pos)) (vector-normalize! (-> s4-0 sun0-normal) 1.0) (vector-normalize! (-> s4-0 sun1-normal) 1.0) (vector-normalize! (-> s4-0 moon-normal) 1.0) @@ -414,7 +403,7 @@ (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) (the-as vector4 (-> this sun1-color)) - (* 0.5 (-> s4-0 sun1-scale)) + (/ (-> s4-0 sun1-scale) 2) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/light-trails.gc b/goal_src/jak3/engine/gfx/sprite/particles/light-trails.gc index ad0e25b03d2..93965c5f188 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/light-trails.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/light-trails.gc @@ -80,7 +80,7 @@ (if (-> this appearance use-tape-mode?) (set! f0-5 (- f2-0 f1-2)) ) - (set! (-> a1-5 pos quad) (-> arg0 quad)) + (vector-copy! (-> a1-5 pos) arg0) (set! (-> a1-5 birth-time) (the-as uint (the int (- (the float (+ (-> this start-marker) arg1)) f0-5)))) ) (mem-copy! @@ -126,7 +126,7 @@ (if (-> this appearance use-tape-mode?) (set! f0-4 (- f2-0 f1-3)) ) - (set! (-> gp-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 pos) arg0) (set! (-> gp-0 birth-time) (the-as uint @@ -145,7 +145,7 @@ (defmethod add-vert-to-prim-strip! ((this light-trail) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) "Add a single vertex to the prim." (let ((v1-3 (-> arg0 data (-> arg0 num-verts)))) - (set! (-> v1-3 pos quad) (-> arg1 quad)) + (vector-copy! (-> v1-3 pos) arg1) (set! (-> v1-3 col) arg2) (set! (-> v1-3 stq x) arg3) (set! (-> v1-3 stq y) arg4) @@ -163,7 +163,7 @@ (cond ((= (-> this appearance lie-mode) (lie-mode use-two-strips)) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> this cache-vector 0 quad)) + (vector-copy! s1-0 (-> this cache-vector 0)) (vector-normalize! s1-0 (/ arg2 2)) (add-vert-to-prim-strip! this @@ -183,7 +183,7 @@ ) ) (let ((s1-1 (new 'stack-no-clear 'vector))) - (set! (-> s1-1 quad) (-> this cache-vector 1 quad)) + (vector-copy! s1-1 (-> this cache-vector 1)) (vector-normalize! s1-1 (/ arg2 2)) (add-vert-to-prim-strip! this @@ -205,7 +205,7 @@ ) (else (let ((s1-2 (new 'stack-no-clear 'vector))) - (set! (-> s1-2 quad) (-> arg3 quad)) + (vector-copy! s1-2 arg3) (vector-normalize! s1-2 (/ arg2 2)) (add-vert-to-prim-strip! this @@ -304,7 +304,7 @@ (vector-cross! arg3 v1-0 (-> this appearance lie-vector)) (set! (-> arg3 y) 0.0) (vector-cross! arg3 v1-0 arg3) - (set! (-> this cache-vector 1 quad) (-> arg3 quad)) + (vector-copy! (-> this cache-vector 1) arg3) ) ) ) @@ -576,10 +576,10 @@ ) ) (set! sv-92 sv-152) - (set! (-> sv-104 quad) (-> (the-as vector (&+ (the-as (pointer uint8) s4-1) 0)) quad)) + (vector-copy! sv-104 (the-as vector (&+ (the-as (pointer uint8) s4-1) 0))) (set! sv-96 sv-196) (set! (-> sv-100 quad) (-> sv-200 quad)) - (set! (-> sv-132 quad) (-> sv-204 quad)) + (vector-copy! sv-132 sv-204) ) ) ) @@ -799,7 +799,7 @@ ) ) (if a0-2 - (set! (-> arg1 quad) (-> (get-trans a0-2 0) quad)) + (vector-copy! arg1 (get-trans a0-2 0)) ) ) arg1 @@ -818,7 +818,7 @@ (when a0-2 (let ((s5-1 (-> a0-2 water))) (when (and s5-1 a0-2 (nonzero? s5-1)) - (set! (-> arg1 quad) (-> (get-trans a0-2 0) quad)) + (vector-copy! arg1 (get-trans a0-2 0)) (set! (-> arg1 y) (+ 40.96 (-> s5-1 surface-height))) ) ) @@ -878,7 +878,7 @@ (defmethod get-tracked-object-pos ((this light-trail-tracker-projectile) (arg0 process-focusable) (arg1 vector)) (let ((a0-1 arg0)) (if a0-1 - (set! (-> arg1 quad) (-> a0-1 root trans quad)) + (vector-copy! arg1 (-> a0-1 root trans)) ) ) arg1 @@ -1034,7 +1034,7 @@ ;; WARN: Return type mismatch vector vs none. (defmethod calc-vertex-pos! ((this weapon-trail) (arg0 light-trail-breadcrumb) (arg1 int) (arg2 vector) (arg3 vector)) - (set! (-> arg3 quad) (-> (&+ arg0 16) pos quad)) + (vector-copy! arg3 (-> (&+ arg0 16) pos)) (none) ) @@ -1109,8 +1109,8 @@ (if (-> this appearance use-tape-mode?) (set! f0-6 (- f2-0 f1-2)) ) - (set! (-> gp-0 pos quad) (-> s3-0 quad)) - (set! (-> gp-0 offset quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 pos) s3-0) + (vector-copy! (-> gp-0 offset) s4-0) (set! (-> gp-0 birth-time) (the-as uint @@ -1144,7 +1144,7 @@ ) (vector-float*! arg3 arg3 arg2) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> arg3 quad)) + (vector-copy! s2-0 arg3) (add-vert-to-prim-strip! this (-> this strip) @@ -1249,7 +1249,7 @@ (if (-> this appearance use-tape-mode?) (set! f0-4 (- f2-0 f1-3)) ) - (set! (-> s5-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 pos) arg0) (set! (-> s5-0 birth-time) (the-as uint @@ -1257,7 +1257,7 @@ ) ) ) - (set! (-> s5-0 normal quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 normal) arg1) ) ) ) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc index a3801fa6206..8cd8e3a2a6e 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -232,7 +232,7 @@ (let ((a3-5 (-> v1-0 queue (-> v1-0 in-use)))) (set! (-> a3-5 sp-system) arg0) (set! (-> a3-5 sp-launcher) arg1) - (set! (-> a3-5 pos quad) (-> arg2 trans quad)) + (vector-copy! (-> a3-5 pos) (-> arg2 trans)) ) (let ((v0-1 (+ (-> v1-0 in-use) 1))) (set! (-> v1-0 in-use) v0-1) @@ -504,7 +504,7 @@ (when (> (-> gp-0 in-use) 0) (dotimes (s4-0 (-> gp-0 in-use)) (let ((v1-4 (-> gp-0 queue s4-0))) - (set! (-> s5-0 trans quad) (-> v1-4 pos quad)) + (vector-copy! (-> s5-0 trans) (-> v1-4 pos)) (launch-particles :system (-> v1-4 sp-system) (-> v1-4 sp-launcher) s5-0 :origin-is-matrix #t) ) ) @@ -537,18 +537,7 @@ (quaternion->matrix sv-96 (-> arg2 key proc root quat)) ) ((logtest? (-> arg2 key group flags) (sp-group-flag sp12)) - (let* ((v1-17 sv-96) - (a3-1 (-> arg2 key local-space-binding mat-new)) - (a0-5 (-> a3-1 rvec quad)) - (a1-2 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-17 rvec quad) a0-5) - (set! (-> v1-17 uvec quad) a1-2) - (set! (-> v1-17 fvec quad) a2-1) - (set! (-> v1-17 trans quad) a3-2) - ) + (matrix-copy! sv-96 (-> arg2 key local-space-binding mat-new)) ) (else (set! s3-0 #f) @@ -944,17 +933,9 @@ (a0-13 (-> (the-as particle-local-space-info a1-0) next0)) ) (while (!= a1-0 (-> v1-7 alive-list-end)) - (let* ((a2-0 (-> (the-as particle-local-space-info a1-0) mat-prev)) - (t1-0 (-> (the-as particle-local-space-info a1-0) mat-new)) - (a1-1 (-> t1-0 rvec quad)) - (a3-0 (-> t1-0 uvec quad)) - (t0-0 (-> t1-0 fvec quad)) - (t1-1 (-> t1-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) a1-1) - (set! (-> a2-0 uvec quad) a3-0) - (set! (-> a2-0 fvec quad) t0-0) - (set! (-> a2-0 trans quad) t1-1) + (matrix-copy! + (-> (the-as particle-local-space-info a1-0) mat-prev) + (-> (the-as particle-local-space-info a1-0) mat-new) ) (set! a1-0 a0-13) (set! a0-13 (-> a0-13 next0)) @@ -975,20 +956,10 @@ (cond ((logtest? (-> arg0 flags) (part-local-space-flags pls0)) (matrix-identity! gp-0) - (set! (-> gp-0 trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> gp-0 trans) (-> s5-0 trans)) ) ((logtest? (-> arg0 flags) (part-local-space-flags pls1)) - (let ((a2-0 gp-0) - (v1-7 (-> s5-0 rvec quad)) - (a0-4 (-> s5-0 uvec quad)) - (a1-0 (-> s5-0 fvec quad)) - (a3-0 (-> s5-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-7) - (set! (-> a2-0 uvec quad) a0-4) - (set! (-> a2-0 fvec quad) a1-0) - (set! (-> a2-0 trans quad) a3-0) - ) + (matrix-copy! gp-0 s5-0) (set! (-> gp-0 rvec y) 0.0) (set! (-> gp-0 fvec y) 0.0) (vector-normalize! (-> gp-0 rvec) 1.0) @@ -996,17 +967,7 @@ (vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec)) ) (else - (let* ((a2-1 s5-0) - (v1-10 (-> a2-1 rvec quad)) - (a0-8 (-> a2-1 uvec quad)) - (a1-4 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-10) - (set! (-> gp-0 uvec quad) a0-8) - (set! (-> gp-0 fvec quad) a1-4) - (set! (-> gp-0 trans quad) a2-2) - ) + (matrix-copy! gp-0 s5-0) ) ) ) @@ -1024,20 +985,10 @@ (cond ((logtest? (-> arg0 flags) (part-local-space-flags pls0)) (matrix-identity! gp-0) - (set! (-> gp-0 trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> gp-0 trans) (-> s5-0 trans)) ) ((logtest? (-> arg0 flags) (part-local-space-flags pls1)) - (let ((a2-2 gp-0) - (v1-14 (-> s5-0 rvec quad)) - (a0-4 (-> s5-0 uvec quad)) - (a1-5 (-> s5-0 fvec quad)) - (a3-0 (-> s5-0 trans quad)) - ) - (set! (-> a2-2 rvec quad) v1-14) - (set! (-> a2-2 uvec quad) a0-4) - (set! (-> a2-2 fvec quad) a1-5) - (set! (-> a2-2 trans quad) a3-0) - ) + (matrix-copy! gp-0 s5-0) (set! (-> gp-0 rvec y) 0.0) (set! (-> gp-0 fvec y) 0.0) (vector-normalize! (-> gp-0 rvec) 1.0) @@ -1045,17 +996,7 @@ (vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec)) ) (else - (let* ((a2-3 s5-0) - (v1-17 (-> a2-3 rvec quad)) - (a0-8 (-> a2-3 uvec quad)) - (a1-9 (-> a2-3 fvec quad)) - (a2-4 (-> a2-3 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-17) - (set! (-> gp-0 uvec quad) a0-8) - (set! (-> gp-0 fvec quad) a1-9) - (set! (-> gp-0 trans quad) a2-4) - ) + (matrix-copy! gp-0 s5-0) ) ) ) @@ -1268,7 +1209,7 @@ ) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> a3-2 center quad)) + (vector-copy! (-> a2-5 trans) (-> a3-2 center)) (t9-4 a0-37 a1-5 a2-5 a3-2 this f0-5) ) ) @@ -1352,7 +1293,7 @@ ) (a2-23 *launch-matrix*) ) - (set! (-> a2-23 trans quad) (-> a3-2 center quad)) + (vector-copy! (-> a2-23 trans) (-> a3-2 center)) (t9-6 a0-82 a1-5 a2-23 a3-2 this f0-5) ) ) @@ -1396,21 +1337,10 @@ (set! sv-104 (the-as int (-> (the-as connection v1-1) param0))) (when (nonzero? sv-96) (let ((a1-8 (-> a0-2 node-list data sv-104))) - (let* ((v1-7 s3-0) - (t0-0 (-> a1-8 bone transform)) - (a0-5 (-> t0-0 rvec quad)) - (a2-2 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-5) - (set! (-> v1-7 uvec quad) a2-2) - (set! (-> v1-7 fvec quad) a3-0) - (set! (-> v1-7 trans quad) t0-1) - ) + (matrix-copy! s3-0 (-> a1-8 bone transform)) (vector<-cspace! (-> s3-0 trans) a1-8) ) - (set! (-> s2-0 quad) (-> (the-as vector s0-0) quad)) + (vector-copy! s2-0 (the-as vector s0-0)) (set! (-> s2-0 w) 1.0) (vector-matrix*! (-> s3-0 trans) s2-0 s3-0) (launch-particles :system gp-0 sv-96 s3-0 :origin-is-matrix #t) @@ -1449,7 +1379,7 @@ (a0-25 gp-0) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> (the-as vector (&-> s0-1 param0)) quad)) + (vector-copy! (-> a2-5 trans) (the-as vector (&-> s0-1 param0))) (t9-5 a0-25 (the-as sparticle-launcher a1-14) @@ -1546,7 +1476,7 @@ (init-vf0-vector) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 vel-sxvel quad)) + (vector-copy! s5-0 (-> arg1 vel-sxvel)) (let ((s4-0 (-> arg1 key proc))) (vector-normalize! s5-0 1.0) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -1790,7 +1720,7 @@ (a1-3 (-> *part-id-table* (-> gp-0 s5-1))) (a2-1 *launch-matrix*) ) - (set! (-> a2-1 trans quad) (-> s2-0 quad)) + (vector-copy! (-> a2-1 trans) s2-0) (t9-1 a0-2 a1-3 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (+! s5-1 1) @@ -1827,7 +1757,7 @@ (a1-3 (-> *part-id-table* (-> gp-0 s2-1))) (a2-1 *launch-matrix*) ) - (set! (-> a2-1 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a2-1 trans) s4-0) (t9-1 a0-2 a1-3 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (+! s2-1 1) @@ -2479,7 +2409,7 @@ (let ((a0-1 (math-camera-matrix)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> a0-1 rvec quad)) + (vector-copy! s5-0 (-> a0-1 rvec)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (let ((a1-3 (matrix-fr-compose (new 'stack-no-clear 'matrix) s5-0 *up-vector*)) @@ -2512,7 +2442,7 @@ (defmethod init-with-vec! ((this sparticle-subsampler) (arg0 vector)) (let ((f30-0 (-> this spt-num))) (when (not (-> this inited?)) - (set! (-> this spawn-mat trans quad) (-> arg0 quad)) + (vector-copy! (-> this spawn-mat trans) arg0) (set! (-> this inited?) #t) (set! f30-0 0.000000000000000000000000000000000000000000001) ) @@ -2520,18 +2450,7 @@ (let ((f28-0 (/ 1.0 f30-0))) 0.0 (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 s4-0) - (a3-0 (-> this spawn-mat)) - (v1-8 (-> a3-0 rvec quad)) - (a0-3 (-> a3-0 uvec quad)) - (a1-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-8) - (set! (-> a2-0 uvec quad) a0-3) - (set! (-> a2-0 fvec quad) a1-1) - (set! (-> a2-0 trans quad) a3-1) - ) + (matrix-copy! s4-0 (-> this spawn-mat)) (dotimes (s3-0 (the int f30-0)) (let ((f0-5 (* f28-0 (the float s3-0)))) (vector-lerp! (-> s4-0 trans) arg0 (-> this spawn-mat trans) f0-5) @@ -2542,43 +2461,21 @@ ) ) (let ((v0-2 (-> this spawn-mat trans))) - (set! (-> v0-2 quad) (-> arg0 quad)) + (vector-copy! v0-2 arg0) v0-2 ) ) (defmethod init-with-mat! ((this sparticle-subsampler) (arg0 matrix)) (when (not (-> this inited?)) - (let* ((a2-0 (-> this spawn-mat)) - (a3-0 arg0) - (v1-2 (-> a3-0 rvec quad)) - (a0-1 (-> a3-0 uvec quad)) - (a1-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-2) - (set! (-> a2-0 uvec quad) a0-1) - (set! (-> a2-0 fvec quad) a1-1) - (set! (-> a2-0 trans quad) a3-1) - ) + (matrix-copy! (-> this spawn-mat) arg0) (set! (-> this inited?) #t) ) (set! (-> this sp-launcher birthaccum) 0.0) (let ((f30-0 (/ 1.0 (-> this spt-num)))) 0.0 (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-1 s4-0) - (a3-2 arg0) - (v1-6 (-> a3-2 rvec quad)) - (a0-2 (-> a3-2 uvec quad)) - (a1-2 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-6) - (set! (-> a2-1 uvec quad) a0-2) - (set! (-> a2-1 fvec quad) a1-2) - (set! (-> a2-1 trans quad) a3-3) - ) + (matrix-copy! s4-0 arg0) (dotimes (s3-0 (the int (-> this spt-num))) (let ((f0-5 (* f30-0 (the float s3-0)))) (vector-lerp! (-> s4-0 trans) (-> arg0 trans) (-> this spawn-mat trans) f0-5) @@ -2587,19 +2484,7 @@ ) ) ) - (let ((v0-2 (-> this spawn-mat))) - (let ((v1-10 (-> arg0 rvec quad)) - (a0-5 (-> arg0 uvec quad)) - (a1-5 (-> arg0 fvec quad)) - (a2-4 (-> arg0 trans quad)) - ) - (set! (-> v0-2 rvec quad) v1-10) - (set! (-> v0-2 uvec quad) a0-5) - (set! (-> v0-2 fvec quad) a1-5) - (set! (-> v0-2 trans quad) a2-4) - ) - v0-2 - ) + (matrix-copy! (-> this spawn-mat) arg0) ) (defun spt-func-relative-pos ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) @@ -2639,30 +2524,8 @@ (set! sv-276 (new 'stack-no-clear 'matrix)) (set! sv-280 (new 'stack-no-clear 'matrix)) (set! sv-284 (new 'stack-no-clear 'matrix)) - (let* ((a2-1 sv-280) - (a3-0 sv-268) - (v1-12 (-> a3-0 rvec quad)) - (a0-4 (-> a3-0 uvec quad)) - (a1-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-12) - (set! (-> a2-1 uvec quad) a0-4) - (set! (-> a2-1 fvec quad) a1-1) - (set! (-> a2-1 trans quad) a3-1) - ) - (let* ((a2-2 sv-284) - (a3-2 sv-272) - (v1-13 (-> a3-2 rvec quad)) - (a0-5 (-> a3-2 uvec quad)) - (a1-2 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-2 rvec quad) v1-13) - (set! (-> a2-2 uvec quad) a0-5) - (set! (-> a2-2 fvec quad) a1-2) - (set! (-> a2-2 trans quad) a3-3) - ) + (matrix-copy! sv-280 sv-268) + (matrix-copy! sv-284 sv-272) (dotimes (s4-0 3) (vector-normalize! (the-as vector (&-> sv-280 quad s4-0)) 1.0) (vector-normalize! (the-as vector (&-> sv-284 quad s4-0)) 1.0) @@ -2701,7 +2564,7 @@ (init-vf0-vector) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 vel-sxvel quad)) + (vector-copy! s5-0 (-> arg1 vel-sxvel)) (let ((s3-0 (-> arg1 key proc))) (vector-normalize! s5-0 1.0) (let ((s4-0 (new 'stack-no-clear 'vector)) diff --git a/goal_src/jak3/engine/gfx/sprite/simple-sprite-h.gc b/goal_src/jak3/engine/gfx/sprite/simple-sprite-h.gc index 9367e04dbbb..60d6f879aca 100644 --- a/goal_src/jak3/engine/gfx/sprite/simple-sprite-h.gc +++ b/goal_src/jak3/engine/gfx/sprite/simple-sprite-h.gc @@ -29,7 +29,7 @@ (defmethod set-trans ((this sprite-glow-data) (arg0 vector)) (let ((f0-0 (-> this position w))) - (set! (-> this position quad) (-> arg0 quad)) + (vector-copy! (-> this position) arg0) (set! (-> this position w) f0-0) ) 0 diff --git a/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc b/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc index d308241d845..d319f632756 100644 --- a/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc +++ b/goal_src/jak3/engine/gfx/sprite/sprite-glow.gc @@ -242,32 +242,10 @@ (defun sprite-glow-init-consts ((arg0 sprite-glow-consts)) "Fill out sprite-glow-consts to be sent to VU1." (let ((v1-0 *math-camera*)) - (let* ((t0-0 (-> arg0 camera)) - (t1-0 (-> v1-0 camera-rot)) - (a1-0 (-> t1-0 rvec quad)) - (a2-0 (-> t1-0 uvec quad)) - (a3-0 (-> t1-0 fvec quad)) - (t1-1 (-> t1-0 trans quad)) - ) - (set! (-> t0-0 rvec quad) a1-0) - (set! (-> t0-0 uvec quad) a2-0) - (set! (-> t0-0 fvec quad) a3-0) - (set! (-> t0-0 trans quad) t1-1) - ) - (let* ((t0-1 (-> arg0 perspective)) - (t1-2 (-> v1-0 perspective)) - (a1-1 (-> t1-2 rvec quad)) - (a2-1 (-> t1-2 uvec quad)) - (a3-1 (-> t1-2 fvec quad)) - (t1-3 (-> t1-2 trans quad)) - ) - (set! (-> t0-1 rvec quad) a1-1) - (set! (-> t0-1 uvec quad) a2-1) - (set! (-> t0-1 fvec quad) a3-1) - (set! (-> t0-1 trans quad) t1-3) - ) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (matrix-copy! (-> arg0 camera) (-> v1-0 camera-rot)) + (matrix-copy! (-> arg0 perspective) (-> v1-0 perspective)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) (set! (-> arg0 basis-x quad) (the-as uint128 0)) (set! (-> arg0 basis-x x) (- (-> *math-camera* perspective rvec x))) (set! (-> arg0 basis-y quad) (the-as uint128 0)) diff --git a/goal_src/jak3/engine/gfx/sprite/sprite.gc b/goal_src/jak3/engine/gfx/sprite/sprite.gc index 2451a1df14d..4fad24d08ec 100644 --- a/goal_src/jak3/engine/gfx/sprite/sprite.gc +++ b/goal_src/jak3/engine/gfx/sprite/sprite.gc @@ -174,8 +174,8 @@ The glow and distort renderers will pull sprites from here." ;; WARN: Return type mismatch float vs none. (defun sprite-setup-frame-data ((arg0 sprite-frame-data) (arg1 uint)) - (set! (-> arg0 hmge-scale quad) (-> *math-camera* hmge-scale quad)) - (set! (-> arg0 inv-hmge-scale quad) (-> *math-camera* inv-hmge-scale quad)) + (vector-copy! (-> arg0 hmge-scale) (-> *math-camera* hmge-scale)) + (vector-copy! (-> arg0 inv-hmge-scale) (-> *math-camera* inv-hmge-scale)) (set! (-> arg0 consts x) (-> *math-camera* pfog0)) (set! (-> arg0 consts y) 0.000095873795) (set! (-> arg0 adgif-giftag tag) (new 'static 'gif-tag64 :nloop #x1 :nreg #x5)) @@ -438,18 +438,8 @@ The glow and distort renderers will pull sprites from here." (set! (-> a2-1 vif1) (new 'static 'vif-tag :num #x5 :cmd (vif-cmd unpack-v4-32) :imm (shr (shl v1-0 54) 54))) (set! (-> a1-1 base) (the-as pointer (&+ a2-1 16))) ) - (let* ((a1-2 (the-as matrix (-> arg0 base))) - (t1-0 (-> *math-camera* camera-temp)) - (a2-4 (-> t1-0 rvec quad)) - (a3-4 (-> t1-0 uvec quad)) - (t0-4 (-> t1-0 fvec quad)) - (t1-1 (-> t1-0 trans quad)) - ) - (set! (-> a1-2 rvec quad) a2-4) - (set! (-> a1-2 uvec quad) a3-4) - (set! (-> a1-2 fvec quad) t0-4) - (set! (-> a1-2 trans quad) t1-1) - ) + ;; og:preserve-this + (matrix-copy! (the-as matrix (-> arg0 base)) (-> *math-camera* camera-temp)) (&+! (-> arg0 base) 64) (let ((v1-1 (+ v1-0 4))) (set! (-> (the-as (pointer uint128) (-> arg0 base))) (-> *math-camera* hvdf-off quad)) @@ -485,7 +475,7 @@ The glow and distort renderers will pull sprites from here." (&+! (-> arg0 base) 64) (let ((v1-2 (+ v1-0 4))) (let ((a1-16 (the-as vector (-> arg0 base)))) - (set! (-> a1-16 quad) (-> *math-camera* hvdf-off quad)) + (vector-copy! a1-16 (-> *math-camera* hvdf-off)) (set! (-> a1-16 x) 2048.0) (set! (-> a1-16 y) 2048.0) (set! (-> a1-16 z) (-> *math-camera* hvdf-off z)) diff --git a/goal_src/jak3/engine/level/level-h.gc b/goal_src/jak3/engine/level/level-h.gc index 5ad335925f8..8a552a2c4df 100644 --- a/goal_src/jak3/engine/level/level-h.gc +++ b/goal_src/jak3/engine/level/level-h.gc @@ -495,7 +495,7 @@ (update-vis-volumes (_type_) none) (level-group-method-24 (_type_) none) (print-volume-sizes (_type_) none) - (status-of-level-and-borrows (_type_ symbol symbol) symbol) + (level-status? (_type_ symbol symbol) symbol) (do-nothing (_type_) none) (load-in-progress? (_type_) symbol) (is-load-allowed? (_type_ (pointer symbol)) symbol) diff --git a/goal_src/jak3/engine/level/level.gc b/goal_src/jak3/engine/level/level.gc index 378488c0a79..e7d22517d3f 100644 --- a/goal_src/jak3/engine/level/level.gc +++ b/goal_src/jak3/engine/level/level.gc @@ -560,7 +560,7 @@ (none) ) -(defmethod status-of-level-and-borrows ((this level-group) (arg0 symbol) (arg1 symbol)) +(defmethod level-status? ((this level-group) (arg0 symbol) (arg1 symbol)) "Get the combined status of a level and borrow levels." (if (not arg0) (return #f) @@ -577,7 +577,7 @@ (let ((v1-14 (-> s4-0 info borrow borrow-info s3-1))) (when v1-14 (when (car (cdr v1-14)) - (let ((v1-15 (status-of-level-and-borrows this (the-as symbol (car v1-14)) arg1))) + (let ((v1-15 (level-status? this (the-as symbol (car v1-14)) arg1))) (if (!= v1-15 (-> s4-0 status)) (return v1-15) ) @@ -617,7 +617,7 @@ ) ) ) - (let ((v1-29 (status-of-level-and-borrows *level* (the-as symbol (car s5-1)) arg1))) + (let ((v1-29 (level-status? *level* (the-as symbol (car s5-1)) arg1))) (if (!= v1-29 'active) (return v1-29) ) diff --git a/goal_src/jak3/engine/level/region.gc b/goal_src/jak3/engine/level/region.gc index 9b8080319cb..74ba7143a92 100644 --- a/goal_src/jak3/engine/level/region.gc +++ b/goal_src/jak3/engine/level/region.gc @@ -575,9 +575,9 @@ ) (defun region-execute () - (set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad)) + (vector-copy! (-> *level* camera-pos 1) (-> *level* camera-pos 0)) (set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad)) - (set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad)) + (vector-copy! (-> *level* target-pos 1) (-> *level* target-pos 0)) (set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad)) (when (and *execute-regions* (-> *setting-control* user-current region-mode) (not (paused?))) (region-tree-execute 'camera (-> *level* camera-pos 1) (the-as vector (-> *level* camera-pos))) diff --git a/goal_src/jak3/engine/math/euler.gc b/goal_src/jak3/engine/math/euler.gc index 54eb813642b..28af00e0866 100644 --- a/goal_src/jak3/engine/math/euler.gc +++ b/goal_src/jak3/engine/math/euler.gc @@ -20,7 +20,7 @@ "Convert from euler angles to 4x4 matrix." (matrix-identity! arg0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (when (= (logand (the int (-> s5-0 w)) 1) 1) (let ((f0-2 (-> s5-0 x))) (set! (-> s5-0 x) (-> s5-0 z)) @@ -99,7 +99,7 @@ (defun matrix->eul ((arg0 euler-angles) (arg1 matrix) (arg2 int)) "Convert matrix to euler angles with given order flag. -Not clear how this works if the matrix has more than just a rotation." + Not clear how this works if the matrix has more than just a rotation." 0 0 0 diff --git a/goal_src/jak3/engine/math/matrix-compose.gc b/goal_src/jak3/engine/math/matrix-compose.gc index 9687c33cec0..d4ec654c54a 100644 --- a/goal_src/jak3/engine/math/matrix-compose.gc +++ b/goal_src/jak3/engine/math/matrix-compose.gc @@ -8,35 +8,35 @@ ;; DECOMP BEGINS (defun matrix-fur-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg3 quad)) - (set! (-> arg0 uvec quad) (-> arg2 quad)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg3) + (vector-copy! (-> arg0 uvec) arg2) + (vector-copy! (-> arg0 fvec) arg1) arg0 ) (defun matrix-fu-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) - (set! (-> arg0 uvec quad) (-> arg2 quad)) + (vector-copy! (-> arg0 fvec) arg1) + (vector-copy! (-> arg0 uvec) arg2) (vector-cross! (-> arg0 rvec) arg2 arg1) arg0 ) (defun matrix-fr-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) - (set! (-> arg0 rvec quad) (-> arg2 quad)) + (vector-copy! (-> arg0 fvec) arg1) + (vector-copy! (-> arg0 rvec) arg2) (vector-cross! (-> arg0 uvec) arg1 arg2) arg0 ) (defun matrix-ur-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg2 quad)) - (set! (-> arg0 uvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg2) + (vector-copy! (-> arg0 uvec) arg1) (vector-cross! (-> arg0 fvec) arg1 arg2) arg0 ) (defun matrix-f-u-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (vector-cross! (-> arg0 rvec) arg2 arg1) (vector-normalize! (-> arg0 rvec) 1.0) (vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec)) @@ -44,7 +44,7 @@ ) (defun matrix-f-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (vector-cross! (-> arg0 uvec) arg1 arg2) (vector-normalize! (-> arg0 uvec) 1.0) (vector-cross! (-> arg0 rvec) (-> arg0 uvec) arg1) @@ -52,7 +52,7 @@ ) (defun matrix-u-f-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 uvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 uvec) arg1) (vector-cross! (-> arg0 rvec) arg1 arg2) (vector-normalize! (-> arg0 rvec) 1.0) (vector-cross! (-> arg0 fvec) (-> arg0 rvec) arg1) @@ -60,7 +60,7 @@ ) (defun matrix-u-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 uvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 uvec) arg1) (vector-cross! (-> arg0 fvec) arg2 arg1) (vector-normalize! (-> arg0 fvec) 1.0) (vector-cross! (-> arg0 rvec) arg1 (-> arg0 fvec)) @@ -68,7 +68,7 @@ ) (defun matrix-r-f-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg1) (vector-cross! (-> arg0 uvec) arg2 arg1) (vector-normalize! (-> arg0 uvec) 1.0) (vector-cross! (-> arg0 fvec) arg1 (-> arg0 uvec)) @@ -76,7 +76,7 @@ ) (defun matrix-r-u-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg1) (vector-cross! (-> arg0 fvec) arg1 arg2) (vector-normalize! (-> arg0 fvec) 1.0) (vector-cross! (-> arg0 uvec) (-> arg0 fvec) arg1) @@ -84,7 +84,7 @@ ) (defun matrix-f-compose ((arg0 matrix) (arg1 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (let ((a2-0 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) (matrix-f-u-compose arg0 arg1 a2-0) ) @@ -92,7 +92,7 @@ ) (defun matrix-u-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 uvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 uvec) arg1) (let ((a2-1 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) (matrix-u-f-compose arg0 arg1 a2-1) ) @@ -100,7 +100,7 @@ ) (defun matrix-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg1) (let ((a2-1 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) (matrix-r-f-compose arg0 arg1 a2-1 arg3) ) diff --git a/goal_src/jak3/engine/math/matrix-h.gc b/goal_src/jak3/engine/math/matrix-h.gc index 22d8336a3dd..1abad42aac6 100644 --- a/goal_src/jak3/engine/math/matrix-h.gc +++ b/goal_src/jak3/engine/math/matrix-h.gc @@ -23,12 +23,12 @@ some, but not all, functions assume that a matrix is an affine transform. others assume that the rotation has no scale or shear (and that its inverse is its transpose)." ((data float 16) - (vector vector 4 :inline :overlay-at (-> data 0)) - (quad uint128 4 :overlay-at (-> data 0)) - (rvec vector :inline :overlay-at (-> data 0)) - (uvec vector :inline :overlay-at (-> data 4)) - (fvec vector :inline :overlay-at (-> data 8)) - (trans vector :inline :overlay-at (-> data 12)) + (vector vector 4 :inline :overlay-at (-> data 0)) + (quad uint128 4 :overlay-at (-> data 0)) + (rvec vector :inline :overlay-at (-> data 0)) + (uvec vector :inline :overlay-at (-> data 4)) + (fvec vector :inline :overlay-at (-> data 8)) + (trans vector :inline :overlay-at (-> data 12)) ) (:methods (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none) @@ -63,6 +63,7 @@ and how they were originally packed (for example, in tie/shrub)." (defun matrix-copy! ((arg0 matrix) (arg1 matrix)) "Copy arg1 to arg0" + (declare (inline)) (let ((v1-0 (-> arg1 rvec quad)) (a2-0 (-> arg1 uvec quad)) (a3-0 (-> arg1 fvec quad)) @@ -77,14 +78,14 @@ and how they were originally packed (for example, in tie/shrub)." ) (defun matrix<-vector-yz-exact! ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) - (set! (-> arg0 uvec quad) (-> arg2 quad)) + (vector-copy! (-> arg0 fvec) arg1) + (vector-copy! (-> arg0 uvec) arg2) (vector-cross! (-> arg0 rvec) (-> arg0 uvec) arg1) arg0 ) (defun matrix<-vector-yz! ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (vector-cross! (-> arg0 rvec) arg2 arg1) (vector-normalize! (-> arg0 rvec) 1.0) (vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec)) @@ -99,9 +100,21 @@ and how they were originally packed (for example, in tie/shrub)." (v1-0 (vector-get-closest-perpendicular! s3-0 arg1 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) (s4-1 arg0) ) - (set! (-> s4-1 fvec quad) (-> arg1 quad)) - (set! (-> s4-1 uvec quad) (-> v1-0 quad)) + (vector-copy! (-> s4-1 fvec) arg1) + (vector-copy! (-> s4-1 uvec) v1-0) (vector-cross! (-> s4-1 rvec) (-> s4-1 uvec) arg1) ) arg0 ) + + +(defmacro new-stack-matrix0 () + "Get a new matrix on the stack that's set to zero." + `(let ((mat (new 'stack-no-clear 'matrix))) + (set! (-> mat quad 0) (the-as uint128 0)) + (set! (-> mat quad 1) (the-as uint128 0)) + (set! (-> mat quad 2) (the-as uint128 0)) + (set! (-> mat quad 3) (the-as uint128 0)) + mat + ) + ) diff --git a/goal_src/jak3/engine/math/matrix.gc b/goal_src/jak3/engine/math/matrix.gc index 1618bcf2e59..36f27ec8954 100644 --- a/goal_src/jak3/engine/math/matrix.gc +++ b/goal_src/jak3/engine/math/matrix.gc @@ -36,6 +36,7 @@ allowed to be the same memory. ;; DECOMP BEGINS + (defun matrix-identity! ((arg0 matrix)) "Set dst to the identity matrix." (set! (-> arg0 rvec quad) (the-as uint128 0)) @@ -63,7 +64,7 @@ allowed to be the same memory. (defun matrix+! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) "Set dst = src1 + src2. It is okay for any arguments to be the same data. -This is not an efficient implementation." + This is not an efficient implementation." (dotimes (v1-0 16) (set! (-> arg0 rvec data v1-0) (+ (-> arg1 rvec data v1-0) (-> arg2 rvec data v1-0))) ) @@ -72,7 +73,7 @@ This is not an efficient implementation." (defun matrix-! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) "Set dst = src1 - src1. It is okay for any arugments to be the same data. -This is not an efficient implementation." + This is not an efficient implementation." (dotimes (v1-0 16) (set! (-> arg0 rvec data v1-0) (- (-> arg1 rvec data v1-0) (-> arg2 rvec data v1-0))) ) @@ -81,7 +82,7 @@ This is not an efficient implementation." (defun matrix*! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) "Set dst = src1 * src2. It is okay for any arguments to be the same data. -This is a moderately efficient implementation." + This is a moderately efficient implementation." (rlet ((acc :class vf) (vf10 :class vf) (vf11 :class vf) @@ -130,8 +131,8 @@ This is a moderately efficient implementation." (defun matrixp*! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) "Set dst = src1 * src2. NOTE: this function is a wrapper around matrix*! -that adds no additional functionality. It seems to be a leftover from -a time when matrix*! wasn't safe to use in place. This is unused." + that adds no additional functionality. It seems to be a leftover from + a time when matrix*! wasn't safe to use in place. This is unused." (let ((s5-0 (new-stack-matrix0))) (matrix*! s5-0 arg1 arg2) (set! (-> arg0 rvec quad) (-> s5-0 rvec quad)) @@ -198,8 +199,8 @@ a time when matrix*! wasn't safe to use in place. This is unused." (defun vector-rotate*! ((arg0 vector) (arg1 vector) (arg2 matrix)) "Set dst to be the input vector rotated by the rotation part of mat. -The input matrix should be a homogeneous transform with a rotation matrix as its upper-left 3x3. -dst may be equal to src." + The input matrix should be a homogeneous transform with a rotation matrix as its upper-left 3x3. + dst may be equal to src." (rlet ((acc :class vf) (vf1 :class vf) (vf2 :class vf) @@ -228,7 +229,7 @@ dst may be equal to src." (defun vector3s-matrix*! ((arg0 vector3s) (arg1 vector3s) (arg2 matrix)) "Set dst to be ([src 1.0] * mat).xyz. Doesn't touch the w of dst. -dst and vec can be the same memory" + dst and vec can be the same memory" (let ((s5-0 (new-stack-vector0))) (set-vector! s5-0 (-> arg1 x) (-> arg1 y) (-> arg1 z) 1.0) (vector-matrix*! s5-0 s5-0 arg2) @@ -241,7 +242,7 @@ dst and vec can be the same memory" (defun vector3s-rotate*! ((arg0 vector3s) (arg1 vector3s) (arg2 matrix)) "Set dst to vec rotated by the rotation in the homogeneous transform mat. -mat should not have a scale/shear (the upper 3x3 should be a pure rotation)." + mat should not have a scale/shear (the upper 3x3 should be a pure rotation)." (let ((s5-0 (new-stack-vector0))) (set-vector! s5-0 (-> arg1 x) (-> arg1 y) (-> arg1 z) 1.0) (vector-rotate*! s5-0 s5-0 arg2) @@ -294,7 +295,7 @@ mat should not have a scale/shear (the upper 3x3 should be a pure rotation)." (defun matrix-inverse-of-rot-trans! ((arg0 matrix) (arg1 matrix)) "Set dst = src^-1, assuming src is a homogeneous tranform with only rotation/translation. -NOTE: THIS FUNCTION REQUIRES dst != src" + NOTE: THIS FUNCTION REQUIRES dst != src" (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -330,7 +331,7 @@ NOTE: THIS FUNCTION REQUIRES dst != src" ;; ERROR: Bad vector register dependency: vf5 (defun matrix-4x4-inverse! ((arg0 matrix) (arg1 matrix)) "Invert a 4x4 matrix. This assumes that the input is a homogeneous transform. -Src and dst can be the same." + Src and dst can be the same." (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -512,7 +513,7 @@ Src and dst can be the same." (defun matrix-translate+! ((arg0 matrix) (arg1 matrix) (arg2 vector)) "Add the given translation to the translation of homogenous transform mat src -and store in dst. It is okay for dst = src." + and store in dst. It is okay for dst = src." (set! (-> arg0 trans x) (+ (-> arg1 trans x) (-> arg2 x))) (set! (-> arg0 trans y) (+ (-> arg1 trans y) (-> arg2 y))) (set! (-> arg0 trans z) (+ (-> arg1 trans z) (-> arg2 z))) @@ -526,7 +527,7 @@ and store in dst. It is okay for dst = src." (defun matrix-scale! ((arg0 matrix) (arg1 vector)) "Set dst to a homogenous transform with only a scale. The x,y,z components -of scale become the x,y,z scaling factors" + of scale become the x,y,z scaling factors" (set! (-> arg0 rvec quad) (the-as uint128 0)) (set! (-> arg0 uvec quad) (the-as uint128 0)) (set! (-> arg0 fvec quad) (the-as uint128 0)) @@ -540,8 +541,8 @@ of scale become the x,y,z scaling factors" (defun scale-matrix! ((arg0 matrix) (arg1 vector) (arg2 matrix)) "Scale an existing matrix. Okay for dst = src. The scaling is applied per row. -This means the x component of scale is used to scale the first row of src. -The w component of scale is used." + This means the x component of scale is used to scale the first row of src. + The w component of scale is used." (rlet ((vf4 :class vf) (vf5 :class vf) (vf6 :class vf) @@ -567,7 +568,7 @@ The w component of scale is used." (defun matrix-inv-scale! ((arg0 matrix) (arg1 vector)) "Set dst to a homogeneous transform with only a scale. -The x,y,z components of scale are inverted and used as the x,y,z scaling factors" + The x,y,z components of scale are inverted and used as the x,y,z scaling factors" (set! (-> arg0 rvec quad) (the-as uint128 0)) (set! (-> arg0 uvec quad) (the-as uint128 0)) (set! (-> arg0 fvec quad) (the-as uint128 0)) @@ -581,7 +582,7 @@ The x,y,z components of scale are inverted and used as the x,y,z scaling factors (defun column-scale-matrix! ((arg0 matrix) (arg1 vector) (arg2 matrix)) "Scale an existing matrix. Okay for dst = src. The scaling is applied column-wise. -Meaning the x component of scale will scale the first column of src." + Meaning the x component of scale will scale the first column of src." (rlet ((vf4 :class vf) (vf5 :class vf) (vf6 :class vf) @@ -773,7 +774,7 @@ Meaning the x component of scale will scale the first column of src." (defun matrix-rotate-yxy! ((arg0 matrix) (arg1 vector)) "Rotate. I believe in yxy order? Compared to the other rotations, this one -is quite a bit more optimized and avoid repeated trig operations." + is quite a bit more optimized and avoid repeated trig operations." (let ((a2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -1082,7 +1083,7 @@ is quite a bit more optimized and avoid repeated trig operations." (defun matrix-3x3-inverse! ((arg0 matrix) (arg1 matrix)) "Compute the inverse of a 3x3 matrix. Not very efficient. -Requires src != dst." + Requires src != dst." (let ((f0-0 (matrix-3x3-determinant arg1))) (set! (-> arg0 rvec x) (/ (- (* (-> arg1 uvec y) (-> arg1 fvec z)) (* (-> arg1 uvec z) (-> arg1 fvec y))) f0-0) @@ -1117,7 +1118,7 @@ Requires src != dst." (defun matrix-3x3-inverse-transpose! ((arg0 matrix) (arg1 matrix)) "Invert and transpose. -Requires dst != src." + Requires dst != src." (let ((f0-0 (matrix-3x3-determinant arg1))) (set! (-> arg0 rvec x) (/ (- (* (-> arg1 uvec y) (-> arg1 fvec z)) (* (-> arg1 uvec z) (-> arg1 fvec y))) f0-0) @@ -1313,7 +1314,7 @@ Requires dst != src." (defun matrix-4x4-inverse-transpose! ((arg0 matrix) (arg1 matrix)) "Invert and transpose an entire 4x4. I think has no restrictions, other than dst != src. Unused. -The answer is wrong. The determinant function is wrong." + The answer is wrong. The determinant function is wrong." (let ((f0-0 (matrix-4x4-determinant arg1))) (let ((f9-0 (-> arg1 uvec y)) (f2-0 (-> arg1 uvec z)) @@ -1627,7 +1628,7 @@ The answer is wrong. The determinant function is wrong." (defun matrix<-trans ((arg0 matrix) (arg1 vector)) "Set the translation." - (set! (-> arg0 trans quad) (-> arg1 quad)) + (vector-copy! (-> arg0 trans) arg1) arg0 ) @@ -1650,19 +1651,8 @@ The answer is wrong. The determinant function is wrong." (defun matrix->quat ((arg0 matrix) (arg1 quaternion)) "Convert matrix to quaternion, works for matrix with scale. -unlike matrix->quaternion." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 arg0) - (v1-0 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-0) - (set! (-> s5-0 uvec quad) a0-1) - (set! (-> s5-0 fvec quad) a1-1) - (set! (-> s5-0 trans quad) a2-1) - ) + unlike matrix->quaternion." + (let ((s5-0 (matrix-copy! (new 'stack-no-clear 'matrix) arg0))) (vector-reset! (-> s5-0 trans)) (vector-normalize! (-> s5-0 rvec) 1.0) (vector-normalize! (-> s5-0 uvec) 1.0) @@ -1701,24 +1691,13 @@ unlike matrix->quaternion." (.nop.vf) (.mov.vf.w vf2 vf0) (.svf (&-> arg0 trans quad) vf2) - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 arg1) - (v1-0 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s4-0 rvec quad) v1-0) - (set! (-> s4-0 uvec quad) a0-1) - (set! (-> s4-0 fvec quad) a1-1) - (set! (-> s4-0 trans quad) a2-1) - ) + (let ((s4-0 (matrix-copy! (new 'stack-no-clear 'matrix) arg1))) (vector-normalize! (-> s4-0 rvec) 1.0) (vector-normalize! (-> s4-0 uvec) 1.0) (vector-normalize! (-> s4-0 fvec) 1.0) (vector-cross! (-> s4-0 fvec) (-> s4-0 rvec) (-> s4-0 uvec)) (vector-cross! (-> s4-0 uvec) (-> s4-0 fvec) (-> s4-0 rvec)) - (matrix->quaternion (the-as quaternion (-> arg0 rot)) s4-0) + (matrix->quaternion (-> arg0 quat) s4-0) ) (set-vector! (-> arg0 scale) diff --git a/goal_src/jak3/engine/math/quaternion.gc b/goal_src/jak3/engine/math/quaternion.gc index f6a4b3aba6b..59c5105e3dc 100644 --- a/goal_src/jak3/engine/math/quaternion.gc +++ b/goal_src/jak3/engine/math/quaternion.gc @@ -11,7 +11,7 @@ (defun quaternion-axis-angle! ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) "Construct a quaternion from an axis and angle. The axis should be normalized." (let ((s5-0 (new 'stack-no-clear 'vector))) - (sincos! s5-0 (* 0.5 arg4)) + (sincos! s5-0 (/ arg4 2)) (let ((f0-2 (-> s5-0 x))) (set! (-> arg0 x) (* arg1 f0-2)) (set! (-> arg0 y) (* arg2 f0-2)) @@ -25,7 +25,7 @@ (defun quaternion-vector-angle! ((arg0 quaternion) (arg1 vector) (arg2 float)) "Construct a quaternion from an axis and angle. The axis should be normalized." (let ((s5-0 (new 'stack-no-clear 'vector))) - (sincos! s5-0 (* 0.5 arg2)) + (sincos! s5-0 (/ arg2 2)) (let ((f0-2 (-> s5-0 x))) (set! (-> arg0 x) (* (-> arg1 x) f0-2)) (set! (-> arg0 y) (* (-> arg1 y) f0-2)) @@ -57,7 +57,7 @@ (let ((s5-0 (new 'stack-no-clear 'matrix))) (vector-cross! (-> s5-0 rvec) arg2 arg1) (vector-cross! (-> s5-0 uvec) arg1 (-> s5-0 rvec)) - (set! (-> s5-0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 fvec) arg1) (quaternion-normalize! (matrix->quaternion arg0 s5-0)) ) ) @@ -498,7 +498,7 @@ (cond ((< 0.0 f0-2) (let ((f0-4 (sqrtf (+ 1.0 f0-2)))) - (set! (-> arg0 w) (* 0.5 f0-4)) + (set! (-> arg0 w) (/ f0-4 2)) (let ((f0-5 (/ 0.5 f0-4))) (set! (-> arg0 x) (* f0-5 (- (-> arg1 uvec z) (-> arg1 fvec y)))) (set! (-> arg0 y) (* f0-5 (- (-> arg1 fvec x) (-> arg1 rvec z)))) @@ -533,7 +533,7 @@ ) ) ) - (set! (-> arg0 data a2-0) (* 0.5 f0-12)) + (set! (-> arg0 data a2-0) (/ f0-12 2)) (if (!= f0-12 0.0) (set! f0-12 (/ 0.5 f0-12)) ) @@ -577,11 +577,7 @@ (vf6 :class vf) (vf7 :class vf) ) - (let ((v1-0 (new 'stack-no-clear 'matrix))) - (set! (-> v1-0 rvec quad) (the-as uint128 0)) - (set! (-> v1-0 uvec quad) (the-as uint128 0)) - (set! (-> v1-0 fvec quad) (the-as uint128 0)) - (set! (-> v1-0 trans quad) (the-as uint128 0)) + (let ((v1-0 (new-stack-matrix0))) (let* ((f0-1 (vector-dot (-> arg1 rvec) (-> arg1 rvec))) (f1-1 (vector-dot (-> arg1 uvec) (-> arg1 uvec))) (f2-1 (vector-dot (-> arg1 fvec) (-> arg1 fvec))) @@ -852,39 +848,27 @@ (defun vector-x-quaternion! ((arg0 vector) (arg1 quaternion)) "Get the first row of the rotation matrix for this quaternion." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> s5-0 rvec quad)) + (vector-copy! arg0 (-> s5-0 rvec)) ) arg0 ) (defun vector-y-quaternion! ((arg0 vector) (arg1 quaternion)) "Get the second row of the rotation matrix for this quaternion." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> s5-0 uvec quad)) + (vector-copy! arg0 (-> s5-0 uvec)) ) arg0 ) (defun vector-z-quaternion! ((arg0 vector) (arg1 quaternion)) "Get the third row of the rotation matrix for this quaternion." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> s5-0 fvec quad)) + (vector-copy! arg0 (-> s5-0 fvec)) ) arg0 ) diff --git a/goal_src/jak3/engine/math/transformq-h.gc b/goal_src/jak3/engine/math/transformq-h.gc index 437600bd280..ec4bf404042 100644 --- a/goal_src/jak3/engine/math/transformq-h.gc +++ b/goal_src/jak3/engine/math/transformq-h.gc @@ -15,12 +15,14 @@ ;; DECOMP BEGINS (deftype transformq (transform) + "A transform, but the rotation is represented with a quaternion." ((quat quaternion :inline :overlay-at (-> rot data 0)) ) ) (deftype trsq (trs) + "A trs, but the rotation is represented with a quaternion." ((quat quaternion :inline :overlay-at (-> rot data 0)) ) ) @@ -71,12 +73,12 @@ As a result, this type has a lot of weird methods and extra stuff hidden in it." (defmethod global-y-angle-to-point ((this trsqv) (arg0 vector)) "Get the angle in the xz plane from the position of this trsqv to the point arg0 -(ignores our current yaw)." + (ignores our current yaw)." (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) (defmethod relative-y-angle-to-point ((this trsqv) (arg0 vector)) "Get the y angle between the current orientation and arg0 -(how much we'd have to yaw to point at arg0)." + (how much we'd have to yaw to point at arg0)." (deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) ) diff --git a/goal_src/jak3/engine/math/vector.gc b/goal_src/jak3/engine/math/vector.gc index 723474effa3..dea6ff5d038 100644 --- a/goal_src/jak3/engine/math/vector.gc +++ b/goal_src/jak3/engine/math/vector.gc @@ -912,7 +912,7 @@ (let ((f0-0 (vector-length arg1))) (cond ((= f0-0 0.0) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) (else (let ((v1-3 (/ arg2 f0-0))) @@ -949,7 +949,7 @@ ) (cond ((= f0-4 0.0) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) (else (let ((v1-3 (/ arg2 f0-4))) @@ -1005,7 +1005,7 @@ (f2-0 (-> arg1 z)) (f0-1 (-> arg1 y)) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (set! (-> arg0 z) (- (* f2-0 f30-0) (* f0-1 f1-0))) (set! (-> arg0 y) (+ (* f2-0 f1-0) (* f0-1 f30-0))) ) @@ -1019,7 +1019,7 @@ (f28-0 (cos arg2)) (f0-0 (sin arg2)) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (set! (-> arg0 z) (- (* f26-0 f28-0) (* f30-0 f0-0))) (set! (-> arg0 x) (+ (* f26-0 f0-0) (* f30-0 f28-0))) ) @@ -1028,7 +1028,7 @@ (defun vector-rotate90-around-y! ((arg0 vector) (arg1 vector)) "Rotate a vector 90 degrees around y." - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (let ((f0-0 (-> arg0 x))) (set! (-> arg0 x) (- (-> arg1 z))) (set! (-> arg0 z) f0-0) @@ -1043,7 +1043,7 @@ (f28-0 (cos arg2)) (f0-0 (sin arg2)) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (set! (-> arg0 x) (- (* f26-0 f28-0) (* f30-0 f0-0))) (set! (-> arg0 y) (+ (* f26-0 f0-0) (* f30-0 f28-0))) ) @@ -1163,10 +1163,10 @@ (init-vf0-vector) (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (let ((v1-3 arg0)) @@ -1216,10 +1216,10 @@ ) (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (let ((v1-3 arg0)) @@ -1327,10 +1327,10 @@ "Apply deg-lerp-clamp to the xyz components of a vector. Sets w = 1." (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (set! (-> arg0 x) (deg-lerp-clamp (-> arg1 x) (-> arg2 x) arg3)) @@ -1709,7 +1709,7 @@ (set! v1-0 2) ) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (set! (-> arg0 data v1-0) 1.0) ) arg0 @@ -1723,7 +1723,7 @@ ) (vector-! s5-0 arg2 s5-0) (vector-normalize! s5-0 1.0) - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) ) arg0 ) diff --git a/goal_src/jak3/engine/nav/nav-control-h.gc b/goal_src/jak3/engine/nav/nav-control-h.gc index 831e0b86e88..0c9000f5998 100644 --- a/goal_src/jak3/engine/nav/nav-control-h.gc +++ b/goal_src/jak3/engine/nav/nav-control-h.gc @@ -193,7 +193,7 @@ (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) (set-spheres-from-nav-ids (_type_) none) - (add-root-sphere-to-hash! (_type_ vector int) symbol) + (check-sphere-blocked! (_type_ vector int) symbol) (get-max-rotation-rate (_type_) float) (get-sphere-mask (_type_) uint) (get-target-speed (_type_) meters) diff --git a/goal_src/jak3/engine/nav/nav-control.gc b/goal_src/jak3/engine/nav/nav-control.gc index 01292350916..ed7fd1e4561 100644 --- a/goal_src/jak3/engine/nav/nav-control.gc +++ b/goal_src/jak3/engine/nav/nav-control.gc @@ -58,7 +58,7 @@ (defmethod set-extra-nav-sphere-xyz! ((this nav-control) (arg0 sphere)) (let ((f0-0 (-> this extra-nav-sphere w))) - (set! (-> this extra-nav-sphere quad) (-> arg0 quad)) + (vector-copy! (-> this extra-nav-sphere) arg0) (set! (-> this extra-nav-sphere w) f0-0) ) 0 @@ -514,7 +514,7 @@ (set! (-> t1-0 y) 0.0) (let ((a0-1 t0-0)) (let ((t3-2 t1-0)) - (set! (-> a0-1 quad) (-> t3-2 quad)) + (vector-copy! a0-1 t3-2) ) (let ((f0-1 1.0)) (.lvf vf1 (&-> a0-1 quad)) @@ -534,7 +534,7 @@ (.nop.vf) (.svf (&-> a0-1 quad) vf1) ) - (set! (-> v1-0 quad) (-> t0-0 quad)) + (vector-copy! v1-0 t0-0) (set! (-> v1-0 x) (-> t0-0 z)) (set! (-> v1-0 z) (- (-> t0-0 x))) (let* ((f0-5 (-> arg1 w)) @@ -693,7 +693,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) - (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (vector-copy! (-> s5-0 in-dir) (-> arg0 travel)) (set! (-> s5-0 in-dir y) 0.0) (let ((v1-1 (-> s5-0 in-dir))) (let ((f0-1 1.0)) @@ -715,11 +715,11 @@ (.svf (&-> v1-1 quad) vf1) ) (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) - (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (vector-copy! (-> s5-0 right-dir) (-> s5-0 in-dir)) (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) - (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (vector-copy! (-> s5-0 best-dir 1) (-> s5-0 in-dir)) (set! (-> s5-0 best-dir-angle 0) 0.0) (set! (-> s5-0 best-dir-angle 1) 0.0) (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) @@ -794,7 +794,7 @@ (let ((a0-30 (logand a0-29 1)) (f0-27 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-20)))) ) - (set! (-> s5-0 best-dir a0-30 quad) (-> s5-0 temp-dir v1-20 quad)) + (vector-copy! (-> s5-0 best-dir a0-30) (-> s5-0 temp-dir v1-20)) (set! (-> s5-0 best-dir-angle a0-30) f0-27) ) ) @@ -831,7 +831,7 @@ ) ) (when (< (-> s5-0 best-dir-angle s3-0) f0-30) - (set! (-> s5-0 best-dir s3-0 quad) (-> s5-0 temp-dir v1-30 quad)) + (vector-copy! (-> s5-0 best-dir s3-0) (-> s5-0 temp-dir v1-30)) (set! (-> s5-0 best-dir-angle s3-0) f0-30) (set! (-> s5-0 dir-update) (the-as basic #t)) ) @@ -990,7 +990,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) - (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (vector-copy! (-> s5-0 in-dir) (-> arg0 travel)) (set! (-> s5-0 in-dir y) 0.0) (let ((v1-1 (-> s5-0 in-dir))) (let ((f0-1 1.0)) @@ -1012,11 +1012,11 @@ (.svf (&-> v1-1 quad) vf1) ) (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) - (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (vector-copy! (-> s5-0 right-dir) (-> s5-0 in-dir)) (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) - (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (vector-copy! (-> s5-0 best-dir 1) (-> s5-0 in-dir)) (set! (-> s5-0 best-dir-angle 0) 0.0) (set! (-> s5-0 best-dir-angle 1) 0.0) (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) @@ -1084,7 +1084,7 @@ (let ((a0-33 (logand a0-32 1)) (f0-22 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-19)))) ) - (set! (-> s5-0 best-dir a0-33 quad) (-> s5-0 temp-dir v1-19 quad)) + (vector-copy! (-> s5-0 best-dir a0-33) (-> s5-0 temp-dir v1-19)) (set! (-> s5-0 best-dir-angle a0-33) f0-22) ) ) @@ -1165,7 +1165,7 @@ (set! sv-124 (-> this work)) (vector-! sv-116 arg0 (the-as vector (-> this bounds))) (set! (-> sv-112 current-poly) arg1) - (set! (-> sv-112 current-pos quad) (-> sv-116 quad)) + (vector-copy! (-> sv-112 current-pos) sv-116) (vector+! (-> sv-112 dest-pos) sv-116 arg2) (let* ((t2-0 this) (v1-11 (-> sv-112 dest-pos)) @@ -1269,7 +1269,7 @@ (set! (-> v1-20 next-poly) #f) (cond ((= sv-136 -1) - (set! (-> v1-20 current-pos quad) (-> v1-20 dest-pos quad)) + (vector-copy! (-> v1-20 current-pos) (-> v1-20 dest-pos)) (set! (-> v1-20 reached-dest) #t) (set! (-> v1-20 terminated) #t) ) @@ -1324,7 +1324,7 @@ (set! (-> arg3 edge) (-> sv-112 last-edge)) (vector+! (-> arg3 vert-0) sv-192 (the-as vector (-> this bounds))) (vector+! (-> arg3 vert-1) sv-196 (the-as vector (-> this bounds))) - (set! (-> sv-112 dest-pos quad) (-> sv-112 current-pos quad)) + (vector-copy! (-> sv-112 dest-pos) (-> sv-112 current-pos)) (if (-> sv-112 hit-gap) (set! (-> arg3 gap-poly) (-> sv-112 next-poly)) ) @@ -1463,7 +1463,7 @@ (set! sv-104 0) (set! sv-112 (-> this work)) (set! (-> sv-96 current-poly) arg1) - (set! (-> sv-96 current-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-96 current-pos) arg0) (vector+! (-> sv-96 dest-pos) arg0 arg2) (let* ((t6-0 this) (t4-2 arg1) @@ -1569,7 +1569,7 @@ (set! (-> v1-19 next-poly) #f) (cond ((= sv-128 -1) - (set! (-> v1-19 current-pos quad) (-> v1-19 dest-pos quad)) + (vector-copy! (-> v1-19 current-pos) (-> v1-19 dest-pos)) (set! (-> v1-19 reached-dest) #t) (set! (-> v1-19 terminated) #t) ) @@ -1628,7 +1628,7 @@ (vector+! (-> arg5 vert-0) sv-184 (the-as vector (-> this bounds))) (vector+! (-> arg5 vert-1) sv-188 (the-as vector (-> this bounds))) ) - (set! (-> sv-96 dest-pos quad) (-> sv-96 current-pos quad)) + (vector-copy! (-> sv-96 dest-pos) (-> sv-96 current-pos)) (cond (arg4 (let ((f0-49 (* 1.01 (+ (* sv-192 sv-200) (* sv-196 sv-204))))) @@ -1733,16 +1733,15 @@ ) ;; WARN: Return type mismatch none vs symbol. -(defmethod add-root-sphere-to-hash! ((this nav-control) (arg0 vector) (arg1 int)) - (the-as symbol (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) - (find-nav-sphere-ids - (-> this state mesh sphere-hash) - (the-as find-nav-sphere-ids-params arg0) - (logand arg1 255) - (the-as int (-> this root-sphere-id)) - ) - ) - ) +(defmethod check-sphere-blocked! ((this nav-control) (arg0 vector) (arg1 int)) + (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) + (check-sphere-blocked + (-> this state mesh sphere-hash) + arg0 + (logand arg1 255) + (the-as int (-> this root-sphere-id)) + ) + ) ) (defmethod reset! ((this nav-state) (arg0 nav-control)) @@ -1763,17 +1762,17 @@ ) (defmethod get-velocity ((this nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> this velocity quad)) + (vector-copy! arg0 (-> this velocity)) arg0 ) (defmethod get-heading ((this nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> this heading quad)) + (vector-copy! arg0 (-> this heading)) arg0 ) (defmethod get-target-pos ((this nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> this target-pos quad)) + (vector-copy! arg0 (-> this target-pos)) arg0 ) @@ -1790,18 +1789,18 @@ ) (defmethod get-travel ((this nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> this travel quad)) + (vector-copy! arg0 (-> this travel)) arg0 ) (defmethod set-velocity! ((this nav-state) (arg0 vector)) - (set! (-> this velocity quad) (-> arg0 quad)) + (vector-copy! (-> this velocity) arg0) 0 (none) ) (defmethod set-heading! ((this nav-state) (arg0 vector)) - (set! (-> this heading quad) (-> arg0 quad)) + (vector-copy! (-> this heading) arg0) 0 (none) ) @@ -1815,21 +1814,21 @@ (defmethod set-target-pos! ((this nav-state) (arg0 vector)) (logclear! (-> this flags) (nav-state-flag directional-mode)) (logior! (-> this flags) (nav-state-flag target-poly-dirty)) - (set! (-> this target-pos quad) (-> arg0 quad)) + (vector-copy! (-> this target-pos) arg0) 0 (none) ) (defmethod set-virtual-cur-pos! ((this nav-state) (arg0 vector)) (logior! (-> this flags) (nav-state-flag use-position)) - (set! (-> this virtual-current-pos-local quad) (-> arg0 quad)) + (vector-copy! (-> this virtual-current-pos-local) arg0) 0 (none) ) (defmethod set-travel! ((this nav-state) (arg0 vector)) (logior! (-> this flags) (nav-state-flag directional-mode)) - (set! (-> this travel quad) (-> arg0 quad)) + (vector-copy! (-> this travel) arg0) 0 (none) ) @@ -1869,7 +1868,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) 0.0 (-> this mesh work debug) - (set! (-> s5-1 quad) (-> this current-pos quad)) + (vector-copy! s5-1 (-> this current-pos)) (let ((f30-0 (-> s5-1 y))) (set! (-> s5-1 y) (+ 2048.0 f30-0)) (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> this heading) (meters 1) *color-yellow*) @@ -1929,7 +1928,7 @@ (vector-! (-> s4-0 dest-pos) arg0 (the-as vector (-> s3-0 bounds))) (b! (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) (logior! (-> this flags) (nav-state-flag in-mesh)) - (set! (-> this current-pos quad) (-> arg0 quad)) + (vector-copy! (-> this current-pos) arg0) (b! #t cfg-17 :delay (nop!)) (label cfg-3) (let ((v1-10 s4-0)) @@ -1980,11 +1979,11 @@ (cond ((-> s4-0 reached-dest) (logior! (-> this flags) (nav-state-flag in-mesh)) - (set! (-> this current-pos quad) (-> arg0 quad)) + (vector-copy! (-> this current-pos) arg0) ) (else (logclear! (-> this flags) (nav-state-flag in-mesh)) - (set! (-> this current-pos quad) (-> arg0 quad)) + (vector-copy! (-> this current-pos) arg0) (let ((s4-1 (new 'stack 'nav-find-poly-parms))) (vector-! (-> s4-1 point) arg0 (the-as vector (-> this mesh bounds))) (set! (-> s4-1 y-threshold) (-> this nav nearest-y-threshold)) @@ -1998,7 +1997,7 @@ ) ) (else - (set! (-> this current-pos quad) (-> arg0 quad)) + (vector-copy! (-> this current-pos) arg0) (let ((s4-2 (new 'stack 'nav-find-poly-parms))) (vector-! (-> s4-2 point) arg0 (the-as vector (-> this mesh bounds))) (set! (-> s4-2 y-threshold) (-> this nav nearest-y-threshold)) @@ -2187,7 +2186,7 @@ (set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2)) (set! sv-124 (the-as symbol #f)) (vector-! (-> this current-pos-local) (-> this current-pos) (the-as vector (-> this mesh bounds))) - (set! (-> this virtual-current-pos-local quad) (-> this current-pos-local quad)) + (vector-copy! (-> this virtual-current-pos-local) (-> this current-pos-local)) (set! (-> sv-116 next-poly) #f) (when (not (logtest? (-> this flags) (nav-state-flag directional-mode))) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -2226,8 +2225,8 @@ ) (else (set! (-> this next-poly) (-> sv-116 next-poly)) - (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) - (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + (vector-copy! (-> sv-120 0) (-> sv-116 vertex 0)) + (vector-copy! (-> sv-120 1) (-> sv-116 vertex 1)) (set! sv-124 #t) (while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment? (-> this current-pos-local) @@ -2252,8 +2251,8 @@ (cond ((get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) sv-116) (set! (-> this next-poly) (-> sv-116 next-poly)) - (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) - (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + (vector-copy! (-> sv-120 0) (-> sv-116 vertex 0)) + (vector-copy! (-> sv-120 1) (-> sv-116 vertex 1)) 0 ) (else @@ -2314,7 +2313,7 @@ (vector-float*! s4-1 s4-1 0.5) ) (else - (set! (-> s4-1 quad) (-> sv-112 quad)) + (vector-copy! s4-1 sv-112) ) ) (countdown (s3-1 2) @@ -2389,9 +2388,9 @@ (logior! (-> this flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) + (vector-copy! (-> this travel) (-> arg0 out-travel 0)) (let ((v1-10 (new 'stack-no-clear 'nav-ray))) - (set! (-> v1-10 current-pos quad) (-> this virtual-current-pos-local quad)) + (vector-copy! (-> v1-10 current-pos) (-> this virtual-current-pos-local)) (set! (-> v1-10 current-poly) (-> this virtual-current-poly)) (vector+! (-> v1-10 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) (let ((a2-5 0)) @@ -2469,7 +2468,7 @@ (set! (-> a3-5 next-poly) #f) (cond ((= sv-96 -1) - (set! (-> a3-5 current-pos quad) (-> a3-5 dest-pos quad)) + (vector-copy! (-> a3-5 current-pos) (-> a3-5 dest-pos)) (set! (-> a3-5 reached-dest) #t) (set! (-> a3-5 terminated) #t) ) @@ -2501,10 +2500,10 @@ ) (cond ((or (-> v1-10 reached-dest) (-> v1-10 hit-gap) (>= (-> v1-10 len) 4096.0)) - (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) + (vector-copy! (-> this travel) (-> arg0 out-travel 0)) ) (else - (set! (-> this travel quad) (-> arg0 out-travel 1 quad)) + (vector-copy! (-> this travel) (-> arg0 out-travel 1)) (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) ) ) @@ -2540,15 +2539,13 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) - (set! (-> s5-0 travel quad) (-> this travel quad)) - (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) - (-> this heading) - (-> this travel) - ) - quad - ) - ) + (vector-copy! (-> s5-0 current-pos) (-> this virtual-current-pos-local)) + (vector-copy! (-> s5-0 travel) (-> this travel)) + (vector-copy! (-> s5-0 pref-dir) (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) + ) + ) (avoid-spheres-1! (-> this nav) s5-0) (when (-> s5-0 avoiding-sphere?) (logior! (-> this flags) (nav-state-flag avoiding-sphere)) @@ -2559,9 +2556,9 @@ (logior! (-> this flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) + (vector-copy! (-> this travel) (-> s5-0 out-travel 0)) (let ((v1-15 (new 'stack-no-clear 'nav-ray))) - (set! (-> v1-15 current-pos quad) (-> this virtual-current-pos-local quad)) + (vector-copy! (-> v1-15 current-pos) (-> this virtual-current-pos-local)) (set! (-> v1-15 current-poly) (-> this virtual-current-poly)) (vector+! (-> v1-15 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) (let ((a0-15 0)) @@ -2639,7 +2636,7 @@ (set! (-> a1-6 next-poly) #f) (cond ((= sv-192 -1) - (set! (-> a1-6 current-pos quad) (-> a1-6 dest-pos quad)) + (vector-copy! (-> a1-6 current-pos) (-> a1-6 dest-pos)) (set! (-> a1-6 reached-dest) #t) (set! (-> a1-6 terminated) #t) ) @@ -2671,10 +2668,10 @@ ) (cond ((or (-> v1-15 reached-dest) (-> v1-15 hit-gap) (>= (-> v1-15 len) 4096.0)) - (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) + (vector-copy! (-> this travel) (-> s5-0 out-travel 0)) ) (else - (set! (-> this travel quad) (-> s5-0 out-travel 1 quad)) + (vector-copy! (-> this travel) (-> s5-0 out-travel 1)) (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) ) ) @@ -2696,7 +2693,7 @@ (vf3 :class vf) ) (init-vf0-vector) - (set! (-> this target-dir quad) (-> this travel quad)) + (vector-copy! (-> this target-dir) (-> this travel)) (let ((v1-1 (-> this target-dir))) (let ((f0-0 1.0)) (.lvf vf1 (&-> v1-1 quad)) @@ -2724,7 +2721,7 @@ (v1-8 (-> this travel)) ) (when (< f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) - (set! (-> this heading quad) (-> this travel quad)) + (vector-copy! (-> this heading) (-> this travel)) (set! (-> this heading y) 0.0) (let ((v1-12 (-> this heading))) (let ((f0-5 1.0)) @@ -2771,7 +2768,7 @@ (v1-26 (-> this travel)) ) (when (< f0-10 (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))) - (set! (-> this heading quad) (-> this travel quad)) + (vector-copy! (-> this heading) (-> this travel)) (set! (-> this heading y) 0.0) (let ((v1-30 (-> this heading))) (let ((f0-12 1.0)) @@ -2863,14 +2860,14 @@ (let ((f0-1 (vector-segment-distance-point! s2-0 (-> s3-0 vertex v1-13) (-> s3-0 vertex s0-0) sv-48))) (when (< f0-1 (the-as float sv-56)) (set! sv-56 f0-1) - (set! (-> sv-52 quad) (-> sv-48 quad)) + (vector-copy! sv-52 sv-48) ) ) (set! v1-13 s0-0) ) ) ) - (set! (-> s4-0 quad) (-> sv-52 quad)) + (vector-copy! s4-0 sv-52) ) (vector+! (-> arg0 dest) (-> arg0 dest) (the-as vector (-> this mesh bounds))) #t @@ -2922,8 +2919,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> this flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> this virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> this nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> this virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> this nav shape trans)) ) (if (or (not (-> this current-poly)) (!= (-> this current-pos x) (-> v1-13 0 x)) @@ -3072,8 +3069,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> s5-0 flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> s5-0 virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> s5-0 nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> s5-0 virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> s5-0 nav shape trans)) ) (if (or (not (-> s5-0 current-poly)) (!= (-> s5-0 current-pos x) (-> v1-13 0 x)) @@ -3164,15 +3161,13 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) - (set! (-> s5-0 travel quad) (-> this travel quad)) - (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) - (-> this heading) - (-> this travel) - ) - quad - ) - ) + (vector-copy! (-> s5-0 current-pos) (-> this virtual-current-pos-local)) + (vector-copy! (-> s5-0 travel) (-> this travel)) + (vector-copy! (-> s5-0 pref-dir) (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) + ) + ) (avoid-spheres-2! (-> this nav) s5-0) (let ((v1-5 this)) (when (-> s5-0 avoiding-sphere?) @@ -3184,9 +3179,9 @@ (logior! (-> v1-5 flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + (vector-copy! (-> v1-5 travel) (-> s5-0 out-travel 0)) (let ((a0-20 (new 'stack-no-clear 'nav-ray))) - (set! (-> a0-20 current-pos quad) (-> v1-5 virtual-current-pos-local quad)) + (vector-copy! (-> a0-20 current-pos) (-> v1-5 virtual-current-pos-local)) (set! (-> a0-20 current-poly) (-> v1-5 virtual-current-poly)) (vector+! (-> a0-20 dest-pos) (-> v1-5 virtual-current-pos-local) (-> v1-5 travel)) (let ((a1-6 0)) @@ -3264,7 +3259,7 @@ (set! (-> a2-5 next-poly) #f) (cond ((= sv-192 -1) - (set! (-> a2-5 current-pos quad) (-> a2-5 dest-pos quad)) + (vector-copy! (-> a2-5 current-pos) (-> a2-5 dest-pos)) (set! (-> a2-5 reached-dest) #t) (set! (-> a2-5 terminated) #t) ) @@ -3296,10 +3291,10 @@ ) (cond ((or (-> a0-20 reached-dest) (-> a0-20 hit-gap) (>= (-> a0-20 len) 4096.0)) - (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + (vector-copy! (-> v1-5 travel) (-> s5-0 out-travel 0)) ) (else - (set! (-> v1-5 travel quad) (-> s5-0 out-travel 1 quad)) + (vector-copy! (-> v1-5 travel) (-> s5-0 out-travel 1)) (logior! (-> v1-5 flags) (nav-state-flag trapped-by-sphere)) ) ) @@ -3406,7 +3401,7 @@ (v1-9 (-> this travel)) ) (when (< f0-3 (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z)))) - (set! (-> this heading quad) (-> this travel quad)) + (vector-copy! (-> this heading) (-> this travel)) (set! (-> this heading y) 0.0) (let ((v1-13 (-> this heading))) (let ((f0-5 1.0)) @@ -3481,8 +3476,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> s5-0 flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> s5-0 virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> s5-0 nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> s5-0 virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> s5-0 nav shape trans)) ) (if (or (not (-> s5-0 current-poly)) (!= (-> s5-0 current-pos x) (-> v1-13 0 x)) @@ -3574,8 +3569,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> gp-0 flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> gp-0 virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> gp-0 nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> gp-0 virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> gp-0 nav shape trans)) ) (if (or (not (-> gp-0 current-poly)) (!= (-> gp-0 current-pos x) (-> v1-13 0 x)) @@ -3693,8 +3688,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> gp-0 flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> gp-0 virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> gp-0 nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> gp-0 virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> gp-0 nav shape trans)) ) (if (or (not (-> gp-0 current-poly)) (!= (-> gp-0 current-pos x) (-> v1-13 0 x)) diff --git a/goal_src/jak3/engine/nav/nav-enemy-h.gc b/goal_src/jak3/engine/nav/nav-enemy-h.gc index 22c9a0b9554..361b95ceab3 100644 --- a/goal_src/jak3/engine/nav/nav-enemy-h.gc +++ b/goal_src/jak3/engine/nav/nav-enemy-h.gc @@ -57,8 +57,8 @@ debug-control ) (:methods - (init-enemy-info! (_type_ nav-enemy-info) none :replace) - (init-enemy-defaults! (_type_ nav-enemy-info) object :replace) + (set-enemy-info! (_type_ nav-enemy-info) none :replace) + (setup-enemy! (_type_ nav-enemy-info) object :replace) (normalize-heading! (_type_ nav-control) none) (nav-enemy-method-161 (_type_ nav-control) none) (nav-enemy-method-162 (_type_) none) diff --git a/goal_src/jak3/engine/nav/nav-enemy.gc b/goal_src/jak3/engine/nav/nav-enemy.gc index a845ef467ae..b1689563b54 100644 --- a/goal_src/jak3/engine/nav/nav-enemy.gc +++ b/goal_src/jak3/engine/nav/nav-enemy.gc @@ -13,8 +13,9 @@ (none) ) -(defmethod get-enemy-aware ((this nav-enemy) (arg0 enemy-aware)) - (let* ((t9-0 (method-of-type enemy get-enemy-aware)) +(defmethod modify-awareness ((this nav-enemy) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." + (let* ((t9-0 (method-of-type enemy modify-awareness)) (s5-0 (t9-0 this arg0)) ) (if (and (>= 1 (the-as int (-> this focus aware))) (< 1 (the-as int s5-0))) @@ -25,6 +26,7 @@ ) (defmethod event-handler ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('nav-mesh-kill) (deactivate this) @@ -45,7 +47,7 @@ (go (method-of-object this debug-control)) ) (('debug-control-off) - (go-best-state this) + (go-state-for-focused this) ) (else ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) @@ -87,7 +89,7 @@ (let ((v1-19 (-> this nav state))) (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-19 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-19 target-pos) s5-0) ) ) ) @@ -125,7 +127,7 @@ (let ((f0-2 (vector-vector-xz-distance arg1 arg0))) (when (< f28-0 f0-2) (set! f28-0 f0-2) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) ) ) (set! f30-0 (cond @@ -141,7 +143,7 @@ (+! f24-0 f26-0) ) (when (and (!= f28-0 0.0) (< 4096.0 (vector-vector-xz-distance (-> this root trans) s3-0))) - (set! (-> arg0 quad) (-> s3-0 quad)) + (vector-copy! arg0 s3-0) arg0 ) ) @@ -156,7 +158,9 @@ ) ) -(defmethod enemy-method-109 ((this nav-enemy)) +(defmethod out-of-bounds? ((this nav-enemy)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (let ((gp-0 (-> this root)) (s3-0 (-> this nav state)) ) @@ -164,7 +168,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (cond ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ) (else (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) @@ -183,6 +187,7 @@ ) (defmethod enemy-common-post ((this nav-enemy)) + "Common implementation of post. Runs ja-post." (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this last-draw-time)) ) @@ -237,7 +242,7 @@ ) ) (if (logtest? (-> this enemy-flags) (enemy-flag victory)) - (check-victory this) + (clear-stale-victory this) ) (if (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags)) (check-water this) @@ -259,6 +264,7 @@ ) (defmethod move-above-ground! ((this nav-enemy) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." (let ((t9-0 (method-of-type enemy move-above-ground!))) (t9-0 this arg0 arg1) ) @@ -340,7 +346,7 @@ (defmethod normalize-heading! ((this nav-enemy) (arg0 nav-control)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) - (set! (-> s5-0 quad) (-> a1-1 heading quad)) + (vector-copy! s5-0 (-> a1-1 heading)) ) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) @@ -354,7 +360,7 @@ ;; WARN: Return type mismatch vector vs none. (defmethod copy-nav-state-vel! ((this nav-enemy) (arg0 vector)) - (set! (-> arg0 quad) (-> this nav state velocity quad)) + (vector-copy! arg0 (-> this nav state velocity)) (none) ) @@ -369,7 +375,7 @@ (cond ((should-move-to-ground? this) (if (focus-test? this under-water) - (accelerate-fall! this (-> this root transv)) + (adjust-transv-under-water! this (-> this root transv)) (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) @@ -482,7 +488,8 @@ ) ) -(defmethod is-pfoc-in-mesh? ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (and arg0 (not arg1)) (set! arg1 (get-trans arg0 1)) ) @@ -510,7 +517,7 @@ (set-time! (-> this frustration-time)) (let ((v1-7 (handle->process (-> this focus handle)))) (if v1-7 - (set! (-> this frustration-point quad) (-> (get-trans (the-as process-focusable v1-7) 1) quad)) + (vector-copy! (-> this frustration-point) (get-trans (the-as process-focusable v1-7) 1)) ) ) 0 @@ -613,7 +620,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod init-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod set-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info)) (set! (-> this enemy-info) arg0) (set! (-> arg0 callback-info) *default-nav-callback-info*) (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) @@ -631,7 +638,7 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod init-enemy-defaults! ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this nav-enemy) (arg0 nav-enemy-info)) (local-vars (sv-16 res-tag)) (rlet ((acc :class vf) (vf0 :class vf) @@ -653,7 +660,7 @@ (logior! (-> this mask) (process-mask actor-pause)) (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (set! (-> this nav-radius-backup) (-> this root nav-radius)) - (init-enemy-info! this arg0) + (set-enemy-info! this arg0) (set! (-> this enemy-info callback-info) *default-nav-callback-info*) (set! (-> this ragdoll-proc) (the-as handle #f)) (let ((a1-2 (-> this enemy-info idle-anim-script))) @@ -821,7 +828,7 @@ ) (set! (-> this penetrate-flinch) (-> arg0 penetrate-flinch)) (set! (-> this penetrate-knocked) (-> arg0 penetrate-knocked)) - (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.8))) + (set! (-> this reaction-time) (rnd-time-frame this (seconds 0.1) (seconds 0.8))) (let* ((v1-132 (-> this enemy-flags)) (a0-61 (-> this fact enemy-options)) (v1-133 @@ -843,7 +850,7 @@ (not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) ) - (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) ) (if (zero? (-> this draw light-index)) (set! (-> this draw light-index) (the-as uint 10)) @@ -854,6 +861,7 @@ ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((a1-2 (res-lump-struct arg0 'art-level structure))) (when a1-2 (let ((a0-3 (level-get *level* (the-as symbol a1-2)))) @@ -895,7 +903,7 @@ (go (method-of-object this dormant-aware)) ) (else - (go-idle2 this) + (go-fallback-init this) ) ) ) @@ -937,7 +945,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-7 quad)) + (vector-copy! (-> gp-0 target-pos) v1-7) ) 0 ) @@ -959,12 +967,12 @@ (let ((a0-7 (-> self nav state)) (a1-3 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-3 quad) (-> a0-7 target-pos quad)) + (vector-copy! a1-3 (-> a0-7 target-pos)) (when (< 2048.0 (vector-vector-xz-distance gp-0 a1-3)) (let ((v1-18 (-> self nav state))) (logclear! (-> v1-18 flags) (nav-state-flag directional-mode)) (logior! (-> v1-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-18 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-18 target-pos) gp-0) ) 0 ) @@ -1021,7 +1029,7 @@ (set! (-> this restore-nav-radius-time) (the-as time-frame - (max (-> this restore-nav-radius-time) (+ (current-time) (set-reaction-time! this (seconds 5) (seconds 8)))) + (max (-> this restore-nav-radius-time) (+ (current-time) (rnd-time-frame this (seconds 5) (seconds 8)))) ) ) (none) @@ -1067,7 +1075,7 @@ (seek-toward-heading-vec! (-> self root) arg0 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) (ja :num! (loop! 0.75)) - (set! v1-18 (or (time-elapsed? s4-0 (seconds 10)) (enemy-method-103 self arg0 arg1))) + (set! v1-18 (or (time-elapsed? s4-0 (seconds 10)) (heading-matches-direction? self arg0 arg1))) ) ) (forward-up->quaternion (-> self root quat) arg0 *y-vector*) @@ -1102,10 +1110,10 @@ ) (go-stare2 this) ) - ((and (= s5-0 (enemy-aware ea3)) (-> this enemy-info use-circling)) + ((and (= s5-0 (enemy-aware hostile)) (-> this enemy-info use-circling)) (go (method-of-object this circling)) ) - ((= s5-0 (enemy-aware ea4)) + ((= s5-0 (enemy-aware flee)) (go-flee this) ) (else @@ -1116,6 +1124,7 @@ ) (defmethod go-hostile ((this nav-enemy)) + "Go to the hostile state, actively trying to attack the target." (if (or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> this enemy-flags))) (nav-enemy-method-174 this) ) @@ -1125,6 +1134,7 @@ ) (defmethod go-flee ((this nav-enemy)) + "Go to the flee state, running away." (if (nav-enemy-method-167 this) (go (method-of-object this flee)) (go (method-of-object this stare)) @@ -1152,7 +1162,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (let ((a1-4 (-> self nav state))) - (set! (-> s4-0 quad) (-> a1-4 heading quad)) + (vector-copy! s4-0 (-> a1-4 heading)) ) (vector-rotate-y! s4-0 s4-0 (* 1820.4445 (-> gp-0 steering))) (vector-float*! s4-0 s4-0 20480.0) @@ -1160,7 +1170,7 @@ (let ((v1-26 (-> self nav state))) (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-26 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-26 target-pos) s5-0) ) ) ) @@ -1257,7 +1267,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (when (enemy-method-134 self 0.2) + (when (rnd-chance-for-idle? self 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.6)) (let ((v1-37 self)) @@ -1275,7 +1285,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -1329,7 +1339,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-11 quad)) + (vector-copy! (-> gp-0 target-pos) v1-11) ) 0 ) @@ -1362,14 +1372,14 @@ ) (until (ja-done? 0) (let ((a1-9 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-9 travel quad)) + (vector-copy! gp-0 (-> a1-9 travel)) ) (seek-toward-heading-vec! (-> self root) gp-0 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -1417,7 +1427,7 @@ ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) (go-stare self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -1440,7 +1450,7 @@ (set-time! (-> self state-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> self nav state))) - (set! (-> a1-0 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-0 (-> a2-0 target-pos)) ) (let ((f0-0 (vector-vector-distance (-> self root trans) a1-0))) (set! (-> self state-timeout) @@ -1482,10 +1492,10 @@ (go-virtual active) ) ) - ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + ((and (= gp-0 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) (else @@ -1583,7 +1593,7 @@ (.nop.vf) (.svf (&-> v1-23 quad) vf1) ) - (set! (-> self nav state heading quad) (-> gp-0 quad)) + (vector-copy! (-> self nav state heading) gp-0) ) 0 ) @@ -1603,7 +1613,7 @@ ((>= 1 (the-as int gp-0)) (go-virtual active) ) - ((= gp-0 (enemy-aware ea3)) + ((= gp-0 (enemy-aware hostile)) (if (and (get-focus! self) (not (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags)))) (time-elapsed? (-> self starting-time) (-> self reaction-time)) @@ -1614,10 +1624,10 @@ (go-virtual circling) ) ) - ((and (= gp-0 (enemy-aware ea4)) (nav-enemy-method-167 self)) + ((and (= gp-0 (enemy-aware flee)) (nav-enemy-method-167 self)) (go-flee self) ) - ((and (= gp-0 (enemy-aware ea2)) + ((and (= gp-0 (enemy-aware aware2)) (-> self enemy-info use-pacing) (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) @@ -1657,7 +1667,7 @@ (go-virtual active) ) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) ) :exit (-> (method-of-type nav-enemy stare) exit) @@ -1668,7 +1678,7 @@ ((>= 1 (the-as int v1-6)) (go-virtual active) ) - ((and (= v1-6 (enemy-aware ea3)) (get-focus! self)) + ((and (= v1-6 (enemy-aware hostile)) (get-focus! self)) (go-virtual hostile) ) ) @@ -1678,7 +1688,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) - (let ((gp-0 (set-reaction-time! self (seconds 0.2) (seconds 0.7))) + (let ((gp-0 (rnd-time-frame self (seconds 0.2) (seconds 0.7))) (s5-0 (current-time)) (f28-0 f30-0) ) @@ -1727,8 +1737,8 @@ 0 (nav-enemy-method-176 self) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self move-dest quad) (-> self root trans quad)) - (set! (-> self state-timeout) (set-reaction-time! self (seconds 7) (seconds 11))) + (vector-copy! (-> self move-dest) (-> self root trans)) + (set! (-> self state-timeout) (rnd-time-frame self (seconds 7) (seconds 11))) (set-time! (-> self starting-time)) (if (zero? (rnd-int self 2)) (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef41) (-> self enemy-flags)))) @@ -1738,13 +1748,13 @@ (if (not gp-0) (go-virtual active) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) (if a0-1 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-1) 0)) ) ) (let ((gp-1 (-> self focus aware))) @@ -1755,7 +1765,7 @@ (if (>= 1 (the-as int gp-1)) (go-virtual active) ) - (when (= gp-1 (enemy-aware ea3)) + (when (= gp-1 (enemy-aware hostile)) (when (and (get-focus! self) (time-elapsed? (-> self starting-time) (-> self reaction-time))) (nav-enemy-method-172 self) (go-virtual hostile) @@ -1790,7 +1800,7 @@ (set! f30-1 (- f30-1)) ) ) - (set! (-> s5-0 quad) (-> self focus-pos quad)) + (vector-copy! s5-0 (-> self focus-pos)) (vector-! s4-0 (-> self root trans) s5-0) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 (rnd-float-range self 16384.0 49152.0)) @@ -1831,7 +1841,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1863,7 +1873,7 @@ (if (not gp-0) (go-virtual active) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (let ((f30-0 (-> self enemy-info circle-dist-lo)) (f28-0 (-> self enemy-info circle-dist-hi)) @@ -1882,7 +1892,7 @@ :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) (if a0-1 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-1) 0)) ) ) (let ((gp-1 (-> self focus aware))) @@ -1898,17 +1908,17 @@ (go-virtual active) ) ) - ((and (= gp-1 (enemy-aware ea3)) + ((and (= gp-1 (enemy-aware hostile)) (get-focus! self) (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) (nav-enemy-method-172 self) (go-hostile self) ) - ((= gp-1 (enemy-aware ea2)) + ((= gp-1 (enemy-aware aware2)) (go-stare self) ) - ((= gp-1 (enemy-aware ea4)) + ((= gp-1 (enemy-aware flee)) (go-flee self) ) ((or (nav-enemy-method-174 self) (logtest? (enemy-flag ef42) (-> self enemy-flags))) @@ -1946,7 +1956,7 @@ (if (logtest? (enemy-flag ef41) (-> self enemy-flags)) (set! f30-0 (- f30-0)) ) - (set! (-> s5-0 quad) (-> self focus-pos quad)) + (vector-copy! s5-0 (-> self focus-pos)) (vector-! gp-0 (-> self root trans) s5-0) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 (-> self desired-angle)) @@ -1957,7 +1967,7 @@ (vector+! s5-0 s5-0 gp-0) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (closest-point-on-mesh (-> self nav) gp-1 s5-0 (the-as nav-poly #f)) (if (< (vector-vector-xz-distance gp-1 (-> self root trans)) 409.6) (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef42) (-> self enemy-flags)))) @@ -1966,7 +1976,7 @@ (let ((v1-28 (-> self nav state))) (logclear! (-> v1-28 flags) (nav-state-flag directional-mode)) (logior! (-> v1-28 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-28 target-pos quad) (-> gp-1 quad)) + (vector-copy! (-> v1-28 target-pos) gp-1) ) ) ) @@ -2004,7 +2014,7 @@ :trans (behavior () (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (let ((v1-3 (-> self focus aware))) - (if (!= v1-3 (enemy-aware ea4)) + (if (!= v1-3 (enemy-aware flee)) (go-stare self) ) ) @@ -2186,24 +2196,26 @@ ) ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-91 ((this nav-enemy) (arg0 enemy-jump-info)) +(defmethod check-jump-blocked? ((this nav-enemy) (arg0 enemy-jump-info)) + "Is this jump blocked by something?" (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (vector-copy! v1-0 (-> arg0 dest-pos)) (set! (-> v1-0 w) (-> this nav-radius-backup)) - (add-root-sphere-to-hash! (-> this nav) v1-0 #x100068) + (check-sphere-blocked! (-> this nav) v1-0 #x100068) ) ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-101 ((this nav-enemy) (arg0 int) (arg1 enemy-jump-info)) - (let ((v1-0 arg0)) - (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) - (let ((a1-4 this)) - (if (logtest? (enemy-flag ef38) (-> a1-4 enemy-flags)) - (seek-to-point-toward-point! (-> this root) (-> arg1 dest-pos) (-> this nav max-rotation-rate) (seconds 0.02)) - ) - ) - ) +(defmethod adjust-heading-for-jump ((this nav-enemy) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Can be overriden. Yaw the enemy in response to an ongoing jump." + (case arg0 + (((jump-stage init) (jump-stage winding-up) (jump-stage takeoff) (jump-stage in-air)) + (let ((a1-4 this)) + (if (logtest? (enemy-flag ef38) (-> a1-4 enemy-flags)) + (seek-to-point-toward-point! (-> this root) (-> arg1 dest-pos) (-> this nav max-rotation-rate) (seconds 0.02)) + ) + ) + ) ) (none) ) @@ -2247,7 +2259,7 @@ (init-jump-info! self gp-0) (if (and (-> self enemy-info use-jump-blocked) (logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags)) - (enemy-method-91 self gp-0) + (check-jump-blocked? self gp-0) ) (go-virtual jump-blocked) ) @@ -2255,7 +2267,7 @@ (a1-2 (-> gp-0 dest-pos)) (f0-0 (-> v1-13 extra-nav-sphere w)) ) - (set! (-> v1-13 extra-nav-sphere quad) (-> a1-2 quad)) + (vector-copy! (-> v1-13 extra-nav-sphere) a1-2) (set! (-> v1-13 extra-nav-sphere w) f0-0) ) 0 @@ -2269,11 +2281,11 @@ 0 (when (logtest? (-> gp-0 flags) (enemy-jump-flags ejf0)) (until #f - (if (jump-anim-handler self s5-0 gp-0) + (if (jump-anim-handler self (the-as jump-stage s5-0) gp-0) (goto cfg-12) ) - (in-jump-handler self s5-0 gp-0) - (enemy-method-101 self s5-0 gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-0) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-0) gp-0) (suspend) (set! s5-0 1) ) @@ -2284,11 +2296,11 @@ (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) (let ((s5-1 2)) (logior! (-> self focus-status) (focus-status in-air)) - (until (on-ground? self gp-0) + (until (landed-jump-yet? self gp-0) (+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter))) - (jump-anim-handler self s5-1 gp-0) - (in-jump-handler self s5-1 gp-0) - (enemy-method-101 self s5-1 gp-0) + (jump-anim-handler self (the-as jump-stage s5-1) gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-1) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-1) gp-0) (suspend) (set! s5-1 3) ) @@ -2306,11 +2318,11 @@ (move-to-gspot! self) (let ((s5-2 4)) (until #f - (if (jump-anim-handler self s5-2 gp-0) + (if (jump-anim-handler self (the-as jump-stage s5-2) gp-0) (goto cfg-19) ) - (in-jump-handler self s5-2 gp-0) - (enemy-method-101 self s5-2 gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-2) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-2) gp-0) (suspend) (set! s5-2 5) ) @@ -2327,7 +2339,7 @@ ) ) ) - (go-directed2 self) + (go-next-state-auto self) ) :post (behavior () (let ((a0-0 self)) diff --git a/goal_src/jak3/engine/nav/nav-engine.gc b/goal_src/jak3/engine/nav/nav-engine.gc index 2bfd99957b9..b6add14b4b3 100644 --- a/goal_src/jak3/engine/nav/nav-engine.gc +++ b/goal_src/jak3/engine/nav/nav-engine.gc @@ -179,7 +179,7 @@ ((-> (the-as connection v1-6) param2) (let ((s1-0 (-> (the-as process-focusable a0-4) nav))) (set! (-> s1-0 sec-per-frame) (-> (the-as process-focusable a0-4) clock seconds-per-frame)) - (set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad)) + (vector-copy! (-> s1-0 root-nav-sphere) (-> (the-as collide-shape s2-0) trans)) (set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius)) (if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash)) (set! (-> this output-sphere-hash) (the-as uint 1)) @@ -206,7 +206,7 @@ (else (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) (let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> (the-as collide-shape s2-0) trans quad)) + (vector-copy! a1-5 (-> (the-as collide-shape s2-0) trans)) (set! (-> a1-5 w) (-> (the-as collide-shape s2-0) nav-radius)) (add-a-sphere-with-flag arg0 a1-5 (the-as int (-> (the-as collide-shape s2-0) backup-collide-as))) ) @@ -227,7 +227,7 @@ (+! s1-1 -1) (when (and (logtest? (collide-action nav-sphere) (-> s2-1 prim-core action)) (= (-> s2-1 prim-core prim-type) -1)) (let ((a1-6 (new 'stack-no-clear 'vector))) - (set! (-> a1-6 quad) (-> s2-1 prim-core world-sphere quad)) + (vector-copy! a1-6 (-> s2-1 prim-core world-sphere)) (set! (-> a1-6 w) (-> (the-as collide-shape-prim-sphere s2-1) nav-radius)) (add-a-sphere-with-flag arg0 a1-6 (the-as int (-> s2-1 prim-core collide-as))) ) @@ -255,7 +255,7 @@ (when *target* (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((v1-8 (-> *target* control))) - (set! (-> a1-0 quad) (-> v1-8 trans quad)) + (vector-copy! a1-0 (-> v1-8 trans)) (set! (-> a1-0 w) (-> v1-8 nav-radius)) ) (add-a-sphere-with-flag gp-0 a1-0 2) diff --git a/goal_src/jak3/engine/nav/nav-mesh-h.gc b/goal_src/jak3/engine/nav/nav-mesh-h.gc index e52eda2477d..7ae937514af 100644 --- a/goal_src/jak3/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak3/engine/nav/nav-mesh-h.gc @@ -294,7 +294,7 @@ Based on the implementation of point-poly-intersection?, these should likely be (vf3 :class vf) ) (init-vf0-vector) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (let ((v0-0 arg0)) (let ((f0-0 1.0)) (.lvf vf1 (&-> v0-0 quad)) @@ -430,13 +430,13 @@ Based on the implementation of point-poly-intersection?, these should likely be (let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-3) (-> arg0 vertex s2-0) sv-48))) (when (< f0-1 (the-as float sv-56)) (set! sv-56 f0-1) - (set! (-> sv-52 quad) (-> sv-48 quad)) + (vector-copy! sv-52 sv-48) ) ) (set! v1-3 s2-0) ) ) - (set! (-> arg1 quad) (-> sv-52 quad)) + (vector-copy! arg1 sv-52) arg1 ) @@ -445,7 +445,7 @@ Based on the implementation of point-poly-intersection?, these should likely be (local-vars (sv-48 vector) (sv-52 vector) (sv-56 number)) (cond ((point-in-poly? this arg0 arg2) - (set! (-> arg1 quad) (-> arg2 quad)) + (vector-copy! arg1 arg2) ) (else (let ((s5-1 arg1)) @@ -459,13 +459,13 @@ Based on the implementation of point-poly-intersection?, these should likely be (let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-6) (-> arg0 vertex s1-0) sv-48))) (when (< f0-1 (the-as float sv-56)) (set! sv-56 f0-1) - (set! (-> sv-52 quad) (-> sv-48 quad)) + (vector-copy! sv-52 sv-48) ) ) (set! v1-6 s1-0) ) ) - (set! (-> s5-1 quad) (-> sv-52 quad)) + (vector-copy! s5-1 sv-52) ) ) ) @@ -525,7 +525,7 @@ Based on the implementation of point-poly-intersection?, these should likely be (set! (-> arg0 next-poly) #f) (cond ((= sv-16 -1) - (set! (-> arg0 current-pos quad) (-> arg0 dest-pos quad)) + (vector-copy! (-> arg0 current-pos) (-> arg0 dest-pos)) (set! (-> arg0 reached-dest) #t) (set! (-> arg0 terminated) #t) ) diff --git a/goal_src/jak3/engine/nav/nav-mesh.gc b/goal_src/jak3/engine/nav/nav-mesh.gc index 2f30ec9315f..9b2db80592c 100644 --- a/goal_src/jak3/engine/nav/nav-mesh.gc +++ b/goal_src/jak3/engine/nav/nav-mesh.gc @@ -373,7 +373,7 @@ (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this nav-mesh bounds quad)) + (vector-copy! s5-0 (-> this nav-mesh bounds)) (let ((a0-6 (new 'stack 'random-generator))) (set! (-> a0-6 seed) (-> this aid)) (let* ((v1-4 (rand-uint31-gen a0-6)) @@ -463,7 +463,7 @@ gp-0 ) (else - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) (the-as nav-mesh #f) ) ) @@ -494,7 +494,7 @@ ) ) (else - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (the-as nav-poly #f) ) ) @@ -508,7 +508,7 @@ (defmethod debug-draw-poly ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) - (set! (-> gp-0 0 quad) (-> this bounds quad)) + (vector-copy! (-> gp-0 0) (-> this bounds)) (if (logtest? (-> arg0 pat) 15) (+! (-> gp-0 0 y) 409.6) ) @@ -1120,8 +1120,8 @@ (vf3 :class vf) ) (init-vf0-vector) - (set! (-> arg0 current-pos quad) (-> arg2 quad)) - (set! (-> arg0 dest-pos quad) (-> arg3 quad)) + (vector-copy! (-> arg0 current-pos) arg2) + (vector-copy! (-> arg0 dest-pos) arg3) (set! (-> arg0 current-poly) arg1) (let ((v1-2 arg0)) (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) @@ -1173,7 +1173,7 @@ ) (init-vf0-vector) (set! (-> arg0 current-poly) arg1) - (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (vector-copy! (-> arg0 current-pos) arg2) (let ((a1-3 (-> arg0 dest-pos))) (let ((v1-1 (-> arg0 current-pos))) (let ((a2-1 arg3)) @@ -1704,7 +1704,7 @@ (set! sv-28 (-> arg0 vertex-count)) (set! sv-32 (-> sv-24 vert0-table)) (set! sv-36 (-> sv-24 vert1-table)) - (set! (-> arg2 quad) (-> arg3 quad)) + (vector-copy! arg2 arg3) (dotimes (v1-8 (the-as int sv-28)) (set! sv-40 (-> arg0 vertex (-> sv-32 v1-8))) (set! sv-44 (-> arg0 vertex (-> sv-36 v1-8))) @@ -1797,12 +1797,12 @@ (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) ) ) - (set! (-> arg2 quad) (-> s4-0 quad)) + (vector-copy! arg2 s4-0) (set! (-> s4-0 w) (- (vector-dot s4-0 (the-as vector (-> arg0 vertex))))) - (set! (-> s5-0 quad) (-> arg3 quad)) + (vector-copy! s5-0 arg3) (set! (-> s5-0 y) (/ (- (+ (* (-> arg3 x) (-> s4-0 x)) (* (-> arg3 z) (-> s4-0 z)) (-> s4-0 w))) (-> s4-0 y))) ) - (set! (-> arg1 quad) (-> s5-0 quad)) + (vector-copy! arg1 s5-0) ) 0 (none) @@ -1941,14 +1941,14 @@ (let ((f0-5 (vector-segment-distance-point! arg2 (-> gp-0 2) (-> gp-0 3) (-> gp-0 0)))) (when (< f0-5 (-> gp-0 4 x)) (set! (-> gp-0 4 x) f0-5) - (set! (-> gp-0 1 quad) (-> gp-0 0 quad)) + (vector-copy! (-> gp-0 1) (-> gp-0 0)) ) ) ) (set! v1-1 s1-0) ) ) - (set! (-> arg1 quad) (-> gp-0 1 quad)) + (vector-copy! arg1 (-> gp-0 1)) (-> gp-0 4 x) ) ) @@ -1959,7 +1959,7 @@ (set! sv-80 arg0) (set! (-> gp-0 vertex3 y) (the-as float #x7f800000)) (set! (-> gp-0 vertex3 x) arg2) - (set! (-> gp-0 vertex1 quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 vertex1) arg1) (set! sv-84 (search-for-sphere (-> this poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) (let ((s4-0 (-> this poly-hash bucket-size)) (s3-0 sv-84) @@ -2004,7 +2004,7 @@ ) ) 0 - (set! (-> sv-80 quad) (-> gp-0 vertex 0 quad)) + (vector-copy! sv-80 (-> gp-0 vertex 0)) (-> gp-0 vertex3 y) ) ) @@ -2015,7 +2015,7 @@ (set! (-> gp-0 2 vertex3 y) arg2) (vector-! (the-as vector (-> gp-0 0)) arg0 (the-as vector (-> this bounds))) (vector-! (-> gp-0 0 vertex1) arg1 (the-as vector (-> this bounds))) - (set! (-> gp-0 2 vertex1 quad) (-> gp-0 0 vertex0 quad)) + (vector-copy! (-> gp-0 2 vertex1) (-> gp-0 0 vertex0)) (set! (-> gp-0 2 vertex2 x) (-> this nearest-y-threshold)) (set! (-> gp-0 2 data 36) (the-as uint 3)) (let ((a1-4 (nav-mesh-method-45 this (the-as nav-poly (-> gp-0 2 vertex1))))) @@ -2028,7 +2028,7 @@ ) (when (< (-> gp-0 2 vertex3 z) (-> gp-0 2 vertex3 y)) (set! (-> gp-0 2 vertex3 y) (-> gp-0 2 vertex3 z)) - (set! (-> gp-0 0 vertex2 quad) (-> gp-0 0 vertex3 quad)) + (vector-copy! (-> gp-0 0 vertex2) (-> gp-0 0 vertex3)) ) (b! (-> gp-0 2 vertex0 x) cfg-6 :delay (nop!)) (advance-ray-to-nearest-poly-edge-or-dest! this (the-as nav-ray (-> gp-0 1))) @@ -2081,7 +2081,7 @@ (set! (-> gp-0 byte04) 3) (set! (-> gp-0 vec3 y) arg1) (set! (-> gp-0 byte02) 0) - (set! (-> gp-0 vec1 quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 vec1) arg0) (b! #t cfg-9 :delay (nop!)) (label cfg-1) (set! (-> gp-0 nav-id-params bsphere quad) (-> gp-0 vec1 quad)) @@ -2099,7 +2099,7 @@ (label cfg-3) (dotimes (v1-15 (-> gp-0 byte01)) (let ((a1-2 (-> gp-0 byte-arr v1-15))) - (set! (-> gp-0 vec4 quad) (-> this sphere-hash sphere-array a1-2 quad)) + (vector-copy! (-> gp-0 vec4) (-> this sphere-hash sphere-array a1-2)) ) (vector-! (-> gp-0 vec5) (-> gp-0 vec1) (-> gp-0 vec4)) (set! (-> gp-0 vec5 y) 0.0) @@ -2110,7 +2110,7 @@ (f1-4 (+ (-> gp-0 vec3 y) (-> gp-0 vec4 w))) ) (when (< f0-8 (* f1-4 f1-4)) - (set! (-> gp-0 vec2 quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> gp-0 vec2) (-> gp-0 vec1)) (set! (-> gp-0 vec3 w) (sqrtf (-> gp-0 vec3 z))) (vector-float*! (-> gp-0 vec6) (-> gp-0 vec5) (/ 1.0 (-> gp-0 vec3 w))) (vector+float*! diff --git a/goal_src/jak3/engine/physics/chain-physics.gc b/goal_src/jak3/engine/physics/chain-physics.gc index b0e0a8f4078..3101b1a2372 100644 --- a/goal_src/jak3/engine/physics/chain-physics.gc +++ b/goal_src/jak3/engine/physics/chain-physics.gc @@ -271,9 +271,9 @@ ) ) ) - (set! (-> sv-272 position quad) (-> sv-528 quad)) + (vector-copy! (-> sv-272 position) sv-528) (if (-> sv-272 joint-mod) - (set! (-> sv-272 joint-mod trans quad) (-> sv-528 quad)) + (vector-copy! (-> sv-272 joint-mod trans) sv-528) ) (when (< s0-0 (the-as int (-> this num-joints))) (vector-! (-> s4-0 uvec) sv-528 s3-0) @@ -324,20 +324,20 @@ (.mul.x.vf acc vf2 vf3) (.add.mul.w.vf.xyz vf4 vf1 vf0 acc) (.svf (&-> sv-512 quad) vf4) - (set! (-> sv-272 old-x quad) (-> s4-0 rvec quad)) + (vector-copy! (-> sv-272 old-x) (-> s4-0 rvec)) ) (else - (set! (-> s4-0 rvec quad) (-> sv-496 quad)) - (set! (-> sv-272 old-x quad) (-> s4-0 rvec quad)) + (vector-copy! (-> s4-0 rvec) sv-496) + (vector-copy! (-> sv-272 old-x) (-> s4-0 rvec)) ) ) (vector-cross! (-> s4-0 fvec) (-> s4-0 rvec) (-> s4-0 uvec)) (matrix->quaternion (-> sv-272 joint-mod quat) s4-0) - (set! (-> s1-0 quad) (-> s4-0 uvec quad)) - (set! (-> s2-0 quad) (-> s4-0 fvec quad)) + (vector-copy! s1-0 (-> s4-0 uvec)) + (vector-copy! s2-0 (-> s4-0 fvec)) 0 ) - (set! (-> s3-0 quad) (-> sv-528 quad)) + (vector-copy! s3-0 sv-528) 0 ) ) @@ -367,7 +367,7 @@ (set! (-> arg1 root-joint-index) (the-as uint arg2)) (set! (-> arg1 joint-length) arg3) (set-vector! (-> arg1 gravity) 0.0 -1.0 0.0 1.0) - (set! (-> arg1 gravity-target quad) (-> arg1 gravity quad)) + (vector-copy! (-> arg1 gravity-target) (-> arg1 gravity)) (set! (-> arg1 stretch-vel) 0.7) (set! (-> arg1 stretch-vel-parallel) 0.8) (set! (-> arg1 compress-vel) 0.85) diff --git a/goal_src/jak3/engine/physics/cloth.gc b/goal_src/jak3/engine/physics/cloth.gc index e6c8902fd66..04df0e9d79d 100644 --- a/goal_src/jak3/engine/physics/cloth.gc +++ b/goal_src/jak3/engine/physics/cloth.gc @@ -128,7 +128,7 @@ (set! (-> s3-0 trans w) 1.0) (matrix*! s4-1 s4-1 s3-0) (matrix-identity! s3-0) - (set! (-> s3-0 trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> s3-0 trans) (-> s5-0 trans)) (matrix*! s4-1 s4-1 s3-0) ) ) @@ -150,17 +150,7 @@ ) ) ) - (let ((a2-7 (-> this last-owner-mat)) - (v1-54 (-> s5-0 rvec quad)) - (a0-42 (-> s5-0 uvec quad)) - (a1-23 (-> s5-0 fvec quad)) - (a3-2 (-> s5-0 trans quad)) - ) - (set! (-> a2-7 rvec quad) v1-54) - (set! (-> a2-7 uvec quad) a0-42) - (set! (-> a2-7 fvec quad) a1-23) - (set! (-> a2-7 trans quad) a3-2) - ) + (matrix-copy! (-> this last-owner-mat) s5-0) (logclear! (-> this flags) (cloth-flag local-space local-space-xyz local-space-y)) ) ) @@ -211,7 +201,7 @@ ) ) (let ((a0-25 (-> s5-0 trans))) - (set! (-> this last-owner-pos quad) (-> a0-25 quad)) + (vector-copy! (-> this last-owner-pos) a0-25) ) ) ) @@ -749,7 +739,7 @@ (when (< (* f0-0 f0-0) (vector-vector-distance-squared (-> this last-owner-pos) s5-2)) ) ) - (set! (-> this last-owner-pos quad) (-> s5-2 quad)) + (vector-copy! (-> this last-owner-pos) s5-2) ) ) ) @@ -827,8 +817,8 @@ (vector-! a1-4 a1-4 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) (vector+float*! a1-4 a1-4 a3-0 f0-1) ) - (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) - (set! (-> a2-1 pos quad) (-> a1-4 quad)) + (vector-copy! (-> a2-1 prev-pos) (-> a2-1 pos)) + (vector-copy! (-> a2-1 pos) a1-4) ) ) ) @@ -1147,7 +1137,7 @@ (when (< 0.0 f0-2) (vector+float*! t0-7 a3-7 (-> a0-6 normal) (* -1.0 f0-2)) (if (< (vector-length (vector-! (new 'stack-no-clear 'vector) t0-7 (-> a0-6 origin))) (-> a0-6 radius)) - (set! (-> a3-7 quad) (-> t0-7 quad)) + (vector-copy! a3-7 t0-7) ) ) ) @@ -1170,8 +1160,8 @@ (a1-20 (the-as object (&-> (-> this particles) _data (* (* 48 (-> this cloth-width)) v1-13)))) ) (set! (-> a0-19 mass-scale) 0.0) - (set! (-> a0-19 pos quad) (-> (the-as vector (&-> (the-as vector a1-20) x)) quad)) - (set! (-> a0-19 prev-pos quad) (-> (the-as vector (&-> (the-as vector a1-20) x)) quad)) + (vector-copy! (-> a0-19 pos) (the-as vector (&-> (the-as vector a1-20) x))) + (vector-copy! (-> a0-19 prev-pos) (the-as vector (&-> (the-as vector a1-20) x))) ) ) ) @@ -1888,7 +1878,7 @@ (cond (s5-0 (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this collision-constraints data s4-1 quad)) + (vector-copy! s3-0 (-> this collision-constraints data s4-1)) (set! (-> s3-0 w) 1.0) (vector-matrix*! s3-0 @@ -2063,7 +2053,7 @@ (when (logtest? (-> this flags) (cloth-flag use-parent-momentum)) (let ((proc (handle->process (-> this owner)))) (if proc - (set! (-> this momentum quad) (-> (the-as process-drawable proc) root transv quad)) + (vector-copy! (-> this momentum) (-> (the-as process-drawable proc) root transv)) ) ) ) diff --git a/goal_src/jak3/engine/physics/ragdoll-edit.gc b/goal_src/jak3/engine/physics/ragdoll-edit.gc index a6e5cfc9e50..0f333026f54 100644 --- a/goal_src/jak3/engine/physics/ragdoll-edit.gc +++ b/goal_src/jak3/engine/physics/ragdoll-edit.gc @@ -142,27 +142,16 @@ (cond (s2-0 (quaternion->matrix arg0 (-> s2-0 quat)) - (set! (-> arg1 quad) (-> s2-0 position quad)) + (vector-copy! arg1 (-> s2-0 position)) arg1 ) ((< (-> arg2 0 parent-joint) 0) (quaternion->matrix arg0 (-> arg4 root quat)) - (set! (-> arg1 quad) (-> arg4 root trans quad)) + (vector-copy! arg1 (-> arg4 root trans)) arg1 ) (else - (let* ((v1-8 arg0) - (a3-1 (-> arg4 node-list data (-> arg2 0 parent-joint) bone transform)) - (a0-7 (-> a3-1 rvec quad)) - (a1-6 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-8 rvec quad) a0-7) - (set! (-> v1-8 uvec quad) a1-6) - (set! (-> v1-8 fvec quad) a2-1) - (set! (-> v1-8 trans quad) a3-2) - ) + (matrix-copy! arg0 (-> arg4 node-list data (-> arg2 0 parent-joint) bone transform)) (vector<-cspace! arg1 (-> arg4 node-list data (-> arg2 0 parent-joint))) ) ) @@ -266,25 +255,15 @@ (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s0-0 pre-tform) (- (-> s0-0 pre-tform w))) ) (set! sv-4432 (new 'stack-no-clear 'vector)) - (let* ((v1-11 s1-0) - (a3-0 - (-> s3-0 - (/ (the-as uint (&- (the-as pointer sv-4352) (the-as uint (the-as pointer (-> arg0 ragdoll-joints))))) - (the-as uint 192) - ) - ) + (matrix-copy! + s1-0 + (-> s3-0 + (/ (the-as uint (&- (the-as pointer sv-4352) (the-as uint (the-as pointer (-> arg0 ragdoll-joints))))) + (the-as uint 192) ) - (a0-9 (-> a3-0 rvec quad)) - (a1-5 (-> a3-0 uvec quad)) - (a2-2 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-11 rvec quad) a0-9) - (set! (-> v1-11 uvec quad) a1-5) - (set! (-> v1-11 fvec quad) a2-2) - (set! (-> v1-11 trans quad) a3-1) + ) ) - (set! (-> sv-4432 quad) (-> s1-0 trans quad)) + (vector-copy! sv-4432 (-> s1-0 trans)) (vector-reset! (-> s1-0 trans)) (when (and (-> this auto-setup-now) (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) @@ -304,49 +283,27 @@ ) (t9-10 a0-21 sv-4416 a2-8) ) - (set! (-> s1-0 trans quad) (-> sv-4432 quad)) + (vector-copy! (-> s1-0 trans) sv-4432) (vector-! (-> sv-4368 uvec) (-> s0-0 position) (-> sv-4352 position)) (vector-normalize! (-> sv-4368 uvec) 1.0) (vector-flatten! (-> sv-4368 rvec) (-> s1-0 rvec) (-> sv-4368 uvec)) (vector-normalize! (-> sv-4368 rvec) 1.0) (vector-cross! (-> sv-4368 fvec) (-> sv-4368 rvec) (-> sv-4368 uvec)) - (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (vector-copy! (-> sv-4368 trans) (-> s0-0 position)) (set! (-> sv-4368 rvec w) 0.0) (set! (-> sv-4368 uvec w) 0.0) (set! (-> sv-4368 fvec w) 0.0) ) ((= s0-0 (-> arg0 ragdoll-joints)) (quaternion->matrix sv-4368 (-> s0-0 quat)) - (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (vector-copy! (-> sv-4368 trans) (-> s0-0 position)) (quaternion->matrix s1-0 (-> arg1 root quat)) - (set! (-> s1-0 trans quad) (-> arg1 root trans quad)) + (vector-copy! (-> s1-0 trans) (-> arg1 root trans)) ) (else - (let* ((v1-43 sv-4368) - (a3-2 (-> arg1 node-list data (-> s0-0 joint-index) bone transform)) - (a0-43 (-> a3-2 rvec quad)) - (a1-27 (-> a3-2 uvec quad)) - (a2-10 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> v1-43 rvec quad) a0-43) - (set! (-> v1-43 uvec quad) a1-27) - (set! (-> v1-43 fvec quad) a2-10) - (set! (-> v1-43 trans quad) a3-3) - ) - (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) - (let* ((a2-11 s1-0) - (a3-4 sv-4368) - (v1-46 (-> a3-4 rvec quad)) - (a0-46 (-> a3-4 uvec quad)) - (a1-28 (-> a3-4 fvec quad)) - (a3-5 (-> a3-4 trans quad)) - ) - (set! (-> a2-11 rvec quad) v1-46) - (set! (-> a2-11 uvec quad) a0-46) - (set! (-> a2-11 fvec quad) a1-28) - (set! (-> a2-11 trans quad) a3-5) - ) + (matrix-copy! sv-4368 (-> arg1 node-list data (-> s0-0 joint-index) bone transform)) + (vector-copy! (-> sv-4368 trans) (-> s0-0 position)) + (matrix-copy! s1-0 sv-4368) (vector<-cspace! (-> s1-0 trans) (-> arg1 node-list data (-> s0-0 parent-joint))) ) ) @@ -355,18 +312,7 @@ ) (set! sv-4464 (new 'stack-no-clear 'matrix)) (set! sv-4480 (new 'stack-no-clear 'matrix)) - (let* ((a2-13 sv-4464) - (a3-6 sv-4368) - (v1-56 (-> a3-6 rvec quad)) - (a0-49 (-> a3-6 uvec quad)) - (a1-32 (-> a3-6 fvec quad)) - (a3-7 (-> a3-6 trans quad)) - ) - (set! (-> a2-13 rvec quad) v1-56) - (set! (-> a2-13 uvec quad) a0-49) - (set! (-> a2-13 fvec quad) a1-32) - (set! (-> a2-13 trans quad) a3-7) - ) + (matrix-copy! sv-4464 sv-4368) (vector-reset! (-> sv-4464 trans)) (matrix-transpose! sv-4464 sv-4464) (set! sv-4448 (matrix->quaternion @@ -407,7 +353,7 @@ (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s0-0 geo-tform) (- (-> s0-0 geo-tform w))) ) (matrix*! sv-4496 sv-4496 sv-4368) - (set! (-> sv-4496 trans quad) (-> (the-as matrix sv-4368) trans quad)) + (vector-copy! (-> sv-4496 trans) (-> (the-as matrix sv-4368) trans)) (let ((t9-30 add-debug-matrix) (a0-66 #t) (a1-46 577) @@ -416,7 +362,7 @@ (t9-30 a0-66 (the-as bucket-id a1-46) sv-4496 (the-as meters a3-10)) ) (let ((a2-22 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> s0-0 quat)))) - (set! (-> a2-22 trans quad) (-> (the-as matrix sv-4368) trans quad)) + (vector-copy! (-> a2-22 trans) (-> (the-as matrix sv-4368) trans)) (add-debug-matrix #t (bucket-id debug-no-zbuf1) a2-22 (meters 0.15)) ) (when (or (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) @@ -448,18 +394,7 @@ (let ((s2-0 (new 'stack-no-clear 'matrix)) (s1-0 (new 'stack-no-clear 'vector)) ) - (let* ((v1-1 s2-0) - (a3-0 (-> arg0 node-list data s3-0 bone transform)) - (a0-4 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-1 rvec quad) a0-4) - (set! (-> v1-1 uvec quad) a1-2) - (set! (-> v1-1 fvec quad) a2-1) - (set! (-> v1-1 trans quad) a3-1) - ) + (matrix-copy! s2-0 (-> arg0 node-list data s3-0 bone transform)) (vector<-cspace! (-> s2-0 trans) (-> arg0 node-list data s3-0)) (when (or (= arg1 -1) (= arg1 s3-0)) (add-debug-matrix #t (bucket-id debug-no-zbuf1) s2-0 (the-as meters arg2)) diff --git a/goal_src/jak3/engine/physics/ragdoll.gc b/goal_src/jak3/engine/physics/ragdoll.gc index c0839d3cbbc..e24fa2bd651 100644 --- a/goal_src/jak3/engine/physics/ragdoll.gc +++ b/goal_src/jak3/engine/physics/ragdoll.gc @@ -42,8 +42,8 @@ (let ((s4-1 (new 'stack-no-clear 'collide-query)) (s5-1 (new 'stack-no-clear 'bounding-box)) ) - (set! (-> s5-1 min quad) (-> this ragdoll-joints 0 position quad)) - (set! (-> s5-1 max quad) (-> s5-1 min quad)) + (vector-copy! (-> s5-1 min) (-> this ragdoll-joints 0 position)) + (vector-copy! (-> s5-1 max) (-> s5-1 min)) (dotimes (v1-25 (the-as int (-> this num-joints))) (let ((a2-2 (-> this ragdoll-joints v1-25)) (a0-21 (new 'stack-no-clear 'vector)) @@ -225,7 +225,7 @@ (a0-4 (new 'stack-no-clear 'vector)) ) 0.0 - (set! (-> a0-4 quad) (-> s5-1 quad)) + (vector-copy! a0-4 s5-1) (let ((f30-0 (vector-normalize-ret-len! a0-4 1.0))) (if (< f30-0 0.1) (return #f) @@ -233,7 +233,7 @@ (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (-> this ragdoll-joints 0 velocity))) (s1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s1-1 quad) (-> s3-1 quad)) + (vector-copy! s1-1 s3-1) (let ((f28-1 (* arg2 (vector-normalize-ret-len! s1-1 1.0) (/ 1.0 (-> pp clock time-adjust-ratio)))) (a0-7 (vector+float*! (new 'stack-no-clear 'vector) arg0 s1-1 (vector-dot s5-1 s1-1))) ) @@ -316,7 +316,7 @@ ) (logclear! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0 rjf2)) (set! (-> s4-1 original-speed) 0.0) - (set! (-> arg0 quad) (-> s4-1 position quad)) + (vector-copy! arg0 (-> s4-1 position)) (until (or (< 6 s1-1) (begin (.lvf vf1 (&-> s3-2 quad)) (.add.w.vf.x vf2 vf0 vf0) @@ -333,8 +333,8 @@ ) ) (+! s1-1 1) - (set! (-> s2-1 start-pos quad) (-> arg0 quad)) - (set! (-> s2-1 move-dist quad) (-> s3-2 quad)) + (vector-copy! (-> s2-1 start-pos) arg0) + (vector-copy! (-> s2-1 move-dist) s3-2) (let ((v1-49 s2-1)) (set! (-> v1-49 radius) (-> s4-1 coll-rad)) (set! (-> v1-49 collide-with) (the-as collide-spec (-> this bg-collide-with))) @@ -446,7 +446,7 @@ (let ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> proc node-list data (-> s4-0 0 joint-index)))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> s4-0 0 position quad)) + (vector-copy! s3-0 (-> s4-0 0 position)) (if (logtest? (-> this ragdoll-flags) (ragdoll-flag mirror)) (vector-matrix*! s3-0 s3-0 (-> this mirror)) ) @@ -473,16 +473,8 @@ 0.0 (let ((s3-0 (new-stack-vector0))) 0.0 - (let ((s2-0 (new 'stack-no-clear 'matrix))) - (set! (-> s2-0 rvec quad) (the-as uint128 0)) - (set! (-> s2-0 uvec quad) (the-as uint128 0)) - (set! (-> s2-0 fvec quad) (the-as uint128 0)) - (set! (-> s2-0 trans quad) (the-as uint128 0)) - (let ((s0-0 (new 'stack-no-clear 'matrix))) - (set! (-> s0-0 rvec quad) (the-as uint128 0)) - (set! (-> s0-0 uvec quad) (the-as uint128 0)) - (set! (-> s0-0 fvec quad) (the-as uint128 0)) - (set! (-> s0-0 trans quad) (the-as uint128 0)) + (let ((s2-0 (new-stack-matrix0))) + (let ((s0-0 (new-stack-matrix0))) (vector-normalize-copy! (-> s0-0 rvec) (-> sv-208 rvec) 1.0) (vector-normalize-copy! (-> s0-0 uvec) (-> sv-208 uvec) 1.0) (vector-normalize-copy! (-> s0-0 fvec) (-> sv-208 fvec) 1.0) diff --git a/goal_src/jak3/engine/physics/rigid-body.gc b/goal_src/jak3/engine/physics/rigid-body.gc index 6291da87016..dd96fe38c7c 100644 --- a/goal_src/jak3/engine/physics/rigid-body.gc +++ b/goal_src/jak3/engine/physics/rigid-body.gc @@ -178,18 +178,7 @@ (defun matrix-3x3-triple-transpose-product ((arg0 matrix) (arg1 matrix) (arg2 matrix)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 3))) - (let* ((v1-0 (-> s5-0 0)) - (a3-0 arg1) - (a0-1 (-> a3-0 rvec quad)) - (a1-1 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-1) - (set! (-> v1-0 uvec quad) a1-1) - (set! (-> v1-0 fvec quad) a2-1) - (set! (-> v1-0 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 0) arg1) (vector-reset! (-> s5-0 0 trans)) (matrix-transpose! (-> s5-0 1) (-> s5-0 0)) (matrix*! (-> s5-0 2) arg2 (-> s5-0 0)) @@ -502,11 +491,11 @@ (set! (-> s5-0 cquery best-dist) -100000000.0) (set! (-> s5-0 cquery best-my-prim) #f) (set! (-> s5-0 cquery best-other-prim) #f) - (set! (-> s5-0 orig-position quad) (-> arg0 position quad)) + (vector-copy! (-> s5-0 orig-position) (-> arg0 position)) (quaternion-copy! (-> s5-0 orig-rotation) (the-as quaternion (-> arg0 rot))) (rigid-body-control-method-14 arg0 (* (-> s5-0 time-step-scale) (-> s5-0 time-step))) (mem-copy! (the-as pointer (-> s5-0 mat)) (the-as pointer (-> arg0 matrix)) 64) - (set! (-> arg0 position quad) (-> s5-0 orig-position quad)) + (vector-copy! (-> arg0 position) (-> s5-0 orig-position)) (quaternion-copy! (the-as quaternion (-> arg0 rot)) (-> s5-0 orig-rotation)) (rigid-body-control-method-26 arg0) (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) @@ -857,7 +846,7 @@ (defmethod update-rbody-transform! ((this rigid-body-control) (arg0 collide-shape-moving)) (quaternion-copy! (-> arg0 quat) (the-as quaternion (-> this rot))) (rigid-body-control-method-25 this (-> arg0 trans)) - (set! (-> arg0 transv quad) (-> this lin-velocity quad)) + (vector-copy! (-> arg0 transv) (-> this lin-velocity)) 0 (none) ) @@ -1007,6 +996,7 @@ ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this rigid-body-object) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (init-rbody-control! this) @@ -1104,7 +1094,7 @@ (set! (-> arg0 prim-id) (the-as uint 0)) (vector-reset! (-> arg0 normal)) (vector-reset! (-> arg0 velocity)) - (set! (-> arg0 point quad) (-> this root trans quad)) + (vector-copy! (-> arg0 point) (-> this root trans)) (when arg1 (let ((s3-0 (-> arg1 head))) (when s3-0 @@ -1175,13 +1165,13 @@ (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) (init-rbody-impact-from-tshape! this s5-0 arg2) (if (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) - (set! (-> s5-0 velocity quad) (-> arg1 attacker-velocity quad)) + (vector-copy! (-> s5-0 velocity) (-> arg1 attacker-velocity)) (vector-! (-> s5-0 velocity) (-> s5-0 point) (-> arg0 root trans)) ) (impulse-force<-penetrate this s5-0 arg1 arg3) (impulse-handler this) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> s5-0 velocity quad)) + (vector-copy! s4-1 (-> s5-0 velocity)) (vector-normalize! s4-1 1.0) (vector-float*! s4-1 s4-1 (-> s5-0 impulse)) (apply-impact! (-> this rbody) (-> s5-0 point) s4-1) @@ -1216,10 +1206,10 @@ (init-rbody-impact-from-tshape! this s5-0 arg1) (if (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (rigid-body-control-method-23 (-> this rbody) (-> s5-0 point) (-> s5-0 velocity)) - (set! (-> s5-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 velocity) (-> this root transv)) ) (let ((v1-17 (-> arg0 root))) - (set! (-> s4-0 quad) (-> v1-17 transv quad)) + (vector-copy! s4-0 (-> v1-17 transv)) (vector-! (-> s5-0 velocity) (-> v1-17 transv) (-> s5-0 velocity)) ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) @@ -1320,7 +1310,7 @@ (when a0-25 (let ((f0-1 (/ 163840.0 (get-inv-mass a0-25)))) (logior! (-> this flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) - (set! (-> this player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) + (vector-copy! (-> this player-force-position) (-> (the-as attack-info s5-2) attacker-velocity)) (vector-reset! (-> this player-force)) (set! (-> this player-force y) (* -1.0 f0-1)) ) @@ -1345,7 +1335,7 @@ ) (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> this flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) - (set! (-> this player-force-position quad) (-> (the-as process-focusable a0-34) root trans quad)) + (vector-copy! (-> this player-force-position) (-> (the-as process-focusable a0-34) root trans)) (vector-reset! (-> this player-force)) (let ((f0-4 (/ 163840.0 (get-inv-mass (the-as process-focusable a0-34)))) (f1-1 1.0) @@ -1370,7 +1360,7 @@ (logior! (-> this flags) (rigid-body-object-flag player-touching player-impulse-force)) (set-time! (-> this player-touch-time)) (impulse-handler this) - (set! (-> this player-force-position quad) (-> (the-as process-focusable s4-1) root trans quad)) + (vector-copy! (-> this player-force-position) (-> (the-as process-focusable s4-1) root trans)) (let ((f30-2 (* 0.00012207031 (the-as float (-> arg3 param 1)))) (f0-9 (/ 163840.0 (get-inv-mass (the-as process-focusable s4-1)))) ) diff --git a/goal_src/jak3/engine/physics/trajectory.gc b/goal_src/jak3/engine/physics/trajectory.gc index 8378c8b84c2..bcf4bde224b 100644 --- a/goal_src/jak3/engine/physics/trajectory.gc +++ b/goal_src/jak3/engine/physics/trajectory.gc @@ -14,7 +14,7 @@ ) (defmethod compute-transv-at-time ((this trajectory) (arg0 float) (arg1 vector)) - (set! (-> arg1 quad) (-> this initial-velocity quad)) + (vector-copy! arg1 (-> this initial-velocity)) (+! (-> arg1 y) (* arg0 (-> this gravity))) arg1 ) @@ -24,7 +24,7 @@ ) (defmethod setup-from-to-duration! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) - (set! (-> this initial-position quad) (-> arg0 quad)) + (vector-copy! (-> this initial-position) arg0) (set! (-> this gravity) arg3) (set! (-> this time) arg2) (let ((f0-3 (/ (vector-vector-xz-distance arg1 arg0) arg2))) @@ -116,9 +116,9 @@ (s4-0 (new 'stack-no-clear 'vector)) (s3-0 10) ) - (set! (-> s4-0 quad) (-> arg0 initial-position quad)) + (vector-copy! s4-0 (-> arg0 initial-position)) (dotimes (s2-0 s3-0) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) (let ((f0-1 (* (-> arg0 time) (/ (+ 1.0 (the float s2-0)) (the float s3-0))))) (compute-trans-at-time arg0 f0-1 s4-0) ) @@ -153,7 +153,7 @@ (defmethod update-from-cspace ((this impact-control)) (when (>= (-> this joint) 0) - (set! (-> this trans 1 quad) (-> this trans 0 quad)) + (vector-copy! (-> this trans 1) (-> this trans 0)) (vector<-cspace! (the-as vector (-> this trans)) (-> this process 0 node-list data (-> this joint))) (vector-! (-> this dir) (the-as vector (-> this trans)) (-> this trans 1)) ) @@ -162,8 +162,8 @@ ) (defmethod impact-control-method-11 ((this impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) - (set! (-> arg0 start-pos quad) (-> this trans 1 quad)) - (set! (-> arg0 move-dist quad) (-> this dir quad)) + (vector-copy! (-> arg0 start-pos) (-> this trans 1)) + (vector-copy! (-> arg0 move-dist) (-> this dir)) (let ((v1-2 (ppointer->process (-> this process))) (a0-6 arg0) ) @@ -210,17 +210,17 @@ (defmethod initialize ((this point-tracker) (arg0 vector) (arg1 vector)) (set! (-> this trans 0 quad) (-> arg0 quad)) - (set! (-> this trans 1 quad) (-> arg1 quad)) + (vector-copy! (-> this trans 1) arg1) this ) (defmethod point-tracker-method-10 ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (let ((a1-2 (vector+float*! arg0 arg2 (vector-! (new 'stack-no-clear 'vector) arg1 arg2) (- 1.0 arg3)))) @@ -413,7 +413,7 @@ ) (init-vf0-vector) (set! (-> this vec 0 quad) (-> arg0 quad)) - (set! (-> this mat uvec quad) (-> arg1 quad)) + (vector-copy! (-> this mat uvec) arg1) (let ((v1-2 (new 'stack-no-clear 'trajectory))) (vector-! (-> v1-2 initial-velocity) arg2 arg0) (vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) 3.0) @@ -433,11 +433,11 @@ (.svf (&-> t1-7 quad) vf6) ) (vector-! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3) - (set! (-> this mat fvec quad) (-> v1-2 initial-position quad)) + (vector-copy! (-> this mat fvec) (-> v1-2 initial-position)) (vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) -2.0) (vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg1) (vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3) - (set! (-> this mat trans quad) (-> v1-2 initial-position quad)) + (vector-copy! (-> this mat trans) (-> v1-2 initial-position)) ) (dotimes (v1-5 4) (set! (-> this vec v1-5 w) 0.0) @@ -483,7 +483,7 @@ (cubic-curve-method-10 this (-> s5-0 initial-velocity) 0.0) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 initial-velocity) *color-red*) (dotimes (s3-0 s4-0) - (set! (-> s5-0 initial-position quad) (-> s5-0 initial-velocity quad)) + (vector-copy! (-> s5-0 initial-position) (-> s5-0 initial-velocity)) (let ((f0-2 (/ (+ 1.0 (the float s3-0)) (the float s4-0)))) (cubic-curve-method-10 this (-> s5-0 initial-velocity) f0-2) ) diff --git a/goal_src/jak3/engine/process-drawable/focus.gc b/goal_src/jak3/engine/process-drawable/focus.gc index febfac2ab47..246e6c3fecf 100644 --- a/goal_src/jak3/engine/process-drawable/focus.gc +++ b/goal_src/jak3/engine/process-drawable/focus.gc @@ -16,7 +16,7 @@ (clear-focused (_type_) none) (collide-spec-match? (_type_ process-focusable) object) (reset-to-collide-spec (_type_ collide-spec) none) - (try-update-focus (_type_ process-focusable) symbol) + (focus-on! (_type_ process-focusable) symbol) ) ) @@ -44,8 +44,8 @@ ) ) -(defmethod try-update-focus ((this focus) (proc process-focusable)) - "Try to set the `handle` of this focus to the given process." +(defmethod focus-on! ((this focus) (proc process-focusable)) + "Set the `handle` of this focus to the given process. Return if the handle changed." (when (!= (handle->process (-> this handle)) proc) (set! (-> this handle) (process->handle proc)) #t diff --git a/goal_src/jak3/engine/process-drawable/process-focusable.gc b/goal_src/jak3/engine/process-drawable/process-focusable.gc index 909cf52b16d..651a800324d 100644 --- a/goal_src/jak3/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak3/engine/process-drawable/process-focusable.gc @@ -87,7 +87,7 @@ (focus-status focus-status) ) (:methods - (process-mask->search-info-flag (_type_) search-info-flag) + (get-search-info-flag (_type_) search-info-flag) (get-trans (_type_ int) vector) (get-quat (_type_ int) quaternion) (get-transv (_type_) vector) @@ -100,7 +100,8 @@ ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this process-focusable)) +(defmethod get-search-info-flag ((this process-focusable)) + "Get search-info-flag for this process." (let ((search-flag (search-info-flag))) (let ((mask (-> this mask))) (if (logtest? (process-mask crate) mask) @@ -158,6 +159,7 @@ ;; WARN: Return type mismatch int vs meters. (defmethod get-water-height ((this process-focusable)) + "Get the height of the water that we're in." (the-as meters 0) ) diff --git a/goal_src/jak3/engine/process-drawable/process-taskable.gc b/goal_src/jak3/engine/process-drawable/process-taskable.gc index e004ee2afa2..ca76cce5c87 100644 --- a/goal_src/jak3/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak3/engine/process-drawable/process-taskable.gc @@ -377,7 +377,8 @@ (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (if (logtest? (-> self flags) (process-taskable-flags ptf5)) (restart-mission) ) @@ -391,7 +392,8 @@ :enter (-> (method-of-type process-taskable active) enter) :exit (-> (method-of-type process-taskable active) exit) :code (behavior ((arg0 game-task-event)) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (go-virtual hide) ) :post (-> (method-of-type process-taskable idle) post) @@ -478,6 +480,7 @@ ) (defmethod init-from-entity! ((this process-taskable) (entity entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (init-collision! this) (process-drawable-from-entity! this entity) diff --git a/goal_src/jak3/engine/process-drawable/simple-focus.gc b/goal_src/jak3/engine/process-drawable/simple-focus.gc index 1ed77b0293b..cbd4f5a8042 100644 --- a/goal_src/jak3/engine/process-drawable/simple-focus.gc +++ b/goal_src/jak3/engine/process-drawable/simple-focus.gc @@ -35,7 +35,7 @@ (case message (('move-trans) (let ((v0-0 (-> self root trans))) - (set! (-> v0-0 quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! v0-0 (the-as vector (-> block param 0))) v0-0 ) ) diff --git a/goal_src/jak3/engine/process-drawable/simple-nav-sphere.gc b/goal_src/jak3/engine/process-drawable/simple-nav-sphere.gc index 6e56b36c07a..b89c293ea58 100644 --- a/goal_src/jak3/engine/process-drawable/simple-nav-sphere.gc +++ b/goal_src/jak3/engine/process-drawable/simple-nav-sphere.gc @@ -105,7 +105,7 @@ (set! (-> s5-0 nav-radius) arg0) (set! (-> s5-0 root-prim local-sphere w) arg0) (if arg1 - (set! (-> s5-0 trans quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 trans) arg1) ) (vector-identity! (-> s5-0 scale)) (quaternion-identity! (-> s5-0 quat)) diff --git a/goal_src/jak3/engine/scene/scene.gc b/goal_src/jak3/engine/scene/scene.gc index 76ea9453e75..86c695c9cd3 100644 --- a/goal_src/jak3/engine/scene/scene.gc +++ b/goal_src/jak3/engine/scene/scene.gc @@ -937,7 +937,7 @@ ((and *target* (zero? (-> self scene-index)) (or (not (-> self scene)) - (!= (status-of-level-and-borrows *level* (-> gp-0 vis-nick) #f) 'active) + (!= (level-status? *level* (-> gp-0 vis-nick) #f) 'active) (logtest? (-> self scene scene-flags) (scene-flags scf5)) ) ) @@ -1085,7 +1085,7 @@ (dotimes (s4-1 10) (when (not (or (not (-> gp-1 want s4-1 name)) (not (-> gp-1 want s4-1 display?)) - (= (status-of-level-and-borrows *level* (-> gp-1 want s4-1 name) 'all) 'active) + (= (level-status? *level* (-> gp-1 want s4-1 name) 'all) 'active) ) ) (set! v1-124 #t) diff --git a/goal_src/jak3/engine/sound/gsound.gc b/goal_src/jak3/engine/sound/gsound.gc index 0f1ca067e82..74ffe0e6785 100644 --- a/goal_src/jak3/engine/sound/gsound.gc +++ b/goal_src/jak3/engine/sound/gsound.gc @@ -919,7 +919,7 @@ (set! (-> s5-1 time-base) -1) ) ) - (set! (-> s5-1 trans quad) (-> trans quad)) + (vector-copy! (-> s5-1 trans) trans) s5-1 ) ) @@ -1054,7 +1054,7 @@ (defmethod update-trans! ((this ambient-sound) (new-trans vector)) "Change the trans of the sound." - (set! (-> this trans quad) (-> new-trans quad)) + (vector-copy! (-> this trans) new-trans) 0 ) @@ -1267,7 +1267,7 @@ (vector-! (-> gp-0 0) (target-pos 0) sound-pos) (if *target* (vector-! (-> gp-0 1) sound-vel (-> *target* control transv)) - (set! (-> gp-0 1 quad) (-> sound-vel quad)) + (vector-copy! (-> gp-0 1) sound-vel) ) (vector-normalize! (-> gp-0 0) 1.0) (let ((f0-1 (/ 1228800.0 (fmax 0.1 (- 1228800.0 (vector-dot (-> gp-0 0) (-> gp-0 1))))))) diff --git a/goal_src/jak3/engine/sound/speech.gc b/goal_src/jak3/engine/sound/speech.gc index da425644af9..22fb24a4ec8 100644 --- a/goal_src/jak3/engine/sound/speech.gc +++ b/goal_src/jak3/engine/sound/speech.gc @@ -249,7 +249,7 @@ ) (logior! (-> this flags) (speech-channel-flag disable)) ) - (set! (-> this target-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this target-pos) (target-pos 0)) (when (not (logtest? (-> this flags) (speech-channel-flag disable))) (let ((s5-1 (-> this speech-table (-> this request speech-type)))) (cond diff --git a/goal_src/jak3/engine/spatial-hash/actor-hash.gc b/goal_src/jak3/engine/spatial-hash/actor-hash.gc index d9f2da78676..275b2dfe7c7 100644 --- a/goal_src/jak3/engine/spatial-hash/actor-hash.gc +++ b/goal_src/jak3/engine/spatial-hash/actor-hash.gc @@ -130,7 +130,7 @@ ) ) (else - (set! (-> this tpos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this tpos) (target-pos 0)) (dotimes (v1-13 4) (set! (-> this data v1-13 length) 0) ) diff --git a/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc b/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc index efb559f70f9..e4b0ff44f80 100644 --- a/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc +++ b/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc @@ -110,7 +110,7 @@ O(n^2) 'check everybody against everybody' collision loop." (add-a-sphere-with-flag (_type_ vector int) int) (update-from-spheres (_type_) none) (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) + (check-sphere-blocked (_type_ vector int int) symbol) (add-sphere-with-mask-and-id (_type_ vector vector float int) symbol) (sphere-hash-method-32 (_type_ sphere int) symbol) ) diff --git a/goal_src/jak3/engine/spatial-hash/spatial-hash.gc b/goal_src/jak3/engine/spatial-hash/spatial-hash.gc index 40969b0ca4b..048936e48c2 100644 --- a/goal_src/jak3/engine/spatial-hash/spatial-hash.gc +++ b/goal_src/jak3/engine/spatial-hash/spatial-hash.gc @@ -187,7 +187,7 @@ (let ((v1-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-0 quad) (-> arg1 quad)) + (vector-copy! v1-0 arg1) (vector+! s2-0 arg1 arg2) (set! (-> v1-0 w) arg3) (set! (-> s2-0 w) arg3) @@ -741,10 +741,10 @@ (call-parent-method this) (new 'stack-no-clear 'vector) (let ((f30-0 6144.0)) - (set! (-> this work temp-box-min quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this work temp-box-min) (target-pos 0)) (+! (-> this work temp-box-min y) f30-0) ) - (set! (-> this work temp-box-max quad) (-> this work temp-box-min quad)) + (vector-copy! (-> this work temp-box-max) (-> this work temp-box-min)) (set! (-> this work visit-count) 0) (set! (-> this debug-draw) #t) (set! (-> this work add-object-time) (the-as uint 0)) @@ -885,7 +885,7 @@ (arg5 int) ) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-copy! v1-0 arg0) (set! (-> v1-0 w) 0.0) (fill-actor-list-for-box this v1-0 (the-as (pointer collide-shape) arg1) (the-as int arg2)) ) diff --git a/goal_src/jak3/engine/target/board/board-h.gc b/goal_src/jak3/engine/target/board/board-h.gc index 170c671e408..c8d5c170f9a 100644 --- a/goal_src/jak3/engine/target/board/board-h.gc +++ b/goal_src/jak3/engine/target/board/board-h.gc @@ -307,7 +307,7 @@ ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) ) (let ((v1-56 (new 'stack-no-clear 'vector))) - (set! (-> v1-56 quad) (-> self control trans quad)) + (vector-copy! v1-56 (-> self control trans)) (if (focus-test? self on-water) (set! (-> v1-56 y) (-> self water height)) ) diff --git a/goal_src/jak3/engine/target/board/board-states.gc b/goal_src/jak3/engine/target/board/board-states.gc index 93c912a71a1..e170919fa40 100644 --- a/goal_src/jak3/engine/target/board/board-states.gc +++ b/goal_src/jak3/engine/target/board/board-states.gc @@ -118,7 +118,7 @@ ) ) (set-time! (-> self board spin-start-time)) - (set! (-> self board spin-start-dir quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-copy! (-> self board spin-start-dir) (-> self node-list data 3 bone transform fvec)) (vector-flatten! (-> self control turn-to-alt-heading) (-> self control c-R-w fvec) *up-vector*) (vector-normalize! (-> self control turn-to-alt-heading) 1.0) (rot->dir-targ! (-> self control)) @@ -425,15 +425,15 @@ ) (when (not (logtest? (-> self control old-status) (collide-status on-surface))) (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> self control trans quad)) + (vector-copy! gp-2 (-> self control trans)) (+! (-> gp-2 y) 2048.0) (cond ((logtest? (-> *part-group-id-table* 189 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-2 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-2) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 189)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-2 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-2) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 189)) ) ) @@ -972,15 +972,15 @@ (time-elapsed? (-> self board ride-time) (seconds 0.5)) ) (let ((s3-5 (new 'stack-no-clear 'vector))) - (set! (-> s3-5 quad) (-> self control trans quad)) + (vector-copy! s3-5 (-> self control trans)) (+! (-> s3-5 y) 2048.0) (cond ((logtest? (-> *part-group-id-table* 190 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s3-5 quad)) + (vector-copy! (-> *launch-matrix* trans) s3-5) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 190)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s3-5 quad)) + (vector-copy! (-> *launch-matrix* trans) s3-5) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 190)) ) ) @@ -1064,7 +1064,7 @@ (set! (-> self control unknown-float36) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :exit target-board-exit :trans (behavior () @@ -1076,7 +1076,7 @@ ) ) (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) (set! (-> self board shock-offset) (* 0.8 (-> self board shock-offset))) ) :code (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) @@ -1360,7 +1360,7 @@ (cond ((< 0.7 (-> self control turn-to-magnitude)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control edge-grab-across-edge-dir quad)) + (vector-copy! gp-0 (-> self control edge-grab-across-edge-dir)) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 1.0) (if (< 0.7 (vector-dot (-> self control to-target-pt-xz) gp-0)) @@ -1547,10 +1547,10 @@ :event target-board-handler :enter (behavior ((arg0 vector) (arg1 float)) (sound-play "board-kick") - (set! (-> self control transv quad) (-> arg0 quad)) + (vector-copy! (-> self control transv) arg0) (vector-xz-normalize! (-> self control transv) (* 0.8 arg1)) (set! (-> self control unknown-word04) (the-as uint (fmax 81920.0 (* 0.8 arg1)))) - (set! (-> self control unknown-vector38 quad) (-> arg0 quad)) + (vector-copy! (-> self control unknown-vector38) arg0) (set! (-> self control transv y) 0.0) (vector-turn-to (vector-negate! (new 'stack-no-clear 'vector) (-> self control transv))) (set! (-> self control transv y) (- (sqrtf (* 24576.0 (-> self control dynam gravity-length))) @@ -1664,7 +1664,7 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (>= (-> self board flip-control) 0.0))) @@ -1816,7 +1816,7 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -2052,7 +2052,7 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((v1-0 (new 'stack-no-clear 'vector))) @@ -2182,7 +2182,7 @@ (set-time! (-> self board jump-land-time)) (go target-board-hit-ground) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (>= (-> self board unk-float005) 0.0)) @@ -2576,7 +2576,7 @@ (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) (set! (-> self board ride-rot-old) (-> self board ride-rot)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (if (find-ground (-> self control) @@ -2591,7 +2591,7 @@ ) ) (if (< (-> self control trans y) (-> self control gspot-pos y)) - (set! (-> gp-0 quad) (-> self control gspot-pos quad)) + (vector-copy! gp-0 (-> self control gspot-pos)) ) (move-to-point! (-> self control) @@ -2824,7 +2824,7 @@ ) (set! (-> gp-2 timeout) (seconds 4)) (vector<-cspace! (-> gp-2 pos) a1-5) - (set! (-> gp-2 vel quad) (-> *zero-vector* quad)) + (vector-copy! (-> gp-2 vel) *zero-vector*) (spawn-projectile grenade gp-2 self *default-dead-pool*) ) (ja-no-eval :num! (seek!)) @@ -2947,7 +2947,7 @@ ) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :exit target-board-exit :code (behavior () @@ -3072,7 +3072,7 @@ ) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :exit target-board-exit :code (behavior ((arg0 handle) (arg1 symbol)) @@ -3347,7 +3347,7 @@ (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) ) - (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (vector-copy! s5-0 (-> gp-0 vector)) (let ((f0-12 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -3371,13 +3371,13 @@ (cond ((= (-> self game mode) 'debug) (let ((s4-1 (new-stack-vector0))) - (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! s4-1 (-> self control last-trans-on-ground)) (ja-channel-set! 0) (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-stance) ) diff --git a/goal_src/jak3/engine/target/board/board-util.gc b/goal_src/jak3/engine/target/board/board-util.gc index d175d608aca..67237a096c1 100644 --- a/goal_src/jak3/engine/target/board/board-util.gc +++ b/goal_src/jak3/engine/target/board/board-util.gc @@ -17,11 +17,11 @@ (defbehavior board-post board () (let ((v1-0 (ppointer->process (-> self parent)))) - (set! (-> self root trans quad) (-> v1-0 board board-trans quad)) + (vector-copy! (-> self root trans) (-> v1-0 board board-trans)) (let ((a0-4 (-> v1-0 board board-quat quad))) (set! (-> self root quat quad) a0-4) ) - (set! (-> self root scale quad) (-> v1-0 board board-scale quad)) + (vector-copy! (-> self root scale) (-> v1-0 board board-scale)) (set! (-> self draw light-index) (-> v1-0 draw light-index)) (let ((a0-10 (-> v1-0 draw color-mult quad))) (set! (-> self draw color-mult quad) a0-10) diff --git a/goal_src/jak3/engine/target/board/target-board.gc b/goal_src/jak3/engine/target/board/target-board.gc index 1e680bbfcb8..d77a21bc45c 100644 --- a/goal_src/jak3/engine/target/board/target-board.gc +++ b/goal_src/jak3/engine/target/board/target-board.gc @@ -504,7 +504,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (cond (arg0 - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (set! (-> gp-0 w) 49152.0) ) (else @@ -769,7 +769,7 @@ (t9-2 vector-normalize!) (a0-2 (new-stack-vector0)) ) - (set! (-> a0-2 quad) (-> self control transv quad)) + (vector-copy! a0-2 (-> self control transv)) (let ((f30-0 (vector-dot s5-0 (t9-2 a0-2 1.0))) (s5-1 (-> self control transv-history)) (f26-0 -1000.0) @@ -1091,7 +1091,7 @@ ) (set-time! (-> self board smack-surface-time)) (set! (-> self board smack-speed) (-> self control ctrl-xz-vel)) - (set! (-> self board smack-normal quad) (-> self control wall-contact-normal quad)) + (vector-copy! (-> self board smack-normal) (-> self control wall-contact-normal)) #t ) ) @@ -1207,7 +1207,7 @@ "ltransv" (the-as rgba (new 'static 'rgba :g #xff :a #x80)) ) - (set! (-> s5-0 quad) (-> self control btransv quad)) + (vector-copy! s5-0 (-> self control btransv)) (vector-float*! s5-0 s5-0 0.5) (vector+! s5-0 s5-0 (-> self control trans)) (add-debug-text-sphere @@ -1481,7 +1481,7 @@ (let ((f30-0 0.5)) (if (time-elapsed? (-> self board unk-time-frame01) (seconds 0.3)) (+! (-> self board shock-offsetv) (* (- (-> arg0 y) (-> self control transv y)) f30-0)) - (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + (vector-copy! (-> self board up-vector 1) (-> self board up-vector 0)) ) (+! (-> self board shock-offsetv) (+ (* -10.0 (seconds-per-frame) (-> self board shock-offset)) @@ -1547,11 +1547,11 @@ (set! (-> self board shock-offsetv) 0.0) (cond ((logtest? (-> *part-group-id-table* 23 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 23)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 23)) ) ) @@ -1569,7 +1569,7 @@ (defbehavior target-board-collision target () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control transv quad)) + (vector-copy! gp-0 (-> self control transv)) (when (focus-test? self halfpipe) (when (-> self control unknown-spool-anim00) *edge-grab-info* @@ -1628,12 +1628,12 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> self control wall-contact-normal quad)) + (vector-copy! s5-1 (-> self control wall-contact-normal)) (vector-normalize! s5-1 1.0) (let ((s3-0 (vector-reflect! (new 'stack-no-clear 'vector) gp-0 s5-1)) (s4-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-1 quad) (-> self control c-R-w fvec quad)) + (vector-copy! s4-1 (-> self control c-R-w fvec)) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (set! (-> s4-1 y) 0.0) @@ -1649,13 +1649,13 @@ (let ((v1-64 s2-1)) (set! (-> self board glance-speed) (sqrtf (+ (* (-> v1-64 x) (-> v1-64 x)) (* (-> v1-64 z) (-> v1-64 z))))) ) - (set! (-> self board glance-normal quad) (-> s5-1 quad)) - (set! (-> self board glance-in-transv quad) (-> gp-0 quad)) + (vector-copy! (-> self board glance-normal) s5-1) + (vector-copy! (-> self board glance-in-transv) gp-0) (set! (-> s3-1 y) (-> s2-1 y)) (vector-xz-normalize! s3-1 (-> self board glance-speed)) (vector-matrix*! (-> self control transv) s3-1 (-> self control c-R-w)) ) - (set! (-> self board glance-out-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board glance-out-transv) (-> self control transv)) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) @@ -1700,8 +1700,8 @@ (vector-float*! (-> gp-3 move-dist) (-> self control dynam gravity-normal) -49152.0) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-3) 0.0) - (set! (-> self board probe-intersect quad) (-> gp-3 best-other-tri intersect quad)) - (set! (-> self board probe-normal quad) (-> gp-3 best-other-tri normal quad)) + (vector-copy! (-> self board probe-intersect) (-> gp-3 best-other-tri intersect)) + (vector-copy! (-> self board probe-normal) (-> gp-3 best-other-tri normal)) (set! (-> self board probe-pat) (-> gp-3 best-other-tri pat)) (set! (-> self board probe) #t) ) @@ -1724,7 +1724,7 @@ (let ((a1-0 (-> self node-list data 37 bone transform))) (matrix->transformq (the-as transformq (-> self board board-trans)) a1-0) ) - (set! (-> self board board-scale quad) (-> self control scale quad)) + (vector-copy! (-> self board board-scale) (-> self control scale)) (let ((a0-4 (-> *target-shadow-control* settings shadow-dir quad))) (set! (-> *board-shadow-control* settings shadow-dir quad) a0-4) ) @@ -1948,7 +1948,7 @@ ) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) (set! (-> self board turn-anim-duck-vel) 0.0) ) ) @@ -2081,7 +2081,7 @@ (mode-set! (-> self board main) (joint-mod-mode flex-blend)) (mode-set! (-> self board board 0 main) (joint-mod-mode flex-blend)) (let ((s5-3 (new 'stack-no-clear 'vector))) - (set! (-> s5-3 quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-copy! s5-3 (-> self node-list data 3 bone transform fvec)) (vector-rotate-y! s5-3 s5-3 15109.688) (if (not (and (-> self next-state) (let ((v1-160 (-> self next-state name))) @@ -2283,10 +2283,10 @@ (target-board-exit-check) (target-board-effect) (when (board-on-ground?) - (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + (vector-copy! (-> self board up-vector 1) (-> self board up-vector 0)) (set! (-> self board up-vector 0 quad) (-> self control local-normal quad)) (if (= (-> self board roty-cum) 0.0) - (set! (-> self board ground-on-dir quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-copy! (-> self board ground-on-dir) (-> self node-list data 3 bone transform fvec)) ) ) 0 @@ -2297,8 +2297,8 @@ (dotimes (s3-0 3) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (let ((v1-2 (-> arg0 collision-spheres s3-0))) - (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) - (set! (-> s2-0 move-dist quad) (-> arg1 quad)) + (vector-copy! (-> s2-0 start-pos) (-> v1-2 prim-core world-sphere)) + (vector-copy! (-> s2-0 move-dist) arg1) (let ((a0-3 s2-0)) (set! (-> a0-3 radius) (/ (-> v1-2 prim-core world-sphere w) 2)) (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) @@ -2326,9 +2326,9 @@ (let ((s4-0 *edge-grab-info*) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self control transv quad)) + (vector-copy! s5-0 (-> self control transv)) (when (not (edge-grab-info-method-9 s4-0)) (format #t "exit update~%") (send-event self 'end-mode 'ride #f) @@ -2364,12 +2364,12 @@ ) 1.0 ) - (set! (-> self control edge-grab-across-edge-dir quad) (-> s4-0 hanging-matrix rvec quad)) + (vector-copy! (-> self control edge-grab-across-edge-dir) (-> s4-0 hanging-matrix rvec)) (when (< (vector-dot (-> self control edge-grab-edge-dir) (-> self board ride-dir)) 0.0) (let ((s3-2 (new 'stack-no-clear 'vector))) - (set! (-> s3-2 quad) (-> s4-0 world-vertex 0 quad)) + (vector-copy! s3-2 (-> s4-0 world-vertex 0)) (set! (-> s4-0 world-vertex 0 quad) (-> s4-0 world-vertex 1 quad)) - (set! (-> s4-0 world-vertex 1 quad) (-> s3-2 quad)) + (vector-copy! (-> s4-0 world-vertex 1) s3-2) (vector-normalize! (vector-! (-> self control edge-grab-edge-dir) @@ -2378,9 +2378,9 @@ ) 1.0 ) - (set! (-> s3-2 quad) (-> s4-0 adjacent-edge-left-vertex quad)) - (set! (-> s4-0 adjacent-edge-left-vertex quad) (-> s4-0 adjacent-edge-right-vertex quad)) - (set! (-> s4-0 adjacent-edge-right-vertex quad) (-> s3-2 quad)) + (vector-copy! s3-2 (-> s4-0 adjacent-edge-left-vertex)) + (vector-copy! (-> s4-0 adjacent-edge-left-vertex) (-> s4-0 adjacent-edge-right-vertex)) + (vector-copy! (-> s4-0 adjacent-edge-right-vertex) s3-2) ) (let ((v1-70 (logtest? (-> s4-0 status) 2))) (if (logtest? (-> s4-0 status) 1) @@ -2394,13 +2394,13 @@ ) ) (dotimes (v1-75 3) - (set! (-> self board ride-vertex-old v1-75 quad) (-> self board ride-vertex v1-75 quad)) + (vector-copy! (-> self board ride-vertex-old v1-75) (-> self board ride-vertex v1-75)) ) - (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) - (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (vector-copy! (-> self board ride-segment-old) (-> self board ride-segment)) + (vector-copy! (-> self board ride-segment-old) (-> self board ride-segment)) (set! (-> self board ride-vertex-length-old) (-> self board ride-vertex-length)) (set! (-> self board ride-vertex 0 quad) (-> s4-0 world-vertex 0 quad)) - (set! (-> self board ride-vertex 1 quad) (-> s4-0 world-vertex 1 quad)) + (vector-copy! (-> self board ride-vertex 1) (-> s4-0 world-vertex 1)) (set! (-> self board ride-vertex 2 quad) (the-as uint128 0)) (set! (-> self board ride-vertex-length) 1) (cond @@ -2409,7 +2409,7 @@ (vector-! (-> self control unknown-vector35) (-> s4-0 adjacent-edge-right-vertex) (-> s4-0 world-vertex 1)) 1.0 ) - (set! (-> self board ride-vertex 2 quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (vector-copy! (-> self board ride-vertex 2) (-> s4-0 adjacent-edge-right-vertex)) (+! (-> self board ride-vertex-length) 1) 0 ) @@ -2434,7 +2434,7 @@ ) (+! s3-3 1) (dotimes (v1-114 3) - (set! (-> self board ride-vertex v1-114 quad) (-> self board ride-vertex-old v1-114 quad)) + (vector-copy! (-> self board ride-vertex v1-114) (-> self board ride-vertex-old v1-114)) ) (set! (-> self board ride-vertex-length) (-> self board ride-vertex-length-old)) (goto cfg-26) @@ -2646,12 +2646,12 @@ ) ) ) - (set! (-> self control to-target-pt-xz quad) (-> gp-1 quad)) + (vector-copy! (-> self control to-target-pt-xz) gp-1) ) ) ((logtest? s4-3 42) (move-to-point! (-> self control) gp-0) - (set! (-> self control transv quad) (-> s5-0 quad)) + (vector-copy! (-> self control transv) s5-0) ) ) (when (not (logtest? s4-3 64)) @@ -2781,9 +2781,9 @@ (pre-collide-setup) (seek! (-> self board cushion-offset) 1638.4 (* 16384.0 (seconds-per-frame))) (let ((s5-3 (new 'stack-no-clear 'vector))) - (set! (-> s5-3 quad) (-> self control transv quad)) + (vector-copy! s5-3 (-> self control transv)) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> self control trans quad)) + (vector-copy! s4-1 (-> self control trans)) (let ((a2-4 (new 'stack-no-clear 'collide-query)) (v1-83 (-> self control)) ) @@ -2804,9 +2804,10 @@ (else (logior! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) (dotimes (v1-102 2) - (set! (-> self board ride-touch-segment v1-102 quad) - (-> self board ride-vertex (+ (-> self board ride-vertex-base) v1-102) quad) - ) + (vector-copy! + (-> self board ride-touch-segment v1-102) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) v1-102)) + ) ) (set! (-> *collide-edge-board-spec* touching-segment) (the-as symbol (-> self board ride-touch-segment))) ) @@ -2843,7 +2844,7 @@ (move-to-point! (-> self control) s3-0) ) ) - (set! (-> self control transv quad) (-> s5-3 quad)) + (vector-copy! (-> self control transv) s5-3) ) ) (target-board-physics s5-3) @@ -2865,7 +2866,7 @@ (if (< (vector-dot (-> self control local-normal) (-> self control dynam gravity-normal)) 0.0) (vector-negate! (-> self control local-normal) (-> self control local-normal)) ) - (set! (-> self control gspot-normal quad) (-> self control local-normal quad)) + (vector-copy! (-> self control gspot-normal) (-> self control local-normal)) (target-powerup-process) (target-board-exit-check) (target-board-effect) diff --git a/goal_src/jak3/engine/target/collide-reaction-target.gc b/goal_src/jak3/engine/target/collide-reaction-target.gc index 440c125b231..e6c4d8e3ddd 100644 --- a/goal_src/jak3/engine/target/collide-reaction-target.gc +++ b/goal_src/jak3/engine/target/collide-reaction-target.gc @@ -34,7 +34,7 @@ ) ) (set! (-> arg0 vertex 0 quad) (-> arg1 sv-40 quad)) - (set! (-> arg0 vertex1 quad) (-> arg1 (mod (+ sv-40 1) 3) quad)) + (vector-copy! (-> arg0 vertex1) (-> arg1 (mod (+ sv-40 1) 3))) arg0 ) @@ -103,7 +103,7 @@ ) ) (set! (-> arg0 low-coverage-pat-next1) (-> s4-0 best-other-tri pat)) - (set! (-> arg0 low-coverage-norm-of-next1 quad) (-> s4-0 best-other-tri normal quad)) + (vector-copy! (-> arg0 low-coverage-norm-of-next1) (-> s4-0 best-other-tri normal)) 0 ) (vector+float*! (-> s4-0 start-pos) (-> arg1 best-other-tri intersect) (-> arg0 dynam gravity-normal) 819.2) @@ -116,7 +116,7 @@ (vector-vector-distance (-> s4-0 start-pos) (-> s4-0 best-other-tri intersect)) ) (set! (-> arg0 low-coverage-pat-next2) (-> s4-0 best-other-tri pat)) - (set! (-> arg0 low-coverage-norm-of-next2 quad) (-> s4-0 best-other-tri normal quad)) + (vector-copy! (-> arg0 low-coverage-norm-of-next2) (-> s4-0 best-other-tri normal)) 0 ) ) @@ -220,8 +220,8 @@ ) (set! sv-96 (collide-status)) (set! sv-104 (cshape-reaction-flags)) - (set! (-> sv-88 rvec quad) (-> arg3 quad)) - (set! (-> sv-88 uvec quad) (-> arg3 quad)) + (vector-copy! (-> sv-88 rvec) arg3) + (vector-copy! (-> sv-88 uvec) arg3) (let ((a1-3 (new 'stack-no-clear 'vector))) (vector-float*! a1-3 (-> arg1 move-dist) (-> arg1 best-dist)) (move-by-vector! arg0 a1-3) @@ -234,7 +234,7 @@ (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf05))) ) (let ((v1-24 (new 'stack-no-clear 'vector))) - (set! (-> v1-24 quad) (-> arg1 best-my-prim prim-core world-sphere quad)) + (vector-copy! v1-24 (-> arg1 best-my-prim prim-core world-sphere)) (vector-! sv-80 v1-24 (-> arg1 best-other-tri intersect)) ) (vector-normalize! sv-80 1.0) @@ -253,7 +253,7 @@ (if (= (-> arg1 best-dist) 0.0) (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0)) ) - (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! (-> arg0 poly-normal) (-> arg1 best-other-tri normal)) (collide-shape-moving-angle-set! arg0 sv-84 (-> sv-88 rvec)) (if (< (-> arg0 poly-angle) -0.2) (set! sv-96 (logior sv-96 (collide-status touch-ceiling))) @@ -285,7 +285,7 @@ (target-collision-low-coverage arg0 arg1 sv-84 (& sv-104) (& sv-96) (& sv-240)) ) (when (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) - (set! (-> arg0 transv-on-last-impact quad) (-> arg0 transv quad)) + (vector-copy! (-> arg0 transv-on-last-impact) (-> arg0 transv)) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (set! (-> arg0 normal-impact-vel) (- (vector-dot (-> arg0 transv) sv-84))) (set! sv-96 (logior sv-96 (collide-status impact-surface))) @@ -322,7 +322,7 @@ ((-> arg1 best-other-prim) (set! sv-96 (logior sv-96 (collide-status touch-actor))) (set! (-> arg0 actor-contact-pt quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> arg0 actor-contact-normal quad) (-> arg0 poly-normal quad)) + (vector-copy! (-> arg0 actor-contact-normal) (-> arg0 poly-normal)) (set! (-> arg0 actor-contact-handle) (process->handle (-> arg1 best-other-prim cshape process))) ) ((= (-> arg0 poly-pat material) (pat-material waterbottom)) @@ -337,8 +337,8 @@ (set! sv-96 (logior sv-96 (collide-status touch-wall))) (set! (-> arg0 cur-pat mode) 1) (set! (-> arg0 wall-contact-pt quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> arg0 wall-contact-poly-normal quad) (-> arg0 poly-normal quad)) - (set! (-> arg0 wall-contact-normal quad) (-> sv-84 quad)) + (vector-copy! (-> arg0 wall-contact-poly-normal) (-> arg0 poly-normal)) + (vector-copy! (-> arg0 wall-contact-normal) sv-84) (set! (-> arg0 wall-contact-pat) (-> arg1 best-other-tri pat)) (cond ((and (focus-test? (the-as process-focusable (-> arg0 process)) mech) @@ -375,7 +375,7 @@ ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) (not (logtest? sv-104 (cshape-reaction-flags csrf05))) - (not (logtest? (state-flags sf26) (-> arg0 process state-flags))) + (not (logtest? (state-flags hang) (-> arg0 process state-flags))) ) ) (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf08))) @@ -394,7 +394,7 @@ (set! sv-96 (logior sv-96 (collide-status on-surface))) (set! (-> arg0 cur-pat mode) 0) (if (= (-> arg1 best-my-prim prim-id) 6) - (set! (-> arg0 local-normal quad) (-> sv-84 quad)) + (vector-copy! (-> arg0 local-normal) sv-84) ) (cond ((and (focus-test? (the-as process-focusable (-> arg0 process)) board) @@ -438,8 +438,8 @@ (set! (-> arg0 ground-touch-point w) 0.0) (when (not (logtest? sv-104 (cshape-reaction-flags csrf00 csrf01 csrf02 csrf03 csrf14))) (set! sv-96 (logior sv-96 (collide-status on-ground))) - (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) - (set! (-> arg0 ground-contact-normal quad) (-> sv-84 quad)) + (vector-copy! (-> arg0 ground-poly-normal) (-> arg0 poly-normal)) + (vector-copy! (-> arg0 ground-contact-normal) sv-84) (set! (-> arg0 ground-local-norm-dot-grav) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) (set-time! (-> arg0 list-time-on-ground)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) @@ -458,34 +458,33 @@ (+! (-> arg0 history-idx) 1) (let ((v1-271 (clear-record-tags! *history* (history-channel surface-normal) (-> arg0 history-idx) (the-as uint 2))) ) - (set! (-> v1-271 origin quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> v1-271 vector quad) (-> arg0 surface-normal quad)) + (vector-copy! (-> v1-271 origin) (-> arg1 best-other-tri intersect)) + (vector-copy! (-> v1-271 vector) (-> arg0 surface-normal)) ) (let ((v1-274 (clear-record-tags! *history* (history-channel local-normal) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-274 origin quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> v1-274 vector quad) (-> arg0 local-normal quad)) + (vector-copy! (-> v1-274 origin) (-> arg1 best-other-tri intersect)) + (vector-copy! (-> v1-274 vector) (-> arg0 local-normal)) + ) + (vector-copy! + (-> (clear-record-tags! *history* (history-channel intersect) (-> arg0 history-idx) (the-as uint 2)) vector) + (-> arg1 best-other-tri intersect) ) - (set! (-> (clear-record-tags! *history* (history-channel intersect) (-> arg0 history-idx) (the-as uint 2)) - vector - quad - ) - (-> arg1 best-other-tri intersect quad) - ) (let ((v1-280 (clear-record-tags! *history* (history-channel transv-out) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-280 origin quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> v1-280 vector quad) (-> arg2 quad)) + (vector-copy! (-> v1-280 origin) (-> arg1 best-other-tri intersect)) + (vector-copy! (-> v1-280 vector) arg2) ) (let ((v1-283 (clear-record-tags! *history* (history-channel transv-in) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-283 origin quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> v1-283 vector quad) (-> sv-88 uvec quad)) + (vector-copy! (-> v1-283 origin) (-> arg1 best-other-tri intersect)) + (vector-copy! (-> v1-283 vector) (-> sv-88 uvec)) ) (let ((v1-286 (clear-record-tags! *history* (history-channel transv) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-286 origin quad) (-> arg0 trans quad)) - (set! (-> v1-286 vector quad) (-> arg0 transv quad)) + (vector-copy! (-> v1-286 origin) (-> arg0 trans)) + (vector-copy! (-> v1-286 vector) (-> arg0 transv)) + ) + (vector-copy! + (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector) + (-> arg0 trans) ) - (set! (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector quad) - (-> arg0 trans quad) - ) (let ((v1-292 (clear-record-tags! *history* (history-channel pat) (-> arg0 history-idx) (the-as uint 2)))) (set! (-> v1-292 vector x) (the-as float (-> arg0 cur-pat))) ) @@ -505,20 +504,21 @@ (when *debug-segment* (+! (-> arg0 history-idx) 1) (let ((v1-9 (clear-record-tags! *history* (history-channel transv-out) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-9 origin quad) (-> arg0 trans quad)) - (set! (-> v1-9 vector quad) (-> arg2 quad)) + (vector-copy! (-> v1-9 origin) (-> arg0 trans)) + (vector-copy! (-> v1-9 vector) arg2) ) (let ((v1-12 (clear-record-tags! *history* (history-channel transv-in) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-12 origin quad) (-> arg0 trans quad)) - (set! (-> v1-12 vector quad) (-> arg3 quad)) + (vector-copy! (-> v1-12 origin) (-> arg0 trans)) + (vector-copy! (-> v1-12 vector) arg3) ) (let ((v1-15 (clear-record-tags! *history* (history-channel transv) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-15 origin quad) (-> arg0 trans quad)) - (set! (-> v1-15 vector quad) (-> arg0 transv quad)) + (vector-copy! (-> v1-15 origin) (-> arg0 trans)) + (vector-copy! (-> v1-15 vector) (-> arg0 transv)) + ) + (vector-copy! + (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector) + (-> arg0 trans) ) - (set! (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector quad) - (-> arg0 trans quad) - ) (let ((v1-21 (clear-record-tags! *history* (history-channel collide-status) (-> arg0 history-idx) (the-as uint 2))) ) (set! (-> v1-21 collide-status) (logior (-> arg0 status) (collide-status no-touch))) @@ -579,7 +579,7 @@ ) 1.0 ) - (set! (-> self control edge-grab-across-edge-dir quad) (-> gp-0 hanging-matrix rvec quad)) + (vector-copy! (-> self control edge-grab-across-edge-dir) (-> gp-0 hanging-matrix rvec)) (send-event self 'push-transv diff --git a/goal_src/jak3/engine/target/flut/flut-racer.gc b/goal_src/jak3/engine/target/flut/flut-racer.gc index 8a49540fe88..58202ade7fd 100644 --- a/goal_src/jak3/engine/target/flut/flut-racer.gc +++ b/goal_src/jak3/engine/target/flut/flut-racer.gc @@ -86,34 +86,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -172,7 +172,7 @@ ) (when v1-9 (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self root trans quad)) + (vector-copy! a1-1 (-> self root trans)) (let ((a0-11 (-> (the-as process-drawable v1-9) root quat))) (new 'stack-no-clear 'vector) (+! (-> a1-1 y) 8192.0) @@ -359,7 +359,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (b! (not a0-5) cfg-20 :delay (nop!)) - (set! (-> gp-0 quad) (-> a0-5 extra trans quad)) + (vector-copy! gp-0 (-> a0-5 extra trans)) (let ((f0-0 (vector-vector-xz-distance gp-0 (-> self root trans))) (f30-0 (- (-> gp-0 y) (-> self root trans y))) ) @@ -368,7 +368,7 @@ ) (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-10 target-pos quad) (-> v1-9 quad)) + (vector-copy! (-> a0-10 target-pos) v1-9) ) 0 (when (and (< f0-0 40960.0) (< 24576.0 (+ -8192.0 f30-0))) @@ -424,18 +424,22 @@ ) (defmethod jump-land-anim ((this flut-racer) (arg0 enemy-jump-info)) + "Play the landing anim" #f ) (defmethod jump-wind-up-anim ((this flut-racer) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" #f ) -(defmethod go-directed2 ((this flut-racer)) +(defmethod go-next-state-auto ((this flut-racer)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (go (method-of-object this race)) ) -(defmethod enemy-method-108 ((this flut-racer) (arg0 process-focusable)) +(defmethod should-flee-from? ((this flut-racer) (arg0 process-focusable)) + "Return if this enemy should flee from the process." #t ) @@ -445,19 +449,21 @@ ) (defmethod get-damage-from-attack ((this flut-racer) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." 0.0 ) -(defmethod go-idle2 ((this flut-racer)) +(defmethod go-fallback-init ((this flut-racer)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this wait)) ) ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 5. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod jump-anim-handler ((this flut-racer) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this flut-racer) (arg0 jump-stage) (arg1 enemy-jump-info)) (let ((v1-0 arg0)) (the-as symbol (cond - ((= v1-0 4) + ((= v1-0 (jump-stage touchdown)) (when (not (focus-test? this dangerous)) (let ((v0-0 (the-as object (logior (-> this focus-status) (focus-status dangerous))))) (set! (-> this focus-status) (the-as focus-status v0-0)) @@ -474,6 +480,7 @@ ) (defmethod event-handler ((this flut-racer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('trigger) (if (and (-> this next-state) (= (-> this next-state name) 'wait)) @@ -553,7 +560,7 @@ ) (when (>= (* f1-2 f1-2) f0-10) (set! (-> this enemy-info attack-damage) 15) - (send-attack this s2-1 (the-as touching-shapes-entry #f) (-> this attack-id)) + (send-attack-from-tshape this s2-1 (the-as touching-shapes-entry #f) (-> this attack-id)) (set! (-> this enemy-info attack-damage) 0) 0 ) @@ -588,7 +595,7 @@ ) (when (>= (* f1-6 f1-6) f0-13) (set! (-> this enemy-info attack-damage) 15) - (send-attack this s4-2 (the-as touching-shapes-entry #f) (-> this attack-id)) + (send-attack-from-tshape this s4-2 (the-as touching-shapes-entry #f) (-> this attack-id)) (set! (-> this enemy-info attack-damage) 0) 0 ) @@ -602,12 +609,13 @@ ) (defmethod init-enemy! ((this flut-racer)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flut-racer" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flut-racer-enemy-info*) + (setup-enemy! this *flut-racer-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -688,6 +696,7 @@ ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod init-enemy-collision! ((this flut-racer)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak3/engine/target/flut/flut.gc b/goal_src/jak3/engine/target/flut/flut.gc index 979e7615ec3..8675aa17f11 100644 --- a/goal_src/jak3/engine/target/flut/flut.gc +++ b/goal_src/jak3/engine/target/flut/flut.gc @@ -352,7 +352,9 @@ (ja-channel-set! 0) (ja-post) (when (not (and (-> self entity) (= (-> self entity extra process) self))) - (suspend-for (seconds 0.1) (spawn-part-and-sound! self)) + (suspend-for (seconds 0.1) + (spawn-part-and-sound! self) + ) (deactivate self) ) (while (zero? (ja-group-size)) @@ -369,7 +371,9 @@ (spawn-part-and-sound! self) (suspend) ) - (suspend-for (seconds 1) (spawn-part-and-sound! self)) + (suspend-for (seconds 1) + (spawn-part-and-sound! self) + ) (go arg0) ) ) @@ -549,7 +553,7 @@ (set-yaw-angle-clear-roll-pitch! (-> self root) (res-lump-float arg0 'rotoffset)) ) (when arg1 - (set! (-> self root trans quad) (-> arg1 trans quad)) + (vector-copy! (-> self root trans) (-> arg1 trans)) (quaternion-copy! (-> self root quat) (-> arg1 quat)) ) (initialize-skeleton @@ -610,6 +614,7 @@ ) (defmethod init-from-entity! ((this flut) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (flut-init arg0 (the-as transformq #f) diff --git a/goal_src/jak3/engine/target/flut/target-flut.gc b/goal_src/jak3/engine/target/flut/target-flut.gc index 638464e1106..258d16b434f 100644 --- a/goal_src/jak3/engine/target/flut/target-flut.gc +++ b/goal_src/jak3/engine/target/flut/target-flut.gc @@ -347,7 +347,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg3 quad)) + (vector-copy! s5-0 arg3) (let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y)))) (if (< 6144.0 f0-1) (set! f0-1 6144.0) @@ -543,7 +543,7 @@ (let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0))) (cond ((>= f30-0 0.0) - (set! (-> s1-0 quad) (-> gp-0 best-other-tri normal quad)) + (vector-copy! s1-0 (-> gp-0 best-other-tri normal)) (when (< 8192.0 (vector-vector-angle-safe *y-vector* s1-0)) (let* ((a1-16 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s1-0) 1.0)) (a2-14 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-16 8192.0)) @@ -566,13 +566,13 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a1-18 quad) vf6) ) - (set! (-> s3-0 user-position quad) (-> s2-0 quad)) - (set! (-> s3-0 user-normal quad) (-> s1-0 quad)) + (vector-copy! (-> s3-0 user-position) s2-0) + (vector-copy! (-> s3-0 user-normal) s1-0) ) (else (set! (-> s0-0 y) (-> (target-pos 0) y)) - (set! (-> s3-0 user-position quad) (-> s0-0 quad)) - (set! (-> s3-0 user-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> s3-0 user-position) s0-0) + (vector-copy! (-> s3-0 user-normal) *y-vector*) ) ) ) @@ -598,7 +598,7 @@ (defbehavior target-flut-post-post target () (vector+! (-> self flut flut-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat)) - (set! (-> self flut flut-scale quad) (-> self control scale quad)) + (vector-copy! (-> self flut flut-scale) (-> self control scale)) (let ((v1-8 (-> *target-shadow-control* settings shadow-dir quad))) (set! (-> *flut-shadow-control* settings shadow-dir quad) v1-8) ) @@ -1222,11 +1222,11 @@ ) (init-vf0-vector) (let ((gp-0 (ppointer->process (-> self parent)))) - (set! (-> self control trans quad) (-> (the-as target gp-0) flut flut-trans quad)) + (vector-copy! (-> self control trans) (-> (the-as target gp-0) flut flut-trans)) (let ((v1-5 (-> (the-as target gp-0) flut flut-quat quad))) (set! (-> self control quat quad) v1-5) ) - (set! (-> self control scale quad) (-> (the-as target gp-0) flut flut-scale quad)) + (vector-copy! (-> self control scale) (-> (the-as target gp-0) flut flut-scale)) (set! (-> self control ground-pat material) (the-as int (-> (the-as target gp-0) control ground-pat material)) ) @@ -2510,7 +2510,7 @@ (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (vector-copy! (-> self control dynam gravity) (-> self control standard-dynamics gravity)) ((-> target-flut-start exit)) ) :trans (behavior () @@ -2681,10 +2681,10 @@ (set! (-> (the-as target self) control mod-surface) *empty-mods*) (set! (-> (the-as target self) neck flex-blend) 0.0) (sound-play "kanga-eat") - (set! (-> (the-as target self) control unknown-vector37 quad) (-> (the-as target self) control trans quad)) - (set! (-> (the-as target self) control unknown-vector38 quad) (-> (the-as target self) control trans quad)) - (set! (-> (the-as target self) control unknown-vector39 quad) (-> (the-as target self) control quat quad)) - (set! (-> (the-as target self) control unknown-vector40 quad) (-> (the-as target self) control quat quad)) + (vector-copy! (-> (the-as target self) control unknown-vector37) (-> (the-as target self) control trans)) + (vector-copy! (-> (the-as target self) control unknown-vector38) (-> (the-as target self) control trans)) + (set! (-> (the-as target self) control unknown-quat39 quad) (-> (the-as target self) control quat quad)) + (set! (-> (the-as target self) control unknown-quat40 quad) (-> (the-as target self) control quat quad)) (ja :group! s5-0 :num! (seek!) :frame-num (ja-aframe 20.0 0)) (while (< (ja-aframe-num 0) 93.0) (let* ((s4-2 (handle->process arg0)) @@ -2698,10 +2698,11 @@ (cond ((< f28-0 24.0) (when s5-1 - (set! (-> (the-as target self) control unknown-vector38 quad) - (-> (get-trans (the-as process-focusable s5-1) 0) quad) - ) - (set! (-> (the-as target self) control unknown-vector40 quad) + (vector-copy! + (-> (the-as target self) control unknown-vector38) + (get-trans (the-as process-focusable s5-1) 0) + ) + (set! (-> (the-as target self) control unknown-quat40 quad) (-> (get-quat (the-as process-focusable s5-1) 0) quad) ) ) @@ -2724,7 +2725,7 @@ (quaternion-slerp! (-> (the-as process-focusable s5-1) root quat) (-> (the-as target self) control quat) - (the-as quaternion (-> (the-as target self) control unknown-vector40)) + (-> (the-as target self) control unknown-quat40) (- 1.0 f28-1) ) ) @@ -2833,7 +2834,7 @@ (vector-xz-normalize! (-> s5-0 vector) (- (fabs (-> s5-0 shove-back)))) (set! (-> s5-0 vector y) (-> s5-0 shove-up)) ) - (set! (-> s4-0 quad) (-> s5-0 vector quad)) + (vector-copy! s4-0 (-> s5-0 vector)) (let ((f0-11 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -2857,12 +2858,13 @@ (cond ((= (-> self game mode) 'debug) (let ((s3-2 (new-stack-vector0))) - (set! (-> s3-2 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! s3-2 (-> self control last-trans-on-ground)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) s3-2) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-flut-stance) ) @@ -2883,11 +2885,11 @@ (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -3042,8 +3044,7 @@ ) ) ) - (suspend-for - (seconds 1) + (suspend-for (seconds 1) (target-flut-falling-anim-trans) (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) (let ((v1-39 (new-stack-vector0)) @@ -3086,11 +3087,11 @@ (sound-play "death-darkeco") (cond ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 62)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 62)) ) ) @@ -3102,17 +3103,18 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (('lava 'melt 'fry 'slime) (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -3124,7 +3126,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ) ) @@ -3297,16 +3300,16 @@ :code (behavior ((arg0 handle)) (set! (-> self control mod-surface) *flut-walk-mods*) (set! (-> self control transv quad) (the-as uint128 0)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (logior! (-> self target-flags) (target-flags tf5 tf6)) (set-time! (-> self state-time)) (when (handle->process arg0) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self control trans quad)) + (vector-copy! s4-0 (-> self control trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self control trans quad)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector39)) (-> self control quat)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector40)) (-> self control quat-for-control)) + (vector-copy! s5-0 (-> self control trans)) + (quaternion-copy! (-> self control unknown-quat39) (-> self control quat)) + (quaternion-copy! (-> self control unknown-quat40) (-> self control quat-for-control)) (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) (let* ((s2-0 (handle->process arg0)) (s3-0 (if (type? s2-0 process-drawable) @@ -3315,16 +3318,16 @@ ) ) (when s3-0 - (set! (-> s5-0 quad) (-> s3-0 root trans quad)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector40)) (-> s3-0 root quat)) + (vector-copy! s5-0 (-> s3-0 root trans)) + (quaternion-copy! (-> self control unknown-quat40) (-> s3-0 root quat)) (send-event s3-0 'trans (-> self flut flut-trans)) (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> s3-0 root quat)) - (set! (-> self flut flut-scale quad) (-> s3-0 root scale quad)) + (vector-copy! (-> self flut flut-scale) (-> s3-0 root scale)) (set! (-> self control did-move-to-pole-or-max-jump-height) (-> self flut flut-trans y)) ) ) - (set! (-> self control unknown-vector37 quad) (-> s4-0 quad)) - (set! (-> self control unknown-vector38 quad) (-> s5-0 quad)) + (vector-copy! (-> self control unknown-vector37) s4-0) + (vector-copy! (-> self control unknown-vector38) s5-0) (let ((s4-1 #f)) (sound-play "uppercut") (ja-channel-push! 1 (seconds 0.05)) @@ -3348,9 +3351,9 @@ ) ) (when v1-66 - (set! (-> s5-0 quad) (-> v1-66 root trans quad)) - (set! (-> self control unknown-vector38 quad) (-> s5-0 quad)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector40)) (-> v1-66 root quat)) + (vector-copy! s5-0 (-> v1-66 root trans)) + (vector-copy! (-> self control unknown-vector38) s5-0) + (quaternion-copy! (-> self control unknown-quat40) (-> v1-66 root quat)) ) ) (when (and (not s4-1) (= (-> self skel root-channel 0) (-> self skel channel))) @@ -3402,8 +3405,8 @@ (move-to-point! (-> self control) gp-0) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) @@ -3504,7 +3507,7 @@ (rot->dir-targ! (-> self control)) (set! (-> self neck flex-blend) 0.0) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (ja-channel-push! 1 (seconds 0.1)) (let ((s5-0 (if (-> self flut as-daxter?) jakb-mech-dummy3-ja @@ -3565,7 +3568,7 @@ (rot->dir-targ! (-> self control)) (set! (-> self neck flex-blend) 0.0) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (ja-channel-push! 1 (seconds 0.1)) (case arg0 (('drown) diff --git a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc index 47c9278a6e2..d0508136094 100644 --- a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc @@ -101,8 +101,8 @@ (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options po17)) (logclear! (-> s4-1 options) (projectile-options po14 po15 po16)) - (set! (-> s4-1 pos quad) (-> gp-0 fire-point quad)) - (set! (-> s4-1 vel quad) (-> s5-0 quad)) + (vector-copy! (-> s4-1 pos) (-> gp-0 fire-point)) + (vector-copy! (-> s4-1 vel) s5-0) (set! (-> s4-1 notify-handle) (the-as handle #f)) (set! (-> s4-1 owner-handle) (the-as handle #f)) (set! (-> s4-1 target-handle) (the-as handle #f)) @@ -145,7 +145,7 @@ ;; WARN: Return type mismatch float vs object. (defun get-dist-and-dot ((arg0 gun-blue-shot) (arg1 dist-dot-val)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> arg0 desired-target-pos quad)) + (vector-copy! s4-0 (-> arg0 desired-target-pos)) (let ((s5-0 (vector-normalize-copy! (-> arg1 current-dir-vec) (-> arg0 root transv) 1.0))) (let ((a0-2 (-> arg1 vec-to-target))) (vector-! a0-2 s4-0 (-> arg0 root trans)) @@ -178,7 +178,7 @@ (cond (s5-0 (let ((a0-9 (get-trans (the-as process-focusable a0-4) 3))) - (set! (-> arg0 desired-target-pos quad) (-> a0-9 quad)) + (vector-copy! (-> arg0 desired-target-pos) a0-9) ) ) ((= (-> arg0 track-mode) 1) @@ -233,7 +233,7 @@ ) ((or (= v1-40 1) (= v1-40 2)) (let ((s5-4 (new 'stack-no-clear 'vector))) - (set! (-> s5-4 quad) (-> arg0 root trans quad)) + (vector-copy! s5-4 (-> arg0 root trans)) (let ((f30-0 2.0) (f24-0 65536.0) ) @@ -259,7 +259,7 @@ ) (cond ((< 0.99 (-> s3-0 dot)) - (set! (-> s3-0 current-dir-vec quad) (-> s3-0 vec-to-target quad)) + (vector-copy! (-> s3-0 current-dir-vec) (-> s3-0 vec-to-target)) ) (else (let* ((s2-0 (new 'stack-no-clear 'vector)) @@ -278,7 +278,7 @@ ) ) ) - (set! (-> arg0 root transv quad) (-> s3-0 current-dir-vec quad)) + (vector-copy! (-> arg0 root transv) (-> s3-0 current-dir-vec)) (let* ((f0-26 (* 0.5 (+ 1.0 (-> s3-0 dot)))) (f0-27 (* f0-26 f0-26)) (f0-28 (lerp 122880.0 409600.0 f0-27)) @@ -305,7 +305,7 @@ ) (label cfg-70) (vector-! (-> arg0 root transv) (-> arg0 root trans) s5-4) - (set! (-> arg0 root trans quad) (-> s5-4 quad)) + (vector-copy! (-> arg0 root trans) s5-4) ) (vector-float*! (-> arg0 root transv) (-> arg0 root transv) (/ 1.0 (seconds-per-frame))) ) @@ -370,7 +370,7 @@ (set! (-> *blue-shot-trail* zbuffer?) #f) -(set! (-> *blue-shot-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *blue-shot-trail* lie-vector) *up-vector*) (set! (-> *blue-shot-trail* use-tape-mode?) #f) @@ -390,7 +390,7 @@ (set! (-> this vehicle-impulse-factor) 2.0) (logior! (-> this options) (projectile-options po13)) (set! (-> this track-mode) (the-as uint 0)) - (set! (-> this start-pos quad) (-> this root trans quad)) + (vector-copy! (-> this start-pos) (-> this root trans)) (let* ((f30-0 12288.0) (f28-0 28672.0) (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -473,7 +473,7 @@ (set! sv-1288 0) (set! sv-1296 (the-as float 0.0)) (set! sv-1300 (send-event *target* 'get-vehicle)) - (set! (-> sv-1280 quad) (-> sv-144 fire-point quad)) + (vector-copy! sv-1280 (-> sv-144 fire-point)) (set! (-> sv-1280 w) 163840.0) (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s5-0 (fill-actor-list-for-box *actor-hash* sv-1280 gp-0 384)) @@ -598,21 +598,19 @@ (vector+! gp-2 (-> sv-144 fire-point) s4-5) ) (let ((s4-6 (new 'stack-no-clear 'vector))) - (set! (-> s4-6 quad) (-> gp-2 quad)) + (vector-copy! s4-6 gp-2) (when s5-7 (let ((s3-6 s4-6) (s2-3 s5-7) ) - (set! (-> s3-6 quad) (-> (get-trans - (the-as process-focusable (if (type? s2-3 process-focusable) - (the-as process-focusable s2-3) - ) - ) - 3 - ) - quad - ) - ) + (vector-copy! s3-6 (get-trans + (the-as process-focusable (if (type? s2-3 process-focusable) + (the-as process-focusable s2-3) + ) + ) + 3 + ) + ) ) ) (let ((s3-7 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> sv-144 fire-dir-out) 2730.6667)) @@ -621,8 +619,8 @@ (s4-7 (new 'stack-no-clear 'vector)) ) (if (< (vector-dot s3-7 a0-114) (vector-dot v1-174 a0-114)) - (set! (-> s4-7 quad) (-> s3-7 quad)) - (set! (-> s4-7 quad) (-> v1-174 quad)) + (vector-copy! s4-7 s3-7) + (vector-copy! s4-7 v1-174) ) (vector-normalize! a0-114 1.0) (let* ((s3-8 vector-rotate-y!) @@ -647,11 +645,11 @@ (set! (-> sv-148 charge) 1.0) (set! (-> sv-148 options) (projectile-options)) (logclear! (-> sv-148 options) (projectile-options po14 po15 po16)) - (set! (-> sv-148 pos quad) (-> sv-144 fire-point quad)) + (vector-copy! (-> sv-148 pos) (-> sv-144 fire-point)) (set! (-> sv-148 notify-handle) (the-as handle #f)) (set! (-> sv-148 owner-handle) (the-as handle #f)) (set! (-> sv-148 target-handle) (process->handle s5-7)) - (set! (-> sv-148 target-pos quad) (-> gp-2 quad)) + (vector-copy! (-> sv-148 target-pos) gp-2) (set! (-> sv-148 ignore-handle) (process->handle (send-event self 'get-vehicle))) (let* ((v1-209 *game-info*) (a0-143 (+ (-> v1-209 attack-id) 1)) @@ -690,7 +688,7 @@ (s3-0 #f) ) (vector-! (-> s5-0 move-dist) arg1 arg0) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) 2.0) (let ((v1-5 s5-0)) (set! (-> v1-5 radius) 12288.0) @@ -724,10 +722,11 @@ (set! (-> a1-8 charge) 1.0) (set! (-> a1-8 options) (projectile-options)) (logclear! (-> a1-8 options) (projectile-options po14 po15 po16)) - (set! (-> a1-8 pos quad) (-> arg0 quad)) - (set! (-> a1-8 vel quad) - (-> (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) (/ 2.0 (seconds-per-frame))) quad) - ) + (vector-copy! (-> a1-8 pos) arg0) + (vector-copy! + (-> a1-8 vel) + (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) (/ 2.0 (seconds-per-frame))) + ) (set! (-> a1-8 notify-handle) (the-as handle #f)) (set! (-> a1-8 owner-handle) (process->handle *target*)) (set! (-> a1-8 target-handle) (the-as handle #f)) @@ -1281,7 +1280,7 @@ (dotimes (v1-31 (-> s3-0 num-active-spans)) (let ((a0-8 (-> s3-0 spans data v1-31))) (let ((a1-5 (-> s3-0 spans-internal data v1-31))) - (set! (-> s3-0 span-pts-start data v1-31 quad) (-> arg0 pts v1-31 quad)) + (vector-copy! (-> s3-0 span-pts-start data v1-31) (-> arg0 pts v1-31)) (set! (-> a0-8 random-offset-size-start) 0.0) (if (> v1-31 0) (set! (-> a0-8 random-offset-size-start) 8192.0) @@ -1292,9 +1291,10 @@ ) ) (let ((v1-37 (-> s3-0 spans data (-> s3-0 num-active-spans)))) - (set! (-> s3-0 span-pts-start data (-> s3-0 num-active-spans) quad) - (-> arg0 pts (-> s3-0 num-active-spans) quad) - ) + (vector-copy! + (-> s3-0 span-pts-start data (-> s3-0 num-active-spans)) + (-> arg0 pts (-> s3-0 num-active-spans)) + ) (set! (-> v1-37 random-offset-size-start) 0.0) ) (lightning-bolt-method-11 s3-0) @@ -1314,7 +1314,7 @@ (dotimes (v1-58 (-> s3-1 num-active-spans)) (let ((a0-24 (-> s3-1 spans data v1-58))) (let ((a1-16 (-> s3-1 spans-internal data v1-58))) - (set! (-> s3-1 span-pts-start data v1-58 quad) (-> arg0 pts v1-58 quad)) + (vector-copy! (-> s3-1 span-pts-start data v1-58) (-> arg0 pts v1-58)) (set! (-> a0-24 random-offset-size-start) 0.0) (if (> v1-58 0) (set! (-> a0-24 random-offset-size-start) 4096.0) @@ -1325,16 +1325,17 @@ ) ) (let ((v1-64 (-> s3-1 spans data (-> s3-1 num-active-spans)))) - (set! (-> s3-1 span-pts-start data (-> s3-1 num-active-spans) quad) - (-> arg0 pts (-> s3-1 num-active-spans) quad) - ) + (vector-copy! + (-> s3-1 span-pts-start data (-> s3-1 num-active-spans)) + (-> arg0 pts (-> s3-1 num-active-spans)) + ) (set! (-> v1-64 random-offset-size-start) 0.0) ) (lightning-bolt-method-11 s3-1) (lightning-bolt-method-12 s3-1) ) ) - (set! (-> this root trans quad) (-> arg0 pts (+ (-> arg0 num-pts) -1) quad)) + (vector-copy! (-> this root trans) (-> arg0 pts (+ (-> arg0 num-pts) -1))) (when (-> arg0 should-draw-terminal-sparks?) (when (time-elapsed? (-> this last-spark-time) (-> this spark-time-interval)) (set-time! (-> this last-spark-time)) @@ -1347,9 +1348,9 @@ (let ((s4-2 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 3) 3))) (let ((v1-90 (-> this lt-array 5))) (-> v1-90 spans data (-> v1-90 num-active-spans)) - (set! (-> arg0 terminal-spark-pos quad) (-> v1-90 span-pts-start data (-> v1-90 num-active-spans) quad)) + (vector-copy! (-> arg0 terminal-spark-pos) (-> v1-90 span-pts-start data (-> v1-90 num-active-spans))) ) - (set! (-> this root trans quad) (-> arg0 terminal-spark-pos quad)) + (vector-copy! (-> this root trans) (-> arg0 terminal-spark-pos)) (dotimes (s5-1 s4-2) (process-drawable-shock-effect-replace this @@ -1389,7 +1390,7 @@ ) ) :enter (behavior () - (set! (-> self prev-targ-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self prev-targ-pos) (target-pos 0)) (set-time! (-> self state-time)) (set-time! (-> self active-enter-time)) (set-time! (-> self last-deduct-ammo-time)) @@ -1398,7 +1399,7 @@ ) (set! (-> *blue-2-lightning-shape* num-knots) (the-as uint 12)) (let ((v1-17 (new 'stack-no-clear 'vector))) - (set! (-> v1-17 quad) (-> *target* gun fire-point quad)) + (vector-copy! v1-17 (-> *target* gun fire-point)) (let ((a0-9 (vector-float*! (new 'stack-no-clear 'vector) (-> *target* gun laser-dir) 24576.0))) (dotimes (a1-4 (the-as int (-> *blue-2-lightning-shape* num-knots))) (set! (-> *blue-2-lightning-shape* constraints a1-4 pt quad) (-> v1-17 quad)) @@ -1622,7 +1623,7 @@ (set! sv-32 (the-as process-drawable #f)) (set! sv-36 4096000.0) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> arg0 quad)) + (vector-copy! v1-1 arg0) (set! sv-40 v1-1) ) (set! (-> sv-40 w) 0.0) @@ -1685,7 +1686,7 @@ (set! sv-32 (the-as process-drawable #f)) (set! sv-36 16384.0) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> arg0 quad)) + (vector-copy! v1-1 arg0) (set! sv-40 v1-1) ) (set! (-> arg0 w) 16384.0) @@ -1803,7 +1804,7 @@ (when (>= f0-3 0.0) (vector-float*! (-> s3-0 move-dist) (-> s3-0 move-dist) f0-3) (vector+! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist)) - (set! (-> arg2 lightning-info terminal-spark-pos quad) (-> s4-0 quad)) + (vector-copy! (-> arg2 lightning-info terminal-spark-pos) s4-0) (set! (-> arg2 lightning-info num-pts) 1) (set! (-> arg2 lightning-info pts 0 quad) (-> s4-0 quad)) (set! (-> arg2 lightning-info should-draw-terminal-sparks?) #t) @@ -1843,7 +1844,7 @@ ) ) ) - (set! (-> this prev-targ-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this prev-targ-pos) (target-pos 0)) (set! sv-624 (-> *target* gun)) (set! sv-628 (-> *target* gun laser-dir)) (set! sv-632 (new 'stack-no-clear 'gun-blue-lightning-command)) @@ -1852,13 +1853,13 @@ (set! sv-656 (new 'static 'array int32 12 0 0 0 0 0 0 0 0 0 0 0 0)) (vector-normalize! sv-628 1.0) (set! (-> *blue-2-lightning-shape* constraints 0 pt quad) (-> sv-624 fire-point quad)) - (set! (-> *blue-2-lightning-shape* constraints 0 dir quad) (-> sv-628 quad)) + (vector-copy! (-> *blue-2-lightning-shape* constraints 0 dir) sv-628) (rope-constraint-method-9 *blue-2-lightning-shape* 0) (if (zero? (-> this last-probe-index)) (+! (-> this last-probe-index) 1) ) (dotimes (v1-22 12) - (set! (-> *lightning-pts-cache* v1-22 quad) (-> *blue-2-lightning-shape* constraints v1-22 pt quad)) + (vector-copy! (-> *lightning-pts-cache* v1-22) (-> *blue-2-lightning-shape* constraints v1-22 pt)) ) (if (not (gun-blue-2-lightning-tracker-method-26 this sv-628 (-> sv-624 fire-point) sv-632)) (return 0) @@ -1872,11 +1873,11 @@ ) (while (>= (the-as int s4-0) s5-3) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> *lightning-pts-cache* s5-3 quad)) + (vector-copy! s3-0 (-> *lightning-pts-cache* s5-3)) (let ((s2-0 (the-as process-drawable #f))) (let ((a0-19 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (set! (-> a0-19 quad) (-> s3-0 quad)) + (vector-copy! a0-19 s3-0) (set! (-> a0-19 w) 12288.0) (if (not (the-as symbol s2-0)) (set! s2-0 (find-gun-blue-2-target-old @@ -1894,8 +1895,8 @@ (set! (-> sv-656 s5-3) 1) (set! sv-640 (+ sv-640 1)) (set! sv-648 s5-3) - (set! (-> s3-0 quad) (-> (get-trans (the-as process-focusable s2-0) 3) quad)) - (set! (-> *lightning-pts-cache* s5-3 quad) (-> s3-0 quad)) + (vector-copy! s3-0 (get-trans (the-as process-focusable s2-0) 3)) + (vector-copy! (-> *lightning-pts-cache* s5-3) s3-0) (vector-! (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-3))) (-> *lightning-pts-cache* s5-3) @@ -1916,10 +1917,10 @@ (let ((s0-0 s3-0) (s1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s1-1 quad) (-> *lightning-pts-cache* (+ s5-3 -1) quad)) + (vector-copy! s1-1 (-> *lightning-pts-cache* (+ s5-3 -1))) (set! sv-1440 (the-as symbol #f)) (set! sv-1456 (new 'stack-no-clear 'collide-query)) - (set! (-> sv-1456 start-pos quad) (-> s1-1 quad)) + (vector-copy! (-> sv-1456 start-pos) s1-1) (vector-! (-> sv-1456 move-dist) s0-0 s1-1) (set! sv-1472 sv-1456) (set! (-> sv-1472 radius) 860.16) @@ -1945,14 +1946,14 @@ ) ) (else - (set! (-> sv-632 lightning-info terminal-spark-pos quad) (-> s0-0 quad)) + (vector-copy! (-> sv-632 lightning-info terminal-spark-pos) s0-0) ) ) ) ) (when (not s2-0) ) - (set! (-> *lightning-pts-cache* s5-3 quad) (-> s3-0 quad)) + (vector-copy! (-> *lightning-pts-cache* s5-3) s3-0) (+! (-> sv-632 lightning-info num-pts) 1) (let ((s3-1 fire-projectile-if-necessary) (a2-13 (if (< 1 sv-640) @@ -1982,7 +1983,7 @@ (set! (-> sv-632 lightning-info should-draw-terminal-sparks?) #f) ) (dotimes (s5-4 (-> sv-632 lightning-info num-pts)) - (set! (-> sv-632 lightning-info pts s5-4 quad) (-> *lightning-pts-cache* s5-4 quad)) + (vector-copy! (-> sv-632 lightning-info pts s5-4) (-> *lightning-pts-cache* s5-4)) (when (and (> s5-4 0) (zero? (-> sv-656 s5-4))) (let ((s4-1 (matrix-f-u-compose @@ -2053,25 +2054,25 @@ (return 0) ) (let ((v1-23 (new 'stack-no-clear 'vector))) - (set! (-> v1-23 quad) (-> sv-608 fire-point quad)) + (vector-copy! v1-23 (-> sv-608 fire-point)) (set! sv-768 v1-23) ) (set! sv-772 (vector+float*! (new 'stack-no-clear 'vector) (-> sv-608 fire-point) sv-612 409600.0)) (let ((v1-26 (new 'stack-no-clear 'vector))) - (set! (-> v1-26 quad) (-> sv-612 quad)) + (vector-copy! v1-26 sv-612) (set! sv-776 v1-26) ) (set! sv-784 0) (set! sv-792 -1) (set! sv-800 (new 'stack-no-clear 'vector)) - (set! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts) quad) (-> sv-768 quad)) + (vector-copy! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts)) sv-768) (+! (-> sv-616 lightning-info num-pts) 1) (vector-! sv-800 sv-772 sv-768) (dotimes (gp-0 8) (let ((f30-0 32768.0)) (set! sv-848 (new 'stack-no-clear 'vector)) (set! sv-852 (vector+float*! (new 'stack-no-clear 'vector) sv-768 sv-612 f30-0)) - (set! (-> sv-848 quad) (-> sv-852 quad)) + (vector-copy! sv-848 sv-852) (set! (-> sv-848 w) 20480.0) (let ((s5-0 (the-as process #f))) (let ((s4-0 #f)) @@ -2135,11 +2136,11 @@ ) ) ) - (set! (-> sv-776 quad) (-> sv-800 quad)) + (vector-copy! sv-776 sv-800) (let ((s5-3 (vector+float*! (new 'stack-no-clear 'vector) sv-768 sv-800 f30-0))) (let ((s4-3 #f)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> sv-768 quad)) + (vector-copy! (-> s3-1 start-pos) sv-768) (vector-! (-> s3-1 move-dist) s5-3 sv-768) (let ((v1-99 s3-1)) (set! (-> v1-99 radius) 40.96) @@ -2165,13 +2166,13 @@ ) ) (else - (set! (-> sv-616 lightning-info terminal-spark-pos quad) (-> s5-3 quad)) + (vector-copy! (-> sv-616 lightning-info terminal-spark-pos) s5-3) ) ) ) ) ) - (set! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts) quad) (-> s5-3 quad)) + (vector-copy! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts)) s5-3) (+! (-> sv-616 lightning-info num-pts) 1) (let ((s3-2 fire-projectile-if-necessary) (s2-3 sv-768) @@ -2184,7 +2185,7 @@ ) (s3-2 s2-3 s1-0 (the-as handle a2-7)) ) - (set! (-> sv-768 quad) (-> s5-3 quad)) + (vector-copy! sv-768 s5-3) (when s4-3 (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #t) (set! (-> sv-616 lightning-info should-draw-extension?) #f) @@ -2192,7 +2193,7 @@ (goto cfg-70) ) ) - (set! (-> sv-616 lightning-info terminal-spark-pos quad) (-> s5-3 quad)) + (vector-copy! (-> sv-616 lightning-info terminal-spark-pos) s5-3) ) ) ) @@ -2207,7 +2208,7 @@ (let ((gp-2 (vector+float*! (new 'stack-no-clear 'vector) s5-4 sv-800 409600.0)) (s4-4 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s4-4 start-pos quad) (-> s5-4 quad)) + (vector-copy! (-> s4-4 start-pos) s5-4) (vector-! (-> s4-4 move-dist) gp-2 s5-4) (let ((v1-154 s4-4)) (set! (-> v1-154 radius) 40.96) @@ -2227,7 +2228,7 @@ (vector+! gp-2 s5-4 (-> s4-4 move-dist)) ) ) - (set! (-> sv-616 lightning-info extension-end-point quad) (-> gp-2 quad)) + (vector-copy! (-> sv-616 lightning-info extension-end-point) gp-2) (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #t) (let ((a0-122 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-4 move-dist) 1.0))) (vector+float*! (-> sv-616 lightning-info terminal-spark-pos) gp-2 a0-122 -12288.0) @@ -2353,7 +2354,7 @@ ) (vector-rotate-y! s1-0 s1-0 16384.0) (vector+float*! s1-0 s5-0 s1-0 -8806.4) - (set! (-> s2-0 start-pos quad) (-> s1-0 quad)) + (vector-copy! (-> s2-0 start-pos) s1-0) (vector-float*! (-> s2-0 move-dist) (-> this root dynam gravity-normal) -81920.0) (let ((v1-15 s2-0)) (set! (-> v1-15 radius) 1228.8) @@ -2418,7 +2419,7 @@ ) (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) - (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (vector-copy! (-> a1-7 fvec) s2-0) (matrix->eul (the-as euler-angles s1-0) a1-7 21) (vector-negate! s3-2 s1-0) (let ((a0-14 s3-2)) @@ -2440,11 +2441,11 @@ ) (let ((v1-24 (cond ((logtest? (-> *part-group-id-table* 90 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 90)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 90)) ) ) @@ -2525,7 +2526,7 @@ (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) (move-by-vector! arg0 a1-1) ) - (set! (-> (the-as gun-blue-shot (-> arg0 process)) collide-normal quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! (-> (the-as gun-blue-shot (-> arg0 process)) collide-normal) (-> arg1 best-other-tri normal)) (let ((v0-1 4)) (logior! (-> arg0 status) v0-1) (the-as collide-status v0-1) @@ -2584,8 +2585,8 @@ (with-pp (+! (-> *game-info* shots-fired 2) 1.0) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> this init-pos quad) (-> this root trans quad)) - (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) + (vector-copy! (-> this init-dir) (-> this starting-dir)) (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) (set! (-> this attack-mode) 'eco-blue) (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) @@ -2604,8 +2605,8 @@ (defmethod init-proj-settings! ((this gun-blue-shot-2)) (with-pp - (set! (-> this init-pos quad) (-> this root trans quad)) - (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) + (vector-copy! (-> this init-dir) (-> this starting-dir)) (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) (set! (-> this attack-mode) 'eco-blue) (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) @@ -2647,11 +2648,11 @@ (let ((v1-11 (cond ((logtest? (-> *part-group-id-table* 108 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 108)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 108)) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc index 0a1882c739b..cbc7543aac8 100644 --- a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc @@ -144,8 +144,8 @@ (set! (-> gp-0 charge) (-> s5-0 fire-charge)) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s5-0 fire-point quad)) - (set! (-> gp-0 vel quad) (-> s5-0 fire-dir-out quad)) + (vector-copy! (-> gp-0 pos) (-> s5-0 fire-point)) + (vector-copy! (-> gp-0 vel) (-> s5-0 fire-dir-out)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -199,7 +199,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dark-3-sphere" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) (/ (-> arg0 size-x) METER_LENGTH) (/ (-> arg0 size-y) METER_LENGTH) 1.0 1.0) (go-virtual active) @@ -211,7 +211,7 @@ (case message (('set-pos-and-size) (let ((v1-2 (the-as gun-dark-3-sphere-init-params (-> block param 0)))) - (set! (-> self root trans quad) (-> v1-2 pos quad)) + (vector-copy! (-> self root trans) (-> v1-2 pos)) (set-vector! (-> self root scale) (/ (-> v1-2 size-x) METER_LENGTH) (/ (-> v1-2 size-y) METER_LENGTH) 1.0 1.0) (vector-float*! (-> self root scale) (-> self root scale) 1.7) (set! (-> self alpha-val) (-> v1-2 alpha-val)) @@ -329,7 +329,7 @@ (when (not (logtest? (-> this draw status) (draw-control-status no-draw))) (let ((s5-0 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) - (set! (-> s5-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) (spawn-from-mat (-> this part) s5-0) (init-with-mat! (-> this smoke-trail) s5-0) ) @@ -339,7 +339,7 @@ (defun gun-dark-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) (cshape-reaction-update-state arg0 arg1 arg3) - (set! (-> arg2 quad) (-> arg3 quad)) + (vector-copy! arg2 arg3) (cond ((logtest? (-> arg0 status) (collide-status touch-wall)) (send-event (-> arg0 process) 'impact-small) @@ -348,7 +348,7 @@ (< -0.3 f0-1) ) (let ((v1-9 (new 'stack-no-clear 'vector))) - (set! (-> v1-9 quad) (-> arg0 trans quad)) + (vector-copy! v1-9 (-> arg0 trans)) (+ 1228.8 (-> v1-9 y)) ) (vector-flatten! arg2 arg3 (-> arg0 surface-normal)) @@ -424,7 +424,7 @@ (set! (-> v1-19 attack-id) a0-15) (set! (-> this attack-id) a0-15) ) - (set! (-> this initial-velocity quad) (-> this root transv quad)) + (vector-copy! (-> this initial-velocity) (-> this root transv)) (set! (-> this start-y) (-> this root trans y)) (set! (-> this launch-impact-state) (method-of-object this impact-dud)) (set! (-> this y-vel-adjust) 0.0) @@ -455,9 +455,9 @@ ;; WARN: Return type mismatch symbol vs object. (defbehavior nuke-move gun-dark-3-nuke () (let ((gp-0 (-> self root))) - (set! (-> self pre-move-transv quad) (-> gp-0 transv quad)) + (vector-copy! (-> self pre-move-transv) (-> gp-0 transv)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ((-> self move) self) (projectile-method-39 self) (set! (-> self old-dist (-> self old-dist-count)) (* 0.0625 (vector-vector-distance s5-0 (-> gp-0 trans)))) @@ -696,11 +696,11 @@ (+! (-> v1-2 y) 409.6) (let ((v1-5 (cond ((logtest? (-> *part-group-id-table* 115 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 115)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 115)) ) ) @@ -735,7 +735,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-0 64) ) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) 1228800.0) (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s2-0 (fill-actor-list-for-box *actor-hash* s4-0 s3-0 384)) @@ -873,7 +873,7 @@ (go empty-state) ) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 0.0) (set! (-> gp-0 scale) 1.0) @@ -1054,11 +1054,11 @@ (let ((v1-23 (cond ((logtest? (-> *part-group-id-table* 114 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 114)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 114)) ) ) @@ -1232,11 +1232,11 @@ (let ((v1-30 (cond ((logtest? (-> *part-group-id-table* 110 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 110)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 110)) ) ) @@ -1247,11 +1247,11 @@ (let ((v1-61 (cond ((logtest? (-> *part-group-id-table* 111 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 111)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 111)) ) ) @@ -1260,7 +1260,7 @@ (send-event (ppointer->process v1-61) 'clock self) ) (let ((gp-4 (new 'stack-no-clear 'gun-dark-3-sphere-init-params))) - (set! (-> gp-4 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-4 pos) (-> self root trans)) (set! (-> gp-4 size-x) 1.0) (set! (-> gp-4 size-y) 1.0) (set! (-> self warp) @@ -1305,7 +1305,7 @@ ) ) (let ((v1-144 (new 'stack-no-clear 'gun-dark-3-sphere-init-params))) - (set! (-> v1-144 pos quad) (-> self mushroom-top-pos quad)) + (vector-copy! (-> v1-144 pos) (-> self mushroom-top-pos)) (set! (-> v1-144 size-x) f28-0) (set! (-> v1-144 size-y) f26-1) (set! (-> v1-144 alpha-val) (* f30-0 f30-0)) @@ -1402,15 +1402,15 @@ (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self gun fire-dir-out quad)) + (vector-copy! s4-0 (-> self gun fire-dir-out)) (set-last-fire-time 37) (sound-play "purple-3-shot" :position (-> gp-0 fire-point)) (set! (-> s5-0 ent) (-> self entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) (logclear! (-> s5-0 options) (projectile-options po14 po15 po16)) - (set! (-> s5-0 pos quad) (-> gp-0 fire-point quad)) - (set! (-> s5-0 vel quad) (-> (vector-float*! (new 'stack-no-clear 'vector) s4-0 81920.0) quad)) + (vector-copy! (-> s5-0 pos) (-> gp-0 fire-point)) + (vector-copy! (-> s5-0 vel) (vector-float*! (new 'stack-no-clear 'vector) s4-0 81920.0)) ) (set! (-> s5-0 notify-handle) (the-as handle #f)) (set! (-> s5-0 owner-handle) (the-as handle #f)) @@ -1574,27 +1574,26 @@ (t9-0) ) ) - (set! (-> self core-position quad) (-> self root trans quad)) + (vector-copy! (-> self core-position) (-> self root trans)) (let ((v1-10 (-> self core-velocity)) (a0-3 (-> self parent)) ) - (set! (-> v1-10 quad) (-> (the-as process-focusable (if a0-3 - (the-as process-focusable (-> a0-3 0 self)) - ) - ) - node-list - data - 13 - bone - transform - fvec - quad - ) - ) + (vector-copy! v1-10 (-> (the-as process-focusable (if a0-3 + (the-as process-focusable (-> a0-3 0 self)) + ) + ) + node-list + data + 13 + bone + transform + fvec + ) + ) ) (when (and *target* (focus-test? *target* in-head)) - (set! (-> self core-position quad) (-> (camera-pos) quad)) - (set! (-> self core-velocity quad) (-> (camera-matrix) fvec quad)) + (vector-copy! (-> self core-position) (camera-pos)) + (vector-copy! (-> self core-velocity) (-> (camera-matrix) fvec)) ) (set-vector! (-> self spin-vector) (-> self core-velocity z) 0.0 (- (-> self core-velocity x)) 1.0) (let ((f0-5 (vector-length (-> self spin-vector)))) @@ -1606,11 +1605,11 @@ (set-time! (-> self state-time)) (let ((v1-35 (cond ((logtest? (-> *part-group-id-table* 92 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 92)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 92)) ) ) @@ -1639,14 +1638,14 @@ ) (when s2-0 (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> (the-as process-focusable s2-0) root trans quad)) + (vector-copy! s3-1 (-> (the-as process-focusable s2-0) root trans)) (let ((a0-6 (if (type? s2-0 process-focusable) s2-0 ) ) ) (if a0-6 - (set! (-> s3-1 quad) (-> (get-trans (the-as process-focusable a0-6) 3) quad)) + (vector-copy! s3-1 (get-trans (the-as process-focusable a0-6) 3)) ) ) (let* ((s2-3 (vector-! (new 'stack-no-clear 'vector) s3-1 (-> self core-position))) @@ -1682,8 +1681,8 @@ (let ((f30-1 (/ f30-0 2))) (vector-normalize! (-> self spin-vector) f30-1) (vector-normalize! (-> self core-velocity) 7372.8) - (set! (-> s5-0 fvec quad) (-> s4-0 quad)) - (set! (-> s5-0 uvec quad) (-> self spin-vector quad)) + (vector-copy! (-> s5-0 fvec) s4-0) + (vector-copy! (-> s5-0 uvec) (-> self spin-vector)) (vector-float*! (-> s5-0 uvec) (-> s5-0 uvec) (/ 1.0 f30-1)) ) ) @@ -1767,7 +1766,7 @@ (a0-6 *sp-particle-system-2d*) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a2-4 trans) s4-0) (t9-5 a0-6 s1-0 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1776,7 +1775,7 @@ (a0-7 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a2-5 trans) s4-0) (t9-6 a0-7 s3-0 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1791,14 +1790,14 @@ (a1-13 gp-0) (a2-6 *launch-matrix*) ) - (set! (-> a2-6 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a2-6 trans) s4-0) (t9-8 a0-12 a1-13 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (let ((t9-9 sp-launch-particles-var) (a0-13 *sp-particle-system-2d*) (a2-7 *launch-matrix*) ) - (set! (-> a2-7 trans quad) (-> s5-0 quad)) + (vector-copy! (-> a2-7 trans) s5-0) (t9-9 a0-13 gp-0 a2-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1839,7 +1838,7 @@ (a0-8 *sp-particle-system-2d*) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> self root trans quad)) + (vector-copy! (-> a2-3 trans) (-> self root trans)) (t9-5 a0-8 gp-0 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1875,7 +1874,7 @@ (set! (-> s5-0 event-self) 'touched) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (let ((v1-16 (-> self root root-prim))) (set! (-> v1-16 prim-core collide-as) (collide-spec)) (set! (-> v1-16 prim-core collide-with) (collide-spec)) @@ -1948,16 +1947,16 @@ 0 (cond ((logtest? (-> *part-group-id-table* 93 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 93)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 93)) ) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (let ((gp-3 (the-as (array float) (new 'stack 'boxed-array float 16))) (a1-13 (new 'stack-no-clear 'event-message-block)) ) @@ -2277,7 +2276,7 @@ (a1-5 (-> *part-id-table* 398)) (a2-0 *launch-matrix*) ) - (set! (-> a2-0 trans quad) (-> v1-15 quad)) + (vector-copy! (-> a2-0 trans) v1-15) (t9-4 a0-9 a1-5 a2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -2312,7 +2311,7 @@ (s4-0 (-> gp-1 process node-list)) (v1-5 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> (the-as process-focusable s3-0) root quat))) ) - (set! (-> v1-5 trans quad) (-> (the-as process-focusable s3-0) root trans quad)) + (vector-copy! (-> v1-5 trans) (-> (the-as process-focusable s3-0) root trans)) (when (nonzero? s4-0) (countdown (a0-7 (-> gp-1 total-prims)) (when (and (= (-> s5-0 transform-index) -2) (!= s5-0 (-> gp-1 root-prim))) @@ -2436,7 +2435,7 @@ (set! (-> self original-sphere-offset quad) (-> (the-as process-focusable gp-1) root root-prim local-sphere quad) ) - (set! (-> *gravity-origin-pos* quad) (-> (get-trans (the-as process-focusable gp-1) 3) quad)) + (vector-copy! *gravity-origin-pos* (get-trans (the-as process-focusable gp-1) 3)) (iterate-prims (-> (the-as process-focusable gp-1) root) (lambda :behavior gravity-spinner @@ -2468,7 +2467,7 @@ (s5-4 (vector-! (new 'stack-no-clear 'vector) v1-23 (the-as vector arg1))) (s4-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-1 quad) (-> v1-23 quad)) + (vector-copy! s4-1 v1-23) (let* ((f0-8 (- (-> s5-4 y))) (f0-9 (if (< f0-8 0.0) (fmax f0-8 (-> (the-as process-focusable gp-1) root root-prim local-sphere w)) @@ -2484,7 +2483,7 @@ (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-1) root transv) 1.0) ) (let ((a0-17 s5-4)) - (set! (-> a0-17 quad) (-> s5-4 quad)) + (vector-copy! a0-17 s5-4) (set! (-> a0-17 y) 0.0) (vector-normalize! a0-17 1.0) ) @@ -2548,7 +2547,7 @@ (set! sv-144 (new 'stack 'sphere)) (set! sv-148 (the-as process (send-event *target* 'get-vehicle))) (let ((v1-7 (new 'stack-no-clear 'vector))) - (set! (-> v1-7 quad) (-> (the-as process-focusable s5-0) root transv quad)) + (vector-copy! v1-7 (-> (the-as process-focusable s5-0) root transv)) (set! sv-152 v1-7) ) (set! sv-156 (the-as float 0.0)) @@ -2598,7 +2597,7 @@ ) (when (< f0-12 f30-0) (let ((a1-19 (new 'stack 'collide-query))) - (set! (-> a1-19 start-pos quad) (-> sv-144 quad)) + (vector-copy! (-> a1-19 start-pos) sv-144) (vector-! (-> a1-19 move-dist) sv-1728 (-> a1-19 start-pos)) (let ((v1-53 a1-19)) (set! (-> v1-53 radius) (* 0.8 (-> (the-as process-focusable s5-0) root root-prim prim-core world-sphere w))) @@ -2661,7 +2660,7 @@ ) (when (< f0-28 f30-1) (let ((a1-29 (new 'stack 'collide-query))) - (set! (-> a1-29 start-pos quad) (-> sv-144 quad)) + (vector-copy! (-> a1-29 start-pos) sv-144) (vector-! (-> a1-29 move-dist) sv-2304 (-> a1-29 start-pos)) (let ((v1-103 a1-29)) (set! (-> v1-103 radius) (* 0.8 (-> (the-as process-focusable s5-0) root root-prim prim-core world-sphere w))) @@ -2695,7 +2694,7 @@ ) (when sv-168 (let ((v0-1 (-> (the-as process-focusable s5-0) root transv))) - (set! (-> v0-1 quad) (-> sv-164 quad)) + (vector-copy! v0-1 sv-164) v0-1 ) ) @@ -2765,7 +2764,7 @@ (cond ((< (current-time) (+ (-> this end-time) (seconds -0.2))) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this rotation-accel quad)) + (vector-copy! s5-1 (-> this rotation-accel)) 0.0 (let* ((f0-1 (vector-normalize-ret-len! s5-1 1.0)) (f0-2 (* 182.04445 f0-1)) @@ -2798,7 +2797,7 @@ (f30-1 (* 4.0 (seconds-per-frame))) ) (let ((a0-18 s2-0)) - (set! (-> a0-18 quad) (-> s2-0 quad)) + (vector-copy! a0-18 s2-0) (set! (-> a0-18 y) 0.0) (vector-normalize! a0-18 1.0) ) @@ -2945,12 +2944,13 @@ (* 3.0 (seconds-per-frame)) ) ) - (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) (-> s4-2 quad)) + (vector-copy! (-> (the-as process-focusable s5-0) root root-prim local-sphere) s4-2) ) (if (>= (+ (current-time) (seconds -1)) time) - (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) - (-> self original-sphere-offset quad) - ) + (vector-copy! + (-> (the-as process-focusable s5-0) root root-prim local-sphere) + (-> self original-sphere-offset) + ) ) ) ) @@ -3181,13 +3181,14 @@ ) ) (when gp-2 - (set! (-> (the-as process-focusable gp-2) root root-prim local-sphere quad) - (-> self original-sphere-offset quad) - ) + (vector-copy! + (-> (the-as process-focusable gp-2) root root-prim local-sphere) + (-> self original-sphere-offset) + ) (let ((s5-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-2) root quat)))) (new 'stack-no-clear 'vector) (let ((a0-67 s5-2)) - (set! (-> a0-67 quad) (-> s5-2 quad)) + (vector-copy! a0-67 s5-2) (set! (-> a0-67 y) 0.0) (vector-normalize! a0-67 1.0) ) @@ -3245,7 +3246,7 @@ (defbehavior gravity-ring-init-by-other gravity-ring ((arg0 vector) (arg1 symbol) (arg2 float) (arg3 float) (arg4 float) (arg5 time-frame)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (initialize-skeleton self @@ -3304,9 +3305,9 @@ (s4-1 0) ) (cond - ((or (= (status-of-level-and-borrows *level* 'desert #f) 'active) - (= (status-of-level-and-borrows *level* 'waswide #f) 'active) - (= (status-of-level-and-borrows *level* 'wasdoors #f) 'active) + ((or (= (level-status? *level* 'desert #f) 'active) + (= (level-status? *level* 'waswide #f) 'active) + (= (level-status? *level* 'wasdoors #f) 'active) ) (set-vector! s5-1 0.85 1.1 1.1 0.25) ) @@ -3431,7 +3432,7 @@ (defbehavior gun-gravity-init-by-other gun-gravity ((arg0 vector) (arg1 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (let ((s4-0 (new 'stack-no-clear 'collide-query))) 0.0 (vector+float*! (-> s4-0 start-pos) (-> self root trans) *up-vector* 24576.0) @@ -3456,7 +3457,7 @@ (s3-0 (-> self root quat)) (a0-12 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-12 quad) (-> arg1 quad)) + (vector-copy! a0-12 arg1) (set! (-> a0-12 y) 0.0) (s4-1 s3-0 (vector-normalize! a0-12 1.0) *up-vector*) ) @@ -3465,7 +3466,7 @@ (if (logtest? (game-secrets gun-upgrade-dark-2) (-> *game-info* secrets)) (set! (-> self total-time) (* 1.5 (-> self total-time))) ) - (set! (-> self start-pos quad) (-> arg0 quad)) + (vector-copy! (-> self start-pos) arg0) (set! (-> self ring-closest) (the-as handle #f)) (set! (-> self ring-furthest) (the-as handle #f)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 118) self)) @@ -3555,7 +3556,7 @@ (let ((f30-2 (-> s4-2 best-other-tri intersect y)) (a1-7 (matrix-identity! (new 'stack-no-clear 'matrix))) ) - (set! (-> a1-7 trans quad) (-> s4-2 start-pos quad)) + (vector-copy! (-> a1-7 trans) (-> s4-2 start-pos)) (set! (-> a1-7 trans y) f30-2) (spawn-from-mat (-> self part) a1-7) ) @@ -3639,7 +3640,7 @@ (f30-0 0.0) (f28-0 (-> this current-radius)) ) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (when arg0 (let ((v1-5 (handle->process (-> this ring-closest)))) (if v1-5 @@ -3745,11 +3746,11 @@ (set-last-fire-time 36) (cond ((logtest? (-> *part-group-id-table* 120 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self gun fire-point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self gun fire-point)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 120)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self gun fire-point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self gun fire-point)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 120)) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-part.gc b/goal_src/jak3/engine/target/gun/gun-part.gc index 37bd83514c3..9b53fb32458 100644 --- a/goal_src/jak3/engine/target/gun/gun-part.gc +++ b/goal_src/jak3/engine/target/gun/gun-part.gc @@ -891,7 +891,7 @@ gun (set! (-> *red-shot-3-trail* zbuffer?) #f) -(set! (-> *red-shot-3-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *red-shot-3-trail* lie-vector) *up-vector*) (set! (-> *red-shot-3-trail* use-tape-mode?) #f) @@ -1056,7 +1056,7 @@ gun (set! (-> *yellow-shot-2-trail* zbuffer?) #f) -(set! (-> *yellow-shot-2-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *yellow-shot-2-trail* lie-vector) *up-vector*) (set! (-> *yellow-shot-2-trail* use-tape-mode?) #f) @@ -3774,7 +3774,7 @@ gun (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack 'vector4w)) ) - (set! (-> s3-0 quad) (-> *target* gun fire-point quad)) + (vector-copy! s3-0 (-> *target* gun fire-point)) (set! (-> s5-0 x) (- (-> arg2 x) (-> s3-0 x))) (set! (-> s5-0 y) (- (-> arg2 y) (-> s3-0 y))) (set! (-> s5-0 z) (- (-> arg2 z) (-> s3-0 z))) @@ -3824,7 +3824,7 @@ gun ) (vector-normalize! s4-0 (lerp 10240.0 0.0 f0-5)) ) - (set! (-> s5-0 quad) (-> *target* gun fire-point quad)) + (vector-copy! s5-0 (-> *target* gun fire-point)) (set! (-> arg2 x) (+ (-> s4-0 x) (-> s5-0 x))) (set! (-> arg2 y) (+ (-> s4-0 y) (-> s5-0 y))) (set! (-> arg2 z) (+ (-> s4-0 z) (-> s5-0 z))) diff --git a/goal_src/jak3/engine/target/gun/gun-red-shot.gc b/goal_src/jak3/engine/target/gun/gun-red-shot.gc index d46aa3dbeca..f5ac78b25d6 100644 --- a/goal_src/jak3/engine/target/gun/gun-red-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-red-shot.gc @@ -140,7 +140,7 @@ (set! (-> v1-15 y) 2.5) (set! (-> v1-15 z) 2.5) (set! (-> v1-15 w) 1.0) - (set! (-> this root scale quad) (-> v1-15 quad)) + (vector-copy! (-> this root scale) v1-15) ) (set! (-> this immediate-detonation?) #f) (let ((s5-2 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) @@ -225,7 +225,7 @@ (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'get-vehicle) (let ((s4-0 (send-event-function *target* a1-0))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) (-> this blast-radius)) (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s2-0 (fill-actor-list-for-box *actor-hash* s5-0 s3-0 384)) @@ -365,7 +365,7 @@ (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'get-vehicle) (let ((s3-0 (send-event-function *target* a1-0))) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) (* 0.6666667 (-> this blast-radius))) (let ((s2-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s1-0 (fill-actor-list-for-box *actor-hash* s4-0 s2-0 384)) @@ -572,7 +572,7 @@ ;; WARN: Return type mismatch float vs none. (defun part-tracker-move-to-target-gun ((arg0 part-tracker)) (when *target* - (set! (-> arg0 root trans quad) (-> *target* gun fire-point quad)) + (vector-copy! (-> arg0 root trans) (-> *target* gun fire-point)) (set! (-> arg0 root trans y) (+ 6553.6 (-> *target* control trans y))) ) (none) @@ -603,7 +603,7 @@ (set! (-> self charge-part-tracker) (ppointer->handle (cond ((logtest? (-> *part-group-id-table* 109 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self origin quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self origin)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -612,7 +612,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self origin quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self origin)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -649,7 +649,7 @@ ) (init-vf0-vector) (set! sv-32 (new 'stack-no-clear 'vector)) - (set! (-> sv-32 quad) (-> this origin quad)) + (vector-copy! sv-32 (-> this origin)) (set! (-> sv-32 w) (-> this current-radius)) (let ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* sv-32 s5-0 384)) @@ -698,7 +698,7 @@ ) (else (set! sv-2720 (new 'stack-no-clear 'collide-query)) - (set! (-> sv-2720 start-pos quad) (-> this origin quad)) + (vector-copy! (-> sv-2720 start-pos) (-> this origin)) (set! sv-2704 (-> sv-2720 move-dist)) (let ((v1-35 (get-trans (the-as process-focusable s3-1) 3)) (a0-26 (-> this origin)) @@ -1103,7 +1103,7 @@ ;; WARN: Return type mismatch float vs none. (defmethod adjust-height-and-radius ((this gun-red-2-shockwave)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> this origin quad)) + (vector-copy! (-> a1-0 start-pos) (-> this origin)) (set-vector! (-> a1-0 move-dist) 0.0 (* -1.0 (-> this max-radius)) 0.0 1.0) (let ((v1-2 a1-0)) (set! (-> v1-2 radius) 40.96) @@ -1181,7 +1181,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (go-virtual active) ) @@ -1224,7 +1224,7 @@ (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> this origin quad)) + (vector-copy! s4-0 (-> this origin)) (set-vector! s3-0 (cos f26-0) 0.0 (sin f26-0) 1.0) (vector-normalize! s3-0 (* 0.9 (-> this max-ground-radius))) (let ((f30-0 (-> this origin y)) @@ -1247,13 +1247,13 @@ (set! f24-0 f0-9) (set! f30-0 (-> sv-176 collision-pt y)) (set! s0-0 (logior s0-0 1)) - (set! (-> s2-1 quad) (-> sv-176 normal quad)) + (vector-copy! s2-1 (-> sv-176 normal)) ) ((and (>= f0-9 0.0) (< f0-9 f22-0)) (set! f22-0 f0-9) (set! f28-0 (-> sv-176 collision-pt y)) (set! s0-0 (logior s0-0 2)) - (set! (-> s1-0 quad) (-> sv-176 normal quad)) + (vector-copy! s1-0 (-> sv-176 normal)) ) ) ) @@ -1284,7 +1284,7 @@ (vector-normalize! s3-0 1.0) (let ((s2-3 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose s2-3 s3-0 *up-vector*) - (set! (-> s2-3 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s2-3 trans) s4-0) (launch-particles (-> *part-id-table* 353) s2-3 :origin-is-matrix #t) ) ) @@ -1398,12 +1398,12 @@ (defmethod spawn-ring ((this gun-red-2-shockwave)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> this origin quad)) + (vector-copy! v1-0 (-> this origin)) (set! (-> v1-0 y) (- (-> v1-0 y) (-> this height-off-ground))) (+! (-> v1-0 y) 2048.0) (+! (-> v1-0 y) -1433.6) (let ((s5-0 (new 'stack-no-clear 'red-2-ring-init-params))) - (set! (-> s5-0 pos quad) (-> v1-0 quad)) + (vector-copy! (-> s5-0 pos) v1-0) (let ((v1-3 (process-spawn red-2-ring s5-0 :name "red-2-ring" :to this))) (if v1-3 (set! (-> this explosion-1) (ppointer->handle v1-3)) @@ -1550,7 +1550,7 @@ (set! (-> *last-player-pos* z) (-> *target* gun fire-point z)) (when #t (let ((s5-0 (new 'stack-no-clear 'gun-red-2-shockwave-init-params))) - (set! (-> s5-0 pos quad) (-> v1-1 quad)) + (vector-copy! (-> s5-0 pos) v1-1) (let ((v1-4 (process-spawn gun-red-2-shockwave s5-0 @@ -1598,7 +1598,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-red-sphere" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (go-virtual active) ) @@ -1610,18 +1610,7 @@ (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) ) :trans (behavior () - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (math-camera-matrix)) - (v1-0 (-> a2-0 rvec quad)) - (a0-0 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-0) - (set! (-> gp-0 uvec quad) a0-0) - (set! (-> gp-0 fvec quad) a1-0) - (set! (-> gp-0 trans quad) a2-1) - ) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) (-> gp-0 fvec) (-> gp-0 rvec) (matrix->quat gp-0 (-> self root quat)) @@ -1675,11 +1664,11 @@ (vector-normalize! sv-20 1.0) (let ((v1-17 (cond ((logtest? (-> *part-group-id-table* 86 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-16 fire-point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> sv-16 fire-point)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 86)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-16 fire-point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> sv-16 fire-point)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 86)) ) ) @@ -1689,7 +1678,7 @@ ) (set! sv-144 (new 'stack-no-clear 'vector)) (let ((v1-42 (new 'stack-no-clear 'vector))) - (set! (-> v1-42 quad) (-> sv-20 quad)) + (vector-copy! v1-42 sv-20) (set! sv-148 v1-42) ) (set! (-> sv-148 y) 0.0) @@ -1780,7 +1769,7 @@ ) (when gp-2 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> (get-trans gp-2 3) quad)) + (vector-copy! s5-1 (get-trans gp-2 3)) (let ((f0-10 (vector-vector-xz-distance s5-1 (-> sv-16 fire-point))) (f1-13 (fabs (- (-> s5-1 y) (-> sv-16 fire-point y)))) ) @@ -1800,8 +1789,8 @@ (set! (-> a1-33 charge) 1.0) (set! (-> a1-33 options) (projectile-options)) (logclear! (-> a1-33 options) (projectile-options po14 po15 po16)) - (set! (-> a1-33 pos quad) (-> sv-24 quad)) - (set! (-> a1-33 vel quad) (-> (vector-float*! (new 'stack-no-clear 'vector) sv-20 sv-28) quad)) + (vector-copy! (-> a1-33 pos) sv-24) + (vector-copy! (-> a1-33 vel) (vector-float*! (new 'stack-no-clear 'vector) sv-20 sv-28)) (set! (-> a1-33 notify-handle) (the-as handle #f)) (set! (-> a1-33 owner-handle) (process->handle self)) (set! (-> a1-33 target-handle) (the-as handle #f)) @@ -1860,7 +1849,7 @@ ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 0.0) (set! (-> gp-0 scale) 1.0) @@ -1917,17 +1906,17 @@ (set-time! (-> self state-time)) (when (not (-> self immediate-detonation?)) (let ((gp-1 (new 'stack-no-clear 'red-3-sphere-init-params))) - (set! (-> gp-1 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 pos) (-> self root trans)) (process-spawn red-3-sphere gp-1 :name "red-3-sphere" :to self) ) ) (cond ((logtest? (-> *part-group-id-table* 88 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 88)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 88)) ) ) @@ -2177,8 +2166,8 @@ (s4-1 (new 'stack-no-clear 'vector)) ) (if a0-2 - (set! (-> s4-1 quad) (-> (get-trans a0-2 3) quad)) - (set! (-> s4-1 quad) (-> arg0 root-prim prim-core world-sphere quad)) + (vector-copy! s4-1 (get-trans a0-2 3)) + (vector-copy! s4-1 (-> arg0 root-prim prim-core world-sphere)) ) (vector-! s4-1 s4-1 (-> this start-pos)) (vector-normalize! s4-1 1.0) @@ -2200,7 +2189,7 @@ ) ) ) - (set! (-> this probe-dir s5-0 quad) (-> s4-1 quad)) + (vector-copy! (-> this probe-dir s5-0) s4-1) ) (set! (-> this probe-count) (+ s5-0 1)) ) @@ -2215,7 +2204,7 @@ (vf3 :class vf) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this start-dir quad)) + (vector-copy! s5-0 (-> this start-dir)) (vector-float*! s5-0 s5-0 43417.6) (vector+! s5-0 s5-0 (-> this start-pos)) (set! (-> s5-0 w) 43827.2) @@ -2352,7 +2341,7 @@ (init-vf0-vector) (let ((gp-0 (-> this root))) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> gp-0 trans quad) (-> this start-pos quad)) + (vector-copy! (-> gp-0 trans) (-> this start-pos)) (vector-float*! (-> gp-0 transv) arg0 61440.0) (let ((a1-1 v1-0)) (set! (-> a1-1 radius) (-> gp-0 root-prim local-sphere w)) @@ -2364,8 +2353,8 @@ ) (set! (-> a1-1 action-mask) (collide-action solid)) ) - (set! (-> v1-0 start-pos quad) (-> gp-0 trans quad)) - (set! (-> v1-0 move-dist quad) (-> gp-0 transv quad)) + (vector-copy! (-> v1-0 start-pos) (-> gp-0 trans)) + (vector-copy! (-> v1-0 move-dist) (-> gp-0 transv)) (fill-using-line-sphere *collide-cache* v1-0) ) (let ((v1-2 (-> gp-0 transv))) @@ -2470,8 +2459,8 @@ ) (defbehavior gun-red-shot-init-by-other gun-red-shot ((arg0 vector) (arg1 vector)) - (set! (-> self start-pos quad) (-> arg0 quad)) - (set! (-> self start-dir quad) (-> arg1 quad)) + (vector-copy! (-> self start-pos) arg0) + (vector-copy! (-> self start-dir) arg1) (rot-zxy-from-vector! (-> self start-rot) arg1) (let* ((v1-2 *game-info*) (a0-7 (+ (-> v1-2 attack-id) 1)) @@ -2508,7 +2497,7 @@ (set! (-> self root) s5-0) ) (let ((s5-1 (-> self root))) - (set! (-> s5-1 trans quad) (-> arg0 quad)) + (vector-copy! (-> s5-1 trans) arg0) (quaternion-copy! (-> s5-1 quat) (-> self parent 0 root quat)) (vector-identity! (-> s5-1 scale)) ) @@ -2520,11 +2509,11 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (let ((v1-39 (cond ((logtest? (-> *part-group-id-table* 84 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self start-pos quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self start-pos)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 84)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self start-pos quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self start-pos)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 84)) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-util.gc b/goal_src/jak3/engine/target/gun/gun-util.gc index b55572af33d..7d8e60fa651 100644 --- a/goal_src/jak3/engine/target/gun/gun-util.gc +++ b/goal_src/jak3/engine/target/gun/gun-util.gc @@ -187,7 +187,7 @@ (defun draw-beam ((arg0 sparticle-launcher) (arg1 vector) (arg2 vector) (arg3 symbol)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-0 1 quad) (-> arg2 quad)) + (vector-copy! (-> s5-0 1) arg2) (let ((v1-2 (get-field-spec-by-id arg0 (sp-field-id spt-scale-y)))) (when v1-2 (let ((f30-0 (-> v1-2 initial-valuef))) @@ -210,7 +210,7 @@ (a1-9 arg0) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> s3-1 quad)) + (vector-copy! (-> a2-2 trans) s3-1) (t9-5 a0-12 a1-9 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (dotimes (s5-1 2) @@ -220,7 +220,7 @@ (a1-11 arg0) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> s3-1 quad)) + (vector-copy! (-> a2-4 trans) s3-1) (t9-7 a0-14 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -264,11 +264,11 @@ (target-gun-compute-pos) (set! self s5-0) ) - (set! (-> self root trans quad) (-> (the-as target gp-0) gun gun-pos trans quad)) + (vector-copy! (-> self root trans) (-> (the-as target gp-0) gun gun-pos trans)) (let ((v1-6 (-> (the-as target gp-0) gun gun-pos quat quad))) (set! (-> self root quat quad) v1-6) ) - (set! (-> self root scale quad) (-> (the-as target gp-0) gun gun-pos scale quad)) + (vector-copy! (-> self root scale) (-> (the-as target gp-0) gun gun-pos scale)) (when (-> self read-scale) (let ((s5-1 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -360,8 +360,8 @@ (set! (-> s5-2 charge) 1.0) (set! (-> s5-2 options) (projectile-options)) (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) - (set! (-> s5-2 pos quad) (-> s3-0 quad)) - (set! (-> s5-2 vel quad) (-> s4-1 quad)) + (vector-copy! (-> s5-2 pos) s3-0) + (vector-copy! (-> s5-2 vel) s4-1) ) (set! (-> s5-2 notify-handle) (the-as handle #f)) (set! (-> s5-2 owner-handle) (the-as handle #f)) @@ -795,7 +795,7 @@ ) ) (vector<-cspace! (-> (the-as target gp-0) gun fire-point) (joint-node gun-lod0-jg muzzle)) - (set! (-> (the-as target gp-0) gun unk-vec quad) (-> (the-as target gp-0) gun fire-dir quad)) + (vector-copy! (-> (the-as target gp-0) gun unk-vec) (-> (the-as target gp-0) gun fire-dir)) (cond ((and (handle->process (-> (the-as target gp-0) gun track-target 0 handle)) (logtest? (surface-flag gun-direct) (-> (the-as target gp-0) control current-surface flags)) @@ -806,7 +806,7 @@ (-> (the-as target gp-0) gun fire-point) ) (vector-normalize! (-> (the-as target gp-0) gun fire-dir) 1.0) - (set! (-> (the-as target gp-0) gun fire-dir-out quad) (-> (the-as target gp-0) gun fire-dir quad)) + (vector-copy! (-> (the-as target gp-0) gun fire-dir-out) (-> (the-as target gp-0) gun fire-dir)) ) (else (vector-normalize-copy! @@ -815,9 +815,10 @@ 1.0 ) (if s5-0 - (set! (-> (the-as target gp-0) gun fire-dir-out quad) - (-> (the-as target gp-0) node-list data 4 bone transform fvec quad) - ) + (vector-copy! + (-> (the-as target gp-0) gun fire-dir-out) + (-> (the-as target gp-0) node-list data 4 bone transform fvec) + ) ) (vector-rotate-y! (-> (the-as target gp-0) gun fire-dir-out) @@ -827,12 +828,13 @@ ) ) (vector<-cspace! (-> (the-as target gp-0) gun laser-point) (joint-node gun-lod0-jg laser)) - (set! (-> (the-as target gp-0) gun unk-vec00 quad) (-> (the-as target gp-0) gun laser-dir quad)) - (set! (-> (the-as target gp-0) gun laser-dir quad) (-> (the-as target gp-0) gun fire-dir-out quad)) + (vector-copy! (-> (the-as target gp-0) gun unk-vec00) (-> (the-as target gp-0) gun laser-dir)) + (vector-copy! (-> (the-as target gp-0) gun laser-dir) (-> (the-as target gp-0) gun fire-dir-out)) (if s5-0 - (set! (-> (the-as target gp-0) gun laser-dir quad) - (-> (the-as target gp-0) node-list data 4 bone transform fvec quad) - ) + (vector-copy! + (-> (the-as target gp-0) gun laser-dir) + (-> (the-as target gp-0) node-list data 4 bone transform fvec) + ) ) ) (let ((s5-1 self)) @@ -858,7 +860,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (vector-float*! s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self parent 0 control quat)) @@ -869,8 +871,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s4-0 quad)) - (set! (-> gp-0 vel quad) (-> s5-0 quad)) + (vector-copy! (-> gp-0 pos) s4-0) + (vector-copy! (-> gp-0 vel) s5-0) ) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) @@ -966,7 +968,7 @@ (s1-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 start-pos)) 1638.4)) (s2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-1 quad) (-> s4-0 start-pos quad)) + (vector-copy! s2-1 (-> s4-0 start-pos)) (cond ((and s0-0 (or (logtest? (process-mask enemy guard) (-> s0-0 cshape process mask)) @@ -990,16 +992,16 @@ ) ) ) - (set! (-> this laser-hit-point quad) (-> s4-0 start-pos quad)) + (vector-copy! (-> this laser-hit-point) (-> s4-0 start-pos)) (let ((s1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (camera-pos) s5-0) 1.0)) (t9-10 vector-normalize!) (a0-37 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-37 quad) (-> s3-0 quad)) + (vector-copy! a0-37 s3-0) (let ((s2-3 (t9-10 a0-37 1.0)) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> s5-0 quad)) + (vector-copy! s3-1 s5-0) (let ((v1-47 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-3 327.68)) (f28-1 (vector-dot s1-3 s2-3)) ) @@ -1057,7 +1059,7 @@ (a0-3 (vector+float*! (new 'stack-no-clear 'vector) arg0 v1-0 -7372.8)) (gp-1 (new 'stack-no-clear 'collide-query)) ) - (set! (-> gp-1 start-pos quad) (-> a0-3 quad)) + (vector-copy! (-> gp-1 start-pos) a0-3) (vector-float*! (-> gp-1 move-dist) v1-0 40960.0) (let ((v1-1 gp-1)) (set! (-> v1-1 radius) 40.96) diff --git a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc index 1243d982b3c..f17631f1b5e 100644 --- a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc @@ -126,7 +126,7 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (vector-normalize! s5-2 1.0) - (set! (-> s3-0 quad) (-> s5-2 quad)) + (vector-copy! s3-0 s5-2) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1228.8) (vector+! s3-0 (-> this root trans) s3-0) @@ -136,7 +136,7 @@ (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options)) (logclear! (-> s4-1 options) (projectile-options po14 po15 po16)) - (set! (-> s4-1 pos quad) (-> s3-0 quad)) + (vector-copy! (-> s4-1 pos) s3-0) (set! (-> s4-1 notify-handle) (the-as handle #f)) (set! (-> s4-1 owner-handle) (the-as handle #f)) (set! (-> s4-1 target-handle) (the-as handle #f)) @@ -199,7 +199,7 @@ (set! sv-1076 (new 'stack-no-clear 'inline-array 'target-quality-info-saucer 66)) (set! sv-1080 0) (set! sv-1088 (the-as float 0.0)) - (set! (-> sv-1072 quad) (-> this root trans quad)) + (vector-copy! sv-1072 (-> this root trans)) (set! (-> sv-1072 w) 143360.0) (let ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* sv-1072 s5-0 384)) @@ -225,7 +225,7 @@ ) ) (let ((s2-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s2-1 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s2-1 start-pos) (-> this root trans)) (vector-! (-> s2-1 move-dist) (get-trans (the-as process-focusable s3-1) 3) (-> this root trans)) (let ((v1-47 s2-1)) (set! (-> v1-47 radius) 40.96) @@ -300,7 +300,7 @@ (s3-4 (method-of-object s4-5 spawn-shot)) (s2-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-2 quad) (-> (get-trans (the-as process-focusable a0-95) 0) quad)) + (vector-copy! s2-2 (get-trans (the-as process-focusable a0-95) 0)) (s3-4 s4-5 s2-2) ) ) @@ -520,11 +520,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 97 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 97)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 97)) ) ) @@ -547,7 +547,7 @@ (the-as vector a2-10) (the-as vector a3-4) ) - (set! (-> gp-3 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-3 trans) (-> self root trans)) (let ((gp-4 (ppointer->handle (if (logtest? (-> *part-group-id-table* 96 flags) (sp-group-flag sp13)) @@ -663,7 +663,7 @@ :code (behavior () (set! (-> self firing?) #t) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 0.0) (set! (-> gp-0 scale) 1.0) @@ -766,7 +766,7 @@ (gp-0 (new 'stack-no-clear 'collide-query)) ) (-> v1-19 root-prim) - (set! (-> gp-0 start-pos quad) (-> v1-19 trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> v1-19 trans)) (vector-normalize-copy! (-> gp-0 move-dist) (-> v1-19 transv) 40960.0) (let ((v1-20 gp-0)) (set! (-> v1-20 radius) 0.01) @@ -894,8 +894,8 @@ (set! (-> s3-2 charge) 1.0) (set! (-> s3-2 options) (projectile-options po13)) (logclear! (-> s3-2 options) (projectile-options po14 po15 po16)) - (set! (-> s3-2 pos quad) (-> s4-0 quad)) - (set! (-> s3-2 vel quad) (-> (vector-float*! (new 'stack-no-clear 'vector) s5-0 f30-0) quad)) + (vector-copy! (-> s3-2 pos) s4-0) + (vector-copy! (-> s3-2 vel) (vector-float*! (new 'stack-no-clear 'vector) s5-0 f30-0)) (set! (-> s3-2 notify-handle) (the-as handle #f)) (set! (-> s3-2 owner-handle) (the-as handle #f)) (set! (-> s3-2 target-handle) (the-as handle #f)) @@ -916,13 +916,13 @@ ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> self gun fire-dir-out quad)) + (vector-copy! s4-1 (-> self gun fire-dir-out)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) (draw-beam (-> *part-id-table* 297) (-> gp-0 fire-point) s4-1 #f) (let ((s5-1 (new 'stack-no-clear 'matrix))) (matrix-f-compose s5-1 s4-1) - (set! (-> s5-1 trans quad) (-> gp-0 fire-point quad)) + (vector-copy! (-> s5-1 trans) (-> gp-0 fire-point)) (let ((v1-62 (if (logtest? (-> *part-group-id-table* 100 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -951,7 +951,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s5-0 fire-point quad)) + (vector-copy! (-> gp-0 pos) (-> s5-0 fire-point)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -981,7 +981,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s5-0 fire-point quad)) + (vector-copy! (-> gp-0 pos) (-> s5-0 fire-point)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1048,7 +1048,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po13 po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1109,7 +1109,7 @@ (f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 gp-1 *up-vector*) - (set! (-> s3-1 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s3-1 trans) s4-0) (gun-yellow-shot-method-42 this f30-1 f28-0 s3-1) ) ) @@ -1153,21 +1153,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 102 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 102)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 102)) ) ) ) ((logtest? (-> *part-group-id-table* 101 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 101)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 101)) ) ) @@ -1288,7 +1288,7 @@ (let ((v1-14 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-5 (-> arg0 hit-pos)) ) - (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector-copy! a1-5 (-> s5-0 trans)) (vector+! a1-5 a1-5 v1-14) (move-to-point! (-> arg0 root) a1-5) ) @@ -1336,7 +1336,7 @@ (when (and (time-elapsed? (-> sv-36 last-collide-time) (seconds 0.05)) (rand-vu-percent? 0.75)) (set! sv-80 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 204800.0)) (set! sv-84 (new 'stack-no-clear 'vector)) - (set! (-> sv-84 quad) (-> s4-0 root trans quad)) + (vector-copy! sv-84 (-> s4-0 root trans)) (vector+! sv-84 sv-84 sv-80) (set! (-> sv-84 w) 409600.0) (set! (-> sv-80 y) 0.0) @@ -1382,7 +1382,7 @@ (when (or (< (the float sv-120) sv-1716) (and (< 0.707 sv-1716) (= sv-136 *last-hit-deflect-target-handle*))) (set! sv-116 sv-1720) (set! sv-120 (the int sv-1716)) - (set! (-> sv-112 quad) (-> sv-1680 quad)) + (vector-copy! sv-112 sv-1680) (set! sv-128 (logtest? (process-mask enemy) (-> s1-1 mask))) (set! sv-136 (process->handle s1-1)) ) @@ -1421,7 +1421,7 @@ (when (or (< (the float sv-120) sv-1748) (and (< 0.707 sv-1748) (= sv-136 *last-hit-deflect-target-handle*))) (set! sv-116 sv-1752) (set! sv-120 (the int sv-1748)) - (set! (-> sv-112 quad) (-> sv-1724 quad)) + (vector-copy! sv-112 sv-1724) (set! sv-128 (logtest? (process-mask enemy) (-> s3-1 mask))) (set! sv-136 (process->handle s3-1)) ) @@ -1611,7 +1611,7 @@ (a1-7 (-> arg0 root transv)) (a2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-1 quad) (-> arg0 root transv quad)) + (vector-copy! a2-1 (-> arg0 root transv)) (t9-4 a0-23 a1-7 a2-1 (-> arg0 delay-norm)) ) ) @@ -1621,7 +1621,7 @@ (let ((v1-57 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-10 (-> arg0 hit-pos)) ) - (set! (-> a1-10 quad) (-> s5-0 trans quad)) + (vector-copy! a1-10 (-> s5-0 trans)) (vector+! a1-10 a1-10 v1-57) (move-to-point! (-> arg0 root) a1-10) ) @@ -1634,7 +1634,7 @@ (launch-particles (-> *part-id-table* 272) (-> arg0 hit-pos)) (launch-particles (-> *part-id-table* 273) (-> arg0 hit-pos)) (let ((a0-32 (new 'stack-no-clear 'vector))) - (set! (-> a0-32 quad) (-> arg0 root transv quad)) + (vector-copy! a0-32 (-> arg0 root transv)) (vector-normalize! a0-32 65536.0) ) (vector+! (-> arg0 tail-pos) (-> arg0 root trans) (-> arg0 root transv)) @@ -1650,7 +1650,7 @@ (defmethod init-proj-settings! ((this gun-yellow-shot)) (+! (-> *game-info* shots-fired 0) 1.0) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 819200.0) @@ -1786,11 +1786,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 102 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 102)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 102)) ) ) @@ -1868,7 +1868,7 @@ (defmethod init-proj-settings! ((this gun-yellow-shot-3)) (+! (-> *game-info* shots-fired 0) 1.0) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (let ((f0-2 (vector-vector-xz-distance (target-pos 0) (-> this root trans)))) (cpad-set-buzz! (-> *cpad-list* cpads 0) @@ -2033,7 +2033,7 @@ (f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 s4-1 *up-vector*) - (set! (-> s3-1 trans quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 trans) s5-0) (gun-yellow-shot-method-42 this f30-1 f28-0 s3-1) ) ) @@ -2065,21 +2065,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 99 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 99)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 99)) ) ) ) ((logtest? (-> *part-group-id-table* 98 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 98)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 98)) ) ) diff --git a/goal_src/jak3/engine/target/indax/target-indax.gc b/goal_src/jak3/engine/target/indax/target-indax.gc index ed4b9e68536..813fcb822f9 100644 --- a/goal_src/jak3/engine/target/indax/target-indax.gc +++ b/goal_src/jak3/engine/target/indax/target-indax.gc @@ -1357,7 +1357,7 @@ (else (set! (-> self control unknown-word04) (the-as uint (-> v1-2 root trans y))) (vector+! (-> self control unknown-vector38) (-> v1-2 root trans) (new 'static 'vector :y 4505.6 :w 1.0)) - (set! (-> self control unknown-vector40 quad) (-> v1-2 root quat quad)) + (set! (-> self control unknown-quat40 quad) (-> v1-2 root quat quad)) ) ) ) @@ -1365,13 +1365,13 @@ :code (behavior () (sound-play "dax-jump" :vol 70) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (let ((gp-1 daxter-indax-jump-ja)) (ja-channel-push! 1 (seconds 0.05)) (set! (-> self control mod-surface) *empty-mods*) (set! (-> self neck flex-blend) 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) (ja :group! gp-1 :num! (seek!) :frame-num 0.0) ) (until (ja-done? 0) @@ -1391,20 +1391,20 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) (rot->dir-targ! (-> self control)) (suspend) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (set! (-> self alt-cam-pos y) (the-as float (-> self control unknown-word04))) (ja :num! (seek!)) ) (do-effect (-> self skel effect) "effect-land" 0.0 -1) (let ((a1-11 (new 'stack-no-clear 'vector))) - (set! (-> a1-11 quad) (-> self control trans quad)) + (vector-copy! a1-11 (-> self control trans)) (set! (-> a1-11 y) (the-as float (-> self control unknown-word04))) (move-to-point! (-> self control) a1-11) ) @@ -1484,7 +1484,7 @@ (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) ) - (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (vector-copy! s5-0 (-> gp-0 vector)) (let ((f0-12 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -1508,12 +1508,13 @@ (cond ((= (-> self game mode) 'debug) (let ((s4-1 (new-stack-vector0))) - (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! s4-1 (-> self control last-trans-on-ground)) (ja-channel-set! 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (move-to-point! (-> self control) s4-1) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-indax-stance) ) @@ -1723,11 +1724,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 233 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 233)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 233)) ) ) @@ -1739,7 +1740,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) ((= arg0 'bot) (set! (-> self post-hook) target-no-move-post) diff --git a/goal_src/jak3/engine/target/lightjak-wings.gc b/goal_src/jak3/engine/target/lightjak-wings.gc index 3313b4e495b..6dfe6f90959 100644 --- a/goal_src/jak3/engine/target/lightjak-wings.gc +++ b/goal_src/jak3/engine/target/lightjak-wings.gc @@ -744,7 +744,7 @@ ;; WARN: Return type mismatch vector vs none. (defmethod ragdoll-method-19 ((this wings-ragdoll) (arg0 vector) (arg1 int) (arg2 object) (arg3 matrix)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this gravity quad)) + (vector-copy! s3-0 (-> this gravity)) (let ((s1-0 (-> this ragdoll-joints arg1)) (f30-0 1.0) ) @@ -787,7 +787,7 @@ ) ) ) - (set! (-> this gravity quad) (-> s3-0 quad)) + (vector-copy! (-> this gravity) s3-0) ) (if (and (= (-> this ragdoll-joints arg1 parent-joint) -1) (= (-> this ragdoll-joints (+ arg1 -1) parent-joint) -1) diff --git a/goal_src/jak3/engine/target/logic-target.gc b/goal_src/jak3/engine/target/logic-target.gc index 6a21d0f4f36..e5a3257b51b 100644 --- a/goal_src/jak3/engine/target/logic-target.gc +++ b/goal_src/jak3/engine/target/logic-target.gc @@ -53,9 +53,9 @@ ) (matrix-transpose! (-> self control w-R-c) (-> self control c-R-w)) (vector-matrix*! (-> self control transv-ctrl) arg0 (-> self control w-R-c)) - (set! (-> self control last-gravity-normal quad) (-> self control gravity-normal quad)) + (vector-copy! (-> self control last-gravity-normal) (-> self control gravity-normal)) (let ((v0-7 (-> self control gravity-normal))) - (set! (-> v0-7 quad) (-> self control dynam gravity-normal quad)) + (vector-copy! v0-7 (-> self control dynam gravity-normal)) v0-7 ) ) @@ -681,7 +681,7 @@ (defbehavior read-pad target ((arg0 vector)) (when (!= (-> self control time-of-last-pad-read) (-> *display* real-clock frame-counter)) - (set! (-> self control last-pad-xz-dir quad) (-> self control pad-xz-dir quad)) + (vector-copy! (-> self control last-pad-xz-dir) (-> self control pad-xz-dir)) (set! (-> self control last-pad-magnitude) (-> self control pad-magnitude)) (set! (-> self control time-of-last-pad-read) (-> *display* real-clock frame-counter)) ) @@ -689,22 +689,11 @@ (set! (-> arg0 y) 0.0) (set! (-> arg0 z) (cos (-> self control cpad stick0-dir))) (set! (-> arg0 w) 0.0) - (set! (-> self control pad-xz-dir quad) (-> arg0 quad)) + (vector-copy! (-> self control pad-xz-dir) arg0) (set! (-> self control pad-magnitude) (-> self control cpad stick0-speed)) - (when (< (-> self control update-cam-R-w-start-time) (current-time)) - (let* ((s5-0 (-> self control cam-R-w)) - (a2-0 (matrix-local->world #t #f)) - (v1-24 (-> a2-0 rvec quad)) - (a0-14 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-24) - (set! (-> s5-0 uvec quad) a0-14) - (set! (-> s5-0 fvec quad) a1-1) - (set! (-> s5-0 trans quad) a2-1) + (if (< (-> self control update-cam-R-w-start-time) (current-time)) + (matrix-copy! (-> self control cam-R-w) (matrix-local->world #t #f)) ) - ) (vector-matrix*! arg0 arg0 (-> self control cam-R-w)) ) @@ -715,16 +704,8 @@ ) (defun warp-vector-into-surface! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 matrix)) - (let ((t9-0 matrix-from-two-vectors!) - (a0-1 (new 'stack-no-clear 'matrix)) - ) - (set! (-> a0-1 rvec quad) (the-as uint128 0)) - (set! (-> a0-1 uvec quad) (the-as uint128 0)) - (set! (-> a0-1 fvec quad) (the-as uint128 0)) - (set! (-> a0-1 trans quad) (the-as uint128 0)) - (let ((a2-1 (t9-0 a0-1 (-> arg3 uvec) arg2))) - (vector-matrix*! arg0 arg1 a2-1) - ) + (let ((a2-1 (matrix-from-two-vectors! (new-stack-matrix0) (-> arg3 uvec) arg2))) + (vector-matrix*! arg0 arg1 a2-1) ) ) @@ -773,7 +754,7 @@ (t9-2 vector-normalize!) (a0-2 (new-stack-vector0)) ) - (set! (-> a0-2 quad) (-> self control transv quad)) + (vector-copy! a0-2 (-> self control transv)) (let ((f0-1 (vector-dot gp-0 (t9-2 a0-2 1.0))) (a1-3 (-> self control transv-history)) (f2-0 -1000.0) @@ -869,7 +850,7 @@ (set! (-> gp-0 ignore-pat) (-> self control pat-ignore-mask)) (fill-using-bounding-box *collide-cache* gp-0) (dotimes (s5-0 3) - (set! (-> gp-0 start-pos quad) (-> self control collision-spheres s5-0 prim-core world-sphere quad)) + (vector-copy! (-> gp-0 start-pos) (-> self control collision-spheres s5-0 prim-core world-sphere)) (vector-float*! (-> gp-0 move-dist) (-> self control wall-contact-normal) -8192.0) (let ((v1-49 gp-0)) (set! (-> v1-49 radius) 4.096) @@ -900,7 +881,7 @@ (defbehavior target-log-trans target () (let ((v1-1 (-> self control trans-log-idx))) (set-time! (-> self control trans-log-times v1-1)) - (set! (-> self control trans-log-trans v1-1 quad) (-> self control trans quad)) + (vector-copy! (-> self control trans-log-trans v1-1) (-> self control trans)) (set! (-> self control trans-log-idx) (logand (+ v1-1 1) 127)) ) 0 @@ -942,8 +923,8 @@ (warp-vector-into-surface! gp-0 arg0 (-> self control local-normal) (-> self control cam-R-w)) (set! (-> self control last-turn-to-magnitude) (-> self control turn-to-magnitude)) (set! (-> self control last-turn-to-angle) (-> self control turn-to-angle)) - (set! (-> self control last-to-target-pt-xz quad) (-> self control to-target-pt-xz quad)) - (set! (-> self control last-turn-to-target quad) (-> self control turn-to-target quad)) + (vector-copy! (-> self control last-to-target-pt-xz) (-> self control to-target-pt-xz)) + (vector-copy! (-> self control last-turn-to-target) (-> self control turn-to-target)) (vector-float*! (-> self control turn-to-target) gp-0 arg1) (if (< 0.0 arg1) (warp-vector-into-surface! (-> self control to-target-pt-xz) arg0 *up-vector* (-> self control cam-R-w)) @@ -959,7 +940,7 @@ (set! (-> self control turn-to-angle) f0-6) ) (let ((f0-8 (* arg1 (-> self control current-surface target-speed)))) - (set! (-> self control target-transv quad) (-> (vector-normalize! gp-0 f0-8) quad)) + (vector-copy! (-> self control target-transv) (vector-normalize! gp-0 f0-8)) ) ) (let ((gp-1 (new-stack-vector0))) @@ -1036,7 +1017,7 @@ (let ((t9-5 vector-xz-normalize!) (a0-10 (new-stack-vector0)) ) - (set! (-> a0-10 quad) (-> arg0 quad)) + (vector-copy! a0-10 arg0) (let ((v1-18 (t9-5 a0-10 1.0))) (set! (-> v1-18 y) 0.0) (let* ((f0-10 (vector-dot s5-1 v1-18)) @@ -1062,18 +1043,18 @@ (gp-0 (-> self control transv-ctrl)) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self control target-transv quad)) + (vector-copy! s4-0 (-> self control target-transv)) (target-bend-vel-turn gp-0) (target-add-slide-factor s5-0) (let ((t9-2 vector-xz-normalize!) (a0-2 (new-stack-vector0)) ) - (set! (-> a0-2 quad) (-> s5-0 quad)) + (vector-copy! a0-2 s5-0) (let ((s3-0 (t9-2 a0-2 1.0))) (let ((t9-3 vector-xz-normalize!) (a0-3 (new-stack-vector0)) ) - (set! (-> a0-3 quad) (-> gp-0 quad)) + (vector-copy! a0-3 gp-0) (let ((v1-9 (t9-3 a0-3 1.0))) (set! (-> s3-0 y) 0.0) (set! (-> v1-9 y) 0.0) @@ -1201,7 +1182,7 @@ "ltransv" (the-as rgba (new 'static 'rgba :g #xff :a #x80)) ) - (set! (-> gp-1 quad) (-> self control btransv quad)) + (vector-copy! gp-1 (-> self control btransv)) (vector-float*! gp-1 gp-1 0.5) (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere @@ -1419,7 +1400,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg3 quad)) + (vector-copy! s5-0 arg3) (let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y)))) (if (< 1228.8 f0-1) (set! f0-1 1228.8) @@ -1554,8 +1535,8 @@ ) (enable-set! (-> self leg-ik s5-0) a1-4) ) - (set! (-> self foot s5-0 twist-max quad) (-> self control ground-contact-normal quad)) - (set! (-> self foot s5-0 trans quad) (-> self control gspot-pos quad)) + (vector-copy! (-> self foot s5-0 twist-max) (-> self control ground-contact-normal)) + (vector-copy! (-> self foot s5-0 trans) (-> self control gspot-pos)) (vector-y-quaternion! (-> self foot s5-0 target) (-> self control quat-for-control)) (set! (-> self foot s5-0 flex-blend) (if (if (zero? s5-0) (logtest? (target-flags lleg-no-ik) (-> self target-flags)) @@ -1570,7 +1551,7 @@ (s2-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s1-0 quad) (-> *y-vector* quad)) + (vector-copy! s1-0 *y-vector*) (let ((s3-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) @@ -1637,7 +1618,7 @@ (let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0))) (cond ((and (>= f30-0 0.0) (< 0.5 (-> gp-0 best-other-tri normal y))) - (set! (-> s4-0 quad) (-> gp-0 best-other-tri normal quad)) + (vector-copy! s4-0 (-> gp-0 best-other-tri normal)) (when (< 8192.0 (vector-vector-angle-safe *y-vector* s4-0)) (let* ((a1-17 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s4-0) 1.0)) (a2-18 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-17 8192.0)) @@ -1660,14 +1641,14 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a1-19 quad) vf6) ) - (set! (-> self leg-ik s5-0 user-position quad) (-> s3-0 quad)) - (set! (-> self leg-ik s5-0 user-normal quad) (-> s4-0 quad)) - (set! (-> self foot s5-0 twist-max quad) (-> s4-0 quad)) + (vector-copy! (-> self leg-ik s5-0 user-position) s3-0) + (vector-copy! (-> self leg-ik s5-0 user-normal) s4-0) + (vector-copy! (-> self foot s5-0 twist-max) s4-0) ) (else - (set! (-> self leg-ik s5-0 user-position quad) (-> s2-0 quad)) - (set! (-> self leg-ik s5-0 user-normal quad) (-> *y-vector* quad)) - (set! (-> self foot s5-0 twist-max quad) (-> *y-vector* quad)) + (vector-copy! (-> self leg-ik s5-0 user-position) s2-0) + (vector-copy! (-> self leg-ik s5-0 user-normal) *y-vector*) + (vector-copy! (-> self foot s5-0 twist-max) *y-vector*) ) ) ) @@ -1711,8 +1692,8 @@ ) ) ) - (set! (-> self control collide-extra-velocity quad) (-> self control additional-decaying-velocity quad)) - (set! (-> self control pre-collide-local-normal quad) (-> self control local-normal quad)) + (vector-copy! (-> self control collide-extra-velocity) (-> self control additional-decaying-velocity)) + (vector-copy! (-> self control pre-collide-local-normal) (-> self control local-normal)) 0 (none) ) @@ -1749,26 +1730,26 @@ ) ) (level-setup) - (set! (-> self control last-transv quad) (-> self control transv quad)) + (vector-copy! (-> self control last-transv) (-> self control transv)) (quaternion-copy! (-> self control last-quat-for-control) (-> self control quat-for-control)) ((-> self control current-surface active-hook)) (cond ((logtest? (-> self control status) (collide-status on-surface)) (set-time! (-> self control last-time-on-surface)) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (if (and (>= (-> self control coverage) 1.0) (not (logtest? (-> self control status) (collide-status touch-actor on-water))) (logtest? (-> self control status) (collide-status on-ground)) ) - (set! (-> self control last-trans-on-ground quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-on-ground) (-> self control trans)) ) ((-> self control current-surface touch-hook)) ) (else (let ((v1-49 (-> self control trans))) (when (logtest? (-> self control old-status) (collide-status on-surface)) - (set! (-> self control last-trans-leaving-surf quad) (-> self control last-trans-any-surf quad)) - (set! (-> self control highest-jump-mark quad) (-> self control last-trans-any-surf quad)) + (vector-copy! (-> self control last-trans-leaving-surf) (-> self control last-trans-any-surf)) + (vector-copy! (-> self control highest-jump-mark) (-> self control last-trans-any-surf)) ) (set! (-> self control highest-jump-mark x) (-> v1-49 x)) (set! (-> self control highest-jump-mark z) (-> v1-49 z)) @@ -1897,7 +1878,7 @@ ) ) (let ((a1-44 (new 'stack-no-clear 'vector))) - (set! (-> a1-44 quad) (-> self control trans quad)) + (vector-copy! a1-44 (-> self control trans)) (let ((v1-190 (new-stack-vector0)) (f0-13 (vector-dot (-> self control dynam gravity-normal) a1-44)) ) @@ -2086,7 +2067,7 @@ ) (seek! (-> self control bend-amount) f0-1 (* (-> self control bend-speed) (seconds-per-frame))) ) - (set! (-> self control dynam gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) + (vector-copy! (-> self control dynam gravity-normal) (-> self control standard-dynamics gravity-normal)) (vector-float*! (-> self control dynam gravity) (-> self control dynam gravity-normal) @@ -2171,24 +2152,13 @@ (cond ((send-event (handle->process (-> s5-0 pilot-edge-grab handle)) 'pilot-edge-grab s5-0) (let ((a0-7 (handle->process (-> s5-0 pilot-edge-grab handle)))) - (set! (-> s5-0 center-hold-old quad) (-> s5-0 center-hold quad)) + (vector-copy! (-> s5-0 center-hold-old) (-> s5-0 center-hold)) (let ((gp-0 (new 'stack-no-clear 'bone))) - (let* ((v1-13 (-> gp-0 transform)) - (a3-0 (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) - (a0-12 (-> a3-0 rvec quad)) - (a1-4 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-13 rvec quad) a0-12) - (set! (-> v1-13 uvec quad) a1-4) - (set! (-> v1-13 fvec quad) a2-1) - (set! (-> v1-13 trans quad) a3-1) - ) + (matrix-copy! (-> gp-0 transform) (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) (vector-matrix*! (-> gp-0 scale) (the-as vector (-> s5-0 pilot-edge-grab)) (-> gp-0 transform)) (vector-rotate*! (the-as vector (&+ gp-0 80)) (-> s5-0 pilot-edge-grab local-dir) (-> gp-0 transform)) - (set! (-> s5-0 center-hold quad) (-> gp-0 scale quad)) - (set! (-> self control edge-grab-edge-dir quad) (-> (&+ gp-0 80) transform rvec quad)) + (vector-copy! (-> s5-0 center-hold) (-> gp-0 scale)) + (vector-copy! (-> self control edge-grab-edge-dir) (-> (&+ gp-0 80) transform rvec)) ) ) ) @@ -2277,7 +2247,7 @@ (move-to-point! (-> self control) s3-1) ) (set! (-> self control hand-to-edge-dist) 0.0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) ) (else (vector-normalize! s4-1 1638.4) @@ -2303,7 +2273,7 @@ (move-to-point! (-> self control) a1-23) ) (set! (-> self control hand-to-edge-dist) 0.0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (set-time! (-> self control last-successful-compute-edge-time)) ) ) @@ -2325,24 +2295,13 @@ (cond ((send-event (handle->process (-> gp-0 pilot-edge-grab handle)) 'pilot-edge-grab gp-0) (let ((a0-7 (handle->process (-> gp-0 pilot-edge-grab handle)))) - (set! (-> gp-0 center-hold-old quad) (-> gp-0 center-hold quad)) + (vector-copy! (-> gp-0 center-hold-old) (-> gp-0 center-hold)) (let ((s5-0 (new 'stack-no-clear 'bone))) - (let* ((v1-13 (-> s5-0 transform)) - (a3-0 (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) - (a0-12 (-> a3-0 rvec quad)) - (a1-4 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-13 rvec quad) a0-12) - (set! (-> v1-13 uvec quad) a1-4) - (set! (-> v1-13 fvec quad) a2-1) - (set! (-> v1-13 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 transform) (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) (vector-matrix*! (-> s5-0 scale) (the-as vector (-> gp-0 pilot-edge-grab)) (-> s5-0 transform)) (vector-rotate*! (the-as vector (&+ s5-0 80)) (-> gp-0 pilot-edge-grab local-dir) (-> s5-0 transform)) - (set! (-> gp-0 center-hold quad) (-> s5-0 scale quad)) - (set! (-> self control edge-grab-edge-dir quad) (-> (&+ s5-0 80) transform rvec quad)) + (vector-copy! (-> gp-0 center-hold) (-> s5-0 scale)) + (vector-copy! (-> self control edge-grab-edge-dir) (-> (&+ s5-0 80) transform rvec)) ) ) ) @@ -2389,7 +2348,7 @@ (let* ((s2-0 (the-as swingpole (handle->process (-> self control anim-handle)))) (gp-0 (-> s2-0 dir)) ) - (set! (-> self control edge-grab-edge-dir quad) (-> gp-0 quad)) + (vector-copy! (-> self control edge-grab-edge-dir) gp-0) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s1-0 (get-trans s2-0)) (s4-1 (vector+float*! (new 'stack-no-clear 'vector) s1-0 gp-0 (the-as float (-> s2-0 edge-length)))) @@ -2452,7 +2411,7 @@ (-> self control) (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self control ctrl-to-hands-offset)) ) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) ) ) ) @@ -2488,13 +2447,13 @@ ) ) ) - (set! (-> self control camera-pos quad) (-> s5-0 quad)) + (vector-copy! (-> self control camera-pos) s5-0) ) ((logtest? (target-flags tf26) (-> self target-flags)) (vector+! (-> self control camera-pos) (-> self control trans) (new 'static 'vector :y -8192.0 :w 1.0)) ) ((focus-test? self board pilot mech indax) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) ) ((or (logtest? (-> self control status) (collide-status on-water)) (let ((v1-28 (-> self water flags))) @@ -2514,7 +2473,7 @@ (vector<-cspace! gp-0 (joint-node jakb-lod0-jg chest)) (cond ((>= (+ (current-time) (seconds -2)) (-> self control unknown-time-frame26)) - (set! (-> self control camera-pos quad) (-> s5-0 quad)) + (vector-copy! (-> self control camera-pos) s5-0) ) ((not (and (logtest? (-> self water flags) (water-flag under-water)) (not (logtest? (-> self water flags) (water-flag swim-ground))) @@ -2547,10 +2506,10 @@ (set! (-> self control camera-pos y) (-> self water base-height)) ) ((focus-test? self tube) - (set! (-> self control camera-pos quad) (-> self control gspot-pos quad)) + (vector-copy! (-> self control camera-pos) (-> self control gspot-pos)) ) ((logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp)) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) ) (else (vector<-cspace! (-> self control camera-pos) (the-as cspace (-> self node-list data))) @@ -2667,8 +2626,8 @@ (not (and (-> self next-state) (= (-> self next-state name) 'target-flop))) (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds))) ) - (set! (-> self control gspot-pos quad) (-> self control trans quad)) - (set! (-> self control gspot-normal quad) (-> self control ground-poly-normal quad)) + (vector-copy! (-> self control gspot-pos) (-> self control trans)) + (vector-copy! (-> self control gspot-normal) (-> self control ground-poly-normal)) (set! (-> self control gspot-pat-surfce) (-> self control ground-pat)) ) (else @@ -2932,12 +2891,13 @@ (let ((gp-2 (-> self control))) (+! (-> gp-2 history-idx) 1) (let ((v1-25 (clear-record-tags! *history* (history-channel transv) (-> gp-2 history-idx) (the-as uint 2)))) - (set! (-> v1-25 origin quad) (-> gp-2 trans quad)) - (set! (-> v1-25 vector quad) (-> gp-2 transv quad)) + (vector-copy! (-> v1-25 origin) (-> gp-2 trans)) + (vector-copy! (-> v1-25 vector) (-> gp-2 transv)) + ) + (vector-copy! + (-> (clear-record-tags! *history* (history-channel trans) (-> gp-2 history-idx) (the-as uint 2)) vector) + (-> gp-2 trans) ) - (set! (-> (clear-record-tags! *history* (history-channel trans) (-> gp-2 history-idx) (the-as uint 2)) vector quad) - (-> gp-2 trans quad) - ) (let ((v1-31 (clear-record-tags! *history* (history-channel collide-status) (-> gp-2 history-idx) (the-as uint 2))) ) (set! (-> v1-31 collide-status) (logior (-> gp-2 status) (collide-status no-touch))) @@ -2976,7 +2936,7 @@ (quaternion-identity! (-> self control quat-for-control)) (quaternion-identity! (-> self control dir-targ)) (set! (-> self control transv quad) (the-as uint128 0)) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) ) (target-exit) (target-timed-invulnerable-off self 0) @@ -2984,7 +2944,7 @@ (set! (-> self control status) (collide-status)) (set! (-> self control standard-dynamics) *standard-dynamics*) (set! (-> self control surf) *standard-ground-surface*) - (set! (-> self control bent-gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) + (vector-copy! (-> self control bent-gravity-normal) (-> self control standard-dynamics gravity-normal)) (quaternion-identity! (-> self control override-quat)) (set! (-> self control override-quat-alpha) 0.0) (set-time! (-> self control last-time-on-surface)) @@ -3138,7 +3098,7 @@ (set! (-> v1-96 event-self) 'touched) ) (move-to-point! (-> this control) (-> arg0 trans)) - (set! (-> this control camera-pos quad) (-> arg0 trans quad)) + (vector-copy! (-> this control camera-pos) (-> arg0 trans)) (set! (-> this focus-search) (new 'process 'boxed-array collide-shape 128)) (set! (-> this focus-search length) 0) (set! (-> this handle-search) (new 'process 'boxed-array handle 128)) @@ -3244,7 +3204,7 @@ (set! (-> this water) (new 'process 'water-control this 10 0.0 8192.0 2048.0)) (set! (-> this water flags) (water-flag swim-ground part-splash part-drip part-rings part-water find-water)) (reset-target-state #t) - (set! (-> this control last-trans-any-surf quad) (-> this control trans quad)) + (vector-copy! (-> this control last-trans-any-surf) (-> this control trans)) (+! (-> this control last-trans-any-surf y) -819200.0) (set! (-> this align) (new 'process 'align-control this)) (set! (-> this manipy) (the-as (pointer manipy) #f)) diff --git a/goal_src/jak3/engine/target/mech/carry-h.gc b/goal_src/jak3/engine/target/mech/carry-h.gc index 0f1f4b137df..ccda3d5ccec 100644 --- a/goal_src/jak3/engine/target/mech/carry-h.gc +++ b/goal_src/jak3/engine/target/mech/carry-h.gc @@ -85,8 +85,8 @@ ) (set! (-> gp-0 max-angle) arg4) (set! (-> gp-0 max-distance) 8192.0) - (set! (-> gp-0 local-point quad) (-> arg2 quad)) - (set! (-> gp-0 local-normal quad) (-> arg3 quad)) + (vector-copy! (-> gp-0 local-point) arg2) + (vector-copy! (-> gp-0 local-normal) arg3) (let* ((s5-1 (-> arg0 root)) (v1-7 (if (type? s5-1 collide-shape) (the-as collide-shape s5-1) @@ -220,7 +220,7 @@ (vector-rotate-y! s4-3 s4-3 (- (deg-diff f30-0 f28-0))) (vector+! s4-3 s4-3 (-> arg0 process 0 control trans)) (vector-matrix*! s4-3 s4-3 s3-2) - (set! (-> arg0 grab-trans quad) (-> s4-3 quad)) + (vector-copy! (-> arg0 grab-trans) s4-3) ) ) (set! (-> arg0 hold-trans x) @@ -320,18 +320,10 @@ (s3-2 (vector-! (new 'stack-no-clear 'vector) v1-10 (-> this process 0 control trans))) ) (when s4-0 - (let ((s5-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-3 (-> s4-0 process 0 node-list data (-> s4-0 joint) bone transform)) - (v1-16 (-> a2-3 rvec quad)) - (a0-16 (-> a2-3 uvec quad)) - (a1-3 (-> a2-3 fvec quad)) - (a2-4 (-> a2-3 trans quad)) - ) - (set! (-> s5-1 rvec quad) v1-16) - (set! (-> s5-1 uvec quad) a0-16) - (set! (-> s5-1 fvec quad) a1-3) - (set! (-> s5-1 trans quad) a2-4) - ) + (let ((s5-1 + (matrix-copy! (new 'stack-no-clear 'matrix) (-> s4-0 process 0 node-list data (-> s4-0 joint) bone transform)) + ) + ) (vector-normalize! (-> s5-1 rvec) 1.0) (vector-normalize! (-> s5-1 uvec) 1.0) (vector-normalize! (-> s5-1 fvec) 1.0) @@ -343,7 +335,7 @@ ) (cond ((time-elapsed? (-> this pickup-time) (seconds 1)) - (set! (-> this process 0 control trans quad) (-> v1-19 quad)) + (vector-copy! (-> this process 0 control trans) v1-19) (quaternion-copy! (-> this process 0 control quat) s5-3) ) (else @@ -388,8 +380,8 @@ ) ) (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) - (set! (-> arg0 grab-trans quad) (-> arg0 process 0 control trans quad)) - (set! (-> arg0 hold-trans quad) (-> this process 0 control trans quad)) + (vector-copy! (-> arg0 grab-trans) (-> arg0 process 0 control trans)) + (vector-copy! (-> arg0 hold-trans) (-> this process 0 control trans)) (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> this point) (-> arg0 point)))) (vector-xz-normalize! s2-2 (-> arg0 max-pull)) (vector+! s2-2 s2-2 (-> arg0 point)) diff --git a/goal_src/jak3/engine/target/mech/mech-part.gc b/goal_src/jak3/engine/target/mech/mech-part.gc index ff7af283f2b..54e037a0237 100644 --- a/goal_src/jak3/engine/target/mech/mech-part.gc +++ b/goal_src/jak3/engine/target/mech/mech-part.gc @@ -173,7 +173,7 @@ (a1-7 (-> arg0 part-thruster)) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> s0-0 quad)) + (vector-copy! (-> a2-4 trans) s0-0) (t9-4 (the-as sparticle-system a0-6) a1-7 diff --git a/goal_src/jak3/engine/target/mech/mech-states.gc b/goal_src/jak3/engine/target/mech/mech-states.gc index a83f2edd7cd..2110537189a 100644 --- a/goal_src/jak3/engine/target/mech/mech-states.gc +++ b/goal_src/jak3/engine/target/mech/mech-states.gc @@ -508,11 +508,11 @@ (when (or (not s5-2) (= (-> self control send-attack-time) (current-time))) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (the-as collide-query gp-1) best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as collide-query gp-1) best-other-tri intersect)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (the-as collide-query gp-1) best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as collide-query gp-1) best-other-tri intersect)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -976,7 +976,7 @@ (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) ) - (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (vector-copy! s5-0 (-> gp-0 vector)) (let ((f0-10 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -1000,13 +1000,13 @@ (cond ((= (-> self game mode) 'debug) (let ((s4-1 (new-stack-vector0))) - (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! s4-1 (-> self control last-trans-on-ground)) (ja-channel-set! 0) (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-mech-stance) ) @@ -1195,11 +1195,11 @@ (sound-play "mech-eject") (cond ((logtest? (-> *part-group-id-table* 236 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 236)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 236)) ) ) @@ -1233,7 +1233,7 @@ ) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (set! (-> self post-hook) target-no-move-post) (ja-channel-set! 1) (ja-no-eval :group! jakb-death-painful-land-ja :num! (seek!) :frame-num 0.0) @@ -1582,7 +1582,7 @@ (let ((a0-8 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-1)))) (when a0-8 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> a0-8 point quad)) + (vector-copy! s5-1 (-> a0-8 point)) (set! (-> s5-1 y) (- (-> s5-1 y) (-> a0-8 process 0 control root-prim prim-core world-sphere w))) (let ((s4-0 (new-stack-vector0)) (f28-0 (vector-dot (-> self control local-normal) s5-1)) @@ -2397,10 +2397,10 @@ (set! (-> self control mod-surface) *empty-mods*) (send-event (ppointer->process (-> self manipy)) 'draw #t) (set! (-> self neck flex-blend) 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector38 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) - (set! (-> self control unknown-vector40 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (vector-copy! (-> self control unknown-vector38) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) + (set! (-> self control unknown-quat40 quad) (-> self control quat quad)) (let* ((gp-1 (handle->process arg0)) (v1-23 (if (type? gp-1 process-drawable) gp-1 @@ -2408,16 +2408,13 @@ ) ) (when v1-23 - (set! (-> self control unknown-vector38 quad) (-> (the-as process-drawable v1-23) root trans quad)) - (set! (-> self control unknown-vector40 quad) (-> (the-as process-drawable v1-23) root quat quad)) + (vector-copy! (-> self control unknown-vector38) (-> (the-as process-drawable v1-23) root trans)) + (set! (-> self control unknown-quat40 quad) (-> (the-as process-drawable v1-23) root quat quad)) ) ) - (set! (-> self mech mech-trans quad) (-> self control unknown-vector38 quad)) - (quaternion-copy! - (the-as quaternion (-> self mech mech-quat)) - (the-as quaternion (-> self control unknown-vector40)) - ) - (set! (-> self mech mech-scale quad) (-> self control scale quad)) + (vector-copy! (-> self mech mech-trans) (-> self control unknown-vector38)) + (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control unknown-quat40)) + (vector-copy! (-> self mech mech-scale) (-> self control scale)) (set! (-> self mech stick-off) (the-as basic #t)) (ja-no-eval :group! jakb-mech-get-on-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -2435,13 +2432,13 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) (rot->dir-targ! (-> self control)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (suspend) (ja :num! (seek!)) ) @@ -2467,10 +2464,10 @@ (set! (-> self control mod-surface) *empty-mods*) (send-event (ppointer->process (-> self manipy)) 'draw #t) (set! (-> self neck flex-blend) 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector38 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) - (set! (-> self control unknown-vector40 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (vector-copy! (-> self control unknown-vector38) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) + (set! (-> self control unknown-quat40 quad) (-> self control quat quad)) (let* ((gp-1 (handle->process arg0)) (v1-23 (if (type? gp-1 process-drawable) gp-1 @@ -2478,16 +2475,13 @@ ) ) (when v1-23 - (set! (-> self control unknown-vector38 quad) (-> (the-as process-drawable v1-23) root trans quad)) - (set! (-> self control unknown-vector40 quad) (-> (the-as process-drawable v1-23) root quat quad)) + (vector-copy! (-> self control unknown-vector38) (-> (the-as process-drawable v1-23) root trans)) + (set! (-> self control unknown-quat40 quad) (-> (the-as process-drawable v1-23) root quat quad)) ) ) - (set! (-> self mech mech-trans quad) (-> self control unknown-vector38 quad)) - (quaternion-copy! - (the-as quaternion (-> self mech mech-quat)) - (the-as quaternion (-> self control unknown-vector40)) - ) - (set! (-> self mech mech-scale quad) (-> self control scale quad)) + (vector-copy! (-> self mech mech-trans) (-> self control unknown-vector38)) + (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control unknown-quat40)) + (vector-copy! (-> self mech mech-scale) (-> self control scale)) (set! (-> self mech stick-off) (the-as basic #t)) (ja-no-eval :group! jakb-mech-get-on-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -2505,13 +2499,13 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) (rot->dir-targ! (-> self control)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (suspend) (ja :num! (seek!)) ) @@ -2696,7 +2690,7 @@ :post (behavior () (vector+! (-> self mech mech-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control quat)) - (set! (-> self mech mech-scale quad) (-> self control scale quad)) + (vector-copy! (-> self mech mech-scale) (-> self control scale)) (target-no-ja-move-post) ) ) diff --git a/goal_src/jak3/engine/target/mech/mech.gc b/goal_src/jak3/engine/target/mech/mech.gc index 64d010b24e4..11134f99c10 100644 --- a/goal_src/jak3/engine/target/mech/mech.gc +++ b/goal_src/jak3/engine/target/mech/mech.gc @@ -251,7 +251,9 @@ (mech-method-24 self) (suspend) ) - (suspend-for (seconds 1) (mech-method-24 self)) + (suspend-for (seconds 1) + (mech-method-24 self) + ) (go arg0) ) ) @@ -316,7 +318,7 @@ (set-yaw-angle-clear-roll-pitch! (-> self root) (res-lump-float arg0 'rotoffset)) ) (when arg1 - (set! (-> self root trans quad) (-> arg1 vector 0 quad)) + (vector-copy! (-> self root trans) (-> arg1 vector 0)) (quaternion-copy! (-> self root quat) (the-as quaternion (-> arg1 vector 1))) ) (initialize-skeleton @@ -357,6 +359,7 @@ ) (defmethod init-from-entity! ((this mech) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (mech-init arg0 (the-as matrix3 #f) (the-as handle #f) 100.0) ) @@ -465,7 +468,7 @@ ) (label cfg-12) (set! (-> self root) (the-as collide-shape-moving (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (set! (-> self root scale x) 0.0) (set! (-> self root scale y) 0.0) diff --git a/goal_src/jak3/engine/target/mech/target-mech.gc b/goal_src/jak3/engine/target/mech/target-mech.gc index 364b5f41517..cd7699b6454 100644 --- a/goal_src/jak3/engine/target/mech/target-mech.gc +++ b/goal_src/jak3/engine/target/mech/target-mech.gc @@ -18,7 +18,7 @@ (set! (-> self sphere-size) (-> arg0 sphere-size)) (set! (-> self owner) (-> arg0 owner)) (set! (-> self track-joint) (-> arg0 track-joint)) - (set! (-> self offset-vec quad) (-> arg0 offset-vec quad)) + (vector-copy! (-> self offset-vec) (-> arg0 offset-vec)) (init-collision! self) (initialize-skeleton self @@ -505,7 +505,7 @@ (a0-12 *sp-particle-system-2d*) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> self root trans quad)) + (vector-copy! (-> a2-3 trans) (-> self root trans)) (t9-6 a0-12 s5-2 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -519,7 +519,7 @@ (a0-15 *sp-particle-system-2d*) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> self root trans quad)) + (vector-copy! (-> a2-4 trans) (-> self root trans)) (t9-8 a0-15 s5-3 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -540,7 +540,7 @@ (a0-21 *sp-particle-system-2d*) (a2-6 *launch-matrix*) ) - (set! (-> a2-6 trans quad) (-> s4-2 quad)) + (vector-copy! (-> a2-6 trans) s4-2) (t9-13 a0-21 s5-4 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -885,7 +885,7 @@ ) (not (logtest? (-> self focus-status) (focus-status dead hit))) ) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (target-timed-invulnerable (seconds 0.1) self 1) (cond ((focus-test? self carry) @@ -922,7 +922,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg3 quad)) + (vector-copy! s5-0 arg3) (let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y)))) (if (< 6144.0 f0-1) (set! f0-1 6144.0) @@ -1113,7 +1113,7 @@ (let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0))) (cond ((>= f30-0 0.0) - (set! (-> s1-0 quad) (-> gp-0 best-other-tri normal quad)) + (vector-copy! s1-0 (-> gp-0 best-other-tri normal)) (when (< 8192.0 (vector-vector-angle-safe *y-vector* s1-0)) (let* ((a1-14 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s1-0) 1.0)) (a2-14 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-14 8192.0)) @@ -1136,13 +1136,13 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a1-16 quad) vf6) ) - (set! (-> s3-0 user-position quad) (-> s2-0 quad)) - (set! (-> s3-0 user-normal quad) (-> s1-0 quad)) + (vector-copy! (-> s3-0 user-position) s2-0) + (vector-copy! (-> s3-0 user-normal) s1-0) ) (else (set! (-> s0-0 y) (-> (target-pos 0) y)) - (set! (-> s3-0 user-position quad) (-> s0-0 quad)) - (set! (-> s3-0 user-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> s3-0 user-position) s0-0) + (vector-copy! (-> s3-0 user-normal) *y-vector*) ) ) ) @@ -1292,11 +1292,11 @@ (lambda :behavior target () (let ((v1-0 (ppointer->process (-> self parent)))) - (set! (-> self control trans quad) (-> (the-as target v1-0) mech mech-trans quad)) + (vector-copy! (-> self control trans) (-> (the-as target v1-0) mech mech-trans)) (let ((a0-4 (-> (the-as target v1-0) mech mech-quat quad))) (set! (-> self control quat quad) a0-4) ) - (set! (-> self control scale quad) (-> (the-as target v1-0) mech mech-scale quad)) + (vector-copy! (-> self control scale) (-> (the-as target v1-0) mech mech-scale)) (set! (-> self draw light-index) (-> (the-as target v1-0) draw light-index)) (let ((a0-10 (-> (the-as target v1-0) draw color-mult quad))) (set! (-> self draw color-mult quad) a0-10) @@ -1381,7 +1381,7 @@ (set! (-> s4-3 shield-strength) 8) (set! (-> s4-3 shield-type) (shield-type shield-type-0)) (if (new 'static 'vector :z -4096.0 :w 1.0) - (set! (-> s4-3 offset-vec quad) (-> (new 'static 'vector :z -4096.0 :w 1.0) quad)) + (vector-copy! (-> s4-3 offset-vec) (new 'static 'vector :z -4096.0 :w 1.0)) (vector-reset! (-> s4-3 offset-vec)) ) (let ((s3-1 (the-as process #f))) @@ -1509,18 +1509,18 @@ (let ((s5-0 (-> self control target-transv)) (gp-0 (-> self control transv-ctrl)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self control target-transv quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self control target-transv)) (target-bend-vel-turn gp-0) (target-add-slide-factor s5-0) (let ((t9-2 vector-xz-normalize!) (a0-5 (new-stack-vector0)) ) - (set! (-> a0-5 quad) (-> s5-0 quad)) + (vector-copy! a0-5 s5-0) (let ((s4-0 (t9-2 a0-5 1.0))) (let ((t9-3 vector-xz-normalize!) (a0-6 (new-stack-vector0)) ) - (set! (-> a0-6 quad) (-> gp-0 quad)) + (vector-copy! a0-6 gp-0) (let ((v1-7 (t9-3 a0-6 1.0))) (set! (-> s4-0 y) 0.0) (set! (-> v1-7 y) 0.0) @@ -1601,8 +1601,8 @@ (let ((s3-0 (send-event-function (handle->process (-> self carry other)) a1-0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> self control trans quad)) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self control transv quad)) + (vector-copy! s4-0 (-> self control trans)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self control transv)) (let ((a2-1 (new 'stack-no-clear 'collide-query)) (v1-18 (-> self control)) ) @@ -1709,8 +1709,8 @@ (set! (-> v1-61 y) 0.0) (when (< (vector-dot v1-61 (-> self control c-R-w fvec)) 0.0) (set-time! (-> self mech back-touch-time)) - (set! (-> self mech back-touch-point quad) (-> self control wall-contact-pt quad)) - (set! (-> self mech back-touch-trans quad) (-> self control trans quad)) + (vector-copy! (-> self mech back-touch-point) (-> self control wall-contact-pt)) + (vector-copy! (-> self mech back-touch-trans) (-> self control trans)) ) ) ) @@ -1803,7 +1803,7 @@ (target-powerup-process) (vector+! (-> self mech mech-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control quat)) - (set! (-> self mech mech-scale quad) (-> self control scale quad)) + (vector-copy! (-> self mech mech-scale) (-> self control scale)) (vector+! (-> self alt-cam-pos) (-> self control camera-pos) (new 'static 'vector :y 4096.0 :w 1.0)) (set-time! (-> self mech mech-time)) (target-mech-effect) diff --git a/goal_src/jak3/engine/target/pilot-states.gc b/goal_src/jak3/engine/target/pilot-states.gc index a3690f2eedd..2c195e38e90 100644 --- a/goal_src/jak3/engine/target/pilot-states.gc +++ b/goal_src/jak3/engine/target/pilot-states.gc @@ -243,13 +243,13 @@ ) (#t (let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 10))) - (set! (-> gp-0 accel-array 7 quad) (-> gp-0 accel-array 6 quad)) - (set! (-> gp-0 accel-array 6 quad) (-> gp-0 accel-array 5 quad)) - (set! (-> gp-0 accel-array 5 quad) (-> gp-0 accel-array 4 quad)) - (set! (-> gp-0 accel-array 4 quad) (-> gp-0 accel-array 3 quad)) - (set! (-> gp-0 accel-array 3 quad) (-> gp-0 accel-array 2 quad)) - (set! (-> gp-0 accel-array 2 quad) (-> gp-0 accel-array 1 quad)) - (set! (-> gp-0 accel-array 1 quad) (-> gp-0 accel-array 0 quad)) + (vector-copy! (-> gp-0 accel-array 7) (-> gp-0 accel-array 6)) + (vector-copy! (-> gp-0 accel-array 6) (-> gp-0 accel-array 5)) + (vector-copy! (-> gp-0 accel-array 5) (-> gp-0 accel-array 4)) + (vector-copy! (-> gp-0 accel-array 4) (-> gp-0 accel-array 3)) + (vector-copy! (-> gp-0 accel-array 3) (-> gp-0 accel-array 2)) + (vector-copy! (-> gp-0 accel-array 2) (-> gp-0 accel-array 1)) + (vector-copy! (-> gp-0 accel-array 1) (-> gp-0 accel-array 0)) (get-linear-accel! s5-0 (the-as vector (-> gp-0 accel-array))) (vector-reset! (-> s4-0 0)) (vector+float*! (-> s4-0 0) (-> s4-0 0) (the-as vector (-> gp-0 accel-array)) 1.0) @@ -413,7 +413,7 @@ (let ((f0-0 v1-1) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> gp-0 local-accel quad)) + (vector-copy! s5-0 (-> gp-0 local-accel)) (set! (-> s5-0 x) (* 4.0 (-> s5-0 x))) (vector-float*! s5-0 s5-0 (/ 1.0 (sqrtf f0-0))) (let ((s4-0 (cond @@ -650,7 +650,7 @@ ) (else (vehicle-method-66 (the-as vehicle gp-0) (-> self control unknown-vector38) (-> self pilot seat-index)) - (set! (-> self control unknown-vector40 quad) (-> (the-as vehicle gp-0) root quat quad)) + (set! (-> self control unknown-quat40 quad) (-> (the-as vehicle gp-0) root quat quad)) ) ) ) @@ -658,7 +658,7 @@ :code (behavior () (logior! (-> self focus-status) (focus-status pilot)) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (sound-play "jump") (let ((gp-1 (if (zero? (-> self pilot stance)) jakb-pilot-bike-get-on-ja @@ -670,8 +670,8 @@ (set! (-> self control mod-surface) *pilot-get-on-mods*) (send-event (ppointer->process (-> self manipy)) 'draw #t) (set! (-> self neck flex-blend) 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) (ja :group! gp-1 :num! (seek!) :frame-num 0.0) ) (until (ja-done? 0) @@ -689,8 +689,8 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) @@ -701,7 +701,7 @@ (suspend) (let ((a1-8 (handle->process (-> self pilot vehicle)))) (if a1-8 - (set! (-> self alt-cam-pos quad) (-> (the-as vehicle a1-8) rbody position quad)) + (vector-copy! (-> self alt-cam-pos) (-> (the-as vehicle a1-8) rbody position)) ) ) (ja :num! (seek!)) @@ -794,8 +794,8 @@ (let ((v1-37 (camera-matrix)) (gp-2 (new 'stack-no-clear 'matrix)) ) - (set! (-> gp-2 rvec quad) (-> v1-37 rvec quad)) - (set! (-> gp-2 uvec quad) (-> v1-37 fvec quad)) + (vector-copy! (-> gp-2 rvec) (-> v1-37 rvec)) + (vector-copy! (-> gp-2 uvec) (-> v1-37 fvec)) (set! (-> gp-2 uvec y) 0.0) (vector-normalize! (-> gp-2 uvec) 1.0) (vector-reset! (-> gp-2 fvec)) @@ -902,7 +902,7 @@ :post (behavior () (vector+! (-> self pilot pilot-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self pilot pilot-quat)) (-> self control quat)) - (set! (-> self pilot pilot-scale quad) (-> self control scale quad)) + (vector-copy! (-> self pilot pilot-scale) (-> self control scale)) (target-no-ja-move-post) ) ) @@ -914,7 +914,7 @@ (let ((gp-0 *edge-grab-info*)) (mem-copy! (the-as pointer (-> gp-0 pilot-edge-grab)) (the-as pointer arg0) 40) (set! (-> gp-0 pilot-grab-interp) 0.0) - (set! (-> gp-0 pilot-start-grab-pos quad) (-> self control trans quad)) + (vector-copy! (-> gp-0 pilot-start-grab-pos) (-> self control trans)) (set! (-> gp-0 actor-handle) (-> arg0 handle)) ((-> target-edge-grab enter)) (let* ((s5-1 (handle->process (-> gp-0 actor-handle))) @@ -1016,17 +1016,18 @@ (logior! (-> self focus-status) (focus-status dead)) (case arg0 (('melt 'grenade 'explode) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (case arg0 (('dark-eco-pool) (sound-play "death-darkeco") (cond ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 62)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 62)) ) ) @@ -1035,11 +1036,11 @@ (sound-play "explosion") (cond ((logtest? (-> *part-group-id-table* 65 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 65)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 65)) ) ) @@ -1048,11 +1049,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -1064,7 +1065,8 @@ ) 0 (ja-channel-set! 0) - (suspend-for (seconds 1.8)) + (suspend-for (seconds 1.8) + ) ) (('endlessfall) (sound-play "death-fall") @@ -1093,7 +1095,8 @@ ) ) ) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) ) (('drown-death) (logclear! (-> self water flags) (water-flag swim-ground)) @@ -1115,7 +1118,8 @@ ) ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (('bot) (set! (-> self trans-hook) #f) @@ -1125,7 +1129,8 @@ ) ) (('big-explosion) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) ) (else ) diff --git a/goal_src/jak3/engine/target/target-darkjak.gc b/goal_src/jak3/engine/target/target-darkjak.gc index 2ec93ecb84e..96938875cee 100644 --- a/goal_src/jak3/engine/target/target-darkjak.gc +++ b/goal_src/jak3/engine/target/target-darkjak.gc @@ -131,11 +131,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 77 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s2-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s2-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 77)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s2-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s2-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 77)) ) ) @@ -222,7 +222,7 @@ (v1-20 (new 'stack-no-clear 'vector)) (f30-0 (/ (-> arg0 root root-prim local-sphere w) 2)) ) - (set! (-> v1-20 quad) (-> arg0 root trans quad)) + (vector-copy! v1-20 (-> arg0 root trans)) (vector+float*! (-> s5-0 start-pos) v1-20 *up-vector* 0.0) (set! (-> s5-0 move-dist quad) (the-as uint128 0)) (set! (-> s5-0 move-dist y) (- f30-0)) @@ -263,11 +263,11 @@ (sound-play "djak-strike-hit") (cond ((logtest? (-> *part-group-id-table* 76 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 76)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 76)) ) ) @@ -410,7 +410,7 @@ (set! (-> this trail) (create-launch-control (-> *part-group-id-table* 173) this)) (set! (-> this impact?) #f) (set! (-> this max-hits) 1000) - (set! (-> this fire-point quad) (-> this root trans quad)) + (vector-copy! (-> this fire-point) (-> this root trans)) (set! (-> this bolts) (new 'process 'boxed-array lightning-bolt 3)) (dotimes (s5-0 (-> this bolts length)) (set! (-> this bolts s5-0) (new 'process 'lightning-bolt)) @@ -418,7 +418,7 @@ ) (set! (-> this fire-sound) (new-sound-id)) (let ((a0-13 (-> this root transv))) - (set! (-> a0-13 quad) (-> this root transv quad)) + (vector-copy! a0-13 (-> this root transv)) (set! (-> a0-13 y) 0.0) (vector-normalize! a0-13 1.0) ) @@ -454,7 +454,7 @@ (set! (-> s2-0 span-pts-start data 0 quad) (-> arg0 quad)) ) (if arg1 - (set! (-> s2-0 span-pts-start data 1 quad) (-> arg1 quad)) + (vector-copy! (-> s2-0 span-pts-start data 1) arg1) ) (set! (-> s2-0 spans-internal data 1 num-inner-points) 0) (lightning-bolt-method-11 s2-0) @@ -589,17 +589,17 @@ (set! (-> *part-id-table* 624 init-specs 11 initial-valuef) (the-as float #x1)) (spawn (-> this ball1) s4-0) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> this root trans quad)) + (vector-copy! s3-1 (-> this root trans)) (let ((s2-0 matrix-f-u-compose) (s1-0 (new 'stack-no-clear 'matrix)) (a0-21 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-21 quad) (-> this root transv quad)) + (vector-copy! a0-21 (-> this root transv)) (set! (-> a0-21 y) 0.0) (let ((a1-10 (s2-0 s1-0 (vector-normalize! a0-21 1.0) *up-vector*))) (set! (-> s3-1 y) (-> this last-ground-height)) (+! (-> s3-1 y) 1638.4) - (set! (-> a1-10 trans quad) (-> s3-1 quad)) + (vector-copy! (-> a1-10 trans) s3-1) (spawn-from-mat (-> this trail) a1-10) ) ) @@ -1501,11 +1501,11 @@ (when (= (-> gp-3 best-other-tri pat mode) (pat-mode wall)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-3 best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> gp-3 best-other-tri intersect)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-3 best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> gp-3 best-other-tri intersect)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -1778,9 +1778,10 @@ (set! (-> s4-2 charge) 1.0) (set! (-> s4-2 options) (projectile-options)) (logclear! (-> s4-2 options) (projectile-options po14 po15 po16)) - (set! (-> s4-2 pos quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_rhand)) quad) - ) + (vector-copy! + (-> s4-2 pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_rhand)) + ) (set! (-> s4-2 notify-handle) (the-as handle #f)) (set! (-> s4-2 owner-handle) (the-as handle #f)) (set! (-> s4-2 target-handle) (the-as handle #f)) @@ -1965,7 +1966,7 @@ (set! (-> self darkjak stage) (-> self darkjak want-stage)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *roll-flip-mods*) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (set! sv-16 (the-as float 0.0)) (set! sv-20 (the-as float 1.0)) (ja-channel-push! 1 (seconds 0.15)) @@ -2101,11 +2102,11 @@ (set! (-> sv-160 y) (-> self control root-prim prim-core world-sphere y)) (cond ((logtest? (-> *part-group-id-table* 71 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-160 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-160) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 71)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-160 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-160) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 71)) ) ) diff --git a/goal_src/jak3/engine/target/target-death.gc b/goal_src/jak3/engine/target/target-death.gc index 001e8b66cbb..27fef54b919 100644 --- a/goal_src/jak3/engine/target/target-death.gc +++ b/goal_src/jak3/engine/target/target-death.gc @@ -63,7 +63,7 @@ (a2-0 (find-nearest-entity (-> arg0 trans) warp-gate)) ) (when a2-0 - (set! (-> s5-1 quad) (-> a2-0 extra trans quad)) + (vector-copy! s5-1 (-> a2-0 extra trans)) (+! (-> s5-1 y) 9011.2) (go target-warp-in s5-1 (-> arg0 trans) a2-0) ) @@ -267,7 +267,7 @@ (set! (-> s2-0 z) (* 4096.0 (the float (-> s0-0 user-int16 1)))) (set! sv-1328 (new 'stack-no-clear 'collide-query)) (set-vector! (-> sv-1328 move-dist) 0.0 -204800.0 0.0 1.0) - (set! (-> sv-1328 start-pos quad) (-> s2-0 quad)) + (vector-copy! (-> sv-1328 start-pos) s2-0) (+! (-> sv-1328 start-pos y) 102400.0) (let ((v1-20 sv-1328)) (set! (-> v1-20 radius) 409.6) @@ -309,7 +309,7 @@ (set! (-> s3-0 z) (* 4096.0 (the float (-> s0-0 user-int16 3)))) (let ((s1-1 (new 'stack-no-clear 'collide-query))) (set-vector! (-> s1-1 move-dist) 0.0 -204800.0 0.0 1.0) - (set! (-> s1-1 start-pos quad) (-> s3-0 quad)) + (vector-copy! (-> s1-1 start-pos) s3-0) (+! (-> s1-1 start-pos y) 102400.0) (let ((v1-33 s1-1)) (set! (-> v1-33 radius) 409.6) @@ -347,7 +347,7 @@ ) ) ) - (set! (-> arg0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> arg0 trans) s3-0) (vector-! s4-0 s3-0 s2-0) (set! (-> s4-0 y) 16384.0) (vector+! (-> arg0 camera-trans) s4-0 s3-0) @@ -388,7 +388,7 @@ ) (move-to-point! (-> self control) (-> arg0 trans)) (rot->dir-targ! (-> self control)) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) ) (else (format 0 "ERROR: failed to find '~S' for pos-from-entity~%" (-> arg0 on-goto)) @@ -502,9 +502,9 @@ ) :exit (behavior () (set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad)) - (set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad)) + (vector-copy! (-> *level* camera-pos 1) (-> *level* camera-pos 0)) (set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad)) - (set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad)) + (vector-copy! (-> *level* target-pos 1) (-> *level* target-pos 0)) (set! (-> *setting-control* user-default border-mode) (-> *level* play?)) (set! (-> *setting-control* user-default region-mode) #t) (kill-persister *setting-control* (the-as engine-pers 'title-control) 'render) @@ -530,7 +530,7 @@ (logclear! (-> self focus-status) (focus-status teleporting)) (set! (-> self mode-cache) #f) (set-time! (-> self teleport-time)) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (set! (-> self game kiosk-timeout) (-> *display* game-clock frame-counter)) 0 ) @@ -610,7 +610,7 @@ ) (move-to-point! (-> self control) (-> arg0 trans)) (rot->dir-targ! (-> self control)) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (vector-reset! (-> self control transv)) (if (not (string= (-> arg0 name) "default")) (set! *external-cam-mode* #f) @@ -649,7 +649,7 @@ (dotimes (s5-0 (-> arg0 want-count)) (when (not (or (not (-> arg0 want s5-0 name)) (not (-> arg0 want s5-0 display?)) - (= (status-of-level-and-borrows *level* (-> arg0 want s5-0 name) #f) 'active) + (= (level-status? *level* (-> arg0 want s5-0 name) #f) 'active) ) ) (set! v1-126 #t) @@ -660,7 +660,7 @@ (dotimes (s4-0 10) (when (not (or (not (-> s5-1 want s4-0 name)) (not (-> s5-1 want s4-0 display?)) - (= (status-of-level-and-borrows *level* (-> s5-1 want s4-0 name) #f) 'active) + (= (level-status? *level* (-> s5-1 want s4-0 name) #f) 'active) ) ) (set! v1-126 #t) @@ -727,7 +727,7 @@ (cam-start #t) (suspend) (when (not (string= (-> arg0 name) "default")) - (set! (-> *camera-combiner* trans quad) (-> arg0 camera-trans quad)) + (vector-copy! (-> *camera-combiner* trans) (-> arg0 camera-trans)) (let ((s5-4 (-> *camera-combiner* inv-camera-rot)) (s4-1 (-> arg0 camera-rot)) ) @@ -934,7 +934,7 @@ (gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 v1-1)) ) (set! (-> gp-1 y) 0.0) - (set! (-> self control force-turn-to-direction quad) (-> gp-1 quad)) + (vector-copy! (-> self control force-turn-to-direction) gp-1) (vector-xz-normalize! (-> self control force-turn-to-direction) 1.0) (set! (-> self control force-turn-to-speed) 1.0) (set! (-> self control unknown-floatiujh1bnb2n3i1) arg1) @@ -946,27 +946,25 @@ (defbehavior target-hit-effect target ((arg0 attack-info)) (cond ((logtest? (-> *part-group-id-table* 10 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) - (-> arg0 intersection) - (the-as vector (-> self control root-prim prim-core)) - ) - ) - quad + (vector-copy! + (-> *launch-matrix* trans) + (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (the-as vector (-> self control root-prim prim-core)) + ) ) - ) + ) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 10)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) - (-> arg0 intersection) - (the-as vector (-> self control root-prim prim-core)) - ) - ) - quad + (vector-copy! + (-> *launch-matrix* trans) + (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (the-as vector (-> self control root-prim prim-core)) + ) ) - ) + ) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 10)) ) ) @@ -1302,7 +1300,7 @@ ) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> self control trans quad)) + (vector-copy! s3-0 (-> self control trans)) (let ((s2-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (+ 32768.0 (vector-y-angle (-> arg0 vector))))) (f30-1 0.0) ) @@ -1425,7 +1423,7 @@ (set! (-> sv-32 damage) (fmax 1.0 (ceil (/ (-> sv-32 damage) 2)))) 0 ) - (set! (-> sv-36 quad) (-> sv-32 vector quad)) + (vector-copy! sv-36 (-> sv-32 vector)) (let ((f0-19 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) sv-36 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -1450,13 +1448,13 @@ (cond ((= (-> self game mode) 'debug) (let ((gp-1 (new-stack-vector0))) - (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! gp-1 (-> self control last-trans-on-ground)) (ja-channel-set! 0) (suspend-for (seconds 1) ) (move-to-point! (-> self control) gp-1) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-stance) ) @@ -1476,11 +1474,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -1497,11 +1495,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -1795,7 +1793,7 @@ (defun kill-nearby-enemies ((arg0 vector) (arg1 float)) (let ((v1-0 *kill-nearby-enemies-info*)) (set! (-> v1-0 dist) arg1) - (set! (-> v1-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 pos) arg0) ) (iterate-process-tree *entity-pool* @@ -2265,11 +2263,11 @@ (sound-play "death-darkeco") (cond ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 62)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 62)) ) ) @@ -2303,11 +2301,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 65 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 65)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 65)) ) ) @@ -2480,11 +2478,11 @@ ((or (= v1-61 'burn) (= v1-61 'burnup)) (cond ((logtest? (-> *part-group-id-table* 66 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 66)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 66)) ) ) @@ -2503,18 +2501,18 @@ ) (cond ((logtest? (-> gp-1 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group gp-1) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group gp-1) ) ) ) (let ((f30-0 (-> self control trans y))) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (logclear! (-> self water flags) (water-flag swim-ground)) (let ((v1-38 (new-stack-vector0))) (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) diff --git a/goal_src/jak3/engine/target/target-gun.gc b/goal_src/jak3/engine/target/target-gun.gc index 89d7b930feb..3dfe8a0f737 100644 --- a/goal_src/jak3/engine/target/target-gun.gc +++ b/goal_src/jak3/engine/target/target-gun.gc @@ -1565,21 +1565,18 @@ (defbehavior target-gun-build-track-list target () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (-> self gun track-dir))) - (set! (-> s4-0 quad) - (-> (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + (vector-copy! s4-0 (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + ) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + (-> self gun fire-dir) + (-> self control to-target-pt-xz) ) - (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) - ) - (-> self gun fire-dir) - (-> self control to-target-pt-xz) ) - quad - ) - ) (vector-flatten! s4-0 s4-0 (-> self control c-R-w uvec)) (vector-normalize! s4-0 1.0) (+! (-> gp-0 y) 6144.0) @@ -1681,15 +1678,15 @@ (gp-0 (set! (-> self gun track-target-hold-time) 0) (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) - (set! (-> self gun track-trans quad) (-> (get-trans gp-0 3) quad)) - (when ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) gp-0) + (vector-copy! (-> self gun track-trans) (get-trans gp-0 3)) + (when ((method-of-type focus focus-on!) (the-as focus (-> self gun track-target)) gp-0) (set-time! (-> self gun track-start-time)) (if (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) (set-time! (-> self gun track-press-start-time)) ) ) - (if (logtest? (process-mask->search-info-flag gp-0) (search-info-flag guard enemy attackable-priority)) - (try-update-focus (-> self gun track-target 1) gp-0) + (if (logtest? (get-search-info-flag gp-0) (search-info-flag guard enemy attackable-priority)) + (focus-on! (-> self gun track-target 1) gp-0) ) ) (else @@ -1728,7 +1725,7 @@ 0.5 ) ) - (logtest? (process-mask->search-info-flag (the-as process-focusable s5-2)) (search-info-flag abort)) + (logtest? (get-search-info-flag (the-as process-focusable s5-2)) (search-info-flag abort)) ) ) ) @@ -1737,16 +1734,16 @@ ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) ) (else - (let ((a0-67 (process-mask->search-info-flag (the-as process-focusable s5-2)))) + (let ((a0-67 (get-search-info-flag (the-as process-focusable s5-2)))) (cond ((and (not (not (or (zero? a0-67) (logtest? a0-67 (search-info-flag abort))))) (zero? (-> self gun track-target-hold-time)) ) (logclear! (-> self gun track?) (gun-track-flags gutflags-2)) - (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) + (vector-copy! (-> self gun track-trans) (get-trans (the-as process-focusable s5-2) 3)) ) (else - (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) + (vector-copy! (-> self gun track-trans) (get-trans (the-as process-focusable s5-2) 3)) ) ) ) @@ -1764,7 +1761,7 @@ (let ((s4-7 (get-trans (the-as process-focusable s5-3) 3))) (let ((s3-1 (new 'stack-no-clear 'vector4w))) (cond - ((and (logtest? (process-mask->search-info-flag (the-as process-focusable s5-3)) + ((and (logtest? (get-search-info-flag (the-as process-focusable s5-3)) (search-info-flag guard enemy attackable-priority) ) (transform-point-qword! s3-1 s4-7) @@ -1990,9 +1987,9 @@ gp-0 (current-time) ) - ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) gp-0) - (try-update-focus (-> self gun track-target 1) gp-0) - (set! (-> self gun track-trans quad) (-> (get-trans gp-0 3) quad)) + ((method-of-type focus focus-on!) (the-as focus (-> self gun track-target)) gp-0) + (focus-on! (-> self gun track-target 1) gp-0) + (vector-copy! (-> self gun track-trans) (get-trans gp-0 3)) (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) @@ -2175,15 +2172,15 @@ ) ) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self control trans quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self control trans)) (if (logtest? (surface-flag gun-no-twist) (-> self control current-surface flags)) (set! (-> self upper-body flex-blend) 0.0) (seek! (-> self upper-body flex-blend) 1.0 (* 8.0 (seconds-per-frame))) ) (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) - (set! (-> self gun top-anim-look-at quad) (-> self gun track-trans quad)) + (vector-copy! (-> self gun top-anim-look-at) (-> self gun track-trans)) (let ((gp-6 (new 'stack-no-clear 'vector))) - (set! (-> gp-6 quad) (-> self gun top-anim-look-at quad)) + (vector-copy! gp-6 (-> self gun top-anim-look-at)) (case (gun->eco (-> self gun gun-type)) (((pickup-type eco-yellow)) (+! (-> gp-6 y) -409.6) @@ -2221,9 +2218,7 @@ ) (cond ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) - (logtest? (process-mask->search-info-flag - (the-as process-focusable (handle->process (-> self gun track-target 0 handle))) - ) + (logtest? (get-search-info-flag (the-as process-focusable (handle->process (-> self gun track-target 0 handle)))) (search-info-flag guard enemy attackable-priority) ) ) @@ -2578,7 +2573,7 @@ ) (matrix-lerp! gp-0 a1-0 a2-0 (-> self gun gun-daxter)) (matrix->transformq (-> self gun gun-pos) gp-0) - (set! (-> self gun gun-pos scale quad) (-> self control scale quad)) + (vector-copy! (-> self gun gun-pos scale) (-> self control scale)) (when (and (using-gun? self) (and (focus-test? self edge-grab) (let ((v1-18 (ja-group))) (and v1-18 (or (= v1-18 jakb-jump-loop-ja) @@ -3454,9 +3449,9 @@ ;; WARN: Return type mismatch object vs none. (defun camera-rotate-to-vector ((arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (camera-matrix) fvec quad)) + (vector-copy! s4-0 (-> (camera-matrix) fvec)) (vector-flatten! s5-0 s5-0 arg1) (vector-normalize! s5-0 1.0) (vector-flatten! s4-0 s4-0 arg1) diff --git a/goal_src/jak3/engine/target/target-handler.gc b/goal_src/jak3/engine/target/target-handler.gc index 928d60bb035..9076d959bf7 100644 --- a/goal_src/jak3/engine/target/target-handler.gc +++ b/goal_src/jak3/engine/target/target-handler.gc @@ -144,27 +144,25 @@ ) (cond ((logtest? (-> *part-group-id-table* 10 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) - (-> self attack-info-rec intersection) - (the-as vector (-> self control root-prim prim-core)) - ) - ) - quad + (vector-copy! + (-> *launch-matrix* trans) + (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (the-as vector (-> self control root-prim prim-core)) + ) ) - ) + ) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 10)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) - (-> self attack-info-rec intersection) - (the-as vector (-> self control root-prim prim-core)) - ) - ) - quad + (vector-copy! + (-> *launch-matrix* trans) + (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (the-as vector (-> self control root-prim prim-core)) + ) ) - ) + ) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 10)) ) ) @@ -205,19 +203,20 @@ (lambda :behavior target () (let ((gp-0 (current-time))) - (suspend-for (seconds 1) (when (time-elapsed? gp-0 (seconds 0.03)) - (set! gp-0 (current-time)) - (process-drawable-shock-effect - *target* - (-> *lightning-spec-id-table* 1) - lightning-probe-callback - (-> *part-id-table* 160) - 0 - 0 - 40960.0 - ) - ) - ) + (suspend-for (seconds 1) + (when (time-elapsed? gp-0 (seconds 0.03)) + (set! gp-0 (current-time)) + (process-drawable-shock-effect + *target* + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) ) (none) ) @@ -371,7 +370,7 @@ ) (when sv-96 (let ((v1-17 (new 'stack-no-clear 'vector))) - (set! (-> v1-17 quad) (-> self control trans quad)) + (vector-copy! v1-17 (-> self control trans)) (set! sv-128 v1-17) ) (set! sv-132 (if arg2 @@ -404,7 +403,7 @@ ) arg0 ) - ) + ) ) (when arg0 (when (and s5-0 (not s2-1) (-> self control danger-mode) (not (logtest? (-> s5-0 mask) (process-mask dark-effect)))) @@ -481,11 +480,11 @@ ((1) (cond ((logtest? (-> *part-group-id-table* 11 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 11)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 11)) ) ) @@ -522,11 +521,11 @@ (when (or (zero? v1-105) (= v1-105 1)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -556,11 +555,11 @@ (when (or (zero? v1-147) (= v1-147 1)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -613,11 +612,11 @@ (when (or (zero? v1-199) (= v1-199 1)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -848,7 +847,7 @@ (('trans) (case (-> arg3 param 0) (('save) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (logior! (-> self target-flags) (target-flags tf12)) (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) ) @@ -900,7 +899,7 @@ (cond ((-> arg3 param 1) (logior! (-> self target-flags) (target-flags tf13)) - (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! (-> self alt-neck-pos) (the-as vector (-> arg3 param 1))) (look-at! (-> self neck) (-> self alt-neck-pos) 'force arg0) ) (else @@ -1056,7 +1055,7 @@ (set! (-> self water drip-wetness) 0.0) ) (('reset-height) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) #f ) (('draw) @@ -1202,7 +1201,7 @@ #t ) ((= v1-0 'push-transv) - (set! (-> self control additional-decaying-velocity quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self control additional-decaying-velocity) (the-as vector (-> arg3 param 0))) (set-time! (-> self control additional-decaying-velocity-end-time)) (set! (-> self control additional-decaying-velocity-decay-start-time) (+ (current-time) (the-as time-frame (-> arg3 param 1))) @@ -1210,7 +1209,7 @@ #t ) ((= v1-0 'launch) - (set! (-> self control transv quad) (-> (the-as vector (-> arg3 param 3)) quad)) + (vector-copy! (-> self control transv) (the-as vector (-> arg3 param 3))) (go target-jump (the-as float (-> arg3 param 0)) @@ -1220,7 +1219,7 @@ ) ((= v1-0 'launch-dir) (when (not (focus-test? self board)) - (set! (-> self control unknown-vector37 quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self control unknown-vector37) (the-as vector (-> arg3 param 0))) (set! (-> self control sliding-start-time) (the-as time-frame (-> arg3 param 1))) (set! (-> self control unknown-word04) (the-as uint (the-as float (-> arg3 param 2)))) (go target-launch-dir) @@ -1335,7 +1334,7 @@ (set! (-> s4-0 guard-type) (the-as uint 11)) (set! (-> s4-0 entity) #f) (vector-reset! (-> s4-0 velocity)) - (set! (-> s4-0 position quad) (-> self control trans quad)) + (vector-copy! (-> s4-0 position) (-> self control trans)) (quaternion-copy! (-> s4-0 rotation) (-> self control quat)) (set! (-> s4-0 id) (the-as uint 0)) (let ((v1-101 (vehicle-spawn (the-as vehicle-type (-> arg3 param 2)) s4-0))) @@ -1785,7 +1784,7 @@ ) (not (logtest? (-> self focus-status) (focus-status dead hit))) ) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (target-timed-invulnerable (seconds 0.1) self 1) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) diff --git a/goal_src/jak3/engine/target/target-invisible.gc b/goal_src/jak3/engine/target/target-invisible.gc index a59da774e32..75ce1e0fcc0 100644 --- a/goal_src/jak3/engine/target/target-invisible.gc +++ b/goal_src/jak3/engine/target/target-invisible.gc @@ -39,7 +39,7 @@ (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (send-event self 'end-mode 'lightjak) ) - (set! (-> self invisible-shadow-dir-backup quad) (-> self draw shadow-ctrl settings shadow-dir quad)) + (vector-copy! (-> self invisible-shadow-dir-backup) (-> self draw shadow-ctrl settings shadow-dir)) 0 (none) ) @@ -167,7 +167,7 @@ ) (when (= (-> self invisible-interp) 1.0) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (math-camera-pos) quad)) + (vector-copy! gp-0 (math-camera-pos)) (dotimes (s5-0 (-> *invis-joint-list* length)) (when (-> *invis-joint-list* s5-0 spawn?) (let ((v1-22 (-> *invis-joint-list* s5-0 joint)) @@ -420,7 +420,7 @@ (let ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 5324.8)) (a1-2 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) ) - (set! (-> a1-2 trans quad) (-> s5-1 quad)) + (vector-copy! (-> a1-2 trans) s5-1) (if (and (nonzero? (-> self part)) (not gp-0)) (spawn-from-mat (-> self part) a1-2) ) @@ -446,11 +446,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 182 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 182)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 182)) ) ) @@ -484,7 +484,7 @@ (let ((gp-2 (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 5324.8)) (a1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) ) - (set! (-> a1-4 trans quad) (-> gp-2 quad)) + (vector-copy! (-> a1-4 trans) gp-2) (spawn-from-mat (-> self part) a1-4) ) ) @@ -493,6 +493,7 @@ ) (defmethod init-from-entity! ((this dark-maker-idol) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) diff --git a/goal_src/jak3/engine/target/target-ladder.gc b/goal_src/jak3/engine/target/target-ladder.gc index c7d6790c5d6..b4bc91b9cb5 100644 --- a/goal_src/jak3/engine/target/target-ladder.gc +++ b/goal_src/jak3/engine/target/target-ladder.gc @@ -135,10 +135,10 @@ ) (set! (-> s5-0 z) (* -1597.44 (-> self ladder interp))) (vector-matrix*! (-> self control trans) s5-0 gp-2) - (set! (-> self control turn-to-alt-heading quad) (-> gp-2 fvec quad)) - (set! (-> self control local-normal quad) (-> gp-2 uvec quad)) - (set! (-> self control bent-gravity-normal quad) (-> gp-2 uvec quad)) - (set! (-> self control gspot-normal quad) (-> gp-2 uvec quad)) + (vector-copy! (-> self control turn-to-alt-heading) (-> gp-2 fvec)) + (vector-copy! (-> self control local-normal) (-> gp-2 uvec)) + (vector-copy! (-> self control bent-gravity-normal) (-> gp-2 uvec)) + (vector-copy! (-> self control gspot-normal) (-> gp-2 uvec)) ) ) (update-transforms (-> self control)) @@ -164,24 +164,13 @@ (set! (-> self ladder ladder) arg0) (set! (-> self ladder flip) -1.0) (set! (-> self ladder interp) 0.0) - (let* ((v1-10 (-> self ladder start-mat)) - (a3-0 (-> self node-list data 0 bone transform)) - (a0-4 (-> a3-0 rvec quad)) - (a1-1 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-10 rvec quad) a0-4) - (set! (-> v1-10 uvec quad) a1-1) - (set! (-> v1-10 fvec quad) a2-0) - (set! (-> v1-10 trans quad) a3-1) - ) + (matrix-copy! (-> self ladder start-mat) (-> self node-list data 0 bone transform)) (set! (-> self control bend-target) 1.0) (set-time! (-> self state-time)) (set! (-> self control mod-surface) *ladder-mods*) (logior! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) (target-collide-set! 'pole 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control transv)) (set! (-> self control transv quad) (the-as uint128 0)) ) :code (behavior ((arg0 handle)) diff --git a/goal_src/jak3/engine/target/target-launch.gc b/goal_src/jak3/engine/target/target-launch.gc index d4c4ea0eac2..164a36af2d9 100644 --- a/goal_src/jak3/engine/target/target-launch.gc +++ b/goal_src/jak3/engine/target/target-launch.gc @@ -28,7 +28,7 @@ (set! (-> self control unknown-vector37 y) (- (-> self control unknown-vector37 y) (* 0.5 (the-as float (-> self control unknown-word04)))) ) - (set! (-> self control unknown-vector39 quad) (-> self control trans quad)) + (set! (-> self control unknown-quat39 quad) (-> self control trans quad)) ) :exit (behavior () (target-state-hook-exit) @@ -37,7 +37,7 @@ (cond ((not (time-elapsed? (-> self state-time) (-> self control sliding-start-time))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self control unknown-vector37 quad)) + (vector-copy! s5-0 (-> self control unknown-vector37)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (set! (-> gp-0 quad) (-> self control unknown-vector37 quad)) (set! (-> gp-0 y) 0.0) @@ -59,13 +59,13 @@ (let ((f0-6 (- 1.0 f0-5))) (vector+float*! (-> self control trans) - (-> self control unknown-vector39) + (the-as vector (-> self control unknown-quat39)) (-> self control unknown-vector37) f0-6 ) (+! (-> self control trans y) (* (/ f0-6 2) f0-6 (the-as float (-> self control unknown-word04)))) (set! (-> self control transv quad) (the-as uint128 0)) - (set! (-> self control transv quad) (-> self control unknown-vector37 quad)) + (vector-copy! (-> self control transv) (-> self control unknown-vector37)) (+! (-> self control transv y) (* f0-6 (the-as float (-> self control unknown-word04)))) ) ) diff --git a/goal_src/jak3/engine/target/target-lightjak.gc b/goal_src/jak3/engine/target/target-lightjak.gc index b7096d5d7d1..051ece3947d 100644 --- a/goal_src/jak3/engine/target/target-lightjak.gc +++ b/goal_src/jak3/engine/target/target-lightjak.gc @@ -672,7 +672,7 @@ (vector-! s4-0 (camera-pos) (target-pos 0)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (set! (-> s5-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s5-0 (target-pos 0)) (reverse-transform-point! arg0 s5-0 s4-0 s3-0) ) arg0 @@ -1938,7 +1938,7 @@ (set! (-> self control mod-surface) *lightjak-swoop-mods*) (set-setting! 'string-min-height 'low (meters 1) 0) (set-setting! 'string-max-height 'low (meters 10) 0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) ) :exit (behavior () (remove-setting! 'board) @@ -2294,7 +2294,7 @@ (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) (set-vector! (-> this root scale) (* f0-4 (if (-> *pc-settings* use-vis?) 1.0 (-> *pc-settings* aspect-ratio-scale))) f0-4 f0-4 1.0) ) - (set! (-> gp-0 quad) (-> (camera-pos) quad)) + (vector-copy! gp-0 (camera-pos)) (vector-normalize-copy! s5-0 (-> s3-0 fvec) 1.0) (matrix->quaternion (-> this root quat) s3-0) (let ((v1-10 (-> this root trans))) @@ -2317,7 +2317,7 @@ (defbehavior freeze-screen-init freeze-screen ((arg0 vector) (arg1 quaternion) (arg2 entity)) (process-entity-set! self arg2) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self @@ -2640,7 +2640,7 @@ :code (behavior () (send-event (handle->process (-> self notify)) 'notify 'attack 27) (set! (-> self neck flex-blend) 0.0) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (if (logtest? (-> *part-group-id-table* 180 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -2675,15 +2675,17 @@ ) (cond ((logtest? (-> *part-group-id-table* 181 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) + ) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 181)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) + ) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 181)) ) ) @@ -2785,7 +2787,7 @@ ) ) (set! (-> self control dynam gravity-length) 122880.0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (let ((gp-0 jakb-lightjak-shield-ja)) (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) (ja-channel-push! 1 (seconds 0.05)) @@ -2911,11 +2913,11 @@ (ppointer->handle (cond ((logtest? (-> *part-group-id-table* 177 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 177)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 177)) ) ) @@ -3044,7 +3046,7 @@ (let ((f0-0 3.0)) (set-vector! (-> self root scale) f0-0 f0-0 f0-0 1.0) ) - (set! (-> gp-1 quad) (-> (get-trans s3-0 5) quad)) + (vector-copy! gp-1 (get-trans s3-0 5)) (vector-normalize-copy! s5-0 (-> s4-0 fvec) 0.0) (matrix->quaternion (-> self root quat) s4-0) (let ((v1-11 (-> self root trans))) diff --git a/goal_src/jak3/engine/target/target-part.gc b/goal_src/jak3/engine/target/target-part.gc index e2a14d1b2bc..e0164738eea 100644 --- a/goal_src/jak3/engine/target/target-part.gc +++ b/goal_src/jak3/engine/target/target-part.gc @@ -33,11 +33,7 @@ (defun birth-func-copy-target-y-rot ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((v1-0 *target*)) (when v1-0 - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (let ((f0-1 (+ -16384.0 (y-angle (-> v1-0 control))))) (matrix-rotate-y! s5-0 f0-1) ) @@ -60,7 +56,7 @@ (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-0 *target*) ) - (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (vector-copy! (-> s4-0 start-pos) (-> arg2 launchrot)) (set-vector! (-> s4-0 move-dist) 0.0 -20480.0 0.0 1.0) (+! (-> s4-0 start-pos y) 4096.0) (let ((v1-3 s4-0)) @@ -2526,7 +2522,7 @@ (a1-7 (-> *part-id-table* 157)) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> v1-13 quad)) + (vector-copy! (-> a2-3 trans) v1-13) (t9-7 a0-18 a1-7 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (suspend) @@ -2902,13 +2898,13 @@ (set! sv-768 (new 'stack-no-clear 'collide-query)) (set! sv-784 (the-as symbol #f)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> *up-vector* quad)) + (vector-copy! gp-0 *up-vector*) (when (nonzero? arg3) (set! sv-736 arg3) sv-736 ) (if (= arg3 256) - (set! (-> sv-768 start-pos quad) (-> arg0 root trans quad)) + (vector-copy! (-> sv-768 start-pos) (-> arg0 root trans)) (vector<-cspace! (-> sv-768 start-pos) (-> arg0 node-list data sv-736)) ) (set! sv-800 (-> sv-768 move-dist)) @@ -2935,9 +2931,9 @@ (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-768) 0.0) (set-time! (-> s5-0 last-valid-time)) (set! (-> s5-0 src-joint-index) (the-as uint sv-736)) - (set! (-> s5-0 end-pos quad) (-> sv-768 best-other-tri intersect quad)) + (vector-copy! (-> s5-0 end-pos) (-> sv-768 best-other-tri intersect)) (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-768 start-pos))) - (set! (-> gp-0 quad) (-> sv-768 best-other-tri normal quad)) + (vector-copy! gp-0 (-> sv-768 best-other-tri normal)) (set! sv-784 #t) (goto cfg-15) ) @@ -2983,7 +2979,7 @@ ) ) (let ((s4-1 (matrix-u-compose (new 'stack-no-clear 'matrix) gp-0 (the-as vector a2-2) (the-as vector a3-1)))) - (set! (-> s4-1 trans quad) (-> s5-0 end-pos quad)) + (vector-copy! (-> s4-1 trans) (-> s5-0 end-pos)) (vector+float*! (-> s4-1 trans) (-> s4-1 trans) gp-0 409.6) (if (logtest? (-> *part-group-id-table* 70 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -3039,7 +3035,7 @@ sv-656 ) (if (= arg4 256) - (set! (-> sv-688 start-pos quad) (-> arg0 root trans quad)) + (vector-copy! (-> sv-688 start-pos) (-> arg0 root trans)) (vector<-cspace! (-> sv-688 start-pos) (-> arg0 node-list data sv-656)) ) (set! sv-720 (-> sv-688 move-dist)) @@ -3066,7 +3062,7 @@ (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) (set-time! (-> s5-0 last-valid-time)) (set! (-> s5-0 src-joint-index) (the-as uint sv-656)) - (set! (-> s5-0 end-pos quad) (-> sv-688 best-other-tri intersect quad)) + (vector-copy! (-> s5-0 end-pos) (-> sv-688 best-other-tri intersect)) (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-688 start-pos))) (set! sv-704 #t) (goto cfg-21) @@ -3109,7 +3105,7 @@ (a0-30 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (vector-copy! (-> a2-5 trans) (-> s5-0 end-pos)) (t9-14 a0-30 arg3 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -3163,14 +3159,14 @@ (a1-14 arg4) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> sv-64 quad)) + (vector-copy! (-> a2-4 trans) sv-64) (t9-8 a0-20 a1-14 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (let ((t9-9 sp-launch-particles-var) (a0-21 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> sv-68 quad)) + (vector-copy! (-> a2-5 trans) sv-68) (t9-9 a0-21 arg4 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -3374,7 +3370,7 @@ (vector-normalize! sv-464 1.0) (quaternion-from-two-vectors! sv-480 s0-2 sv-464) (vector-orient-by-quat! s1-2 sv-448 sv-480) - (set! (-> s1-2 quad) (-> sv-448 quad)) + (vector-copy! s1-2 sv-448) (let ((a1-40 s2-1)) (let ((v1-56 sv-640)) (let ((a0-47 s1-2)) @@ -3399,10 +3395,10 @@ (+! (-> s4-1 state points-to-draw) 1) (set-point! s4-1 (-> s4-1 state points-to-draw) s2-1) (+! (-> s4-1 state points-to-draw) 1) - (set! (-> s3-1 quad) (-> s2-1 quad)) - (set! (-> s0-2 quad) (-> sv-464 quad)) - (set! (-> sv-448 quad) (-> s1-2 quad)) - (set! (-> sv-432 quad) (-> sv-640 quad)) + (vector-copy! s3-1 s2-1) + (vector-copy! s0-2 sv-464) + (vector-copy! sv-448 s1-2) + (vector-copy! sv-432 sv-640) (set! sv-576 (+ sv-576 1)) ) ) diff --git a/goal_src/jak3/engine/target/target-pilot.gc b/goal_src/jak3/engine/target/target-pilot.gc index afd37222008..289660c94a3 100644 --- a/goal_src/jak3/engine/target/target-pilot.gc +++ b/goal_src/jak3/engine/target/target-pilot.gc @@ -427,7 +427,7 @@ ) (when s5-0 (vehicle-method-66 (the-as vehicle s5-0) (-> self control trans) (-> gp-2 seat-index)) - (set! (-> self control transv quad) (-> (the-as vehicle s5-0) root transv quad)) + (vector-copy! (-> self control transv) (-> (the-as vehicle s5-0) root transv)) (quaternion-copy! (-> self control quat) (-> (the-as vehicle s5-0) root quat)) (quaternion-copy! (-> self control quat-for-control) (-> self control quat)) (quaternion-copy! (-> self control dir-targ) (-> self control quat)) @@ -437,7 +437,7 @@ (set! (-> s3-0 vec 2 x) 0.0) (set! (-> s3-0 vec 2 y) 20480.0) (let ((a0-18 (-> self node-list data 0 bone transform))) - (set! (-> s3-0 vec 1 quad) (-> a0-18 fvec quad)) + (vector-copy! (-> s3-0 vec 1) (-> a0-18 fvec)) ) (set! (-> s3-0 vec 1 y) 0.0) (vector-rotate90-around-y! (-> s3-0 vec 1) (-> s3-0 vec 1)) @@ -455,7 +455,7 @@ ) (set! (-> v1-48 action-mask) (collide-action solid)) ) - (set! (-> s3-0 cquery start-pos quad) (-> s3-0 vec 0 quad)) + (vector-copy! (-> s3-0 cquery start-pos) (-> s3-0 vec 0)) (vector-float*! (-> s3-0 cquery move-dist) (-> s3-0 vec 1) (-> s3-0 vec 2 y)) (let ((f0-10 (fill-and-probe-using-line-sphere *collide-cache* (-> s3-0 cquery)))) (when (and (>= f0-10 0.0) (= (-> s3-0 cquery best-other-tri pat mode) (pat-mode wall))) diff --git a/goal_src/jak3/engine/target/target-tube.gc b/goal_src/jak3/engine/target/target-tube.gc index b13a4aafc88..0c3d61c7c59 100644 --- a/goal_src/jak3/engine/target/target-tube.gc +++ b/goal_src/jak3/engine/target/target-tube.gc @@ -237,15 +237,15 @@ ) (vector-matrix*! s4-1 s4-1 (-> self control w-R-c)) (let ((f0-11 (-> self control transv-ctrl y))) - (set! (-> self control transv-ctrl quad) (-> s4-1 quad)) + (vector-copy! (-> self control transv-ctrl) s4-1) (set! (-> self control transv-ctrl y) f0-11) ) ) ) (let ((s4-2 (new 'stack-no-clear 'vector))) - (set! (-> s4-2 quad) (-> self tube downtube quad)) + (vector-copy! s4-2 (-> self tube downtube)) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> self tube sidetube quad)) + (vector-copy! s3-1 (-> self tube sidetube)) (vector-flatten! s3-1 s3-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* @@ -338,7 +338,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self tube old-transv quad) (-> self control transv quad)) + (vector-copy! (-> self tube old-transv) (-> self control transv)) (flag-setup) (build-conversions (-> self control transv)) (if (logtest? (-> self target-flags) (target-flags tinvuln1)) @@ -931,7 +931,7 @@ (t9-14 vector-normalize!) (a0-71 (new-stack-vector0)) ) - (set! (-> a0-71 quad) (-> self control transv quad)) + (vector-copy! a0-71 (-> self control transv)) (s5-2 s4-1 (t9-14 a0-71 1.0) (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ))) ) (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) @@ -1056,9 +1056,9 @@ (set! f28-0 (+ 0.01 f28-0)) ) (distance-from-tangent (-> self path) f30-0 s4-0 s5-0 gp-0 arg0) - (set! (-> self trans quad) (-> s4-0 quad)) - (set! (-> self rot quad) (-> s5-0 quad)) - (set! (-> self side quad) (-> gp-0 quad)) + (vector-copy! (-> self trans) s4-0) + (vector-copy! (-> self rot) s5-0) + (vector-copy! (-> self side) gp-0) (set! (-> self pos) f30-0) ) ) @@ -1151,6 +1151,7 @@ ) (defmethod init-from-entity! ((this slide-control) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak3/engine/target/target-turret-shot.gc b/goal_src/jak3/engine/target/target-turret-shot.gc index 8d375ba57fa..11d2b3918e7 100644 --- a/goal_src/jak3/engine/target/target-turret-shot.gc +++ b/goal_src/jak3/engine/target/target-turret-shot.gc @@ -281,7 +281,7 @@ (f28-1 (-> *part-id-table* 1021 init-specs 4 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 1021 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 1021 init-specs 4 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 1021) s4-1 :origin-is-matrix #t) @@ -299,15 +299,15 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector-copy! v1-2 (-> gp-0 trans)) (vector+! v1-2 v1-2 a0-3) (cond ((logtest? (-> *part-group-id-table* 234 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 234)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 234)) ) ) @@ -333,7 +333,7 @@ ;; WARN: Return type mismatch projectile-options vs none. (defmethod init-proj-settings! ((this turret-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 1228800.0) diff --git a/goal_src/jak3/engine/target/target-turret.gc b/goal_src/jak3/engine/target/target-turret.gc index 7d80f6ba618..8bcf214fb8a 100644 --- a/goal_src/jak3/engine/target/target-turret.gc +++ b/goal_src/jak3/engine/target/target-turret.gc @@ -1018,7 +1018,8 @@ (sound-stop (-> self sound-id 1)) (sound-stop (-> self sound-id 2)) (logior! (-> self focus-status) (focus-status disable ignore inactive)) - (suspend-for (seconds 0.8)) + (suspend-for (seconds 0.8) + ) (send-event (handle->process (-> self rider)) 'attack @@ -1059,15 +1060,15 @@ ) ) (let ((v1-10 (new 'stack-no-clear 'vector))) - (set! (-> v1-10 quad) (-> this root trans quad)) + (vector-copy! v1-10 (-> this root trans)) (+! (-> v1-10 y) 8192.0) (cond ((logtest? (-> *part-group-id-table* 235 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-10) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 235)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-10) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 235)) ) ) @@ -1223,7 +1224,7 @@ (while (< sv-592 s0-0) (vector+! s5-0 s1-0 s3-0) (vector-rotate-y! s3-0 s3-0 f30-0) - (set! (-> s2-0 start-pos quad) (-> s5-0 quad)) + (vector-copy! (-> s2-0 start-pos) s5-0) (set-vector! (-> s2-0 move-dist) 0.0 -24576.0 0.0 0.0) (+! (-> s2-0 start-pos y) 2048.0) (let ((v1-9 s2-0)) @@ -1236,7 +1237,7 @@ ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) (set! (-> s5-0 y) (+ 4096.0 (-> s2-0 best-other-tri intersect y))) - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) (return #t) ) (set! sv-592 (+ sv-592 1)) @@ -1251,8 +1252,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po13 po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg0 quad)) - (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1228800.0) quad)) + (vector-copy! (-> gp-0 pos) arg0) + (vector-copy! (-> gp-0 vel) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1228800.0)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1273,7 +1274,7 @@ (defmethod target-turret-method-49 ((this target-turret) (arg0 vector) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-normalize-copy! (-> s5-0 move-dist) arg1 arg2) (let ((v1-1 s5-0)) (set! (-> v1-1 radius) 2048.0) @@ -1341,6 +1342,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this target-turret) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (target-turret-method-36 this) (when arg0 @@ -1432,7 +1434,7 @@ :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 @@ -1491,7 +1493,7 @@ ) ) (if a0-16 - (set! (-> self alt-cam-pos quad) (-> (the-as process-drawable a0-16) root trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> (the-as process-drawable a0-16) root trans)) ) ) (vector-lerp! @@ -1506,8 +1508,8 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-1 ) ) @@ -1535,14 +1537,14 @@ ) ) (if a0-12 - (set! (-> self alt-cam-pos quad) (-> (the-as process-drawable a0-12) root trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> (the-as process-drawable a0-12) root trans)) ) ) (vector+float*! (-> self control trans) (-> self control unknown-vector37) gp-1 f30-0) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) @@ -1567,8 +1569,8 @@ ((< (ja-aframe-num 0) 76.0) (send-event (handle->process (-> self turret handle)) 'player-quat (-> self control dir-targ)) (set-quaternion! (-> self control) (-> self control dir-targ)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector39)) (-> self control quat-for-control)) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (quaternion-copy! (-> self control unknown-quat39) (-> self control quat-for-control)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) ) (else (let ((f30-1 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 76.0 95.0)))) @@ -1585,8 +1587,8 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-1 ) ) @@ -1619,8 +1621,8 @@ (suspend) (ja :num! (seek! max 1.2)) ) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector39)) (-> self control quat-for-control)) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (quaternion-copy! (-> self control unknown-quat39) (-> self control quat-for-control)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector38) (-> self control unknown-vector37)) ) @@ -1635,8 +1637,8 @@ (vector+float*! (-> self control trans) (-> self control unknown-vector37) gp-1 f0-11) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f0-11 ) ) @@ -2063,11 +2065,11 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self target-flags) (target-flags tf2 tf5 lleg-still rleg-still lleg-no-ik rleg-no-ik)) (logior! (-> self focus-status) (focus-status disable grabbed)) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) (send-event (handle->process arg0) 'player-pos (-> self control unknown-vector38)) - (send-event (handle->process arg0) 'player-quat (-> self control unknown-vector40)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (send-event (handle->process arg0) 'player-quat (-> self control unknown-quat40)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (sound-play "jump" :vol 70) (case (-> self turret turret-type) (('turret) @@ -2086,7 +2088,7 @@ ) ) (send-event (handle->process arg0) 'change-mode) - (set! (-> self turret trans quad) (-> self control trans quad)) + (vector-copy! (-> self turret trans) (-> self control trans)) (set! (-> self turret turret) (the-as (pointer process) #f)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *empty-mods*) @@ -2109,7 +2111,7 @@ (rot->dir-targ! (-> self control)) (set! (-> self neck flex-blend) 0.0) (send-event (handle->process (-> self turret handle)) 'player-pos (-> self turret trans)) - (set! (-> self control unknown-vector40 quad) (-> self control quat quad)) + (set! (-> self control unknown-quat40 quad) (-> self control quat quad)) (case (-> self turret turret-type) (('turret 'scorpion) (target-turret-get-off-play) @@ -2118,8 +2120,8 @@ (target-for-turret-get-off-play) ) (else - (set! (-> self control trans quad) (-> self control unknown-vector38 quad)) - (quaternion-copy! (-> self control quat-for-control) (the-as quaternion (-> self control unknown-vector40))) + (vector-copy! (-> self control trans) (-> self control unknown-vector38)) + (quaternion-copy! (-> self control quat-for-control) (-> self control unknown-quat40)) (rot->dir-targ! (-> self control)) (logior! (-> self skel status) (joint-control-status sync-math)) ) diff --git a/goal_src/jak3/engine/target/target-util.gc b/goal_src/jak3/engine/target/target-util.gc index 1b2c6fdf90d..fbee96c345d 100644 --- a/goal_src/jak3/engine/target/target-util.gc +++ b/goal_src/jak3/engine/target/target-util.gc @@ -505,7 +505,7 @@ (-> *TARGET-bank* spin-offset) (+ 8192.0 (-> *TARGET-bank* spin-radius)) ) - (set! (-> self control root-prim local-sphere quad) (-> s4-0 local-sphere quad)) + (vector-copy! (-> self control root-prim local-sphere) (-> s4-0 local-sphere)) ) (('spin 'spin-air 'get-on) (sphere<-vector+r! @@ -1198,7 +1198,7 @@ (defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> arg2 quad)) + (vector-copy! s2-0 arg2) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((s3-0 (-> this control c-R-w)) @@ -1307,7 +1307,7 @@ (defun find-collision-below ((arg0 vector) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 start-pos) arg1) (set-vector! (-> s5-0 move-dist) 0.0 (- arg2) 0.0 1.0) (let ((v1-2 s5-0)) (set! (-> v1-2 radius) 40.96) @@ -1320,7 +1320,7 @@ (set! (-> v1-2 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) - (set! (-> arg0 quad) (-> s5-0 best-other-tri intersect quad)) + (vector-copy! arg0 (-> s5-0 best-other-tri intersect)) #t ) ) @@ -1717,7 +1717,7 @@ ) (cond ((logtest? (attack-mask attacker-velocity) (-> this mask)) - (set! (-> arg0 attacker-velocity quad) (-> this attacker-velocity quad)) + (vector-copy! (-> arg0 attacker-velocity) (-> this attacker-velocity)) (vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0) ) (v1-0 @@ -1725,13 +1725,13 @@ (s5-0 (vector-! (-> arg0 trans) (-> v1-0 root trans) (-> s5-0 root trans)) (vector-normalize! (-> arg0 trans) 1.0) - (set! (-> arg0 attacker-velocity quad) (-> arg0 trans quad)) + (vector-copy! (-> arg0 attacker-velocity) (-> arg0 trans)) ) (else (vector-z-quaternion! (-> arg0 trans) (-> v1-0 root quat)) (vector-negate-in-place! (-> arg0 trans)) (vector-normalize! (-> arg0 trans) 1.0) - (set! (-> arg0 attacker-velocity quad) (-> arg0 trans quad)) + (vector-copy! (-> arg0 attacker-velocity) (-> arg0 trans)) ) ) ) @@ -1742,8 +1742,8 @@ ) ) (if s5-0 - (set! (-> arg0 intersection quad) (-> s5-0 root trans quad)) - (set! (-> arg0 intersection quad) (-> (target-pos 0) quad)) + (vector-copy! (-> arg0 intersection) (-> s5-0 root trans)) + (vector-copy! (-> arg0 intersection) (target-pos 0)) ) ) (.lvf vf1 (&-> (-> arg0 trans) quad)) @@ -1755,7 +1755,7 @@ (.mov v1-14 vf1) (cond ((!= v1-14 0.0) - (set! (-> arg0 vector quad) (-> arg0 trans quad)) + (vector-copy! (-> arg0 vector) (-> arg0 trans)) (set! (-> arg0 vector y) 0.0) (vector-xz-normalize! (-> arg0 vector) 1.0) ) @@ -1847,10 +1847,10 @@ (set! (-> this rotate-to) (-> arg0 rotate-to)) ) (if (logtest? s4-0 (attack-mask intersection)) - (set! (-> this intersection quad) (-> arg0 intersection quad)) + (vector-copy! (-> this intersection) (-> arg0 intersection)) ) (if (logtest? (attack-mask attacker-velocity) s4-0) - (set! (-> this attacker-velocity quad) (-> arg0 attacker-velocity quad)) + (vector-copy! (-> this attacker-velocity) (-> arg0 attacker-velocity)) ) (cond ((not (logtest? s4-0 (attack-mask vector))) @@ -1861,7 +1861,7 @@ ) ) (when (and v1-65 (nonzero? (-> v1-65 root))) - (set! (-> this trans quad) (-> v1-65 root trans quad)) + (vector-copy! (-> this trans) (-> v1-65 root trans)) (vector-! (-> this vector) (-> arg1 root trans) (-> v1-65 root trans)) (logior! (-> this mask) (attack-mask vector)) ) @@ -1875,10 +1875,10 @@ ) ) (if (and v1-72 (nonzero? (-> v1-72 root))) - (set! (-> this trans quad) (-> v1-72 root trans quad)) + (vector-copy! (-> this trans) (-> v1-72 root trans)) ) ) - (set! (-> this vector quad) (-> arg0 vector quad)) + (vector-copy! (-> this vector) (-> arg0 vector)) (when (not (logtest? s4-0 (attack-mask shove-back))) (let ((v1-79 (-> this vector))) (set! (-> this shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z))))) @@ -1893,7 +1893,7 @@ (set! (-> this dist) (fabs (-> this shove-back))) ) (if (logtest? s4-0 (attack-mask trans)) - (set! (-> this trans quad) (-> arg0 trans quad)) + (vector-copy! (-> this trans) (-> arg0 trans)) ) ) this @@ -2026,7 +2026,7 @@ ) ((logtest? (-> gp-0 target-flags) (target-flags tf14)) (let ((s5-0 (new 'static 'vector))) - (set! (-> s5-0 quad) (-> gp-0 control camera-pos quad)) + (vector-copy! s5-0 (-> gp-0 control camera-pos)) (set! (-> s5-0 y) (fmax (-> s5-0 y) (-> gp-0 alt-cam-pos y))) (add-debug-sphere *display-camera-marks* @@ -2077,7 +2077,7 @@ (not (logtest? (focus-status mech) (-> this focus-status))) ) (set! v0-0 (new 'static 'vector :w 1.0)) - (set! (-> v0-0 quad) (-> this control trans quad)) + (vector-copy! v0-0 (-> this control trans)) (set! (-> v0-0 y) (-> this water height)) v0-0 ) @@ -2097,7 +2097,7 @@ (cond ((logtest? (-> this draw status) (draw-control-status no-draw no-draw-temp)) (set! v0-0 (new 'static 'vector)) - (set! (-> v0-0 quad) (-> v1-0 trans quad)) + (vector-copy! v0-0 (-> v1-0 trans)) (vector+float*! v0-0 v0-0 (-> this control local-normal) 8192.0) ) (else @@ -2202,6 +2202,7 @@ ;; WARN: Return type mismatch float vs meters. (defmethod get-water-height ((this target)) + "Get the height of the water that we're in." (the-as meters (if (logtest? (-> this water flags) (water-flag active)) (-> this water surface-height) (-> this control trans y) @@ -2362,7 +2363,7 @@ (lambda :behavior target () (target-update-segs self) - (set! (-> self control trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (vector-copy! (-> self control trans) (-> (the-as process-drawable (-> self parent 0)) root trans)) (quaternion-copy! (-> self control quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) (none) ) diff --git a/goal_src/jak3/engine/target/target.gc b/goal_src/jak3/engine/target/target.gc index ff5e0b16eea..f0ed5580bb5 100644 --- a/goal_src/jak3/engine/target/target.gc +++ b/goal_src/jak3/engine/target/target.gc @@ -651,7 +651,7 @@ ) ) (let ((v0-2 (-> self control unknown-vector37))) - (set! (-> v0-2 quad) (-> self control trans quad)) + (vector-copy! v0-2 (-> self control trans)) v0-2 ) ) @@ -712,7 +712,7 @@ (cond (v1-57 (set! v0-1 (-> self control anim-collide-offset-local)) - (set! (-> v0-1 quad) (-> v1-57 quad)) + (vector-copy! v0-1 v1-57) ) (else (set! v0-1 (-> self control anim-collide-offset-local)) @@ -1106,7 +1106,7 @@ (a1-3 (-> self control unknown-dword08)) (a2-3 (-> self control unknown-vector37)) ) - (set! (-> a2-3 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (vector-copy! a2-3 (the-as vector (-> self control unknown-dword09))) (go target-launch (the-as float a0-7) (the-as symbol a1-3) a2-3 (-> self control unknown-dword10)) ) ) @@ -1378,7 +1378,7 @@ (a1-1 (-> self control unknown-dword08)) (a2-0 (-> self control unknown-vector37)) ) - (set! (-> a2-0 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (vector-copy! a2-0 (the-as vector (-> self control unknown-dword09))) (go target-launch (the-as float a0-21) (the-as symbol a1-1) a2-0 (-> self control unknown-dword10)) ) ) @@ -1498,7 +1498,7 @@ (a1-1 (-> self control unknown-dword08)) (a2-1 (-> self control unknown-vector37)) ) - (set! (-> a2-1 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (vector-copy! a2-1 (the-as vector (-> self control unknown-dword09))) (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-1 (-> self control unknown-dword10)) ) ) @@ -2715,11 +2715,11 @@ (when (= (-> s5-3 best-other-tri pat mode) (pat-mode wall)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s5-3 best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s5-3 best-other-tri intersect)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s5-3 best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s5-3 best-other-tri intersect)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -2941,7 +2941,7 @@ ) ) (set! (-> self control dynam gravity-length) 122880.0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -3456,7 +3456,7 @@ (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (vector-copy! (-> self control dynam gravity) (-> self control standard-dynamics gravity)) (set! (-> self neck flex-blend) 1.0) ) :trans (behavior () @@ -3560,7 +3560,7 @@ ) ) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (vector-copy! (-> self control dynam gravity) (-> self control standard-dynamics gravity)) (target-danger-set! 'flop-down #f) (let ((v1-56 (get-channel (-> self skel top-anim) 0))) (if (and v1-56 (= (-> v1-56 frame-group) jakb-gun-flop-down-ja)) diff --git a/goal_src/jak3/engine/target/target2.gc b/goal_src/jak3/engine/target/target2.gc index 3ff49c0e3e7..c119ee5eab8 100644 --- a/goal_src/jak3/engine/target/target2.gc +++ b/goal_src/jak3/engine/target/target2.gc @@ -298,7 +298,7 @@ (vector+float*! s5-1 s5-1 (-> gp-0 uvec) -4096.0) (vector+! (-> self gun fire-point) (camera-pos) s5-1) ) - (set! (-> self gun fire-dir-out quad) (-> gp-0 fvec quad)) + (vector-copy! (-> self gun fire-dir-out) (-> gp-0 fvec)) ) (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (target-gun-check) @@ -681,7 +681,7 @@ (set! (-> self control mod-surface) *pole-mods*) (logior! (-> self focus-status) (focus-status pole)) (target-collide-set! 'pole 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control transv)) (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #f)) @@ -906,7 +906,7 @@ (set-time! (-> self control edge-grab-start-time)) (logior! (-> self control root-prim prim-core action) (collide-action dont-push-away)) (logior! (-> self focus-status) (focus-status edge-grab)) - (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control transv)) (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) (if (!= (-> self skel top-anim interp) 0.0) @@ -1649,7 +1649,7 @@ (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) (set! sv-32 (current-time)) (let ((v1-2 (new-stack-vector0))) - (set! (-> v1-2 quad) (-> arg0 quad)) + (vector-copy! v1-2 arg0) (set! sv-40 v1-2) ) (set! sv-44 #t) @@ -1756,7 +1756,7 @@ ) :enter (behavior ((arg0 handle)) (set! (-> self control anim-handle) arg0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) (set! (-> self control unknown-word04) (the-as uint #t)) (quaternion-copy! (the-as quaternion (-> self control unknown-vector38)) (-> self control quat)) (logior! (-> self focus-status) (focus-status grabbed)) @@ -1866,7 +1866,7 @@ ;; og:preserve-this no debug hover when paused. ((and (cpad-hold? (-> self control cpad number) r2) (not *pause-lock*)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self control trans quad)) + (vector-copy! a1-0 (-> self control trans)) (let ((v1-14 (new-stack-vector0)) (f0-1 (vector-dot (-> self control dynam gravity-normal) a1-0)) ) @@ -1888,7 +1888,7 @@ ) ((cpad-hold? (-> self control cpad number) l2) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self control trans quad)) + (vector-copy! a1-1 (-> self control trans)) (let ((v1-29 (new-stack-vector0)) (f0-5 (vector-dot (-> self control dynam gravity-normal) a1-1)) ) diff --git a/goal_src/jak3/engine/ui/bigmap.gc b/goal_src/jak3/engine/ui/bigmap.gc index 0977c16dc73..0c82851a2ab 100644 --- a/goal_src/jak3/engine/ui/bigmap.gc +++ b/goal_src/jak3/engine/ui/bigmap.gc @@ -805,7 +805,7 @@ ) ) ) - (if (and (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (and (= (level-status? *level* 'ctywide #f) 'active) (not (or (= (-> s5-0 name) 'mhcitya) (= (-> s5-0 name) 'mhcityb))) ) (set! (-> this bigmap-index) (-> ctyport bigmap-id)) @@ -850,7 +850,7 @@ ;; WARN: Return type mismatch bigmap-flag vs none. (defmethod enable-drawing ((this bigmap)) (set-map-indices! this) - (set! (-> this offset quad) (-> *bigmap-info-array* data (-> this load-index) quad)) + (vector-copy! (-> this offset) (-> *bigmap-info-array* data (-> this load-index))) (let ((s4-0 (target-pos 0)) (s5-0 (-> this offset)) ) @@ -891,16 +891,16 @@ (set! (-> this drawing-flag) #t) (set! (-> this loading-flag) #f) (set! (-> this global-flags) (bigmap-flag)) - (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (= (level-status? *level* 'ctywide #f) 'active) (logior! (-> this global-flags) (bigmap-flag ctywide)) ) - (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (if (= (level-status? *level* 'waswide #f) 'active) (logior! (-> this global-flags) (bigmap-flag wasall)) ) - (if (= (status-of-level-and-borrows *level* 'wasall #f) 'active) + (if (= (level-status? *level* 'wasall #f) 'active) (logior! (-> this global-flags) (bigmap-flag waswide)) ) - (if (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (if (= (level-status? *level* 'desert #f) 'active) (logior! (-> this global-flags) (bigmap-flag desert)) ) (none) diff --git a/goal_src/jak3/engine/ui/minimap.gc b/goal_src/jak3/engine/ui/minimap.gc index 6da7ba236ce..75d1093c0db 100644 --- a/goal_src/jak3/engine/ui/minimap.gc +++ b/goal_src/jak3/engine/ui/minimap.gc @@ -1804,7 +1804,7 @@ (vector-reset! (-> s5-0 1)) (let ((s1-0 0)) (while (>= (-> arg1 node-count) s1-0) - (set! (-> s5-0 0 quad) (-> s5-0 1 quad)) + (vector-copy! (-> s5-0 0) (-> s5-0 1)) (cond ((< s1-0 (-> arg1 node-count)) (trail-graph-method-20 *trail-graph* (-> arg1 node-id s1-0) (-> s5-0 1)) @@ -1960,7 +1960,7 @@ (when s3-0 (when (not (logtest? (-> s3-0 flags) (minimap-flag active))) (set! (-> s3-0 class) s2-1) - (set! (-> s3-0 last-world-pos quad) (-> s2-1 default-position quad)) + (vector-copy! (-> s3-0 last-world-pos) (-> s2-1 default-position)) (vector-! (-> s3-0 last-relative-pos) (target-pos 0) (-> s3-0 last-world-pos)) (set! (-> s3-0 edge-ry) -131072) ) @@ -2150,7 +2150,7 @@ ) ) (set! (-> this last-name) (-> s4-0 s3-0 tex-name)) - (set! (-> this minimap-corner quad) (-> s4-0 s3-0 corner quad)) + (vector-copy! (-> this minimap-corner) (-> s4-0 s3-0 corner)) (set! (-> this meters-per-texel) (-> s4-0 s3-0 meters-per-texel)) (set! (-> this pos-scale) (-> s4-0 s3-0 pos-scale)) (set! (-> this level) s5-0) @@ -2182,7 +2182,7 @@ (let ((a0-23 (-> *minimap-texture-name-array* data (+ (* 5 s4-1) s5-1)))) (when a0-23 (set! (-> this last-name) a0-23) - (set! (-> this minimap-corner quad) (-> *minimap-corner-array* data (+ (* 5 s4-1) s5-1) quad)) + (vector-copy! (-> this minimap-corner) (-> *minimap-corner-array* data (+ (* 5 s4-1) s5-1))) (dotimes (v1-69 (-> *level* length)) (let ((a0-34 (-> *level* level v1-69))) (when (= (-> a0-34 status) 'active) @@ -2272,7 +2272,7 @@ (set! (-> this target-inv-scale) 0.5) ) ) - (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) + (seek! (-> this offset y) (-> this target-inv-scale) (/ f30-2 2)) ) (set! (-> this icon-inv-scale) (/ (* 32768.0 (-> this offset y)) (-> this meters-per-texel))) (set! (-> this map-inv-scale) @@ -2315,7 +2315,7 @@ (set! sv-220 (new 'stack-no-clear 'vector)) (set! sv-224 (new 'stack-no-clear 'matrix)) (set! sv-228 (new 'stack-no-clear 'matrix)) - (set! (-> sv-216 quad) (-> (#if PC_PORT (if (-> *pc-settings* minimap-force-north) *matrix-minimap-north* (matrix-world->local #f #f)) (matrix-world->local #f #f)) fvec quad)) + (vector-copy! sv-216 (-> (matrix-world->local #f #f) fvec)) (set! (-> sv-216 y) 0.0) (vector-normalize! sv-216 1.0) (vector-z-quaternion! sv-220 (-> (the-as process-drawable sv-16) root quat)) @@ -2601,7 +2601,7 @@ (set! sv-228 (new 'stack-no-clear 'matrix)) (set! sv-232 (new 'stack-no-clear 'matrix)) (when sv-212 - (set! (-> sv-220 quad) (-> (#if PC_PORT (if (-> *pc-settings* minimap-force-north) *matrix-minimap-north* (matrix-world->local #f #f)) (matrix-world->local #f #f)) fvec quad)) + (vector-copy! sv-220 (-> (matrix-world->local #f #f) fvec)) (set! (-> sv-220 y) 0.0) (vector-normalize! sv-220 1.0) (vector-z-quaternion! sv-224 (-> (the-as process-drawable sv-16) root quat)) @@ -2771,7 +2771,7 @@ (set! sv-228 (new 'stack-no-clear 'matrix)) (set! sv-232 (new 'stack-no-clear 'matrix)) (when sv-212 - (set! (-> sv-220 quad) (-> (#if PC_PORT (if (-> *pc-settings* minimap-force-north) *matrix-minimap-north* (matrix-world->local #f #f)) (matrix-world->local #f #f)) fvec quad)) + (vector-copy! sv-220 (-> (matrix-world->local #f #f) fvec)) (set! (-> sv-220 y) 0.0) (vector-normalize! sv-220 1.0) (vector-z-quaternion! sv-224 (-> (the-as process-drawable sv-16) root quat)) @@ -2950,17 +2950,17 @@ ) ) (set! (-> arg0 mat trans y) 0.0) - (set! (-> arg0 corner 0 x) (* 0.25 (-> this map-inv-scale))) - (set! (-> arg0 corner 0 z) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 0 x) (/ (-> this map-inv-scale) 4)) + (set! (-> arg0 corner 0 z) (/ (-> this map-inv-scale) 4)) (set! (-> arg0 corner 0 w) 1.0) - (set! (-> arg0 corner 1 x) (* -0.25 (-> this map-inv-scale))) - (set! (-> arg0 corner 1 z) (* 0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 1 x) (/ (-> this map-inv-scale) -4)) + (set! (-> arg0 corner 1 z) (/ (-> this map-inv-scale) 4)) (set! (-> arg0 corner 1 w) 1.0) - (set! (-> arg0 corner 2 x) (* 0.25 (-> this map-inv-scale))) - (set! (-> arg0 corner 2 z) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 2 x) (/ (-> this map-inv-scale) 4)) + (set! (-> arg0 corner 2 z) (/ (-> this map-inv-scale) -4)) (set! (-> arg0 corner 2 w) 1.0) - (set! (-> arg0 corner 3 x) (* -0.25 (-> this map-inv-scale))) - (set! (-> arg0 corner 3 z) (* -0.25 (-> this map-inv-scale))) + (set! (-> arg0 corner 3 x) (/ (-> this map-inv-scale) -4)) + (set! (-> arg0 corner 3 z) (/ (-> this map-inv-scale) -4)) (set! (-> arg0 corner 3 w) 1.0) (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) @@ -3280,7 +3280,7 @@ ) ) (when (and v1-4 (nonzero? (-> (the-as process-drawable v1-4) root))) - (set! (-> arg1 last-world-pos quad) (-> (the-as process-drawable v1-4) root trans quad)) + (vector-copy! (-> arg1 last-world-pos) (-> (the-as process-drawable v1-4) root trans)) (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) ) ) @@ -3300,18 +3300,18 @@ ) (cond (a0-16 - (set! (-> arg1 last-world-pos quad) (-> (the-as process-drawable a0-16) root trans quad)) + (vector-copy! (-> arg1 last-world-pos) (-> (the-as process-drawable a0-16) root trans)) (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) ) (else - (set! (-> arg1 last-world-pos quad) (-> (the-as entity-actor (-> arg1 position)) extra trans quad)) + (vector-copy! (-> arg1 last-world-pos) (-> (the-as entity-actor (-> arg1 position)) extra trans)) (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) ) ) ) ) (else - (set! (-> arg1 last-world-pos quad) (-> arg1 position quad)) + (vector-copy! (-> arg1 last-world-pos) (-> arg1 position)) (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) ) ) @@ -3321,7 +3321,7 @@ 1.0 0.0 (let ((f30-0 (/ 1.0 (* (-> this icon-inv-scale) (-> this meters-per-texel))))) - (set! (-> s3-2 quad) (-> arg1 last-relative-pos quad)) + (vector-copy! s3-2 (-> arg1 last-relative-pos)) (set! (-> s3-2 x) (* (-> s3-2 x) f30-0)) (set! (-> s3-2 z) (* (-> s3-2 z) f30-0)) (set! (-> s3-2 y) 0.0) @@ -3366,7 +3366,7 @@ ) ((< 50.0 f28-0) (let ((s0-0 (new 'stack-no-clear 'vector))) - (set! (-> s0-0 quad) (-> s3-2 quad)) + (vector-copy! s0-0 s3-2) (let ((s1-1 (get-icon-draw-pos *minimap* arg1 a2-2 s1-0 f30-0 s3-2))) (if (not s1-1) (vector-normalize-copy! s3-2 s0-0 50.0) @@ -3416,7 +3416,7 @@ (cond ((< 50.0 f28-0) (let ((a1-22 (new 'stack-no-clear 'vector))) - (set! (-> a1-22 quad) (-> s3-2 quad)) + (vector-copy! a1-22 s3-2) (vector-normalize-copy! s3-2 a1-22 54.0) ) (let ((f30-2 (atan (-> s3-2 x) (-> s3-2 z)))) @@ -3551,16 +3551,16 @@ (set! (-> gp-0 draw-pos quad) (-> arg1 quad)) (set! (-> gp-0 justify-right) arg2) (set! (-> gp-0 global-flags) (the-as uint 0)) - (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (= (level-status? *level* 'ctywide #f) 'active) (logior! (-> gp-0 global-flags) #x40000) ) - (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (if (= (level-status? *level* 'waswide #f) 'active) (logior! (-> gp-0 global-flags) #x100000) ) - (if (= (status-of-level-and-borrows *level* 'wasall #f) 'active) + (if (= (level-status? *level* 'wasall #f) 'active) (logior! (-> gp-0 global-flags) #x80000) ) - (if (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (if (= (level-status? *level* 'desert #f) 'active) (logior! (-> gp-0 global-flags) #x200000) ) (sub-draw-1-1 this gp-0) @@ -3892,24 +3892,16 @@ (let ((gp-0 (-> this flags))) (when (and (logtest? (minimap-flag local-only) gp-0) (not (logtest? (minimap-flag transport) gp-0))) (cond - ((and (logtest? (minimap-flag ctywide) gp-0) - (!= (status-of-level-and-borrows *level* 'ctywide 'ignore-borrow) 'active) - ) + ((and (logtest? (minimap-flag ctywide) gp-0) (!= (level-status? *level* 'ctywide 'ignore-borrow) 'active)) (return #f) ) - ((and (logtest? (minimap-flag wasall) gp-0) - (!= (status-of-level-and-borrows *level* 'wasall 'ignore-borrow) 'active) - ) + ((and (logtest? (minimap-flag wasall) gp-0) (!= (level-status? *level* 'wasall 'ignore-borrow) 'active)) (return #f) ) - ((and (logtest? (minimap-flag waswide) gp-0) - (!= (status-of-level-and-borrows *level* 'waswide 'ignore-borrow) 'active) - ) + ((and (logtest? (minimap-flag waswide) gp-0) (!= (level-status? *level* 'waswide 'ignore-borrow) 'active)) (return #f) ) - ((and (logtest? (minimap-flag desert) gp-0) - (!= (status-of-level-and-borrows *level* 'desert 'ignore-borrow) 'active) - ) + ((and (logtest? (minimap-flag desert) gp-0) (!= (level-status? *level* 'desert 'ignore-borrow) 'active)) (return #f) ) ) diff --git a/goal_src/jak3/engine/ui/progress/progress.gc b/goal_src/jak3/engine/ui/progress/progress.gc index 4fd910d4fb6..cbd2c314edc 100644 --- a/goal_src/jak3/engine/ui/progress/progress.gc +++ b/goal_src/jak3/engine/ui/progress/progress.gc @@ -326,10 +326,10 @@ (set! (-> self joint-idx) arg0) (set! (-> self init-angle) arg1) (set! (-> self graphic-index) arg2) - (set! (-> self root trans quad) (-> self parent 0 root trans quad)) + (vector-copy! (-> self root trans) (-> self parent 0 root trans)) (quaternion-copy! (-> self root quat) (-> self parent 0 root quat)) (quaternion-normalize! (-> self root quat)) - (set! (-> self root scale quad) (-> self parent 0 root scale quad)) + (vector-copy! (-> self root scale) (-> self parent 0 root scale)) (let ((gp-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* (-> self init-angle)))) (quaternion-normalize! gp-1) (quaternion*! (-> self root quat) (-> self root quat) gp-1) @@ -1324,7 +1324,7 @@ ) ) ) - (set! (-> s5-0 quad) (-> (the-as vector gp-1) quad)) + (vector-copy! s5-0 (the-as vector gp-1)) (with-dma-buffer-add-bucket ((v1-12 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha) ) @@ -1432,25 +1432,21 @@ (let ((s3-0 (-> self current-options y-center)) (s5-0 (-> self current-options y-space)) ) - (let ((s2-0 (new 'stack-no-clear 'matrix))) - (set! (-> s2-0 rvec quad) (the-as uint128 0)) - (set! (-> s2-0 uvec quad) (the-as uint128 0)) - (set! (-> s2-0 fvec quad) (the-as uint128 0)) - (set! (-> s2-0 trans quad) (the-as uint128 0)) - (let ((s4-0 *progress-work*)) - (mem-copy! (the-as pointer s2-0) (the-as pointer *font-default-matrix*) 64) - (set! sv-208 (new 'stack 'font-context s2-0 0 0 0.0 (font-color default) (font-flags shadow kerning))) - (set! sv-212 (- s3-0 (/ (* s5-0 (length gp-0)) 2))) - (set! sv-216 (new 'stack-no-clear 'hud-box)) - (set! sv-220 (and (!= (-> self current) 'main) (or (= (-> self next) 'none) (> (-> self state-pos) 0)))) - (progress-method-33 self (-> s4-0 small-screen)) - (when sv-220 - (begin-scan sv-216 self) - (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> self menu-transition)))))) - (when (not (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) - (progress-method-43 self (-> s4-0 small-screen) (* 144.0 f30-0)) - (progress-method-41 self (-> s4-0 small-screen) (* 128.0 f30-0)) - ) + (let ((s2-0 (new-stack-matrix0)) + (s4-0 *progress-work*) + ) + (mem-copy! (the-as pointer s2-0) (the-as pointer *font-default-matrix*) 64) + (set! sv-208 (new 'stack 'font-context s2-0 0 0 0.0 (font-color default) (font-flags shadow kerning))) + (set! sv-212 (- s3-0 (/ (* s5-0 (length gp-0)) 2))) + (set! sv-216 (new 'stack-no-clear 'hud-box)) + (set! sv-220 (and (!= (-> self current) 'main) (or (= (-> self next) 'none) (> (-> self state-pos) 0)))) + (progress-method-33 self (-> s4-0 small-screen)) + (when sv-220 + (begin-scan sv-216 self) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> self menu-transition)))))) + (when (not (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) + (progress-method-43 self (-> s4-0 small-screen) (* 144.0 f30-0)) + (progress-method-41 self (-> s4-0 small-screen) (* 128.0 f30-0)) ) ) ) @@ -2807,7 +2803,7 @@ (cond ((and (or (demo?) (kiosk?)) (or (= (-> arg0 current) 'select-kiosk-start) (= (-> arg0 current) 'select-kiosk-start-special)) - (= (status-of-level-and-borrows *level* 'title #f) 'active) + (= (level-status? *level* 'title #f) 'active) ) (send-event (handle->process (-> *game-info* controller 0)) 'control-spec (get-play-list-idx s5-1)) (set-master-mode 'game) @@ -4037,7 +4033,7 @@ (suspend-for (seconds 2.5) ) (while (or (not (handle-command-list *gui-control* (gui-channel alert) (the-as gui-connection #f))) - (= (status-of-level-and-borrows *level* 'title #f) 'active) + (= (level-status? *level* 'title #f) 'active) ) (suspend) ) diff --git a/goal_src/jak3/engine/util/script.gc b/goal_src/jak3/engine/util/script.gc index 23364dc4312..04fb3fb3be0 100644 --- a/goal_src/jak3/engine/util/script.gc +++ b/goal_src/jak3/engine/util/script.gc @@ -1100,7 +1100,7 @@ (set! (-> v1-66 name) 'level-status?) (set! (-> v1-66 spec) '((return macro (symbol)) (function macro (symbol)) (level eval (symbol)))) (set! (-> v1-66 func) - (lambda ((arg0 script-context)) (status-of-level-and-borrows *level* (the-as symbol (-> arg0 param 1)) #f)) + (lambda ((arg0 script-context)) (level-status? *level* (the-as symbol (-> arg0 param 1)) #f)) ) ) @@ -1521,7 +1521,7 @@ ) ) ((= v1-0 'hang) - (if (and (= (-> gp-0 type) target) (logtest? (state-flags sf26) (-> gp-0 state-flags))) + (if (and (= (-> gp-0 type) target) (logtest? (state-flags hang) (-> gp-0 state-flags))) (return #t) ) ) @@ -1546,7 +1546,7 @@ ) ) ((= v1-0 'invisible) - (if (and (= (-> gp-0 type) target) (logtest? (state-flags sf28) (-> gp-0 state-flags))) + (if (and (= (-> gp-0 type) target) (logtest? (state-flags invisible) (-> gp-0 state-flags))) (return #t) ) ) @@ -2981,7 +2981,7 @@ ) ) (if a0-3 - (toggle-status (the-as entity-actor a0-3) (entity-perm-status bit-7) (the-as symbol (-> arg0 param 2))) + (toggle-status (the-as entity-actor a0-3) (entity-perm-status special) (the-as symbol (-> arg0 param 2))) ) ) ) @@ -3359,7 +3359,7 @@ ) ) ) - (and s4-1 (or (not s5-1) (= (status-of-level-and-borrows *level* (the-as symbol s5-1) #f) 'active))) + (and s4-1 (or (not s5-1) (= (level-status? *level* (the-as symbol s5-1) #f) 'active))) ) (when (not (handle->process (-> gp-0 manager manager))) (let* ((s4-2 (get-process *default-dead-pool* (the-as type s4-1) #x4000 1)) @@ -3497,7 +3497,7 @@ (when (-> arg0 side-effect?) (let ((a0-2 (string->talker-speech (the-as string (-> arg0 param 1))))) (if a0-2 - (play-communicator-speech! a0-2) + (mark-played! a0-2) ) ) ) @@ -3517,7 +3517,7 @@ (a1-1 (command-get-int (-> arg0 param 2) 0)) ) (if s5-0 - (talker-speech-class-method-12 s5-0 a1-1) + (yes-play! s5-0 a1-1) ) ) ) @@ -3537,7 +3537,7 @@ (a1-1 (command-get-int (-> arg0 param 2) 0)) ) (if s5-0 - (talker-speech-class-method-13 s5-0 a1-1) + (no-play! s5-0 a1-1) ) ) ) diff --git a/goal_src/jak3/engine/util/sync-info.gc b/goal_src/jak3/engine/util/sync-info.gc index 10bdef39a7f..005522645a4 100644 --- a/goal_src/jak3/engine/util/sync-info.gc +++ b/goal_src/jak3/engine/util/sync-info.gc @@ -542,8 +542,8 @@ (defmethod set-params! ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> this value quad) (-> arg0 quad)) - (set! (-> this target quad) (-> arg0 quad)) + (vector-copy! (-> this value) arg0) + (vector-copy! (-> this target) arg0) ) (else (vector-reset! (-> this value)) diff --git a/goal_src/jak3/kernel/gkernel-h.gc b/goal_src/jak3/kernel/gkernel-h.gc index 45e2f85ec18..6b2ad730af3 100644 --- a/goal_src/jak3/kernel/gkernel-h.gc +++ b/goal_src/jak3/kernel/gkernel-h.gc @@ -257,7 +257,7 @@ (deactivate (_type_) none) (init-from-entity! (_type_ entity-actor) object) ;; todo check (run-logic? (_type_) symbol) - (process-tree-method-13 () none) + (entity-info-slot () none) ) :no-runtime-type ) diff --git a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc index c989fbac383..e5ea7e7e941 100644 --- a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc +++ b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs.gc @@ -92,7 +92,7 @@ (defmethod init ((this blow-tower-enemy)) (set! (-> this hit-points) 5.0) - (if (!= (status-of-level-and-borrows *level* 'lctyblow #f) 'active) + (if (!= (level-status? *level* 'lctyblow #f) 'active) (go empty-state) ) ) @@ -145,11 +145,11 @@ (logior! (-> this focus-status) (focus-status dead)) (cond ((logtest? (-> *part-group-id-table* 1457 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) ) @@ -172,8 +172,8 @@ (let ((f30-0 (get-damage-from-attack this s4-0 (the-as process-focusable arg0)))) (let ((s3-0 (new 'stack-no-clear 'attack-info))) (attack-info-method-9 s4-0 s3-0 (the-as process-drawable arg0) this) - (set! (-> this last-attack-dir quad) (-> s3-0 trans quad)) - (set! (-> this last-attack-pos quad) (-> s3-0 intersection quad)) + (vector-copy! (-> this last-attack-dir) (-> s3-0 trans)) + (vector-copy! (-> this last-attack-pos) (-> s3-0 intersection)) ) (set! (-> this hit-points) (- (-> this hit-points) f30-0)) (if (>= 0.0 (-> this hit-points)) @@ -316,8 +316,8 @@ (defmethod tower-flyer-method-46 ((this tower-flyer)) (cond ((-> this entity-pos) - (set! (-> this basetrans quad) (-> this entity-pos quad)) - (set! (-> this root trans quad) (-> this entity-pos quad)) + (vector-copy! (-> this basetrans) (-> this entity-pos)) + (vector-copy! (-> this root trans) (-> this entity-pos)) (let* ((s4-0 (handle->process (-> this focus))) (s5-0 (if (type? s4-0 process-focusable) (the-as process-focusable s4-0) @@ -326,9 +326,7 @@ ) (when s5-0 (let ((a0-9 (new 'stack-no-clear 'vector))) - (set! (-> a0-9 quad) - (-> (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root trans) (-> this root trans)) quad) - ) + (vector-copy! a0-9 (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root trans) (-> this root trans))) (set! (-> a0-9 y) 0.0) (let ((a1-5 (vector-normalize! a0-9 1.0))) (vector-! (-> this local-offset) (-> this basetrans) (-> s5-0 root trans)) @@ -344,19 +342,19 @@ (let ((s3-0 (new 'stack-no-clear 'quaternion))) (set! (-> s5-1 path) (the-as blow-tower-path (send-event (handle->process (-> this focus)) 'get-path))) (blow-tower-path-cursor-method-9 s5-1 (the-as int (-> this spawn-path-time))) - (set! (-> s4-1 quad) (-> s5-1 pos quad)) + (vector-copy! s4-1 (-> s5-1 pos)) (let ((s2-0 quaternion-look-at!) (s1-0 s3-0) (a0-22 (-> s5-1 norm)) ) - (set! (-> a0-22 quad) (-> s5-1 norm quad)) + (vector-copy! a0-22 (-> s5-1 norm)) (set! (-> a0-22 y) 0.0) (s2-0 s1-0 (vector-normalize! a0-22 1.0) *up-vector*) ) (send-event (handle->process (-> this focus)) 'retrieve-spot (-> this surround-spot) s4-1 s3-0) (let ((s2-1 (new 'stack-no-clear 'collide-query))) (let ((v1-33 (vector-z-quaternion! (new 'stack-no-clear 'vector) s3-0))) - (set! (-> s2-1 start-pos quad) (-> s4-1 quad)) + (vector-copy! (-> s2-1 start-pos) s4-1) (vector-float*! (-> s2-1 move-dist) v1-33 61440.0) ) (let ((v1-34 s2-1)) @@ -377,9 +375,9 @@ (vector+! s4-1 s4-1 (-> s2-1 move-dist)) ) ) - (set! (-> this basetrans quad) (-> s4-1 quad)) + (vector-copy! (-> this basetrans) s4-1) ) - (set! (-> this root trans quad) (-> this basetrans quad)) + (vector-copy! (-> this root trans) (-> this basetrans)) (let* ((s4-2 (handle->process (-> this focus))) (a1-20 (if (type? s4-2 process-focusable) (the-as process-focusable s4-2) @@ -602,7 +600,7 @@ (defun tower-fly-quick-raycast ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (let ((s4-0 (new 'stack 'collide-query))) - (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 start-pos) arg0) (vector-! (-> s4-0 move-dist) arg1 arg0) (let ((v1-3 s4-0)) (set! (-> v1-3 radius) arg3) @@ -617,11 +615,11 @@ (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) (cond ((!= f0-1 -100000000.0) - (set! (-> arg2 quad) (-> s4-0 best-other-tri intersect quad)) + (vector-copy! arg2 (-> s4-0 best-other-tri intersect)) (vector+float*! arg2 arg0 (-> s4-0 move-dist) f0-1) ) (else - (set! (-> arg2 quad) (-> arg1 quad)) + (vector-copy! arg2 arg1) ) ) f0-1 @@ -655,11 +653,11 @@ (s3-0 (new 'stack-no-clear 'vector)) (f30-0 (-> pp clock frames-per-second)) ) - (set! (-> s1-0 quad) (-> arg2 quad)) + (vector-copy! s1-0 arg2) (compute-tower-flyer-lerp-point this s3-0 arg0 s1-0 (* f30-0 (seconds-per-frame))) (set! *current-color* *color-red*) (when (= (tower-fly-quick-raycast (-> this basetrans) s3-0 (new 'stack-no-clear 'vector) 8192.0) -100000000.0) - (set! (-> arg2 quad) (-> s1-0 quad)) + (vector-copy! arg2 s1-0) (return #t) ) (let ((s2-0 (new 'stack-no-clear 'vector)) @@ -670,7 +668,7 @@ (compute-tower-flyer-lerp-point this s3-1 arg0 s2-0 (* f30-0 (seconds-per-frame))) (set! *current-color* *color-blue*) (when (= (tower-fly-quick-raycast s3-1 (-> this basetrans) (new 'stack-no-clear 'vector) 0.0) -100000000.0) - (set! (-> arg2 quad) (-> s2-0 quad)) + (vector-copy! arg2 s2-0) (return #t) ) (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) arg0 s2-0))) @@ -710,7 +708,7 @@ ) (set! *current-color* *color-white*) (when (= (tower-fly-quick-raycast (-> this basetrans) s3-1 (new 'stack-no-clear 'vector) 2048.0) -100000000.0) - (set! (-> arg2 quad) (-> s2-1 quad)) + (vector-copy! arg2 s2-1) (return #t) ) ) @@ -759,7 +757,7 @@ (set! sv-608 (new 'stack-no-clear 'collide-query)) (set! sv-612 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg1)) (set! sv-616 #t) - (set! (-> sv-608 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-608 start-pos) arg0) (vector-float*! (-> sv-608 move-dist) sv-612 (+ 16384.0 (-> this desired-z-dist))) (let ((v1-7 sv-608)) (set! (-> v1-7 radius) 4096.0) @@ -783,7 +781,7 @@ (f28-0 (vector-dot v1-15 sv-612)) ) (vector+float*! s4-0 arg0 sv-612 f28-0) - (set! (-> a1-5 start-pos quad) (-> this basetrans quad)) + (vector-copy! (-> a1-5 start-pos) (-> this basetrans)) (vector-! (-> a1-5 move-dist) s4-0 (-> a1-5 start-pos)) (let ((v1-21 a1-5)) (set! (-> v1-21 radius) 40.96) @@ -865,7 +863,7 @@ ) ) ) - (set! (-> this basetrans quad) (-> s4-0 quad)) + (vector-copy! (-> this basetrans) s4-0) ) (tower-flyer-method-48 this arg0) ) @@ -963,7 +961,7 @@ (defbehavior flyer-projectile-init-by-other flyer-projectile ((arg0 flyer-projectile-params) (arg1 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (mem-copy! (the-as pointer (-> self params)) (the-as pointer arg0) 20) (let ((gp-1 (new 'stack-no-clear 'vector))) (send-event (handle->process (-> self params target)) 'get-attack-pos gp-1) @@ -1165,7 +1163,7 @@ ) ) (if a0-4 - (set! (-> self track-pos quad) (-> (get-trans a0-4 2) quad)) + (vector-copy! (-> self track-pos) (get-trans a0-4 2)) ) ) (target-set! (-> self neck) (-> self track-pos)) @@ -1203,7 +1201,7 @@ (defbehavior bt-barrel-init-by-other bt-barrel ((arg0 vector)) (init self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (go-virtual idle) ) @@ -1256,9 +1254,10 @@ (when a0-8 (when (and (= (-> a0-8 type) bt-barrel) (< (-> this num-nearby-barrels) 16) (!= a0-8 this)) (set! (-> this nearby-barrels (-> this num-nearby-barrels)) (process->handle a0-8)) - (set! (-> this nearby-barrel-pos (-> this num-nearby-barrels) quad) - (-> (get-trans (the-as process-focusable a0-8) 3) quad) - ) + (vector-copy! + (-> this nearby-barrel-pos (-> this num-nearby-barrels)) + (get-trans (the-as process-focusable a0-8) 3) + ) (set! (-> this nearby-barrel-dist (-> this num-nearby-barrels)) (vector-vector-distance (-> this nearby-barrel-pos (-> this num-nearby-barrels)) (get-trans this 3)) ) @@ -1281,7 +1280,7 @@ (when (and s4-1 (< (vector-vector-distance (get-trans s4-1 0) s5-0) (-> s5-0 r))) (when (and (= (-> s4-1 type) bt-barrel) (< (-> this num-nearby-barrels) 16) (!= s4-1 this)) (set! (-> this nearby-barrels (-> this num-nearby-barrels)) (process->handle s4-1)) - (set! (-> this nearby-barrel-pos (-> this num-nearby-barrels) quad) (-> (get-trans s4-1 3) quad)) + (vector-copy! (-> this nearby-barrel-pos (-> this num-nearby-barrels)) (get-trans s4-1 3)) (set! (-> this nearby-barrel-dist (-> this num-nearby-barrels)) (vector-vector-distance (-> this nearby-barrel-pos (-> this num-nearby-barrels)) (get-trans this 3)) ) @@ -1506,11 +1505,11 @@ (count-nearby-barrels self) (cond ((logtest? (-> *part-group-id-table* 1460 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) @@ -1537,7 +1536,7 @@ (set-vector! (-> self draw color-mult) 0.2 0.2 0.2 0.0) (set-vector! (-> self draw color-emissive) 0.0 0.0 0.0 0.0) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (math-camera-matrix) rvec quad)) + (vector-copy! gp-0 (-> (math-camera-matrix) rvec)) (let* ((s5-0 vector-rotate-around-y!) (s4-0 gp-0) (s3-0 gp-0) @@ -1613,12 +1612,12 @@ ) :trans (behavior () (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) - (set! (-> a1-1 trans quad) (-> self root trans quad)) + (vector-copy! (-> a1-1 trans) (-> self root trans)) (spawn-from-mat (-> self part) a1-1) ) (set! (-> self root transv y) (- (-> self root transv y) (* 368640.0 (seconds-per-frame)))) (let ((gp-0 (new 'stack-no-clear 'collide-query))) - (set! (-> gp-0 start-pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> self root trans)) (vector-float*! (-> gp-0 move-dist) (-> self root transv) (seconds-per-frame)) (when (< (-> self root transv y) 40960.0) (let ((v1-14 gp-0)) @@ -1636,11 +1635,11 @@ (vector+float*! (-> self root trans) (-> self root trans) (-> gp-0 move-dist) f0-5) (cond ((logtest? (-> *part-group-id-table* 1457 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) ) @@ -1655,11 +1654,11 @@ (set! (-> self root trans y) 0.0) (cond ((logtest? (-> *part-group-id-table* 1457 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) ) @@ -1730,7 +1729,7 @@ (the-as pair 0) ) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (go-virtual idle) ) @@ -1764,17 +1763,17 @@ (local-vars (sv-48 vector) (sv-52 vector) (sv-80 vector) (sv-84 float) (sv-112 process) (sv-128 vector)) (set! sv-48 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> self root trans quad)) + (vector-copy! v1-1 (-> self root trans)) (set! sv-52 v1-1) ) (let ((a0-5 sv-48)) - (set! (-> a0-5 quad) (-> sv-48 quad)) + (vector-copy! a0-5 sv-48) (set! (-> a0-5 y) 0.0) (vector-normalize! a0-5 1.0) ) (dotimes (s2-0 arg0) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> sv-52 quad)) + (vector-copy! v1-4 sv-52) (set! sv-80 v1-4) ) (let* ((f30-0 (- (/ arg2 2))) @@ -1823,6 +1822,7 @@ ) (defmethod init-from-entity! ((this bt-barrel-stack) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (initialize-skeleton this @@ -1928,11 +1928,11 @@ (('die) (cond ((logtest? (-> *part-group-id-table* 1460 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) diff --git a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc index 580974c1495..dcb83597445 100644 --- a/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc +++ b/goal_src/jak3/levels/city/blow-tower/blow-tower-obs2.gc @@ -47,6 +47,7 @@ (defmethod init-from-entity! ((this bt-roboguard) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (with-pp (set! (-> pp level) (level-get *level* 'lblowtmh)) (bt-roboguard-method-44 this) @@ -59,7 +60,7 @@ (defbehavior bt-roboguard-init-by-other bt-roboguard ((arg0 vector)) (set! (-> self level) (level-get *level* 'lblowtmh)) (bt-roboguard-method-44 self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (init self) (go-virtual idle) @@ -99,11 +100,11 @@ (defmethod on-death ((this bt-roboguard)) (cond ((logtest? (-> *part-group-id-table* 1460 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) @@ -307,7 +308,7 @@ (when (time-elapsed? (-> self state-time) (seconds 0.3)) (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) - (set! (-> gp-0 start-pos quad) (-> self focus-pos quad)) + (vector-copy! (-> gp-0 start-pos) (-> self focus-pos)) (vector-! (-> gp-0 move-dist) (get-trans self 3) (-> self focus-pos)) (let ((v1-13 gp-0)) (set! (-> v1-13 radius) 409.6) @@ -435,7 +436,7 @@ (let ((v1-3 (joint-node bt-roboguard-lod0-jg chest)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (vector-copy! gp-0 (-> v1-3 bone transform fvec)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) (set! (-> gp-0 y) 0.0) (set! (-> s5-1 y) 0.0) @@ -578,8 +579,8 @@ (set! (-> gp-0 vehicle-impulse-factor) 4.0) (logior! (-> gp-0 options) (projectile-options po16)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -590,7 +591,7 @@ (defbehavior bt-roboguard-fire-backcheck bt-roboguard ((arg0 bt-roboguard) (arg1 vector) (arg2 vector)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 1.0))) - (set! (-> gp-0 start-pos quad) (-> (get-trans arg0 3) quad)) + (vector-copy! (-> gp-0 start-pos) (get-trans arg0 3)) (vector-! (-> gp-0 move-dist) arg1 (-> gp-0 start-pos)) (vector+float*! (-> gp-0 move-dist) (-> gp-0 move-dist) s5-0 8192.0) ) @@ -616,7 +617,7 @@ (v1-3 (-> this node-list data 4)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> v1-3 bone transform fvec quad)) + (vector-copy! s4-0 (-> v1-3 bone transform fvec)) (set! (-> s4-0 y) 0.0) (let ((f0-1 (vector-vector-xz-distance s5-0 (-> this focus-pos)))) (vector-normalize! s4-0 f0-1) @@ -731,7 +732,7 @@ (defmethod bt-mh-flyer-method-51 ((this bt-mh-flyer)) (let ((f30-0 0.3)) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> this bob-vec quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> this bob-vec)) (set! (-> this xz-dir x) (-> this bobbers 0 current-speed)) (set! (-> this xz-dir z) (/ (-> this bobbers 2 current-speed) 4)) (let ((f26-0 (lerp-scale 0.0 10922.667 (-> this xz-dir z) f30-0 1.0)) @@ -998,7 +999,7 @@ (defbehavior bt-grunt-init-by-other bt-grunt ((arg0 tower-enemy-init-params)) (set! (-> self level) (level-get *level* 'lblowtmh)) (bt-grunt-method-46 self) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (set! (-> self target) (-> arg0 target)) (quaternion-identity! (-> self root quat)) (set! (-> self jump-time-offset) (-> arg0 time-offset)) @@ -1011,6 +1012,7 @@ ) (defmethod init-from-entity! ((this bt-grunt) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (with-pp (set! (-> pp level) (level-get *level* 'lblowtmh)) (bt-grunt-method-46 this) @@ -1091,7 +1093,7 @@ (set! (-> this breathe-sound) (new-sound-id)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1459) this)) (let ((v0-8 (-> this start-pos))) - (set! (-> v0-8 quad) (-> this root trans quad)) + (vector-copy! v0-8 (-> this root trans)) v0-8 ) ) @@ -1099,7 +1101,7 @@ ;; WARN: Return type mismatch matrix vs none. (defmethod blow-tower-enemy-method-36 ((this bt-grunt)) (process-entity-status! this (entity-perm-status no-kill) #t) - (set! (-> this root trans quad) (-> this start-pos quad)) + (vector-copy! (-> this root trans) (-> this start-pos)) (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) (set! (-> this hit-points) 5.0) (set! (-> this rider-index) -1) @@ -1202,10 +1204,10 @@ (the-as int (- (-> self jump-cursor current-time) (the-as time-frame s3-0))) ) ) - (set! (-> self jump-cursor pos quad) (-> s4-1 pos quad)) + (vector-copy! (-> self jump-cursor pos) (-> s4-1 pos)) ) (let ((s4-2 (new 'stack-no-clear 'vector))) - (set! (-> s4-2 quad) (-> self jump-cursor pos quad)) + (vector-copy! s4-2 (-> self jump-cursor pos)) (let ((f28-0 (-> s4-2 y))) (set! (-> s4-2 y) (+ f28-0 (the-as float (send-event (handle->process (-> self target)) 'predict-height)))) ) @@ -1428,7 +1430,7 @@ ) (defmethod calculate-jump-trajectory ((this bt-grunt)) - (set! (-> this jump-start-pos quad) (-> this root trans quad)) + (vector-copy! (-> this jump-start-pos) (-> this root trans)) (quaternion-copy! (-> this jump-start-quat) (-> this root quat)) (let ((f30-0 (-> this jump-cursor pos y))) (set! (-> this jump-cursor pos y) @@ -1436,7 +1438,7 @@ ) ) (quaternion-look-at! (-> this jump-end-quat) (-> this jump-cursor norm) *up-vector*) - (set! (-> this jump-end-pos quad) (-> this jump-cursor pos quad)) + (vector-copy! (-> this jump-end-pos) (-> this jump-cursor pos)) (send-event (handle->process (-> this target)) 'rider-predict-transform @@ -1803,7 +1805,7 @@ (defmethod bt-grunt-method-54 ((this bt-grunt) (arg0 vector)) (let ((v1-2 (-> this node-list data 0 bone transform))) - (set! (-> arg0 quad) (-> this root trans quad)) + (vector-copy! arg0 (-> this root trans)) (vector+float*! arg0 arg0 (-> v1-2 uvec) 5324.8) (vector+float*! arg0 arg0 (-> v1-2 fvec) 4915.2) ) @@ -2050,7 +2052,7 @@ (cond ((send-event (handle->process (-> this target)) 'get-rider-transform (-> this rider-index) s4-0 s5-0) (set-vector! (-> this root scale) 1.1 1.1 1.1 1.0) - (set! (-> this root trans quad) (-> s4-0 quad)) + (vector-copy! (-> this root trans) s4-0) (quaternion-copy! (-> this root quat) s5-0) ) (else @@ -2120,7 +2122,7 @@ ) ) (let ((a0-39 (-> this last-attack-dir))) - (set! (-> a0-39 quad) (-> this last-attack-dir quad)) + (vector-copy! a0-39 (-> this last-attack-dir)) (set! (-> a0-39 y) 0.0) (vector-normalize! a0-39 1.0) ) @@ -2146,7 +2148,7 @@ :virtual #t :enter (behavior () (call-parent-state-handler enter) - (set! (-> self root trans quad) (-> self start-pos quad)) + (vector-copy! (-> self root trans) (-> self start-pos)) (set! (-> self entity extra vis-dist) 819200.0) ) :exit (behavior () @@ -2251,7 +2253,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (set! (-> self target) (-> arg0 target)) (set! (-> self chase-start-time) (-> arg0 activate-time)) (set! (-> self dumb-fire?) (-> arg0 bool-userdata?)) @@ -2271,14 +2273,14 @@ (let ((gp-1 (new 'stack 'blow-tower-path-cursor))) (when (send-event (handle->process (-> self target)) 'predict-position gp-1 (-> self root trans)) (blow-tower-path-cursor-method-9 gp-1 (the-as int (-> self chase-end-time))) - (set! (-> self dumb-dest quad) (-> gp-1 pos quad)) + (vector-copy! (-> self dumb-dest) (-> gp-1 pos)) (+! (-> self dumb-dest y) 8192.0) (let ((f30-1 (-> self dumb-dest y))) (set! (-> self dumb-dest y) (+ f30-1 (the-as float (send-event (handle->process (-> self target)) 'predict-height))) ) ) - (set! (-> self dumb-start quad) (-> self root trans quad)) + (vector-copy! (-> self dumb-start) (-> self root trans)) ) ) ) @@ -2457,7 +2459,7 @@ (set! (-> s5-3 root trans y) (-> this base-y)) ) (process-xform-list s5-3 s5-3 (the-as (inline-array xform) (-> this bob-xform)) 1) - (set! (-> this root trans quad) (-> s5-3 root trans quad)) + (vector-copy! (-> this root trans) (-> s5-3 root trans)) (let ((s3-3 (new 'stack-no-clear 'vector))) (set! (-> s3-3 x) (-> this bobbers 0 current-speed)) (set! (-> s3-3 y) (-> this bobbers 1 current-speed)) @@ -2508,11 +2510,11 @@ (let ((v1-3 (get-trans self 3))) (cond ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-3 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-3) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 218)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-3 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-3) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 218)) ) ) @@ -2591,7 +2593,7 @@ (vector-float*! s4-0 (-> this root transv) (seconds-per-frame)) (ragdoll-proc-method-15 (the-as ragdoll-proc s5-1) #f (the-as vector #f) #t) (ragdoll-method-23 (-> (the-as ragdoll-proc s5-1) ragdoll) (-> this root trans) s4-0 1.0 #t) - (set! (-> (the-as ragdoll-proc s5-1) ragdoll ragdoll-joints 0 velocity quad) (-> s4-0 quad)) + (vector-copy! (-> (the-as ragdoll-proc s5-1) ragdoll ragdoll-joints 0 velocity) s4-0) ) ) ) @@ -2691,7 +2693,7 @@ ) ) (set! (-> this main-joint-movement 0 quad) (-> a0-2 quad)) - (set! (-> this main-joint-movement 1 quad) (-> v1-1 quad)) + (vector-copy! (-> this main-joint-movement 1) v1-1) ) (let ((s4-0 (-> this main-joint-movement 1)) (s5-0 (-> this main-joint-movement 2)) @@ -2712,7 +2714,7 @@ 0.75 (quaternion-rotate-local-z! sv-208 a1-3 sv-192) (quaternion->matrix s5-0 sv-208) - (set! (-> s2-1 quad) (-> arg0 root scale quad)) + (vector-copy! s2-1 (-> arg0 root scale)) (scale-matrix! s5-0 s2-1 s5-0) (let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat))) (t9-6 vector-inv-orient-by-quat!) @@ -2756,7 +2758,7 @@ ) ) ) - (set! (-> s5-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 trans) s4-0) (spawn-from-mat (-> arg0 engine-part) s5-0) (lerp-scale 0.75 1.0 f28-0 1638.4 f30-0) ) @@ -2787,11 +2789,11 @@ (logior! (-> this focus-status) (focus-status dead)) (cond ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 218)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 218)) ) ) @@ -2835,6 +2837,7 @@ ) (defmethod enemy-common-post ((this kg-bombbot)) + "Common implementation of post. Runs ja-post." (if (< (seconds 20) (- (-> *blow-tower-targets* mission-time) (-> this start-time))) (go empty-state) ) @@ -2843,6 +2846,7 @@ ) (defmethod init-enemy! ((this kg-bombbot)) + "Typical place for shared init code. Runs from entity or process style init." (with-pp (set! (-> pp level) (level-get *level* 'lblowtkg)) (set! (-> this start-time) (-> *blow-tower-targets* mission-time)) @@ -2914,8 +2918,8 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-orient-by-quat! s3-0 (-> s4-0 pos-offset) (-> this root quat)) (vector+! s3-0 s3-0 (-> this root trans)) - (set! (-> s4-0 next-position quad) (-> s3-0 quad)) - (set! (-> s4-0 position quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 next-position) s3-0) + (vector-copy! (-> s4-0 position) s3-0) ) (set! (-> s4-0 delta-y) 0.0) ) @@ -2948,7 +2952,7 @@ ) (cond (s5-0 - (set! (-> this target-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-copy! (-> this target-pos) (get-trans s5-0 3)) (let ((v1-9 (-> this target-pos))) (let ((a0-9 (-> s5-0 root trans))) (let ((a1-5 (-> s5-0 root transv))) @@ -2964,9 +2968,9 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> v1-9 quad) vf6) ) - (set! (-> this start-target-pos quad) (-> this target-pos quad)) - (set! (-> this start-target-vel quad) (-> s5-0 root transv quad)) - (try-update-focus (-> this focus) s5-0 this) + (vector-copy! (-> this start-target-pos) (-> this target-pos)) + (vector-copy! (-> this start-target-vel) (-> s5-0 root transv)) + (focus-on! (-> this focus) s5-0 this) ) (else (clear-focused (-> this focus)) diff --git a/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc b/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc index a243f9d4c76..a51bb4a4d09 100644 --- a/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc +++ b/goal_src/jak3/levels/city/blow-tower/cty-blow-tower.gc @@ -353,7 +353,7 @@ ) (defmethod init-params ((this bt-vehicle)) - (set! (-> this path-pos quad) (-> this root trans quad)) + (vector-copy! (-> this path-pos) (-> this root trans)) (quaternion-identity! (-> this barrel-roll-quat)) (set! (-> this root penetrated-by) (penetrate)) (set! (-> this mission-fail?) #f) @@ -404,7 +404,7 @@ ) (defmethod bt-vehicle-method-35 ((this bt-vehicle) (arg0 int) (arg1 vector) (arg2 quaternion)) - (set! (-> arg1 quad) (-> this root trans quad)) + (vector-copy! arg1 (-> this root trans)) (quaternion-copy! arg2 (-> this root quat)) (bt-vehicle-method-36 this arg0 arg1 arg2) 0 @@ -444,11 +444,11 @@ (sound-play "snd-ship-explod") (cond ((logtest? (-> *part-group-id-table* 296 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 296)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 296)) ) ) @@ -490,7 +490,7 @@ (set! sv-100 (the-as float 0.0)) (let ((s2-0 (new 'stack-no-clear 'attack-info))) (attack-info-method-9 arg1 s2-0 arg2 this) - (set! (-> sv-64 quad) (-> s2-0 intersection quad)) + (vector-copy! sv-64 (-> s2-0 intersection)) ) (let ((a0-6 (if (type? arg2 process-focusable) arg2 @@ -498,13 +498,13 @@ ) ) (if a0-6 - (set! (-> sv-64 quad) (-> (get-trans a0-6 3) quad)) + (vector-copy! sv-64 (get-trans a0-6 3)) ) ) (vector-! sv-72 sv-64 sv-68) (set! (-> sv-72 y) 0.0) (let ((a0-8 sv-96)) - (set! (-> a0-8 quad) (-> sv-96 quad)) + (vector-copy! a0-8 sv-96) (set! (-> a0-8 y) 0.0) (vector-normalize! a0-8 1.0) ) @@ -752,7 +752,7 @@ (defmethod update-barrel-pos ((this bt-pickup) (arg0 vector) (arg1 vector) (arg2 quaternion)) (let ((v1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))) - (set! (-> arg0 quad) (-> this root trans quad)) + (vector-copy! arg0 (-> this root trans)) (vector+float*! arg0 arg0 (-> v1-1 uvec) 819.2) (vector+float*! arg0 arg0 (-> v1-1 rvec) 4096.0) (cond @@ -1037,11 +1037,11 @@ (sound-play "snd-hellcat-hit") (cond ((logtest? (-> *part-group-id-table* 1458 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> arg1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> arg1 intersection)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> arg1 intersection)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) ) @@ -1071,14 +1071,14 @@ ) (vector-z-quaternion! sv-48 sv-68) (let ((a0-8 sv-48)) - (set! (-> a0-8 quad) (-> sv-48 quad)) + (vector-copy! a0-8 sv-48) (set! (-> a0-8 y) 0.0) (vector-normalize! a0-8 1.0) ) (dotimes (s2-0 12) (when (= (-> this spots s2-0 rider-index) arg0) (let ((a0-9 (new 'stack-no-clear 'vector))) - (set! (-> a0-9 quad) (-> this spots s2-0 offset-dir quad)) + (vector-copy! a0-9 (-> this spots s2-0 offset-dir)) (set! (-> a0-9 y) 0.0) (let ((v1-18 (vector-normalize! a0-9 1.0))) 0.0 @@ -1087,7 +1087,7 @@ (set! sv-64 f0-5) (set! sv-56 s2-0) (if arg3 - (set! (-> arg3 quad) (-> v1-18 quad)) + (vector-copy! arg3 v1-18) ) ) ) @@ -1096,7 +1096,7 @@ ) ) (if arg2 - (set! (-> arg2 quad) (-> sv-48 quad)) + (vector-copy! arg2 sv-48) ) sv-56 ) @@ -1200,7 +1200,7 @@ ) (vector-z-quaternion! sv-240 sv-224) (let ((a0-14 sv-240)) - (set! (-> a0-14 quad) (-> sv-240 quad)) + (vector-copy! a0-14 sv-240) (set! (-> a0-14 y) 0.0) (vector-normalize! a0-14 1.0) ) @@ -1279,7 +1279,7 @@ (stack-size-set! (-> self main-thread) 256) (set! (-> self parent-vehicle) (the-as handle arg0)) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self root trans) (target-pos 0)) (quaternion-identity! (-> self root quat)) (matrix-identity! (-> self last-parent-xform)) (set! (-> self params) *bt-turret-params*) @@ -1334,7 +1334,7 @@ ) (('trans 'player-pos) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> this root trans quad)) + (vector-copy! v1-1 (-> this root trans)) (set! v0-0 (-> arg3 param 0)) (set! (-> (the-as vector v0-0) quad) (-> v1-1 quad)) ) @@ -1476,7 +1476,7 @@ :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 @@ -2053,7 +2053,7 @@ (vector-float*! (new 'stack-no-clear 'vector) (-> (camera-matrix) fvec) 1.0) sv-80 ) - (set! (-> this aim-pos quad) (-> sv-92 quad)) + (vector-copy! (-> this aim-pos) sv-92) (vector-! (-> this aim-dir) sv-92 (-> this root trans)) (vector-normalize! (-> this aim-dir) 1.0) (quaternion-look-at! (-> this root quat) (-> this aim-dir) *up-vector*) @@ -2079,7 +2079,7 @@ (not (logtest? (-> (the-as process-focusable a0-37) focus-status) (focus-status disable dead ignore inactive)) ) ) - (set! (-> this look-cursor pos quad) (-> (get-trans (the-as process-focusable a0-37) 3) quad)) + (vector-copy! (-> this look-cursor pos) (get-trans (the-as process-focusable a0-37) 3)) ) (else (set! (-> this look-mode) (the-as uint 0)) @@ -2089,7 +2089,7 @@ ) ) (else - (set! (-> this look-cursor pos quad) (-> v1-64 extra trans quad)) + (vector-copy! (-> this look-cursor pos) (-> v1-64 extra trans)) ) ) ) @@ -2106,7 +2106,7 @@ (not (logtest? (-> (the-as process-focusable a0-43) focus-status) (focus-status disable dead ignore inactive)) ) ) - (set! (-> this look-cursor pos quad) (-> (get-trans (the-as process-focusable a0-43) 3) quad)) + (vector-copy! (-> this look-cursor pos) (get-trans (the-as process-focusable a0-43) 3)) ) ) ) @@ -2119,12 +2119,12 @@ (cond ((zero? (-> this look-mode)) (let ((a0-47 s2-2)) - (set! (-> a0-47 quad) (-> s2-2 quad)) + (vector-copy! a0-47 s2-2) (set! (-> a0-47 y) 0.0) (vector-normalize! a0-47 1.0) ) (let ((a0-48 s4-12)) - (set! (-> a0-48 quad) (-> s4-12 quad)) + (vector-copy! a0-48 s4-12) (set! (-> a0-48 y) 0.0) (vector-normalize! a0-48 1.0) ) @@ -2145,14 +2145,14 @@ (when (handle->process (-> s1-0 grunt-rider-boarded?)) (let ((s2-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s1-0 root quat)))) (let ((a0-59 s2-3)) - (set! (-> a0-59 quad) (-> s2-3 quad)) + (vector-copy! a0-59 s2-3) (set! (-> a0-59 y) 0.0) (vector-normalize! a0-59 1.0) ) (vector-rotate-around-y! s2-3 s2-3 (-> s1-0 land-grunt-offset)) (let ((f0-33 (vector-dot s4-12 s2-3))) (when (< 0.2 f0-33) - (set! (-> s4-12 quad) (-> s2-3 quad)) + (vector-copy! s4-12 s2-3) (set! f30-0 6.0) ) ) @@ -2188,7 +2188,7 @@ (defbehavior bt-hellcat-init-by-other bt-hellcat ((arg0 bt-obj-init-params)) (init-collision! self) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (initialize-skeleton self @@ -2203,7 +2203,7 @@ ) (defmethod bt-hellcat-method-46 ((this bt-hellcat) (arg0 vector) (arg1 quaternion)) - (set! (-> arg0 quad) (-> this root trans quad)) + (vector-copy! arg0 (-> this root trans)) (quaternion-copy! arg1 (-> this root quat)) (vector<-cspace! arg0 (-> this node-list data 5)) (vector+float*! arg0 arg0 (-> this node-list data 5 bone transform uvec) 8192.0) @@ -2557,7 +2557,7 @@ ) ) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> (get-trans (the-as process-focusable sv-32) 3) quad)) + (vector-copy! s3-1 (get-trans (the-as process-focusable sv-32) 3)) (set! sv-80 s3-1) ) (set! sv-84 (new 'stack-no-clear 'vector)) @@ -2590,7 +2590,7 @@ (set! sv-136 (vector-vector-distance sv-132 sv-128)) (set! sv-136 (- sv-136 sv-224)) (let ((a1-11 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-11 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> a1-11 start-pos) (-> this root trans)) (vector-! (-> a1-11 move-dist) sv-80 (-> a1-11 start-pos)) (let ((v1-57 a1-11)) (set! (-> v1-57 radius) 40.96) @@ -2606,7 +2606,7 @@ (when (< sv-136 sv-16) (set! sv-20 sv-32) (set! sv-16 sv-136) - (set! (-> this hit-pos quad) (-> sv-80 quad)) + (vector-copy! (-> this hit-pos) sv-80) (set! sv-24 (-> this num-onscreen-targets)) ) (transform-point-qword! (-> sv-228 transformed-pos) sv-80) @@ -2650,7 +2650,7 @@ ) ) (let ((s3-10 (new 'stack-no-clear 'vector))) - (set! (-> s3-10 quad) (-> (get-trans (the-as process-focusable sv-784) 3) quad)) + (vector-copy! s3-10 (get-trans (the-as process-focusable sv-784) 3)) (set! sv-832 s3-10) ) (set! sv-836 (new 'stack-no-clear 'vector)) @@ -2683,7 +2683,7 @@ (set! sv-888 (vector-vector-distance sv-884 sv-880)) (set! sv-888 (- sv-888 sv-976)) (let ((a1-25 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-25 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> a1-25 start-pos) (-> this root trans)) (vector-! (-> a1-25 move-dist) sv-832 (-> a1-25 start-pos)) (let ((v1-133 a1-25)) (set! (-> v1-133 radius) 40.96) @@ -2699,7 +2699,7 @@ (when (< sv-888 sv-16) (set! sv-20 sv-784) (set! sv-16 sv-888) - (set! (-> this hit-pos quad) (-> sv-832 quad)) + (vector-copy! (-> this hit-pos) sv-832) (set! sv-24 (-> this num-onscreen-targets)) ) (transform-point-qword! (-> sv-980 transformed-pos) sv-832) @@ -2742,7 +2742,7 @@ ) ) (let ((s3-19 (new 'stack-no-clear 'vector))) - (set! (-> s3-19 quad) (-> (get-trans (the-as process-focusable sv-1536) 3) quad)) + (vector-copy! s3-19 (get-trans (the-as process-focusable sv-1536) 3)) (set! sv-1584 s3-19) ) (set! sv-1588 (new 'stack-no-clear 'vector)) @@ -2775,7 +2775,7 @@ (set! sv-1640 (vector-vector-distance sv-1636 sv-1632)) (set! sv-1640 (- sv-1640 sv-1728)) (let ((a1-39 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-39 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> a1-39 start-pos) (-> this root trans)) (vector-! (-> a1-39 move-dist) sv-1584 (-> a1-39 start-pos)) (let ((v1-208 a1-39)) (set! (-> v1-208 radius) 40.96) @@ -2791,7 +2791,7 @@ (when (< sv-1640 sv-16) (set! sv-20 sv-1536) (set! sv-16 sv-1640) - (set! (-> this hit-pos quad) (-> sv-1584 quad)) + (vector-copy! (-> this hit-pos) sv-1584) (set! sv-24 (-> this num-onscreen-targets)) ) (transform-point-qword! (-> sv-1732 transformed-pos) sv-1584) @@ -2850,7 +2850,7 @@ (set-time! (-> this last-fire-time)) (new 'stack 'projectile-init-by-other-params) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (new 'stack-no-clear 'vector) 491520.0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)) @@ -2867,7 +2867,7 @@ ) (sound-play "hc-gun-fire" :position (-> this root trans)) (let ((s4-2 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-2 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-2 start-pos) (-> this root trans)) (vector-! (-> s4-2 move-dist) (-> this hit-pos) (-> s4-2 start-pos)) (let ((v1-35 s4-2)) (set! (-> v1-35 radius) 1228.8) @@ -2886,27 +2886,25 @@ (sound-play "hellcat-riccos" :position s3-2) (cond ((logtest? (-> *part-group-id-table* 1461 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector+! - (new 'stack-no-clear 'vector) - s3-2 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-2 move-dist) -4096.0) - ) - quad - ) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector+! + (new 'stack-no-clear 'vector) + s3-2 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-2 move-dist) -4096.0) + ) + ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1461)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector+! - (new 'stack-no-clear 'vector) - s3-2 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-2 move-dist) -4096.0) - ) - quad - ) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector+! + (new 'stack-no-clear 'vector) + s3-2 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-2 move-dist) -4096.0) + ) + ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1461)) ) ) @@ -2974,7 +2972,7 @@ (cubic-curve-method-10 arg0 (-> s4-0 uvec) 0.0) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s4-0 uvec) (the-as rgba arg1)) (dotimes (s2-0 s3-0) - (set! (-> s4-0 rvec quad) (-> s4-0 uvec quad)) + (vector-copy! (-> s4-0 rvec) (-> s4-0 uvec)) (let ((f0-2 (/ (+ 1.0 (the float s2-0)) (the float s3-0)))) (cubic-curve-method-10 arg0 (-> s4-0 uvec) f0-2) ) @@ -3014,13 +3012,13 @@ (vector-lerp! (-> this path-pos) (-> this path-pos) (-> this path-cursor pos) f0-9) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> this pre-bounce-pos quad)) + (vector-copy! s2-0 (-> this pre-bounce-pos)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (set! (-> this pre-bounce-pos quad) (-> this path-pos quad)) + (vector-copy! (-> this pre-bounce-pos) (-> this path-pos)) (bt-vehicle-method-40 this (the-as int (-> s5-0 elapsed-clock-time))) (+! (-> this pre-bounce-pos y) (-> this path-height-offset)) (vector-! s4-0 s2-0 (-> this pre-bounce-pos)) @@ -3047,7 +3045,7 @@ (-> this root trans) ) ) - (set! (-> this last-vel quad) (-> s4-0 quad)) + (vector-copy! (-> this last-vel) s4-0) (set! (-> this last-speed) f30-0) ) ) @@ -3059,7 +3057,7 @@ (vector+! (-> this root trans) (-> this pre-bounce-pos) s4-1) ) (let ((v1-58 (new 'stack-no-clear 'vector))) - (set! (-> v1-58 quad) (-> this path-cursor norm quad)) + (vector-copy! v1-58 (-> this path-cursor norm)) (set! sv-256 v1-58) ) (set! sv-260 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) @@ -3170,7 +3168,7 @@ ) (vector-x-quaternion! s3-4 s5-3) (let ((a0-101 s3-4)) - (set! (-> a0-101 quad) (-> s3-4 quad)) + (vector-copy! a0-101 s3-4) (set! (-> a0-101 y) 0.0) (vector-normalize! a0-101 1.0) ) @@ -3207,7 +3205,7 @@ (defbehavior bt-pickup-init-by-other bt-pickup ((arg0 bt-obj-init-params)) (init-collision! self) (set-vector! (-> self root scale) 2.2 2.0 1.75 1.0) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (initialize-skeleton self @@ -3388,7 +3386,7 @@ (set! (-> s5-0 debug?) #f) (send-event (handle->process (-> this task-man)) 'get-clock s5-0) (blow-tower-path-cursor-method-9 (-> this path-cursor) (the-as int (-> s5-0 elapsed-clock-time))) - (set! (-> this root trans quad) (-> this path-cursor pos quad)) + (vector-copy! (-> this root trans) (-> this path-cursor pos)) (let ((f0-5 (* 4.0 (seconds-per-frame)))) (if (-> s5-0 debug?) (set! f0-5 1.0) @@ -3399,7 +3397,7 @@ ) (vector-lerp! (-> this path-pos) (-> this path-pos) (-> this path-cursor pos) f0-5) ) - (set! (-> this pre-bounce-pos quad) (-> this path-pos quad)) + (vector-copy! (-> this pre-bounce-pos) (-> this path-pos)) (bt-vehicle-method-40 this (the-as int (-> s5-0 elapsed-clock-time))) (+! (-> this pre-bounce-pos y) (-> this path-height-offset)) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -3409,7 +3407,7 @@ (vector+! (-> this root trans) (-> this pre-bounce-pos) s4-0) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this path-cursor norm quad)) + (vector-copy! s3-0 (-> this path-cursor norm)) (let ((s2-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (set! (-> s2-0 y) 0.0) (vector-normalize! s2-0 1.0) @@ -3805,7 +3803,7 @@ (set! (-> self event-cursor path) (-> *blow-tower-paths* 0)) (init-fields (-> self event-cursor)) (let ((s5-0 (new 'stack 'bt-obj-init-params))) - (set! (-> s5-0 pos quad) (-> *blow-tower-paths* 0 pts 0 quad)) + (vector-copy! (-> s5-0 pos) (-> *blow-tower-paths* 0 pts 0)) (quaternion-copy! (-> s5-0 quat) (quaternion-look-at! (new 'stack-no-clear 'quaternion) gp-1 *up-vector*)) (set! (-> s5-0 path) (-> *blow-tower-paths* 0)) (set! (-> s5-0 task-man) (process->handle self)) @@ -3819,7 +3817,7 @@ (vector-normalize! gp-4 1.0) (set! (-> *blow-tower-paths* 1 total-time) (the-as time-frame (the int (* 300.0 f30-0)))) (let ((s5-1 (new 'stack 'bt-obj-init-params))) - (set! (-> s5-1 pos quad) (-> *blow-tower-paths* 1 pts 0 quad)) + (vector-copy! (-> s5-1 pos) (-> *blow-tower-paths* 1 pts 0)) (quaternion-copy! (-> s5-1 quat) (quaternion-look-at! (new 'stack-no-clear 'quaternion) gp-4 *up-vector*)) (set! (-> s5-1 path) (-> *blow-tower-paths* 1)) (set! (-> s5-1 task-man) (process->handle self)) @@ -3871,7 +3869,7 @@ (((blow-tower-cmd-spawn-type kg-flyer) (blow-tower-cmd-spawn-type kg-flyer-ent)) (let ((s4-0 (new 'stack 'tower-enemy-init-params))) (set! (-> s4-0 target) (-> this target-handles (-> arg0 target))) - (set! (-> s4-0 pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s4-0 pos) (target-pos 0)) (set! (-> s4-0 entity-name) (-> arg0 entity-name)) (set! (-> s4-0 time-offset) (-> arg0 time-offset)) (if (= (-> s4-0 time-offset) 0.0) @@ -3889,7 +3887,7 @@ (((blow-tower-cmd-spawn-type mh-flyer) (blow-tower-cmd-spawn-type mh-flyer-ent)) (let ((s4-1 (new 'stack 'tower-enemy-init-params))) (set! (-> s4-1 target) (-> this target-handles (-> arg0 target))) - (set! (-> s4-1 pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s4-1 pos) (target-pos 0)) (set! (-> s4-1 entity-name) (-> arg0 entity-name)) (set! (-> s4-1 time-offset) (-> arg0 time-offset)) (if (= (-> s4-1 time-offset) 0.0) @@ -3907,7 +3905,7 @@ (((blow-tower-cmd-spawn-type missiles)) (let ((s4-2 (new 'stack 'tower-enemy-init-params))) (set! (-> s4-2 target) (-> this target-handles (-> arg0 target))) - (set! (-> s4-2 pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s4-2 pos) (target-pos 0)) (set! (-> s4-2 entity-name) "") (set! (-> s4-2 activate-time) (the-as @@ -3930,7 +3928,7 @@ (set! (-> s4-3 target) (-> this target-handles (-> arg0 target))) (let ((a0-30 (entity-by-name (-> arg0 entity-name)))) (if a0-30 - (set! (-> s4-3 pos quad) (-> a0-30 extra trans quad)) + (vector-copy! (-> s4-3 pos) (-> a0-30 extra trans)) ) ) (set! (-> s4-3 entity-name) "") @@ -3956,7 +3954,7 @@ ) ) (else - (set! (-> this missile-dir-vec quad) (-> s3-6 quad)) + (vector-copy! (-> this missile-dir-vec) s3-6) (set! (-> this last-missile-ent) (-> arg0 entity-name)) ) ) @@ -3976,7 +3974,7 @@ (if (> (-> arg0 event-id) 0) (set! v1-93 (find-event-id-index (-> this event-cursor) (the-as int (-> arg0 event-id)))) ) - (set! (-> s4-4 pos quad) (-> *blow-tower-paths* 0 pts v1-93 quad)) + (vector-copy! (-> s4-4 pos) (-> *blow-tower-paths* 0 pts v1-93)) ) (set! (-> s4-4 entity-name) "") (set! (-> s4-4 time-offset) (-> arg0 time-offset)) @@ -3994,14 +3992,14 @@ (set! (-> s1-0 path) (-> *blow-tower-paths* (-> arg0 target))) (cond (s0-0 - (set! (-> s2-2 quad) (-> s0-0 extra trans quad)) + (vector-copy! s2-2 (-> s0-0 extra trans)) ) (else (blow-tower-path-cursor-method-9 s1-0 (the-as int (+ (-> this mission-elapsed-clock) (the int (* 300.0 (-> arg0 time-offset))))) ) - (set! (-> s2-2 quad) (-> s1-0 pos quad)) + (vector-copy! s2-2 (-> s1-0 pos)) ) ) ) @@ -4009,15 +4007,15 @@ (((blow-tower-cmd-spawn-type kg-bombbot)) (let ((a0-79 (find-path-event-id-index (-> *blow-tower-paths* 0) (the-as int (-> arg0 event-id))))) (if (>= a0-79 0) - (set! (-> s3-7 quad) (-> *blow-tower-paths* (-> arg0 target) pts a0-79 quad)) - (set! (-> s3-7 quad) (-> s2-2 quad)) + (vector-copy! s3-7 (-> *blow-tower-paths* (-> arg0 target) pts a0-79)) + (vector-copy! s3-7 s2-2) ) ) ) (((blow-tower-cmd-spawn-type kg-bombbot-ent)) (let ((a0-87 (entity-by-name (-> arg0 entity-name2)))) (if a0-87 - (set! (-> s3-7 quad) (-> a0-87 extra trans quad)) + (vector-copy! s3-7 (-> a0-87 extra trans)) ) ) ) @@ -4452,16 +4450,16 @@ ) ) (if a0-11 - (set! (-> s2-1 intersection quad) (-> (get-trans a0-11 3) quad)) + (vector-copy! (-> s2-1 intersection) (get-trans a0-11 3)) ) ) (cond ((logtest? (-> *part-group-id-table* 1458 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s2-1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s2-1 intersection)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s2-1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s2-1 intersection)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) ) @@ -4472,11 +4470,11 @@ ) ) ((logtest? (-> *part-group-id-table* 1458 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> arg1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> arg1 intersection)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> arg1 intersection)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) ) @@ -4527,7 +4525,7 @@ ) (defmethod bt-pickup-method-50 ((this bt-pickup) (arg0 int) (arg1 vector)) - (set! (-> arg1 quad) (-> this root trans quad)) + (vector-copy! arg1 (-> this root trans)) (let ((v1-2 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))) (vector+float*! arg1 arg1 (-> v1-2 fvec) -21708.8) (vector+float*! arg1 arg1 (-> v1-2 uvec) -2457.6) diff --git a/goal_src/jak3/levels/city/bombbot/bombbot.gc b/goal_src/jak3/levels/city/bombbot/bombbot.gc index 4018124e17f..0515c140060 100644 --- a/goal_src/jak3/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak3/levels/city/bombbot/bombbot.gc @@ -352,7 +352,7 @@ (let ((s5-0 (-> this root))) (let ((a1-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 (-> s5-0 root-prim))) - (set! (-> a1-0 start-pos quad) (-> s5-0 trans quad)) + (vector-copy! (-> a1-0 start-pos) (-> s5-0 trans)) (let ((a0-2 (-> a1-0 move-dist))) (.lvf vf1 (&-> (-> s5-0 transv) quad)) (let ((f0-0 (seconds-per-frame))) @@ -379,7 +379,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) (vector-cross! s5-1 (-> this root transv) *y-vector*) (vector-normalize! s5-1 1.0) - (set! (-> this rot-axis quad) (-> s5-1 quad)) + (vector-copy! (-> this rot-axis) s5-1) ) (let ((s5-2 (new 'stack-no-clear 'quaternion))) (new 'stack-no-clear 'vector) @@ -503,19 +503,19 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> s1-1 quad) vf6) ) - (set! (-> s5-0 src quad) (-> self root trans quad)) + (vector-copy! (-> s5-0 src) (-> self root trans)) (set! (-> s5-0 initial-tilt) (* 182.04445 (rand-vu-float-range 30.0 50.0))) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) (vector-! gp-1 (-> self root trans) (target-pos 0)) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) - (set! (-> s4-0 quad) (-> s5-0 initial-velocity quad)) + (vector-copy! s4-0 (-> s5-0 initial-velocity)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (cond ((< 0.7 (vector-dot gp-1 s4-0)) - (set! (-> self root transv quad) (-> s5-0 initial-velocity quad)) + (vector-copy! (-> self root transv) (-> s5-0 initial-velocity)) ) (else (let ((t9-10 vector-normalize!) @@ -525,7 +525,7 @@ (t9-10 a0-22 (sqrtf (+ (* (-> v1-20 x) (-> v1-20 x)) (* (-> v1-20 z) (-> v1-20 z))))) ) (set! (-> gp-1 y) (-> s5-0 initial-velocity y)) - (set! (-> self root transv quad) (-> gp-1 quad)) + (vector-copy! (-> self root transv) gp-1) ) ) (go-virtual back) @@ -561,7 +561,7 @@ (a0-5 (-> a0-3 root-prim prim-core)) ) 0.0 - (set! (-> a1-2 start-pos quad) (-> v1-4 world-sphere quad)) + (vector-copy! (-> a1-2 start-pos) (-> v1-4 world-sphere)) (vector-! (-> a1-2 move-dist) (the-as vector a0-5) (the-as vector v1-4)) ) (let ((v1-5 a1-2)) @@ -663,7 +663,7 @@ 0 (sound-play "grenade-explode") (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 12288.0) (set! (-> gp-1 scale) 1.0) @@ -684,7 +684,7 @@ (cond ((not (time-elapsed? (-> self state-time) (seconds 2))) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (+! (-> a1-0 y) 2048.0) (spawn (-> self explode-part) a1-0) ) @@ -832,7 +832,7 @@ (set! (-> s4-0 event-self) 'touched) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot-bomb" (the-as (pointer level) #f))) @@ -840,7 +840,7 @@ ) (set-vector! (-> self root scale) 0.5 0.5 0.5 1.0) (quaternion-set! (-> self root quat) 0.0 0.0 0.0 1.0) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root transv) arg1) (set! (-> self draw light-index) (the-as uint 10)) (set! (-> self root dynam gravity y) 184320.0) (set! (-> self root dynam gravity-length) 184320.0) @@ -848,7 +848,7 @@ (let ((s5-2 (new 'stack-no-clear 'vector))) (vector-cross! s5-2 arg1 *z-vector*) (vector-normalize! s5-2 1.0) - (set! (-> self rot-axis quad) (-> s5-2 quad)) + (vector-copy! (-> self rot-axis) s5-2) ) (set! (-> self rot-angle) 65536.0) (set! (-> self explode-part) (create-launch-control (-> *part-group-id-table* 219) self)) @@ -1012,34 +1012,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -1193,18 +1193,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s1-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> this node-list data 6 bone transform)) - (v1-2 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s1-0 rvec quad) v1-2) - (set! (-> s1-0 uvec quad) a0-1) - (set! (-> s1-0 fvec quad) a1-0) - (set! (-> s1-0 trans quad) a2-1) - ) + (let ((s1-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 6 bone transform)))) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) @@ -1233,8 +1222,8 @@ (.svf (&-> a1-3 quad) vf6) ) (vector-normalize-copy! s5-0 (-> s1-0 fvec) 819200.0) - (set! (-> s3-0 start-pos quad) (-> gp-0 quad)) - (set! (-> s3-0 move-dist quad) (-> s5-0 quad)) + (vector-copy! (-> s3-0 start-pos) gp-0) + (vector-copy! (-> s3-0 move-dist) s5-0) (let ((v1-13 s3-0)) (set! (-> v1-13 radius) 40.96) (set! (-> v1-13 collide-with) (collide-spec backgnd enemy hit-by-others-list)) @@ -1257,7 +1246,7 @@ (v1-22 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s3-0 start-pos) s4-0) 1638.4)) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> s4-0 quad)) + (vector-copy! s3-1 s4-0) (vector+! s3-1 s3-1 v1-22) (cond (s2-1 @@ -1356,7 +1345,7 @@ (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> a1-0 velocity) (-> this root transv)) (vector-reset! (-> a1-0 velocity)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) @@ -1444,7 +1433,7 @@ (-> this joint-ik s4-0 elbow-matrix-no-ik) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> this node-list data 3 bone transform uvec quad)) + (vector-copy! s2-0 (-> this node-list data 3 bone transform uvec)) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((f30-0 0.4)) @@ -1561,11 +1550,11 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> v1-51 quad) vf6) (- (-> s3-0 y) (-> v1-51 y)) - (set! (-> s3-0 quad) (-> v1-51 quad)) + (vector-copy! s3-0 v1-51) ) ) ) - (set! (-> s1-0 next-position quad) (-> s3-0 quad)) + (vector-copy! (-> s1-0 next-position) s3-0) (set! (-> s1-0 moving) #t) (let ((a1-16 s3-0)) (let ((v1-55 (-> s1-0 position))) @@ -1617,7 +1606,7 @@ (else (toggle-cspec-deadly this #f (+ s4-0 1)) (when (-> s1-0 moving) - (set! (-> s1-0 position quad) (-> s1-0 next-position quad)) + (vector-copy! (-> s1-0 position) (-> s1-0 next-position)) (set! (-> s1-0 moving) #f) (let ((s0-1 lerp-scale)) (set! sv-896 (the-as float 819.2)) @@ -1636,11 +1625,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 23 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s1-0 position quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s1-0 position)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 23)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s1-0 position quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s1-0 position)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 23)) ) ) @@ -1684,7 +1673,7 @@ ) ) (set! (-> s1-0 delta-y) 0.0) - (set! (-> s3-0 quad) (-> s1-0 position quad)) + (vector-copy! s3-0 (-> s1-0 position)) ) ) ) @@ -1738,7 +1727,7 @@ ) ) ) - (set! (-> s1-0 real-position quad) (-> s3-0 quad)) + (vector-copy! (-> s1-0 real-position) s3-0) ) ) (set-ik-target! (-> this joint-ik s4-0) s3-0) @@ -1753,6 +1742,7 @@ ) (defmethod enemy-common-post ((this bombbot)) + "Common implementation of post. Runs ja-post." (local-vars (sv-48 sparticle-launcher) (sv-52 sparticle-launcher)) (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) @@ -1779,7 +1769,7 @@ ) ) (vector-! (-> this linear-speed) (-> this root trans) (-> this last-trans)) - (set! (-> this last-trans quad) (-> this root trans quad)) + (vector-copy! (-> this last-trans) (-> this root trans)) (set! (-> this y-angular-velocity) (deg- (quaternion-y-angle (-> this root quat)) (quaternion-y-angle (-> this last-quat))) ) @@ -1827,7 +1817,7 @@ (a1-10 sv-48) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> s5-3 quad)) + (vector-copy! (-> a2-2 trans) s5-3) (t9-15 a0-23 a1-10 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1836,7 +1826,7 @@ (a1-11 sv-48) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> s5-3 quad)) + (vector-copy! (-> a2-3 trans) s5-3) (t9-16 a0-24 a1-11 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1887,12 +1877,14 @@ ) ) -(defmethod penetrate->next-state ((this bombbot) (arg0 process) (arg1 event-message-block) (arg2 float)) - ((method-of-type nav-enemy penetrate->next-state) this arg0 arg1 arg2) +(defmethod msg-for-incoming-attack ((this bombbot) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." + ((method-of-type nav-enemy msg-for-incoming-attack) this arg0 arg1 arg2) 'hit-flinch ) (defmethod get-damage-from-attack ((this bombbot) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (-> arg1 param 1) (let* ((t9-0 (method-of-type nav-enemy get-damage-from-attack)) (f30-0 (t9-0 this arg0 arg1)) @@ -1918,6 +1910,7 @@ ) (defmethod event-handler ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('nav-mesh-kill) (change-to *default-nav-mesh* this) @@ -1937,7 +1930,7 @@ (when v1-8 (let ((s5-1 (new 'stack-no-clear 'vector))) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> v1-8 root trans quad)) + (vector-copy! s4-1 (-> v1-8 root trans)) (let ((s3-1 (matrix->trans (-> this node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) (+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) (+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0))) @@ -1998,7 +1991,7 @@ (t9-0) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -2057,7 +2050,7 @@ ) (cond (gp-0 - (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (vector-copy! (-> this target-pos) (get-trans (the-as process-focusable gp-0) 3)) (let ((v1-34 (-> this target-pos))) (let ((a0-16 (-> gp-0 root trans))) (let ((a1-8 (-> gp-0 root transv))) @@ -2073,9 +2066,9 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> v1-34 quad) vf6) ) - (set! (-> this start-target-pos quad) (-> gp-0 root trans quad)) - (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) - (try-update-focus (-> this focus) (the-as process-focusable gp-0) this) + (vector-copy! (-> this start-target-pos) (-> gp-0 root trans)) + (vector-copy! (-> this start-target-vel) (-> gp-0 root transv)) + (focus-on! (-> this focus) (the-as process-focusable gp-0) this) ) (else (clear-focused (-> this focus)) @@ -2088,7 +2081,7 @@ ) (defmethod bombbot-method-208 ((this bombbot) (arg0 vector) (arg1 vector)) - (set! (-> arg1 quad) (-> this target-pos quad)) + (vector-copy! arg1 (-> this target-pos)) arg1 ) @@ -2101,18 +2094,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> this node-list data 6 bone transform)) - (v1-2 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s4-0 rvec quad) v1-2) - (set! (-> s4-0 uvec quad) a0-1) - (set! (-> s4-0 fvec quad) a1-0) - (set! (-> s4-0 trans quad) a2-1) - ) + (let ((s4-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 6 bone transform)))) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -2136,8 +2118,8 @@ (.svf (&-> a1-2 quad) vf6) ) (vector-normalize-copy! s2-0 (-> s4-0 fvec) 819200.0) - (set! (-> s5-0 dest quad) (-> (bombbot-method-208 this s3-0 (new 'stack-no-clear 'vector)) quad)) - (set! (-> s5-0 src quad) (-> s3-0 quad)) + (vector-copy! (-> s5-0 dest) (bombbot-method-208 this s3-0 (new 'stack-no-clear 'vector))) + (vector-copy! (-> s5-0 src) s3-0) (set! (-> s5-0 initial-tilt) (+ 3640.889 (-> this angle-gun))) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) @@ -2145,7 +2127,7 @@ (sound-play "bb-fire-grenade") (process-spawn bombbot-bomb (-> s5-0 src) (-> s5-0 initial-velocity) :name "bombbot-bomb" :to this) (let ((s4-4 (new 'stack-no-clear 'vector))) - (set! (-> s4-4 quad) (-> s5-0 initial-velocity quad)) + (vector-copy! s4-4 (-> s5-0 initial-velocity)) (vector-normalize! s4-4 -2048000.0) (vector-inv-orient-by-quat! s4-4 s4-4 (-> this root quat)) (apply-impact! @@ -2275,7 +2257,7 @@ (defmethod init-proj-settings! ((this bombbot-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'guard-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) guard-shot-move) @@ -2309,8 +2291,8 @@ (set! (-> gp-0 damage) arg5) (logior! (-> gp-0 options) (projectile-options po14)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 1.0) ) @@ -2344,18 +2326,7 @@ (when (>= (+ (current-time) (seconds -0.2)) (-> this next-shoot)) (set-time! (-> this next-shoot)) (handle->process (-> this focus handle)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> this node-list data 6 bone transform)) - (v1-27 (-> a2-0 rvec quad)) - (a0-12 (-> a2-0 uvec quad)) - (a1-2 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-27) - (set! (-> s5-0 uvec quad) a0-12) - (set! (-> s5-0 fvec quad) a1-2) - (set! (-> s5-0 trans quad) a2-1) - ) + (let ((s5-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 6 bone transform)))) (new 'stack-no-clear 'matrix) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -2382,7 +2353,7 @@ (fire-shot this s3-0 (vector+! (new 'stack-no-clear 'vector) s3-0 s4-0)) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> s4-0 quad)) + (vector-copy! s5-1 s4-0) (vector-normalize! s5-1 -2048000.0) (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) (apply-impact! @@ -2405,7 +2376,7 @@ (let ((a0-1 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (let ((a2-0 (-> this nav state))) - (set! (-> a0-1 quad) (-> a2-0 heading quad)) + (vector-copy! a0-1 (-> a2-0 heading)) ) (let ((f0-1 (deg-diff (-> this y-angle) (vector-y-angle a0-1)))) (let ((f1-0 7281.778)) @@ -2460,8 +2431,8 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-orient-by-quat! s3-0 (-> s4-0 pos-offset) (-> this root quat)) (vector+! s3-0 s3-0 (-> this root trans)) - (set! (-> s4-0 next-position quad) (-> s3-0 quad)) - (set! (-> s4-0 position quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 next-position) s3-0) + (vector-copy! (-> s4-0 position) s3-0) ) (set! (-> s4-0 delta-y) 0.0) ) @@ -2506,7 +2477,7 @@ ) (when (< (-> self next-target) (current-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 w) 204800.0) (bombbot-method-196 self a1-0) ) @@ -2518,8 +2489,8 @@ (when v1-19 (when (< (current-time) (+ (-> self next-target) (seconds -3.5))) (set-time! (-> self start-target)) - (set! (-> self start-target-pos quad) (-> v1-19 root trans quad)) - (set! (-> self start-target-vel quad) (-> v1-19 root transv quad)) + (vector-copy! (-> self start-target-pos) (-> v1-19 root trans)) + (vector-copy! (-> self start-target-vel) (-> v1-19 root transv)) (vector-! (-> self target-delta) (-> v1-19 root trans) (-> self root trans)) ) (let ((a2-2 (-> self target-pos))) @@ -2538,7 +2509,7 @@ (.svf (&-> a2-2 quad) vf6) ) (if (= (-> v1-19 type) target) - (set! (-> self target-pos quad) (-> self start-target-pos quad)) + (vector-copy! (-> self target-pos) (-> self start-target-pos)) ) (if (< (+ (-> self next-target) (seconds -1)) (current-time)) (bombbot-method-197 self) @@ -2600,7 +2571,7 @@ ) (logclear! (-> v1-25 flags) (nav-state-flag directional-mode)) (logior! (-> v1-25 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-25 target-pos quad) (-> a0-10 position quad)) + (vector-copy! (-> v1-25 target-pos) (-> a0-10 position)) ) 0 (nav-enemy-method-187 self) @@ -2648,7 +2619,7 @@ ) (init-vf0-vector) (when (and (nonzero? (-> self drop-num)) (< (-> self next-target) (current-time))) - (let ((v1-5 (enemy-method-131 self 5 (the-as int (-> self drop-mask))))) + (let ((v1-5 (rnd-int-excluding-masked self 5 (the-as int (-> self drop-mask))))) (logior! (-> self drop-mask) (ash 1 v1-5)) (set! (-> self next-shoot) (+ (current-time) (seconds 0.8))) (set! (-> self next-target) (+ (current-time) (seconds 1))) @@ -2770,7 +2741,7 @@ ) (logclear! (-> v1-2 flags) (nav-state-flag directional-mode)) (logior! (-> v1-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-2 target-pos quad) (-> a0-0 quad)) + (vector-copy! (-> v1-2 target-pos) a0-0) ) 0 (when (logtest? (-> self nav state flags) (nav-state-flag at-target)) @@ -2884,21 +2855,21 @@ (set! (-> a1-1 gravity) -163840.0) (set! (-> a1-1 scale-rand-lo) 1.0) (set! (-> a1-1 scale-rand-hi) 3.0) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> self root trans)) (debris-spawn self a1-1 *bombbot-debris-params* (the-as process-drawable #f)) ) (let ((v1-15 (new 'stack-no-clear 'vector))) - (set! (-> v1-15 quad) (-> self root trans quad)) + (vector-copy! v1-15 (-> self root trans)) (+! (-> v1-15 y) 2048.0) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! s5-0 (-> self node-list data 3 bone transform trans)) (new 'stack-no-clear 'vector) 4.0 (+! (-> s5-0 y) 8192.0) (activate! *camera-smush-control* 1024.0 37 210 1.0 0.995 (-> self clock)) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> s5-0 quad)) + (vector-copy! (-> gp-0 spawn-point) s5-0) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 61440.0) (set! (-> gp-0 scale) 1.0) @@ -2922,13 +2893,13 @@ (set-vector! s4-0 (cos f30-0) 0.0 (sin f30-0) 1.0) ) (vector-float*! s4-0 s4-0 (* 4096.0 (+ 2.0 (* 2.0 (rand-vu))))) - (set! (-> s5-1 quad) (-> self root trans quad)) + (vector-copy! s5-1 (-> self root trans)) (vector+! (-> self root trans) (-> self root trans) s4-0) (set! (-> self fact pickup-type) (pickup-type ammo-random)) (set! (-> self fact pickup-amount) 10.0) (set! (-> self fact pickup-spawn-amount) 2.0) (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) - (set! (-> self root trans quad) (-> s5-1 quad)) + (vector-copy! (-> self root trans) s5-1) ) ) (set! (-> self explosing) #t) @@ -2962,6 +2933,7 @@ ) (defmethod init-enemy-collision! ((this bombbot)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -3230,6 +3202,7 @@ ) (defmethod coin-flip? ((this bombbot)) + "Return #t half the time, #f the other." #f ) @@ -3279,7 +3252,7 @@ (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) (set! (-> v1-3 main-y) (-> v1-3 delta-y)) (+! f30-0 (/ (-> v1-3 main-y) 4)) - (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) + (vector-copy! s1-0 (-> v1-3 pos-offset)) (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) (new 'stack-no-clear 'vector) (set! sv-224 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-3 pos-offset) 1.0)) @@ -3336,12 +3309,13 @@ (quaternion-slerp! (-> s4-0 main-quat) (-> s4-0 main-quat) s3-0 0.8) ) (quaternion-copy! (-> arg1 quat) (-> s4-0 main-quat)) - (set! (-> arg1 trans quad) (-> s4-0 main-pos quad)) + (vector-copy! (-> arg1 trans) (-> s4-0 main-pos)) (set! (-> arg1 trans y) (+ 16384.0 (-> s4-0 main-pos-y))) (quaternion-copy! (-> arg1 quat) (the-as quaternion (-> s4-0 rigidbody rot))) - (set! (-> arg1 trans quad) - (-> (rigid-body-control-method-25 (-> s4-0 rigidbody) (new 'stack-no-clear 'vector)) quad) - ) + (vector-copy! + (-> arg1 trans) + (rigid-body-control-method-25 (-> s4-0 rigidbody) (new 'stack-no-clear 'vector)) + ) ) (cspace<-parented-transformq-joint! arg0 arg1) 0 @@ -3355,12 +3329,12 @@ (s3-0 (new 'stack-no-clear 'quaternion)) ) (let ((a1-1 (-> s4-0 nav state))) - (set! (-> s2-0 quad) (-> a1-1 target-pos quad)) + (vector-copy! s2-0 (-> a1-1 target-pos)) ) (vector-! s2-0 s2-0 (-> s4-0 root trans)) (set! (-> s2-0 y) 0.0) (let ((a1-6 (-> s4-0 nav state))) - (set! (-> s2-0 quad) (-> a1-6 heading quad)) + (vector-copy! s2-0 (-> a1-6 heading)) ) (vector-normalize! s2-0 1.0) (quaternion-from-two-vectors! @@ -3412,7 +3386,7 @@ (set! (-> s3-0 angle-turret) (deg-seek (-> s3-0 angle-turret) (-> s2-0 y) (* 36408.89 (seconds-per-frame)))) (quaternion-vector-angle! s4-0 *up-vector* (-> s3-0 angle-turret)) (quaternion->matrix (-> arg0 bone transform) s4-0) - (set! (-> arg0 bone transform trans quad) (-> s5-0 quad)) + (vector-copy! (-> arg0 bone transform trans) s5-0) ) ) 0 @@ -3583,12 +3557,13 @@ ) (defmethod init-enemy! ((this bombbot)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *bombbot-nav-enemy-info*) + (setup-enemy! this *bombbot-nav-enemy-info*) (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) @@ -3690,8 +3665,8 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> this root quat)) (vector+! s3-0 s3-0 (-> this root trans)) - (set! (-> s4-1 next-position quad) (-> s3-0 quad)) - (set! (-> s4-1 position quad) (-> s3-0 quad)) + (vector-copy! (-> s4-1 next-position) s3-0) + (vector-copy! (-> s4-1 position) s3-0) ) (set! (-> s4-1 delta-y) 0.0) ) @@ -3703,7 +3678,7 @@ (let ((s5-3 (new 'stack-no-clear 'vector))) (vector-z-quaternion! s5-3 (-> this root quat)) (set! (-> this y-angle) (vector-y-angle s5-3)) - (set! (-> this nav state heading quad) (-> s5-3 quad)) + (vector-copy! (-> this nav state heading) s5-3) ) 0 (set! (-> this max-hit-points) (-> this hit-points)) @@ -3727,14 +3702,14 @@ (set! (-> self city-path) (-> arg0 path)) (set! (-> self current-node) (-> arg0 first-node)) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> self city-path node (-> self current-node) position quad)) + (vector-copy! (-> self root trans) (-> self city-path node (-> self current-node) position)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (vector-identity! (-> self root scale)) (-> arg0 nav-mesh) (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) (init-enemy! self) (set! (-> self shot-count) (the-as uint 5)) - (set! (-> self last-trans quad) (-> self root trans quad)) + (vector-copy! (-> self last-trans) (-> self root trans)) (logior! (-> self mask) (process-mask kg-robot)) (set! (-> self minimap) #f) (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) @@ -3745,7 +3720,8 @@ (go-virtual hostile) ) -(defmethod send-attack-on-jump-or-knocked ((this bombbot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this bombbot) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (when (!= (-> arg0 type) target) (let* ((s3-0 (-> arg1 param 0)) (s2-0 arg0) @@ -3778,7 +3754,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -3850,7 +3826,7 @@ ) (cond (gp-0 - (set! (-> this target-pos quad) (-> (get-trans gp-0 3) quad)) + (vector-copy! (-> this target-pos) (get-trans gp-0 3)) (let ((v1-25 (-> this target-pos))) (let ((a0-12 (-> gp-0 root trans))) (let ((a1-7 (-> gp-0 root transv))) @@ -3866,9 +3842,9 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> v1-25 quad) vf6) ) - (set! (-> this start-target-pos quad) (-> this target-pos quad)) - (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) - (try-update-focus (-> this focus) gp-0 this) + (vector-copy! (-> this start-target-pos) (-> this target-pos)) + (vector-copy! (-> this start-target-vel) (-> gp-0 root transv)) + (focus-on! (-> this focus) gp-0 this) ) (else (clear-focused (-> this focus)) @@ -3880,7 +3856,8 @@ ) ) -(defmethod go-idle2 ((this bomb-bot)) +(defmethod go-fallback-init ((this bomb-bot)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this hostile)) ) @@ -3897,7 +3874,7 @@ (init-vf0-vector) (when (< (-> self next-target) (current-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 w) 409600.0) (bombbot-method-196 self a1-0) ) @@ -3909,8 +3886,8 @@ (when gp-0 (when (< (current-time) (+ (-> self next-target) (seconds -2))) (set-time! (-> self start-target)) - (set! (-> self start-target-pos quad) (-> (get-trans gp-0 3) quad)) - (set! (-> self start-target-vel quad) (-> gp-0 root transv quad)) + (vector-copy! (-> self start-target-pos) (get-trans gp-0 3)) + (vector-copy! (-> self start-target-vel) (-> gp-0 root transv)) (vector-! (-> self target-delta) (-> gp-0 root trans) (-> self root trans)) ) (let ((a1-5 (-> self target-pos))) @@ -3928,7 +3905,7 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a1-5 quad) vf6) ) - (set! (-> self target-pos quad) (-> self start-target-pos quad)) + (vector-copy! (-> self target-pos) (-> self start-target-pos)) (if (< (+ (-> self next-target) (seconds -1)) (current-time)) (bombbot-method-197 self) (bombbot-method-204 self) @@ -3966,7 +3943,7 @@ (if (logtest? (-> self nav state flags) (nav-state-flag at-target)) (nav-enemy-method-164 self) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self nav state target-pos quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self nav state target-pos)) (nav-enemy-method-187 self) ) ) @@ -3974,13 +3951,14 @@ ) (defmethod init-from-entity! ((this bomb-bot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (init-enemy-collision! this) (process-drawable-from-entity! this arg0) (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) (init-enemy! this) (set! (-> this shot-count) (the-as uint 5)) - (set! (-> this last-trans quad) (-> this root trans quad)) + (vector-copy! (-> this last-trans) (-> this root trans)) (logior! (-> this mask) (process-mask kg-robot)) (set! (-> this minimap) #f) (logior! (-> this mask) (process-mask enemy)) @@ -3993,7 +3971,7 @@ ) (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-19 target-pos quad) (-> a0-13 quad)) + (vector-copy! (-> v1-19 target-pos) a0-13) ) 0 (set! (-> this max-hit-points) (-> this hit-points)) @@ -4013,6 +3991,7 @@ (defmethod move-above-ground! ((this bombbot-player) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." (let ((a1-1 (new 'stack-no-clear 'collide-query))) (find-ground (-> this root) @@ -4025,7 +4004,7 @@ ) ) (-> *math-camera* inv-camera-rot) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> *math-camera* inv-camera-rot fvec)) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) @@ -4090,6 +4069,7 @@ ;; WARN: Return type mismatch float vs none. (defmethod enemy-common-post ((this bombbot-player)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type bombbot enemy-common-post))) (t9-0 this) ) @@ -4190,7 +4170,7 @@ (set! sv-880 (new 'stack-no-clear 'collide-query)) (set! sv-884 (new 'stack-no-clear 'array 'collide-shape 64)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (camera-matrix) fvec quad)) + (vector-copy! s5-0 (-> (camera-matrix) fvec)) (set! sv-888 s5-0) ) (set! sv-896 0) @@ -4211,12 +4191,12 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> s5-1 quad) vf6) ) - (set! (-> sv-876 quad) (-> (get-trans this 4) quad)) + (vector-copy! sv-876 (get-trans this 4)) (matrix->trans (-> this node-list data 6 bone transform) sv-872) (set! (-> sv-876 y) (-> sv-872 y)) (vector-normalize-copy! sv-872 sv-888 204800.0) - (set! (-> sv-880 start-pos quad) (-> sv-876 quad)) - (set! (-> sv-880 move-dist quad) (-> sv-872 quad)) + (vector-copy! (-> sv-880 start-pos) sv-876) + (vector-copy! (-> sv-880 move-dist) sv-872) (let ((v1-20 sv-880)) (set! (-> v1-20 radius) 40.96) (set! (-> v1-20 collide-with) (collide-spec backgnd)) @@ -4273,10 +4253,10 @@ ) (cond (sv-864 - (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable sv-864) 3) quad)) - (set! (-> this start-target-pos quad) (-> sv-864 root trans quad)) - (set! (-> this start-target-vel quad) (-> sv-864 root transv quad)) - (try-update-focus (-> this focus) (the-as process-focusable sv-864) this) + (vector-copy! (-> this target-pos) (get-trans (the-as process-focusable sv-864) 3)) + (vector-copy! (-> this start-target-pos) (-> sv-864 root trans)) + (vector-copy! (-> this start-target-vel) (-> sv-864 root transv)) + (focus-on! (-> this focus) (the-as process-focusable sv-864) this) ) (else (vector+! (-> this target-pos) sv-876 sv-872) @@ -4299,18 +4279,7 @@ ) (init-vf0-vector) (handle->process (-> this focus handle)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> this node-list data 6 bone transform)) - (v1-7 (-> a2-0 rvec quad)) - (a0-5 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-7) - (set! (-> s5-0 uvec quad) a0-5) - (set! (-> s5-0 fvec quad) a1-1) - (set! (-> s5-0 trans quad) a2-1) - ) + (let ((s5-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 6 bone transform)))) (new 'stack-no-clear 'matrix) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -4345,7 +4314,7 @@ (launch-particles (-> *part-id-table* 2055) s3-0) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> s4-0 quad)) + (vector-copy! s5-1 s4-0) (vector-normalize! s5-1 -2048000.0) (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) (apply-impact! @@ -4442,7 +4411,7 @@ (.svf (&-> s5-5 quad) vf6) ) (let ((a1-7 (new 'stack-no-clear 'vector))) - (set! (-> a1-7 quad) (-> self root trans quad)) + (vector-copy! a1-7 (-> self root trans)) (set! (-> a1-7 w) 204800.0) (bombbot-method-196 self a1-7) ) @@ -4514,7 +4483,7 @@ (else (-> *math-camera* inv-camera-rot) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! gp-0 (-> *math-camera* inv-camera-rot fvec)) (let ((s5-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -4544,7 +4513,7 @@ (let ((v1-24 (-> self nav state))) (logclear! (-> v1-24 flags) (nav-state-flag directional-mode)) (logior! (-> v1-24 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-24 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-24 target-pos) s5-0) ) 0 (when *target* @@ -4590,6 +4559,7 @@ ;; WARN: Return type mismatch none vs sound-id. (defmethod play-damage-sound ((this bombbot-player) (arg0 int)) + "Pick and play the damage/death sound." ((method-of-type bombbot play-damage-sound) this arg0) (the-as sound-id (if (zero? arg0) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) @@ -4610,7 +4580,7 @@ (set! (-> self city-path) (-> arg0 path)) (set! (-> self current-node) (the-as uint 0)) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (vector-identity! (-> self root scale)) (-> arg0 nav-mesh) @@ -4618,7 +4588,7 @@ (init-enemy! self) (set! (-> self gun-rotation-speed) 7281.778) (set! (-> self shot-count) (the-as uint 5)) - (set! (-> self last-trans quad) (-> self root trans quad)) + (vector-copy! (-> self last-trans) (-> self root trans)) (set! (-> self minimap) #f) (logior! (-> self mask) (process-mask enemy guard)) (send-event *camera* 'change-target self) @@ -4718,7 +4688,7 @@ (gp-1 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (target-pos 0) quad)) + (vector-copy! s5-1 (target-pos 0)) (if (and (< 4096000.0 (vector-vector-distance s5-1 s3-0)) (< 819200.0 (vector-vector-distance s5-1 (-> self start-point))) ) @@ -4827,8 +4797,8 @@ (when (or (zero? (-> this bombbot-h)) (not (handle->process (-> this bombbot-h)))) (let ((s5-1 (new 'stack 'bombbot-spawn-params))) (set! (-> s5-1 nav-mesh) (get-nav-mesh (the-as actor-id #x48e9))) - (set! (-> s5-1 position quad) (-> this start-point quad)) - (set! (-> s5-1 position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s5-1 position) (-> this start-point)) + (vector-copy! (-> s5-1 position) (target-pos 0)) (quaternion-copy! (-> s5-1 quat) (new 'static 'quaternion :y 0.841 :w 0.5409)) (set! (-> this bombbot-h) (ppointer->handle (process-spawn bombbot-player s5-1 :name "bombbot-player" :to this)) @@ -5015,7 +4985,7 @@ :code (behavior () (when (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead)))) (cond - ((= (status-of-level-and-borrows *level* 'ctyport #f) 'active) + ((= (level-status? *level* 'ctyport #f) 'active) (set-setting! 'entity-name "camera-321" 0.0 0) (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set-time! (-> self state-time)) diff --git a/goal_src/jak3/levels/city/common/cty-guard-projectile.gc b/goal_src/jak3/levels/city/common/cty-guard-projectile.gc index 77d896ab1dd..64ed8ea338e 100644 --- a/goal_src/jak3/levels/city/common/cty-guard-projectile.gc +++ b/goal_src/jak3/levels/city/common/cty-guard-projectile.gc @@ -107,7 +107,7 @@ (set! (-> v1-11 y) 2.0) (set! (-> v1-11 z) 2.0) (set! (-> v1-11 w) 1.0) - (set! (-> this root scale quad) (-> v1-11 quad)) + (vector-copy! (-> this root scale) v1-11) ) 0 (none) @@ -168,7 +168,7 @@ ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) (-> self blast-radius)) (set! (-> gp-0 scale) 1.0) @@ -202,7 +202,7 @@ (let ((v1-1 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-1 sphere quad) (-> this root trans quad)) (set! (-> v1-1 sphere r) (-> this blast-radius)) - (set! (-> v1-1 velocity quad) (-> this root transv quad)) + (vector-copy! (-> v1-1 velocity) (-> this root transv)) (set! (-> v1-1 notify-radius) 122880.0) (set! (-> v1-1 danger-level) 2.0) (set! (-> v1-1 decay-rate) 0.0) @@ -234,7 +234,7 @@ (let ((v1-10 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-10 sphere quad) (-> self root trans quad)) (set! (-> v1-10 sphere r) (the-as float (* (the int (-> self blast-radius)) 2))) - (set! (-> v1-10 velocity quad) (-> self root transv quad)) + (vector-copy! (-> v1-10 velocity) (-> self root transv)) (set! (-> v1-10 notify-radius) 122880.0) (set! (-> v1-10 danger-level) 2.0) (set! (-> v1-10 decay-rate) 0.0) @@ -361,11 +361,11 @@ (if (-> this has-hit-ground) (set! f26-0 0.7) ) - (set! (-> s3-1 quad) (-> (the-as target v1-22) control to-target-pt-xz quad)) + (vector-copy! s3-1 (-> (the-as target v1-22) control to-target-pt-xz)) (vector-normalize! s3-1 1.0) (set! (-> s3-1 y) 0.0) (if (< (vector-dot s3-1 s4-2) f26-0) - (set! (-> s4-2 quad) (-> s3-1 quad)) + (vector-copy! s4-2 s3-1) ) ) ) diff --git a/goal_src/jak3/levels/city/common/ff-squad-control.gc b/goal_src/jak3/levels/city/common/ff-squad-control.gc index 8d3d5873b45..5403d20aa42 100644 --- a/goal_src/jak3/levels/city/common/ff-squad-control.gc +++ b/goal_src/jak3/levels/city/common/ff-squad-control.gc @@ -768,7 +768,7 @@ (if (not (logtest? (-> this alert-state flags) (squad-alert-flag alarm-on))) (logior! (-> this alert-state flags) (squad-alert-flag alarm-on)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> (target-pos 0) quad)) + (vector-copy! (new 'stack-no-clear 'vector) (target-pos 0)) (if #t (ff-squad-control-method-47 this) ) diff --git a/goal_src/jak3/levels/city/common/guard-grenade.gc b/goal_src/jak3/levels/city/common/guard-grenade.gc index 38180c8beda..0555b0006db 100644 --- a/goal_src/jak3/levels/city/common/guard-grenade.gc +++ b/goal_src/jak3/levels/city/common/guard-grenade.gc @@ -27,9 +27,10 @@ (cond ((!= (-> (handle->process (-> this focus handle)) type) target) (set! (-> s3-1 quad) (the-as uint128 0)) - (set! (-> s5-0 dest quad) - (-> (get-trans (the-as process-focusable (handle->process (-> this focus handle))) 3) quad) - ) + (vector-copy! + (-> s5-0 dest) + (get-trans (the-as process-focusable (handle->process (-> this focus handle))) 3) + ) 0.0 ) (else @@ -37,14 +38,12 @@ (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 2.0))) (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 3.0))) ) - (set! (-> s5-0 dest quad) - (-> (vector+! (new 'stack-no-clear 'vector) s3-1 (-> this target-pos-predict-miss)) quad) - ) + (vector-copy! (-> s5-0 dest) (vector+! (new 'stack-no-clear 'vector) s3-1 (-> this target-pos-predict-miss))) f30-0 ) ) ) - (set! (-> s5-0 src quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 src) s4-0) (set! (-> s5-0 initial-tilt) 8192.0) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) @@ -53,8 +52,8 @@ (set! (-> a1-14 charge) f30-0) (set! (-> a1-14 options) (projectile-options)) (logclear! (-> a1-14 options) (projectile-options po14 po15 po16)) - (set! (-> a1-14 pos quad) (-> s5-0 src quad)) - (set! (-> a1-14 vel quad) (-> s5-0 initial-velocity quad)) + (vector-copy! (-> a1-14 pos) (-> s5-0 src)) + (vector-copy! (-> a1-14 vel) (-> s5-0 initial-velocity)) (set! (-> a1-14 notify-handle) (the-as handle #f)) (set! (-> a1-14 owner-handle) (process->handle this)) (set! (-> a1-14 target-handle) (the-as handle #f)) @@ -135,7 +134,7 @@ (loop (let ((a2-0 (new 'stack-no-clear 'vector))) (let ((a1-0 (-> self nav state))) - (set! (-> a2-0 quad) (-> a1-0 target-pos quad)) + (vector-copy! a2-0 (-> a1-0 target-pos)) ) (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 2) *color-red*) ) @@ -410,7 +409,7 @@ (let ((a0-8 (-> self nav state)) (v1-15 *null-vector*) ) - (set! (-> a0-8 velocity quad) (-> v1-15 quad)) + (vector-copy! (-> a0-8 velocity) v1-15) ) 0 (set-time! (-> self state-time)) diff --git a/goal_src/jak3/levels/city/common/guard-rifle.gc b/goal_src/jak3/levels/city/common/guard-rifle.gc index 5f13376e183..c0b00aaea4f 100644 --- a/goal_src/jak3/levels/city/common/guard-rifle.gc +++ b/goal_src/jak3/levels/city/common/guard-rifle.gc @@ -23,7 +23,7 @@ (defmethod crimson-guard-method-257 ((this crimson-guard)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) + (vector-copy! s5-0 (-> this target-pos-predict-miss)) (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a0-3)) @@ -66,7 +66,7 @@ (let ((a0-9 (-> self nav state)) (v1-20 *null-vector*) ) - (set! (-> a0-9 velocity quad) (-> v1-20 quad)) + (vector-copy! (-> a0-9 velocity) v1-20) ) 0 (set-time! (-> self state-time)) diff --git a/goal_src/jak3/levels/city/common/guard-states.gc b/goal_src/jak3/levels/city/common/guard-states.gc index 7a6232e72d4..13c23194c7b 100644 --- a/goal_src/jak3/levels/city/common/guard-states.gc +++ b/goal_src/jak3/levels/city/common/guard-states.gc @@ -18,7 +18,7 @@ (v1-3 *null-vector*) ) (logior! (-> a0-3 flags) (nav-state-flag directional-mode)) - (set! (-> a0-3 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-3 travel) v1-3) ) 0 (if *citizen-debug* @@ -51,9 +51,9 @@ (suspend) (ja :num! (seek! max (-> self speed-scale))) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) - (go-best-state self) + (go-state-for-focused self) ) ) ) @@ -81,7 +81,7 @@ (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) (set! (-> self hit-face) (the-as uint -1)) - (enemy-method-50 self 0) + (update-collision-action self 0) ) :trans (behavior () '() @@ -97,15 +97,15 @@ (ja :num! (seek! max (-> self speed-scale))) ) (set! (-> self hit-face) (the-as uint -1)) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (let ((a0-1 (-> self nav state)) (v1-3 *null-vector*) ) (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) - (set! (-> a0-1 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-1 travel) v1-3) ) 0 (enemy-common-post self) @@ -135,7 +135,7 @@ (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) (set! (-> self hit-face) (the-as uint -1)) - (enemy-method-50 self 0) + (update-collision-action self 0) ) :trans (behavior () '() @@ -151,15 +151,15 @@ (ja :num! (seek! max (-> self speed-scale))) ) (set! (-> self hit-face) (the-as uint -1)) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (let ((a0-1 (-> self nav state)) (v1-3 *null-vector*) ) (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) - (set! (-> a0-1 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-1 travel) v1-3) ) 0 (enemy-common-post self) @@ -206,7 +206,7 @@ (t9-0) ) ) - (reset-penetrate! self) + (reset-penetrate-later! self) ) ) @@ -396,7 +396,7 @@ ) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-9 quad)) + (vector-copy! (-> a0-2 target-pos) v1-9) ) 0 (nav-enemy-method-187 self) @@ -513,7 +513,7 @@ (init-vf0-vector) (handle->process (-> this focus handle)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this move-position quad)) + (vector-copy! s5-0 (-> this move-position)) (when (< 8192000.0 (-> this target-self-xz-dist)) (let ((s3-0 (-> this root trans)) (s2-0 (new 'stack-no-clear 'vector)) @@ -522,7 +522,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (set! sv-112 (new 'stack-no-clear 'vector)) - (set! (-> s1-0 quad) (-> s5-0 quad)) + (vector-copy! s1-0 s5-0) (vector-z-quaternion! s2-0 (-> this root quat)) (let ((f30-0 (* 182.04445 (* 60.0 (the float (- (-> this traffic-id) *guard-min-id-hack*)))))) (set! sv-128 s0-0) @@ -558,13 +558,13 @@ (set! sv-144 (+ sv-144 1)) ) (do-spline s4-0 s3-0 s2-0 s1-0 s0-0 0.9) - (set! (-> s4-0 quad) (-> s5-0 quad)) + (vector-copy! s4-0 s5-0) ) ) (let ((v1-39 (-> this nav state))) (logclear! (-> v1-39 flags) (nav-state-flag directional-mode)) (logior! (-> v1-39 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-39 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-39 target-pos) s5-0) ) ) 0 @@ -909,7 +909,7 @@ (let ((a0-9 (-> self nav state)) (v1-12 *null-vector*) ) - (set! (-> a0-9 velocity quad) (-> v1-12 quad)) + (vector-copy! (-> a0-9 velocity) v1-12) ) 0 (set-time! (-> self state-time)) @@ -987,7 +987,7 @@ (let ((a0-9 (-> self nav state)) (v1-12 *null-vector*) ) - (set! (-> a0-9 velocity quad) (-> v1-12 quad)) + (vector-copy! (-> a0-9 velocity) v1-12) ) 0 (set-time! (-> self state-time)) @@ -1067,7 +1067,7 @@ (when (not (-> self already-shot)) (crimson-guard-method-265 self 1.0) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s5-0 (new 'stack 'collide-query)) ) @@ -1094,7 +1094,7 @@ (a1-7 (-> self event-param-point)) (f0-3 (-> v1-16 extra-nav-sphere w)) ) - (set! (-> v1-16 extra-nav-sphere quad) (-> a1-7 quad)) + (vector-copy! (-> v1-16 extra-nav-sphere) a1-7) (set! (-> v1-16 extra-nav-sphere w) f0-3) ) 0 @@ -1142,6 +1142,7 @@ ;; WARN: Return type mismatch int vs object. (defmethod go-hostile ((this crimson-guard)) + "Go to the hostile state, actively trying to attack the target." (let ((v1-2 (handle->process (-> this focus handle)))) (cond (v1-2 diff --git a/goal_src/jak3/levels/city/common/guard-tazer.gc b/goal_src/jak3/levels/city/common/guard-tazer.gc index e3a44053833..5261f239b8a 100644 --- a/goal_src/jak3/levels/city/common/guard-tazer.gc +++ b/goal_src/jak3/levels/city/common/guard-tazer.gc @@ -18,15 +18,15 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> arg2 quad)) + (vector-copy! s4-0 arg2) (let ((s3-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'quaternion)) ) (vector-length arg2) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> arg3 quad)) + (vector-copy! s1-0 arg3) (let ((s0-0 (new 'stack-no-clear 'collide-query))) (set! sv-640 0) (while (< sv-640 6) @@ -42,8 +42,8 @@ ) (set! (-> v1-6 action-mask) (collide-action solid)) ) - (set! (-> s0-0 start-pos quad) (-> s5-0 quad)) - (set! (-> s0-0 move-dist quad) (-> s4-0 quad)) + (vector-copy! (-> s0-0 start-pos) s5-0) + (vector-copy! (-> s0-0 move-dist) s4-0) (set-from-point-offset-pad! (-> s0-0 bbox) (-> s0-0 start-pos) (-> s0-0 move-dist) (-> s0-0 radius)) (fill-using-bounding-box *collide-cache* s0-0) (set! (-> s0-0 radius) 409.6) @@ -65,7 +65,7 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a1-4 quad) vf6) ) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) ) (else (vector+! (-> s0-0 start-pos) s5-0 s4-0) @@ -117,7 +117,7 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a1-11 quad) vf6) ) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) ) ) ) @@ -131,7 +131,7 @@ (set! sv-656 (-> s0-0 best-other-tri normal)) (quaternion-from-two-vectors! s2-0 s1-0 sv-656) (vector-orient-by-quat! s4-0 s4-0 s2-0) - (set! (-> s1-0 quad) (-> sv-656 quad)) + (vector-copy! s1-0 sv-656) (vector-flatten! s4-0 s4-0 sv-656) ) (else @@ -207,8 +207,8 @@ ) (set! (-> v1-10 action-mask) (collide-action solid)) ) - (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) - (set! (-> s3-0 move-dist quad) (-> s1-0 quad)) + (vector-copy! (-> s3-0 start-pos) s4-0) + (vector-copy! (-> s3-0 move-dist) s1-0) (set! (-> this l-control state points-to-draw) 0) (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) (s2-1 (new 'stack-no-clear 'vector)) @@ -231,21 +231,21 @@ ) (cond ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) ) ) (cond ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) ) ) @@ -274,7 +274,7 @@ (set! (-> s0-1 ignore-handle) (process->handle this)) (set! (-> s0-1 attack-id) (-> this attack-id)) (set! (-> s0-1 timeout) (seconds 4)) - (set! (-> s0-1 pos quad) (-> s4-0 quad)) + (vector-copy! (-> s0-1 pos) s4-0) (vector-! (-> s0-1 vel) s5-0 s4-0) (vector-normalize! (-> s0-1 vel) 131072.0) (spawn-projectile guard-lazer-shot s0-1 this *default-dead-pool*) @@ -286,21 +286,21 @@ (else (cond ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) ) ) (cond ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) ) ) @@ -312,7 +312,7 @@ (let ((a0-97 (-> this l-control)) (v1-178 s5-0) ) - (set! (-> a0-97 state meet data (+ (-> a0-97 state points-to-draw) -1) quad) (-> v1-178 quad)) + (vector-copy! (-> a0-97 state meet data (+ (-> a0-97 state points-to-draw) -1)) v1-178) ) ) ) diff --git a/goal_src/jak3/levels/city/common/height-map.gc b/goal_src/jak3/levels/city/common/height-map.gc index 25788796e30..506d3f773f2 100644 --- a/goal_src/jak3/levels/city/common/height-map.gc +++ b/goal_src/jak3/levels/city/common/height-map.gc @@ -140,7 +140,7 @@ (set! sv-80 (+ s4-0 -1)) (while (nonzero? sv-80) (set! sv-80 (+ sv-80 -1)) - (set! (-> s5-0 0 max quad) (-> s5-0 0 min quad)) + (vector-copy! (-> s5-0 0 max) (-> s5-0 0 min)) (+! (-> s5-0 0 min x) f28-0) (set! s0-0 (&-> s0-0 1)) (set! (-> s5-0 0 min y) (+ (-> this y-offset) (* (the float (-> s0-0 0)) (-> this y-scale)))) @@ -172,7 +172,7 @@ (set! sv-96 (+ s3-0 -1)) (while (nonzero? sv-96) (set! sv-96 (+ sv-96 -1)) - (set! (-> s5-0 0 max quad) (-> s5-0 0 min quad)) + (vector-copy! (-> s5-0 0 max) (-> s5-0 0 min)) (+! (-> s5-0 0 min z) f30-0) (&+! s0-1 s4-0) (set! (-> s5-0 0 min y) diff --git a/goal_src/jak3/levels/city/common/kg-squad-member.gc b/goal_src/jak3/levels/city/common/kg-squad-member.gc index b806cf3fe4e..a5194d04414 100644 --- a/goal_src/jak3/levels/city/common/kg-squad-member.gc +++ b/goal_src/jak3/levels/city/common/kg-squad-member.gc @@ -132,6 +132,7 @@ ) (defmethod enemy-common-post ((this kg-squad-member)) + "Common implementation of post. Runs ja-post." (local-vars (s5-0 int)) (when (focus-test? this dangerous) (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) @@ -172,10 +173,11 @@ (none) ) -(defmethod send-attack-on-jump-or-knocked ((this kg-squad-member) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this kg-squad-member) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond (#f - ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type citizen enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -211,7 +213,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else diff --git a/goal_src/jak3/levels/city/common/krimson-wall.gc b/goal_src/jak3/levels/city/common/krimson-wall.gc index 18f928c4ce5..6cf0638f160 100644 --- a/goal_src/jak3/levels/city/common/krimson-wall.gc +++ b/goal_src/jak3/levels/city/common/krimson-wall.gc @@ -122,18 +122,7 @@ '() ) :trans (behavior () - (let* ((v1-0 (new 'stack-no-clear 'matrix)) - (a3-0 (-> self node-list data 2 bone transform)) - (a0-2 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-2) - (set! (-> v1-0 uvec quad) a1-0) - (set! (-> v1-0 fvec quad) a2-0) - (set! (-> v1-0 trans quad) a3-1) - ) + (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 2 bone transform)) ) :code sleep-code :post ja-post @@ -147,7 +136,7 @@ :trans (behavior () (when (not (time-elapsed? (-> self state-time) (seconds 0.5))) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (+! (-> gp-0 z) (* 4096.0 (rand-vu-float-range -60.0 60.0))) (+! (-> gp-0 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) (+! (-> gp-0 y) (* 4096.0 (rand-vu-float-range 0.0 25.0))) @@ -156,11 +145,11 @@ ((zero? v1-9) (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) ) ) @@ -168,11 +157,11 @@ ((= v1-9 1) (cond ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 218)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 218)) ) ) @@ -219,6 +208,7 @@ ) (defmethod init-from-entity! ((this krimson-wall-break) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-96 entity)) (set! (-> this level) (level-get *level* (-> this level-name))) (stack-size-set! (-> this main-thread) 512) @@ -395,10 +385,10 @@ ) ) (if (nonzero? (-> this alt-actor 0)) - (set! (-> gp-0 0 quad) (-> this alt-actor 0 extra trans quad)) + (vector-copy! (-> gp-0 0) (-> this alt-actor 0 extra trans)) ) (if (nonzero? (-> this alt-actor 1)) - (set! (-> gp-0 1 quad) (-> this alt-actor 1 extra trans quad)) + (vector-copy! (-> gp-0 1) (-> this alt-actor 1 extra trans)) ) (spawn-security-wall this (-> gp-0 0) (-> gp-0 1) 77824.0 #f) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 1) (-> gp-0 0)))) @@ -425,6 +415,7 @@ ) (defmethod init-from-entity! ((this krimson-wall) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) diff --git a/goal_src/jak3/levels/city/common/mh-squad-member.gc b/goal_src/jak3/levels/city/common/mh-squad-member.gc index 18d894ccb0f..f71bc6d148d 100644 --- a/goal_src/jak3/levels/city/common/mh-squad-member.gc +++ b/goal_src/jak3/levels/city/common/mh-squad-member.gc @@ -93,6 +93,7 @@ ) (defmethod enemy-common-post ((this mh-squad-member)) + "Common implementation of post. Runs ja-post." (local-vars (s5-0 int)) (when (focus-test? this dangerous) (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) @@ -134,10 +135,11 @@ (none) ) -(defmethod send-attack-on-jump-or-knocked ((this mh-squad-member) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this mh-squad-member) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond (#f - ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type citizen enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -173,7 +175,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -222,7 +224,7 @@ (not (logtest? (-> (the-as process-focusable a0-18) focus-status) (focus-status disable dead inactive))) ) (let* ((s5-1 this) - (s4-0 (method-of-object s5-1 enemy-method-70)) + (s4-0 (method-of-object s5-1 set-focus!)) (s3-0 (handle->process (-> this current-enemy))) ) (s4-0 diff --git a/goal_src/jak3/levels/city/common/nav-graph-h.gc b/goal_src/jak3/levels/city/common/nav-graph-h.gc index 0aeb2a7aa90..0bf93f5a2e7 100644 --- a/goal_src/jak3/levels/city/common/nav-graph-h.gc +++ b/goal_src/jak3/levels/city/common/nav-graph-h.gc @@ -171,7 +171,7 @@ ) (defmethod get-position ((this nav-node) (arg0 vector)) - (set! (-> arg0 quad) (-> this position quad)) + (vector-copy! arg0 (-> this position)) (set! (-> arg0 w) 1.0) arg0 ) diff --git a/goal_src/jak3/levels/city/common/nav-graph.gc b/goal_src/jak3/levels/city/common/nav-graph.gc index 03a31b2df48..ce59c44101e 100644 --- a/goal_src/jak3/levels/city/common/nav-graph.gc +++ b/goal_src/jak3/levels/city/common/nav-graph.gc @@ -58,7 +58,7 @@ (let ((a1-0 this) (v1-0 gp-0) ) - (set! (-> v1-0 quad) (-> a1-0 position quad)) + (vector-copy! v1-0 (-> a1-0 position)) (set! (-> v1-0 w) 1.0) ) (set! (-> s4-0 quad) (-> gp-0 quad)) @@ -260,7 +260,7 @@ (let ((a2-6 this) (a0-19 v1-24) ) - (set! (-> a0-19 quad) (-> a2-6 position quad)) + (vector-copy! a0-19 (-> a2-6 position)) (set! (-> a0-19 w) 1.0) ) (format arg0 "~S~T :position (~4,,2M ~4,,2M ~4,,2M)~%" arg1 (-> v1-24 x) (-> v1-24 y) (-> v1-24 z)) @@ -287,7 +287,7 @@ (defmethod set-pos-xyz ((this nav-node) (arg0 vector)) (let ((f0-0 (-> this position w))) - (set! (-> this position quad) (-> arg0 quad)) + (vector-copy! (-> this position) arg0) (set! (-> this position w) f0-0) ) 0 @@ -829,7 +829,7 @@ (let ((a2-0 a0-2) (v1-4 s4-0) ) - (set! (-> v1-4 quad) (-> a2-0 position quad)) + (vector-copy! v1-4 (-> a2-0 position)) (set! (-> v1-4 w) 1.0) ) (vector+! s4-0 s4-0 arg0) @@ -875,7 +875,7 @@ (let ((a1-0 s3-0) (v1-6 (-> s5-0 rvec)) ) - (set! (-> v1-6 quad) (-> a1-0 position quad)) + (vector-copy! v1-6 (-> a1-0 position)) (set! (-> v1-6 w) 1.0) ) (dotimes (s2-0 (-> s3-0 branch-count)) @@ -884,7 +884,7 @@ (let ((a2-0 v1-9) (a0-7 (-> s5-0 uvec)) ) - (set! (-> a0-7 quad) (-> a2-0 position quad)) + (vector-copy! a0-7 (-> a2-0 position)) (set! (-> a0-7 w) 1.0) ) (vector-! (-> s5-0 fvec) (-> s5-0 uvec) (-> s5-0 rvec)) @@ -939,7 +939,7 @@ (let ((a2-1 s1-0) (v1-8 a1-1) ) - (set! (-> v1-8 quad) (-> a2-1 position quad)) + (vector-copy! v1-8 (-> a2-1 position)) (set! (-> v1-8 w) 1.0) ) (let ((f0-3 (vector-vector-distance-squared arg0 a1-1))) @@ -968,7 +968,7 @@ (let ((a1-0 s4-0) (v1-8 s3-0) ) - (set! (-> v1-8 quad) (-> a1-0 position quad)) + (vector-copy! v1-8 (-> a1-0 position)) (set! (-> v1-8 w) 1.0) ) (let ((a1-3 s3-0)) @@ -991,7 +991,7 @@ (let ((a1-0 s4-0) (v1-1 s3-0) ) - (set! (-> v1-1 quad) (-> a1-0 position quad)) + (vector-copy! v1-1 (-> a1-0 position)) (set! (-> v1-1 w) 1.0) ) (when (logtest? (-> s4-0 flags) (nav-node-flag-byte pedestrian)) @@ -1137,7 +1137,7 @@ (let ((t0-0 a0-12) (a2-8 (-> a1-7 position)) ) - (set! (-> a2-8 quad) (-> t0-0 position quad)) + (vector-copy! a2-8 (-> t0-0 position)) (set! (-> a2-8 w) 1.0) ) (set! (-> a1-7 level_name) (-> a0-12 level)) diff --git a/goal_src/jak3/levels/city/common/searchlight.gc b/goal_src/jak3/levels/city/common/searchlight.gc index 3807453be59..cecb7103558 100644 --- a/goal_src/jak3/levels/city/common/searchlight.gc +++ b/goal_src/jak3/levels/city/common/searchlight.gc @@ -67,6 +67,7 @@ ) (defmethod init-from-entity! ((this searchlight) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak3/levels/city/common/trail.gc b/goal_src/jak3/levels/city/common/trail.gc index a3a5653f6eb..b6998dbba5f 100644 --- a/goal_src/jak3/levels/city/common/trail.gc +++ b/goal_src/jak3/levels/city/common/trail.gc @@ -105,11 +105,11 @@ (+ (* (-> s5-0 cell-width) (the float (/ arg0 16))) (-> s5-0 origin z)) 1.0 ) - (set! (-> s3-0 1 quad) (-> s3-0 0 quad)) + (vector-copy! (-> s3-0 1) (-> s3-0 0)) (+! (-> s3-0 1 x) (-> s5-0 cell-width)) - (set! (-> s3-0 2 quad) (-> s3-0 1 quad)) + (vector-copy! (-> s3-0 2) (-> s3-0 1)) (+! (-> s3-0 2 z) (-> s5-0 cell-width)) - (set! (-> s3-0 3 quad) (-> s3-0 2 quad)) + (vector-copy! (-> s3-0 3) (-> s3-0 2)) (set! (-> s3-0 3 x) (- (-> s3-0 3 x) (-> s5-0 cell-width))) (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s3-0 0) (-> s3-0 1) *color-white* #f (the-as rgba -1)) (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s3-0 1) (-> s3-0 2) *color-white* #f (the-as rgba -1)) @@ -165,7 +165,7 @@ (set-vector! (-> s0-0 1) (+ (-> arg2 x) arg5) (+ (-> arg2 y) arg5) (+ (-> arg2 z) arg5) 1.0) (set! sv-48 0) (until #f - (set! (-> s0-0 0 quad) (-> s0-0 1 quad)) + (vector-copy! (-> s0-0 0) (-> s0-0 1)) (cond ((< sv-48 arg0) (let ((a0-6 (-> this node (-> arg1 sv-48)))) @@ -196,10 +196,10 @@ (defmethod debug-draw ((this trail-graph)) (when (= (-> this mode) 3) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-0 1 quad) (-> this orig-goal-pos quad)) + (vector-copy! (-> s5-0 1) (-> this orig-goal-pos)) (let ((v1-3 (-> this goal-node-id))) (until #f - (set! (-> s5-0 0 quad) (-> s5-0 1 quad)) + (vector-copy! (-> s5-0 0) (-> s5-0 1)) (cond ((>= v1-3 0) (let ((s4-0 (-> this node v1-3))) @@ -215,7 +215,7 @@ ) ) (else - (set! (-> s5-0 1 quad) (-> this orig-start-pos quad)) + (vector-copy! (-> s5-0 1) (-> this orig-start-pos)) (add-debug-line #t (bucket-id debug) (-> s5-0 0) (-> s5-0 1) *color-green* #f (the-as rgba -1)) (goto cfg-7) ) @@ -236,7 +236,7 @@ (meters 1) (new 'static 'rgba :r #xff :a #x80) ) - (set! (-> s5-1 quad) (-> this conn-start-pos quad)) + (vector-copy! s5-1 (-> this conn-start-pos)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-1 (meters 0.25) (new 'static 'rgba :r #xff :a #x80)) (add-debug-sphere #t @@ -245,7 +245,7 @@ (meters 1) (new 'static 'rgba :g #xff :a #x80) ) - (set! (-> s5-1 quad) (-> this conn-goal-pos quad)) + (vector-copy! s5-1 (-> this conn-goal-pos)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-1 (meters 0.25) (new 'static 'rgba :g #xff :a #x80)) ) ) @@ -505,7 +505,7 @@ ) (set! (-> arg0 best-dist) f0-14) (set! (-> arg0 best-conn-id) (the-as int s2-0)) - (set! (-> arg0 conn-pos quad) (-> s1-0 quad)) + (vector-copy! (-> arg0 conn-pos) s1-0) ) ) ) @@ -675,7 +675,7 @@ (cond ((< (seconds 1) a0-2) (set! (-> gp-0 last-updated) v1-1) - (set! (-> gp-0 start-pos quad) (-> this orig-start-pos quad)) + (vector-copy! (-> gp-0 start-pos) (-> this orig-start-pos)) (let* ((v1-7 (-> this cell-pov-bit-arrays (trail-graph-method-18 this (-> gp-0 start-pos)))) (s3-0 (-> this node 0)) (s2-0 1) @@ -695,7 +695,7 @@ ) ((> a0-2 0) (set! (-> gp-0 last-updated) v1-1) - (set! (-> gp-0 start-pos quad) (-> this orig-start-pos quad)) + (vector-copy! (-> gp-0 start-pos) (-> this orig-start-pos)) (let ((s3-1 (-> this cell-pov-bit-arrays (trail-graph-method-18 this (-> gp-0 start-pos))))) (set! s4-2 (logand (-> gp-0 pov-can-see-start) s3-1)) (let ((s2-1 (-> gp-0 next-node-id))) @@ -733,10 +733,10 @@ (defmethod trail-graph-method-13 ((this trail-graph) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) - (set! (-> gp-0 1 quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 1) arg0) (set! (-> gp-0 1 y) 0.0) (set! (-> gp-0 1 w) 1.0) - (set! (-> gp-0 2 quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 2) arg1) (set! (-> gp-0 2 y) 0.0) (set! (-> gp-0 2 w) 1.0) (let ((s5-0 (-> this blocker 0))) @@ -1011,7 +1011,7 @@ (* 4096.0 (the float (-> v1-2 z))) 1.0 ) - (set! (-> s5-0 p1 quad) (-> s5-0 p0 quad)) + (vector-copy! (-> s5-0 p1) (-> s5-0 p0)) (set! (-> s5-0 best-count) (the-as uint 0)) (set! (-> s5-0 best-dist) -1.0) (let ((s2-0 (&-> (-> this conn-ids) (-> v1-2 first-conn)))) @@ -1070,7 +1070,7 @@ (local-vars (v0-6 int)) (trail-graph-method-26 this) (+! (-> this search-id) 1) - (set! (-> this orig-start-pos quad) (-> arg0 quad)) + (vector-copy! (-> this orig-start-pos) arg0) (let ((s5-1 0)) (let ((a1-1 -1)) (when arg2 @@ -1081,17 +1081,17 @@ (= (-> arg2 orig-goal-pos z) (-> arg1 z)) ) (set! a1-1 v1-6) - (set! (-> this conn-goal-pos quad) (-> arg2 conn-goal-pos quad)) + (vector-copy! (-> this conn-goal-pos) (-> arg2 conn-goal-pos)) ) ) ) - (set! (-> this orig-goal-pos quad) (-> arg1 quad)) + (vector-copy! (-> this orig-goal-pos) arg1) (when (< a1-1 0) (set! a1-1 (trail-graph-method-17 this (-> this orig-goal-pos) (-> this conn-goal-pos))) (when arg2 (set! (-> arg2 goal-conn-id) a1-1) - (set! (-> arg2 orig-goal-pos quad) (-> this orig-goal-pos quad)) - (set! (-> arg2 conn-goal-pos quad) (-> this conn-goal-pos quad)) + (vector-copy! (-> arg2 orig-goal-pos) (-> this orig-goal-pos)) + (vector-copy! (-> arg2 conn-goal-pos) (-> this conn-goal-pos)) ) ) (set! (-> this goal-conn-id) a1-1) diff --git a/goal_src/jak3/levels/city/ctyport-obs.gc b/goal_src/jak3/levels/city/ctyport-obs.gc index 92e3cbb5a6d..b14f100cb18 100644 --- a/goal_src/jak3/levels/city/ctyport-obs.gc +++ b/goal_src/jak3/levels/city/ctyport-obs.gc @@ -348,12 +348,12 @@ (when (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 6))) (let ((a1-1 (-> this nav state))) - (set! (-> s5-1 0 quad) (-> a1-1 velocity quad)) + (vector-copy! (-> s5-1 0) (-> a1-1 velocity)) ) (let ((s4-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info))) (let ((s3-0 (-> this nav state current-poly))) (vector-xz-normalize-copy! (-> s5-1 3) (-> s5-1 0) 163840.0) - (set! (-> s5-1 4 quad) (-> s5-1 3 quad)) + (vector-copy! (-> s5-1 4) (-> s5-1 3)) (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s3-0 (-> s5-1 4) s4-0) ) (when (-> s4-0 found-boundary) @@ -379,7 +379,7 @@ (.add.mul.z.vf.x vf1 vf2 vf1 acc) (.mov v1-42 vf1) (when (< f0-5 v1-42) - (set! (-> s5-1 5 quad) (-> s5-1 0 quad)) + (vector-copy! (-> s5-1 5) (-> s5-1 0)) (vector-normalize! (-> s5-1 5) 1.0) (let ((s4-1 (-> this root quat))) (quaternion-set! (the-as quaternion (-> s5-1 2)) 0.0 (-> s5-1 5 x) 0.0 (+ 1.0 (-> s5-1 5 z))) @@ -405,7 +405,7 @@ ) (when s4-2 (let ((a1-22 (-> this nav state))) - (set! (-> s5-2 quad) (-> a1-22 target-pos quad)) + (vector-copy! s5-2 (-> a1-22 target-pos)) ) (if (or (= (-> this path-num) 2) (-> *setting-control* user-current stop-boats?)) (get-point-at-percent-along-path! @@ -432,7 +432,7 @@ (let ((v1-102 (-> this nav state))) (logclear! (-> v1-102 flags) (nav-state-flag directional-mode)) (logior! (-> v1-102 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-102 target-pos quad) (-> s5-2 quad)) + (vector-copy! (-> v1-102 target-pos) s5-2) ) 0 ) @@ -452,7 +452,7 @@ (s4-0 (new 'stack-no-clear 'matrix)) ) (let ((a1-1 (-> this nav state))) - (set! (-> s4-0 uvec quad) (-> a1-1 velocity quad)) + (vector-copy! (-> s4-0 uvec) (-> a1-1 velocity)) ) (vector-! (-> s4-0 rvec) (-> s4-0 uvec) (-> s3-0 lin-velocity)) (vector-float*! (-> s4-0 rvec) (-> s4-0 rvec) (* 4.0 (-> s2-0 info mass))) @@ -842,8 +842,8 @@ (set! (-> s2-0 flags) (traffic-spawn-flags tsf0)) (set! (-> s2-0 guard-type) (the-as uint 11)) (set! (-> s2-0 entity) #f) - (set! (-> s2-0 velocity quad) (-> s3-0 uvec quad)) - (set! (-> s2-0 position quad) (-> s3-0 rvec quad)) + (vector-copy! (-> s2-0 velocity) (-> s3-0 uvec)) + (vector-copy! (-> s2-0 position) (-> s3-0 rvec)) (quaternion-copy! (-> s2-0 rotation) (the-as quaternion (-> s3-0 trans))) (set! (-> s2-0 position w) f30-0) (when (vehicle-spawn-hack barge s2-0 this) @@ -866,6 +866,7 @@ ) (defmethod init-from-entity! ((this boat-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) (set! (-> this entity) arg0) (set! (-> this boats-stop?) (-> *setting-control* user-current stop-boats?)) diff --git a/goal_src/jak3/levels/city/ctywide-obs.gc b/goal_src/jak3/levels/city/ctywide-obs.gc index 25479f7f475..3fa0145075f 100644 --- a/goal_src/jak3/levels/city/ctywide-obs.gc +++ b/goal_src/jak3/levels/city/ctywide-obs.gc @@ -194,7 +194,7 @@ ) (when (< f0-0 (* f1-1 f1-1)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) - (set! (-> s5-0 0 quad) (-> s4-0 control trans quad)) + (vector-copy! (-> s5-0 0) (-> s4-0 control trans)) (when (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) (* f30-0 f30-0)) (let ((f0-3 (vector4-dot (-> this target-pos) (the-as vector (-> this plane)))) (f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> this plane)))) @@ -207,7 +207,7 @@ ) ) ) - (set! (-> this target-pos quad) (-> s5-0 0 quad)) + (vector-copy! (-> this target-pos) (-> s5-0 0)) ) (when (-> this breach) (if (send-event @@ -505,7 +505,7 @@ (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) (set! (-> s1-0 scale y) (/ arg2 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) - (set! (-> s2-1 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-copy! (-> s2-1 uvec) (new 'static 'vector :y 1.0 :w 1.0)) (vector-cross! (-> s2-1 fvec) (-> s2-1 rvec) (-> s2-1 uvec)) (vector-normalize! (-> s2-1 fvec) 1.0) (matrix->quaternion (-> s1-0 quat) s2-1) @@ -528,6 +528,7 @@ ) (defmethod init-from-entity! ((this security-wall) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (set! (-> this breach) #f) (set! (-> this pass) (res-lump-value arg0 'pickup-type pickup-type :time -1000000000.0)) @@ -713,8 +714,8 @@ (defmethod parking-spot-method-24 ((this parking-spot)) (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> gp-0 vec0 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> gp-0 vec0) (-> this root trans)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec0)) (vector-reset! (-> gp-0 vec1)) (set! (-> gp-0 vec1 y) 1.0) (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) @@ -731,15 +732,15 @@ (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) (when (>= f30-0 0.0) (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) - (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) - (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> gp-0 vec1) (-> gp-0 cquery best-other-tri normal)) + (vector-copy! (-> this root trans) (-> gp-0 vec0)) (format #t "parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) ) (if (< f30-0 0.0) (format #t "parking-spot::find-ground: could not find ground~%") ) ) - (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec0)) (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) ) 0 @@ -840,7 +841,7 @@ (a1-2 (the-as uint #xa01013fd)) (a2-1 (logand -2 a1-2)) ) - (set! (-> a0-1 0 quad) (-> this test-sphere quad)) + (vector-copy! (-> a0-1 0) (-> this test-sphere)) (let ((a1-4 (-> v1-0 cquery))) (set! (-> a1-4 best-dist) (the-as float a0-1)) (set! (-> a1-4 best-other-prim) (the-as collide-shape-prim 1)) @@ -857,7 +858,7 @@ 0 (when (not (fill-and-probe-using-spheres *collide-cache* (-> v1-0 cquery))) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 position quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 position) (-> this root trans)) (mem-copy! (the-as pointer (-> s4-0 rotation)) (the-as pointer (-> this root quat)) 16) (+! (-> s4-0 position y) 14336.0) (set! (-> s4-0 behavior) (the-as uint 0)) @@ -883,6 +884,7 @@ ) (defmethod init-from-entity! ((this parking-spot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (set! (-> this minimap) #f) (set! (-> this vehicle) (the-as handle #f)) @@ -1134,7 +1136,7 @@ (.mul.x.vf.xyz acc vf5 vf7) (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a0-12 quad) vf6) - (set! (-> v1-25 quad) (-> a0-12 quad)) + (vector-copy! v1-25 a0-12) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 224)) ) @@ -1155,7 +1157,7 @@ (.mul.x.vf.xyz acc vf5 vf7) (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a0-17 quad) vf6) - (set! (-> v1-40 quad) (-> a0-17 quad)) + (vector-copy! v1-40 a0-17) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 224)) ) @@ -1219,7 +1221,7 @@ ) ) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> self root trans quad)) + (vector-copy! a1-4 (-> self root trans)) (set! (-> a1-4 w) 40960.0) (propa-method-32 self a1-4) ) @@ -1386,6 +1388,7 @@ ) (defmethod init-from-entity! ((this propa) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (propa-method-30 this) (process-drawable-from-entity! this arg0) (ctywide-entity-hack) @@ -1463,18 +1466,7 @@ ) :trans (behavior () (let ((gp-0 (get-current-task-event (-> self task)))) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> self node-list data 3 bone transform)) - (v1-4 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-4) - (set! (-> s5-0 uvec quad) a0-1) - (set! (-> s5-0 fvec quad) a1-0) - (set! (-> s5-0 trans quad) a2-1) - ) + (let ((s5-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform)))) (when (< (vector-dot (-> s5-0 fvec) (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans s5-0 (new 'stack-no-clear 'vector))) @@ -1670,7 +1662,7 @@ (vector+! s5-0 s4-0 (s3-0 s2-0 s1-0 (s0-0 (the-as quaternion sv-272) sv-288 a2-1))) ) ) - (set! (-> *camera* slave 0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> *camera* slave 0 trans) gp-0) (let ((t9-4 forward-down->inv-matrix) (a0-6 (-> *camera* slave 0 tracking)) (a1-3 (new 'stack-no-clear 'vector)) @@ -1693,18 +1685,7 @@ ) ) ) - (let ((gp-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-6 (-> self node-list data 3 bone transform)) - (v1-23 (-> a2-6 rvec quad)) - (a0-7 (-> a2-6 uvec quad)) - (a1-5 (-> a2-6 fvec quad)) - (a2-7 (-> a2-6 trans quad)) - ) - (set! (-> gp-1 rvec quad) v1-23) - (set! (-> gp-1 uvec quad) a0-7) - (set! (-> gp-1 fvec quad) a1-5) - (set! (-> gp-1 trans quad) a2-7) - ) + (let ((gp-1 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform)))) (if (< (vector-dot (-> gp-1 fvec) (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-1 (new 'stack-no-clear 'vector))) @@ -1919,7 +1900,7 @@ (-> self root quat) ) ) - (set! (-> *camera* slave 0 trans quad) (-> gp-1 quad)) + (vector-copy! (-> *camera* slave 0 trans) gp-1) (let ((t9-6 forward-down->inv-matrix) (a0-27 (-> *camera* slave 0 tracking)) (a1-13 (new 'stack-no-clear 'vector)) @@ -1942,18 +1923,7 @@ ) ) ) - (let ((gp-2 (new 'stack-no-clear 'matrix))) - (let* ((a2-11 (-> self node-list data 3 bone transform)) - (v1-40 (-> a2-11 rvec quad)) - (a0-28 (-> a2-11 uvec quad)) - (a1-15 (-> a2-11 fvec quad)) - (a2-12 (-> a2-11 trans quad)) - ) - (set! (-> gp-2 rvec quad) v1-40) - (set! (-> gp-2 uvec quad) a0-28) - (set! (-> gp-2 fvec quad) a1-15) - (set! (-> gp-2 trans quad) a2-12) - ) + (let ((gp-2 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform)))) (if (< (vector-dot (-> gp-2 fvec) (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-2 (new 'stack-no-clear 'vector))) @@ -2142,6 +2112,7 @@ ) (defmethod init-from-entity! ((this burning-bush) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (burning-bush-method-32 this) (process-drawable-from-entity! this arg0) (ctywide-entity-hack) @@ -2397,7 +2368,7 @@ (set! (-> t1-1 fade-time) (the-as time-frame (the int (-> *city-burning-bush-get-on-info* (-> self info index) time))) ) - (set! (-> a0-3 quad) (-> *city-burning-bush-get-on-info* (-> self info index) trans quad)) + (vector-copy! a0-3 (-> *city-burning-bush-get-on-info* (-> self info index) trans)) (+! (-> a0-3 y) 4096.0) (set! (-> self skill) (ppointer->handle @@ -2417,24 +2388,13 @@ (suspend) (let ((f30-0 (-> *camera* settings fov))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *camera-combiner* trans quad)) - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-7 (-> *camera-combiner* inv-camera-rot)) - (v1-46 (-> a2-7 rvec quad)) - (a0-15 (-> a2-7 uvec quad)) - (a1-15 (-> a2-7 fvec quad)) - (a2-8 (-> a2-7 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-46) - (set! (-> gp-0 uvec quad) a0-15) - (set! (-> gp-0 fvec quad) a1-15) - (set! (-> gp-0 trans quad) a2-8) - ) + (vector-copy! s5-0 (-> *camera-combiner* trans)) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> *camera-combiner* inv-camera-rot)))) (let ((s4-0 (new 'stack 'transformq))) (let ((v1-52 (-> *city-burning-bush-get-on-info* (-> self info index))) (a1-17 (new 'stack-no-clear 'matrix)) ) - (set! (-> s4-0 trans quad) (-> v1-52 camera-trans quad)) + (vector-copy! (-> s4-0 trans) (-> v1-52 camera-trans)) (set-vector! (-> s4-0 scale) 1.0 1.0 1.0 1.0) (set! (-> a1-17 rvec x) (-> v1-52 camera-rot 0)) (set! (-> a1-17 rvec y) (-> v1-52 camera-rot 1)) @@ -2459,18 +2419,8 @@ (suspend-for (seconds 3) (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) ) - (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) - (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) - (v1-74 (-> gp-0 rvec quad)) - (a0-24 (-> gp-0 uvec quad)) - (a1-19 (-> gp-0 fvec quad)) - (a3-5 (-> gp-0 trans quad)) - ) - (set! (-> a2-15 rvec quad) v1-74) - (set! (-> a2-15 uvec quad) a0-24) - (set! (-> a2-15 fvec quad) a1-19) - (set! (-> a2-15 trans quad) a3-5) - ) + (vector-copy! (-> *camera-combiner* trans) s5-0) + (matrix-copy! (-> *camera-combiner* inv-camera-rot) gp-0) ) ) (set! (-> *camera* settings fov) f30-0) @@ -2524,12 +2474,12 @@ ) (defmethod init ((this city-ambush-info) (arg0 traffic-object-spawn-params)) - (set! (-> arg0 position quad) (-> this array 0 pos quad)) + (vector-copy! (-> arg0 position) (-> this array 0 pos)) (set! (-> arg0 nav-mesh) (find-nearest-nav-mesh (-> arg0 position) (the-as float #x7f800000))) (vector-reset! (-> arg0 velocity)) (dotimes (s4-0 (-> this count)) (let ((v1-3 (-> this array s4-0))) - (set! (-> arg0 position quad) (-> v1-3 pos quad)) + (vector-copy! (-> arg0 position) (-> v1-3 pos)) (set! (-> arg0 object-type) (-> v1-3 obj-type)) ) (send-event *traffic-manager* 'activate-object arg0) @@ -2577,7 +2527,7 @@ (let ((s5-0 proc) (gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) ) - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (the-as joint-exploder s5-0) root trans quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) (-> (the-as joint-exploder s5-0) root trans)) (set! (-> gp-0 fountain-rand-transv-hi x) 16384.0) (set! (-> gp-0 fountain-rand-transv-hi y) 40960.0) (process-spawn @@ -2671,6 +2621,7 @@ ) (defmethod init-from-entity! ((this ctyn-lamp) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctyn-lamp-method-30 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2710,6 +2661,7 @@ ) (defmethod init-from-entity! ((this fac-lorez) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2789,6 +2741,7 @@ ) (defmethod init-from-entity! ((this flitter-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -2840,7 +2793,7 @@ (defmethod spawn-flitter ((this flitter-spawner) (arg0 entity-actor)) (let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params))) (set! (-> gp-0 velocity quad) (the-as uint128 0)) - (set! (-> gp-0 position quad) (-> arg0 extra trans quad)) + (vector-copy! (-> gp-0 position) (-> arg0 extra trans)) (quaternion-copy! (-> gp-0 rotation) (-> arg0 quat)) (set! (-> gp-0 behavior) (the-as uint 2)) (set! (-> gp-0 object-type) (traffic-type metalhead-flitter)) @@ -2864,7 +2817,7 @@ (set! (-> v1-8 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) - (set! (-> s4-0 quad) (-> s3-0 best-other-tri intersect quad)) + (vector-copy! s4-0 (-> s3-0 best-other-tri intersect)) ) ) (set! (-> gp-0 nav-mesh) (find-nearest-nav-mesh s4-0 (the-as float #x7f800000))) @@ -3446,6 +3399,7 @@ ) (defmethod init-from-entity! ((this mh-tower-smoke-cty) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak3/levels/city/ctywide-tasks.gc b/goal_src/jak3/levels/city/ctywide-tasks.gc index a6b9f22fa96..23b97b7cfe1 100644 --- a/goal_src/jak3/levels/city/ctywide-tasks.gc +++ b/goal_src/jak3/levels/city/ctywide-tasks.gc @@ -50,7 +50,8 @@ (talker-spawn-func (-> *talker-speech* 26) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) @@ -58,7 +59,8 @@ (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (while (or (not *target*) (focus-test? *target* dead teleporting)) (suspend) ) @@ -79,7 +81,8 @@ ) (wait-for-speech-end (-> self speech-id)) (set! (-> self player-vehicle) (the-as handle #f)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (send-event self 'complete) (call-parent-state-handler code) ) @@ -144,7 +147,8 @@ (talker-spawn-func (-> *talker-speech* 27) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (set! (-> self speech-id) (talker-spawn-func (-> *talker-speech* 28) *entity-pool* (target-pos 0) (the-as region #f)) ) @@ -163,7 +167,8 @@ (talker-spawn-func (-> *talker-speech* 29) *entity-pool* (target-pos 0) (the-as region #f)) ) (wait-for-speech-end (-> self speech-id)) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (go-virtual complete) ) ) @@ -179,7 +184,8 @@ ((-> (method-of-object self wait) trans)) ) :code (behavior () - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) (until (< 327680.0 (vector-vector-xz-distance (target-pos 0) (new 'static 'vector :x -285696.0 :y 36044.8 :z 5443625.0 :w 1.0)) ) @@ -187,7 +193,8 @@ ) (set-setting! 'airlock-command '(("hip-door-a-6" close)) 0.0 0) (talker-spawn-func (-> *talker-speech* 162) *entity-pool* (target-pos 0) (the-as region #f)) - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) (until (handle-command-list *gui-control* (gui-channel voicebox) (the-as gui-connection #f)) (suspend) ) @@ -226,9 +233,9 @@ ) (until v1-22 (suspend) - (set! v1-22 (and (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) - (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) - (= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) + (set! v1-22 (and (= (level-status? *level* 'ctypesb #f) 'active) + (= (level-status? *level* 'ctypesc #f) 'active) + (= (level-status? *level* 'ctypesa #f) 'active) ) ) ) diff --git a/goal_src/jak3/levels/city/ctywide-texture.gc b/goal_src/jak3/levels/city/ctywide-texture.gc index 726859448b7..8a701a0b8bc 100644 --- a/goal_src/jak3/levels/city/ctywide-texture.gc +++ b/goal_src/jak3/levels/city/ctywide-texture.gc @@ -149,17 +149,17 @@ (defun set-security-color! ((arg0 vector)) (let ((v1-1 (-> *security-texture-anim-array* array-data 0))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-1 data 0 start-color) arg0) + (vector-copy! (-> v1-1 data 0 end-color) arg0) + (vector-copy! (-> v1-1 data 1 start-color) arg0) + (vector-copy! (-> v1-1 data 1 end-color) arg0) ) (let ((v1-5 (-> *security-texture-anim-array* array-data 1))) - (set! (-> v1-5 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 1 end-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 2 start-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-5 data 1 start-color) arg0) + (vector-copy! (-> v1-5 data 1 end-color) arg0) + (vector-copy! (-> v1-5 data 2 start-color) arg0) (let ((v0-0 (-> v1-5 data 2 end-color))) - (set! (-> v0-0 quad) (-> arg0 quad)) + (vector-copy! v0-0 arg0) v0-0 ) ) @@ -167,9 +167,9 @@ (defun set-security-flash! ((arg0 vector)) (let ((v1-1 (-> *security-texture-anim-array* array-data 1))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-1 data 0 start-color) arg0) (let ((v0-0 (-> v1-1 data 0 end-color))) - (set! (-> v0-0 quad) (-> arg0 quad)) + (vector-copy! v0-0 arg0) v0-0 ) ) diff --git a/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc b/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc index 04a98ee5589..4cfe911771b 100644 --- a/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc +++ b/goal_src/jak3/levels/city/destroy-grid/cty-destroy-grid.gc @@ -196,34 +196,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 45056.0 - :knocked-soft-vxz-hi 54067.2 - :knocked-soft-vy-lo 38092.8 - :knocked-soft-vy-hi 45056.0 - :knocked-medium-vxz-lo 65536.0 - :knocked-medium-vxz-hi 74547.2 - :knocked-medium-vy-lo 65536.0 - :knocked-medium-vy-hi 73728.0 - :knocked-hard-vxz-lo 66355.2 - :knocked-hard-vxz-hi 85196.8 - :knocked-hard-vy-lo 60620.8 - :knocked-hard-vy-hi 101580.8 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 73728.0 - :knocked-red-vy-lo 65536.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 40960.0 + :knocked-soft-vxz-lo (meters 11) + :knocked-soft-vxz-hi (meters 13.2) + :knocked-soft-vy-lo (meters 9.3) + :knocked-soft-vy-hi (meters 11) + :knocked-medium-vxz-lo (meters 16) + :knocked-medium-vxz-hi (meters 18.2) + :knocked-medium-vy-lo (meters 16) + :knocked-medium-vy-hi (meters 18) + :knocked-hard-vxz-lo (meters 16.2) + :knocked-hard-vxz-hi (meters 20.8) + :knocked-hard-vy-lo (meters 14.8) + :knocked-hard-vy-hi (meters 24.8) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 18) + :knocked-red-vy-lo (meters 16) + :knocked-red-vy-hi (meters 20) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 10) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -316,10 +316,12 @@ ) (defmethod go-die ((this jinx)) + "Go to the die state." ((method-of-type nav-enemy go-die) this) ) (defmethod move-above-ground! ((this jinx) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." ((method-of-type nav-enemy move-above-ground!) this arg0 arg1) (none) ) @@ -335,6 +337,7 @@ ) (defmethod enemy-common-post ((this jinx)) + "Common implementation of post. Runs ja-post." (logior! (-> this flags) (citizen-flag persistent)) (update-nav-mesh this) (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) @@ -479,8 +482,8 @@ ) (let ((s3-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (set! (-> s2-0 quad) (-> self root trans quad)) - (set! (-> s1-0 quad) (-> gp-0 quad)) + (vector-copy! s2-0 (-> self root trans)) + (vector-copy! s1-0 gp-0) (vector-! s5-0 gp-0 (-> s0-0 root trans)) (vector-z-quaternion! s4-0 (-> self root quat)) (let ((f30-1 (* 0.5 (vector-vector-xz-distance s2-0 s1-0)))) @@ -492,7 +495,7 @@ (let ((v1-20 (-> self nav state))) (logclear! (-> v1-20 flags) (nav-state-flag directional-mode)) (logior! (-> v1-20 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-20 target-pos quad) (-> s3-0 quad)) + (vector-copy! (-> v1-20 target-pos) s3-0) ) ) 0 @@ -647,7 +650,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! jinx-get-in-car-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -684,7 +687,7 @@ :virtual #t :code (behavior () (cond - ((enemy-method-109 self) + ((out-of-bounds? self) (go-die self) ) ((>= 0.0 (-> self box-time)) @@ -745,7 +748,7 @@ ) (logclear! (-> a0-5 flags) (nav-state-flag directional-mode)) (logior! (-> a0-5 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-5 target-pos quad) (-> v1-14 quad)) + (vector-copy! (-> a0-5 target-pos) v1-14) ) 0 (citizen-method-195 self) @@ -809,7 +812,7 @@ (ja :num! (seek!)) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> gp-0 quad)) + (vector-copy! s5-1 gp-0) (let ((gp-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! jinx-get-out-car-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -962,7 +965,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -980,7 +983,7 @@ (nav-enemy-method-177 self) ) :trans (behavior () - (set! (-> self destination quad) (-> self event-param-point quad)) + (vector-copy! (-> self destination) (-> self event-param-point)) (if (< (vector-vector-distance (-> self destination) (-> self root trans)) 10240.0) (go-virtual do-power-box) ) @@ -998,7 +1001,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1164,6 +1167,7 @@ ) (defmethod event-handler ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('nav-mesh-kill) (set! (-> this nav-mesh-aid) (the-as actor-id (-> this nav state mesh entity aid))) @@ -1176,13 +1180,14 @@ ) ) -(defmethod send-attack-on-jump-or-knocked ((this jinx) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this jinx) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'knocked) (= v1-3 'jump)) ) ) - ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type nav-enemy enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -1217,7 +1222,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -1250,6 +1255,7 @@ ) (defmethod init-enemy-collision! ((this jinx)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1321,18 +1327,19 @@ (none) ) -(defmethod init-enemy-defaults! ((this jinx) (arg0 nav-enemy-info)) +;; WARN: Return type mismatch int vs object. +(defmethod setup-enemy! ((this jinx) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) 0 - (none) ) (defmethod init-enemy! ((this jinx)) + "Typical place for shared init code. Runs from entity or process style init." (set-vector! (-> this follow-dir) 0.0 0.0 1.0 1.0) (logclear! (-> this mask) (process-mask enemy)) (logior! (-> this mask) (process-mask bot)) @@ -1346,7 +1353,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-jinx" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *jinx-nav-enemy-info*) + (setup-enemy! this *jinx-nav-enemy-info*) (set! (-> this draw light-index) (the-as uint 10)) (set! (-> this shield-handle) (the-as handle #f)) (set! (-> this health-handle) @@ -1682,7 +1689,7 @@ (dotimes (s4-0 (length (-> this actor-group 0))) (let ((s3-0 (-> this actor-group 0 data s4-0))) (when (= (-> this next-box) s4-0) - (set! (-> this goal-pos quad) (-> s3-0 actor trans quad)) + (vector-copy! (-> this goal-pos) (-> s3-0 actor trans)) (let ((s2-0 (-> this goal-pos-front))) (let ((s1-0 (-> s3-0 actor trans))) (let ((v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 actor quat)))) @@ -1889,9 +1896,7 @@ :virtual #t :code (behavior () (set-setting! 'borrow-hold-perm '(ctycara) 0.0 0) - (while (or (!= (status-of-level-and-borrows *level* 'ctycara #f) 'active) - (!= (status-of-level-and-borrows *level* 'mhcitya #f) 'active) - ) + (while (or (!= (level-status? *level* 'ctycara #f) 'active) (!= (level-status? *level* 'mhcitya #f) 'active)) (suspend) ) (call-parent-state-handler code) @@ -1924,7 +1929,7 @@ (let ((s5-0 *traffic-manager*) (gp-0 (new 'stack 'traffic-object-spawn-params)) ) - (set! (-> gp-0 position quad) (-> (new 'static 'vector :x -1781217.8 :y 49152.0 :z 3740217.0 :w 1.0) quad)) + (vector-copy! (-> gp-0 position) (new 'static 'vector :x -1781217.8 :y 49152.0 :z 3740217.0 :w 1.0)) (quaternion-copy! (-> gp-0 rotation) (new 'static 'quaternion :x 0.0013 :y 0.744 :z -0.0068 :w 0.6681)) (set! (-> gp-0 object-type) (traffic-type civilian-car-a)) (set! (-> gp-0 behavior) (the-as uint 0)) @@ -1942,7 +1947,7 @@ (let ((gp-1 (entity-by-name "tmanager-1"))) (when gp-1 (let ((s5-1 (new 'stack-no-clear 'enemy-init-by-other-params))) - (set! (-> s5-1 trans quad) (-> (new 'static 'vector :x -1785244.0 :y 35316.53 :z 3693337.5 :w 1.0) quad)) + (vector-copy! (-> s5-1 trans) (new 'static 'vector :x -1785244.0 :y 35316.53 :z 3693337.5 :w 1.0)) (quaternion-copy! (-> s5-1 quat) (new 'static 'quaternion :y 0.5494 :w 0.8355)) (set! (-> s5-1 entity) gp-1) (set! (-> s5-1 directed?) #f) @@ -1977,7 +1982,7 @@ ) (let ((gp-3 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-38 (new 'static 'vector :w 1.0))) - (set! (-> gp-3 pos quad) (-> a0-38 quad)) + (vector-copy! (-> gp-3 pos) a0-38) ) (quaternion-identity! (-> gp-3 quat)) (set! (-> gp-3 flags) (task-arrow-flags taf3 taf8)) @@ -2121,7 +2126,8 @@ (process-entity-status! self (entity-perm-status dead) #t) (sound-play "bomb-set") (set! (-> self sound-id) (sound-play "time-tick-loop")) - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) (sound-stop (-> self sound-id)) (sound-play "bomb-explode") (setup-masks (-> self draw) 0 -1) @@ -2132,7 +2138,7 @@ ) 0 (let ((gp-4 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-4 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-4 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-4 spawn-quat)) (set! (-> gp-4 radius) 32768.0) (set! (-> gp-4 scale) 1.0) @@ -2161,7 +2167,7 @@ (set! (-> a1-11 hit-y-reaction) 0.6) (set! (-> a1-11 scale-rand-lo) 0.4) (set! (-> a1-11 scale-rand-hi) 0.7) - (set! (-> a1-11 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> a1-11 fountain-rand-transv-lo) (-> self root trans)) (+! (-> a1-11 fountain-rand-transv-lo y) -40960.0) (debris-spawn self a1-11 *combox-debris-params* (the-as process-drawable #f)) ) @@ -2171,6 +2177,7 @@ ) (defmethod init-from-entity! ((this com-power-box) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-80 vector) (sv-96 vector)) (rlet ((acc :class vf) (vf0 :class vf) diff --git a/goal_src/jak3/levels/city/farm/ctyfarm-obs.gc b/goal_src/jak3/levels/city/farm/ctyfarm-obs.gc index 472a88984f8..d6b881fa89a 100644 --- a/goal_src/jak3/levels/city/farm/ctyfarm-obs.gc +++ b/goal_src/jak3/levels/city/farm/ctyfarm-obs.gc @@ -901,6 +901,7 @@ ) (defmethod init-from-entity! ((this farm-marrow) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -935,6 +936,7 @@ ) (defmethod init-from-entity! ((this farm-beetree) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -969,6 +971,7 @@ ) (defmethod init-from-entity! ((this farm-cabbage) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1003,6 +1006,7 @@ ) (defmethod init-from-entity! ((this farm-small-cabbage) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1037,6 +1041,7 @@ ) (defmethod init-from-entity! ((this farm-chilirots) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1079,6 +1084,7 @@ ) (defmethod init-from-entity! ((this farm-sprinkler-barrels) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1196,7 +1202,7 @@ (defun birth-func-ctyfarma-drip ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (vector-copy! (-> s4-0 start-pos) (-> arg2 launchrot)) (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) (let ((v1-2 s4-0)) (set! (-> v1-2 radius) 40.96) @@ -1427,7 +1433,7 @@ (defun birth-func-ctyfarmb-drip ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (vector-copy! (-> s4-0 start-pos) (-> arg2 launchrot)) (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) (let ((v1-2 s4-0)) (set! (-> v1-2 radius) 40.96) diff --git a/goal_src/jak3/levels/city/freehq/freehq-scenes.gc b/goal_src/jak3/levels/city/freehq/freehq-scenes.gc index 02b4fe18f3f..26152dc85b6 100644 --- a/goal_src/jak3/levels/city/freehq/freehq-scenes.gc +++ b/goal_src/jak3/levels/city/freehq/freehq-scenes.gc @@ -125,6 +125,7 @@ (defmethod init-from-entity! ((this freehq-sml-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/goal_src/jak3/levels/city/hijack/billiards.gc b/goal_src/jak3/levels/city/hijack/billiards.gc index 28e9ebeef2e..a41d24b3628 100644 --- a/goal_src/jak3/levels/city/hijack/billiards.gc +++ b/goal_src/jak3/levels/city/hijack/billiards.gc @@ -66,8 +66,8 @@ (defmethod init! ((this billiard-table) (arg0 int) (arg1 vector) (arg2 vector)) (set! (-> this billiards) (new 'process 'billiard-ball-array arg0)) (set! (-> this billiards length) arg0) - (set! (-> this min-xyz quad) (-> arg1 quad)) - (set! (-> this max-xyz quad) (-> arg2 quad)) + (vector-copy! (-> this min-xyz) arg1) + (vector-copy! (-> this max-xyz) arg2) (dotimes (v1-4 (-> this billiards length)) (set! (-> this billiards data v1-4 size) 4096.0) ) @@ -135,13 +135,13 @@ (a1-4 (new 'stack-no-clear 'vector)) ) (let ((a3-0 (new 'stack-no-clear 'vector))) - (set! (-> a3-0 quad) (-> this accum-force quad)) + (vector-copy! a3-0 (-> this accum-force)) (vector-float*! a1-4 (-> a2-1 pos) (- 2.0 f1-1)) (vector-! a1-4 a1-4 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) (vector+float*! a1-4 a1-4 a3-0 f0-1) ) - (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) - (set! (-> a2-1 pos quad) (-> a1-4 quad)) + (vector-copy! (-> a2-1 prev-pos) (-> a2-1 pos)) + (vector-copy! (-> a2-1 pos) a1-4) ) ) ) @@ -231,7 +231,7 @@ ) (logior! (-> s3-1 flags) (billiard-ball-flag bb0)) (vector+float*! v1-38 (-> s3-1 prev-pos) a0-24 f30-1) - (set! (-> s1-2 quad) (-> a0-24 quad)) + (vector-copy! s1-2 a0-24) (set! (-> s1-2 data s2-1) (* -1.0 (-> s1-2 data s2-1))) (vector+float*! (-> s3-1 pos) v1-38 s1-2 (- 1.0 f30-1)) (let ((v1-39 (vector-normalize-copy! (new 'stack-no-clear 'vector) s1-2 1.0))) diff --git a/goal_src/jak3/levels/city/hijack/cty-hijack-missile.gc b/goal_src/jak3/levels/city/hijack/cty-hijack-missile.gc index 2a3c39db228..fd0f79c94b8 100644 --- a/goal_src/jak3/levels/city/hijack/cty-hijack-missile.gc +++ b/goal_src/jak3/levels/city/hijack/cty-hijack-missile.gc @@ -301,7 +301,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-hijack-missile" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) self (set! (-> self particle-trail) @@ -339,7 +339,7 @@ ) ) (if a0-5 - (set! (-> arg0 quad) (-> (get-trans a0-5 3) quad)) + (vector-copy! arg0 (get-trans a0-5 3)) ) ) arg0 @@ -347,7 +347,7 @@ (defmethod probe-ground ((this cty-hijack-missile) (arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 start-pos) arg0) (vector-! (-> v1-0 move-dist) arg1 (-> v1-0 start-pos)) (let ((a0-4 v1-0)) (set! (-> a0-4 radius) 8192.0) @@ -386,9 +386,7 @@ (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -2)) s5-0 ) - (set! (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -1) quad) - (-> s5-0 quad) - ) + (vector-copy! (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -1)) s5-0) (push-back (-> this tracked-player-positions) s5-0) ) ) @@ -498,11 +496,11 @@ :enter (behavior () (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217)) ) ) @@ -520,11 +518,11 @@ (logior! (-> self draw status) (draw-control-status no-draw)) (cond ((logtest? (-> *part-group-id-table* 296 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 296)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 296)) ) ) @@ -557,7 +555,7 @@ (s5-1 (new 'stack-no-clear 'vector)) ) (let ((s0-0 (new 'stack-no-clear 'vector))) - (set! (-> s0-0 quad) (-> s2-0 root transv quad)) + (vector-copy! s0-0 (-> s2-0 root transv)) (let ((v1-8 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s2-0 root quat))) (s1-0 (new 'stack-no-clear 'vector)) ) @@ -590,7 +588,7 @@ ) ) ) - (set! (-> arg0 quad) (-> s5-1 quad)) + (vector-copy! arg0 s5-1) ) (add-debug-sphere #t (bucket-id debug) arg0 (meters 2) *color-yellow*) arg0 @@ -624,11 +622,11 @@ (logior! (-> self draw status) (draw-control-status no-draw)) (cond ((logtest? (-> *part-group-id-table* 88 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 88)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 88)) ) ) @@ -702,7 +700,7 @@ (defmethod cty-hijack-missile-method-49 ((this cty-hijack-missile)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) - (set! (-> gp-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> gp-0 trans) (-> this root trans)) (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -3686.4) (spawn-from-mat (-> this part) gp-0) (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -4096.0) @@ -744,16 +742,14 @@ (when (-> this is-leader?) (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((s3-0 arg0)) - (set! (-> s4-0 quad) (-> (get-trans - (the-as process-focusable (if (type? s3-0 process-focusable) - (the-as process-focusable s3-0) - ) - ) - 3 - ) - quad - ) - ) + (vector-copy! s4-0 (get-trans + (the-as process-focusable (if (type? s3-0 process-focusable) + (the-as process-focusable s3-0) + ) + ) + 3 + ) + ) ) (let ((s3-1 (get-tracked-obj-pos this (new 'stack-no-clear 'vector)))) 0.0 @@ -865,9 +861,9 @@ (if (not s5-0) (return 0) ) - (set! (-> a0-5 quad) (-> s5-0 root transv quad)) + (vector-copy! a0-5 (-> s5-0 root transv)) (let ((f30-0 (vector-normalize-ret-len! a0-5 1.0))) - (set! (-> s4-1 quad) (-> this target-pos quad)) + (vector-copy! s4-1 (-> this target-pos)) (when #t (seek! (-> this offset-dist) (-> this missile-dist) (* 20480.0 (seconds-per-frame))) (seek! (-> this vel-factor) *k1* (* 2.0 (seconds-per-frame))) @@ -1010,8 +1006,8 @@ (set! (-> this lisa rate y-mag) (* 10240.0 (seconds-per-frame))) (set! (-> this lisa rate period-shift) (* 16384.0 (seconds-per-frame))) (set! (-> this lisa dest period-shift) 16384.0) - (lissajous-interp-method-10 (-> this lisa)) - (let ((s5-3 (lissajous-interp-method-9 (-> this lisa) (new 'stack-no-clear 'vector)))) + (update! (-> this lisa)) + (let ((s5-3 (evaluate! (-> this lisa) (new 'stack-no-clear 'vector)))) (vector-float*! s5-3 s5-3 0.5) (vector-lerp! (-> this lisa-pt) (-> this lisa-pt) s5-3 1.0) (let ((a2-9 (matrix-f-u-compose (matrix-identity! (new 'stack-no-clear 'matrix)) sv-76 *up-vector*))) @@ -1039,7 +1035,7 @@ (vector-normalize! s5-5 1.0) (quaternion-look-at! (-> this root quat) s5-5 *up-vector*) ) - (set! (-> this last-trans quad) (-> this root trans quad)) + (vector-copy! (-> this last-trans) (-> this root trans)) (none) ) @@ -1067,7 +1063,7 @@ (set! (-> this lisa dest wx) 1.0) (set! (-> this lisa dest wy) 1.2) (set! (-> this lisa dest period-shift) 16384.0) - (set! (-> this basetrans quad) (-> this root trans quad)) + (vector-copy! (-> this basetrans) (-> this root trans)) (none) ) @@ -1166,8 +1162,8 @@ (set! (-> self lisa rate y-mag) (* 10240.0 (seconds-per-frame))) (set! (-> self lisa rate period-shift) (* 16384.0 (seconds-per-frame))) (set! (-> self lisa dest period-shift) 16384.0) - (lissajous-interp-method-10 (-> self lisa)) - (let ((gp-0 (lissajous-interp-method-9 (-> self lisa) (new 'stack-no-clear 'vector)))) + (update! (-> self lisa)) + (let ((gp-0 (evaluate! (-> self lisa) (new 'stack-no-clear 'vector)))) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self target-pos) (-> self basetrans)))) (vector-normalize! s5-1 1.0) (vector-float*! gp-0 gp-0 0.5) @@ -1183,7 +1179,7 @@ (vector-normalize! gp-2 1.0) (quaternion-look-at! (-> self root quat) gp-2 *up-vector*) ) - (set! (-> self last-trans quad) (-> self root trans quad)) + (vector-copy! (-> self last-trans) (-> self root trans)) (if (and (< (vector-vector-distance (-> self root trans) (get-tracked-obj-pos self (new 'stack-no-clear 'vector))) 20480.0 ) diff --git a/goal_src/jak3/levels/city/hijack/cty-hijack.gc b/goal_src/jak3/levels/city/hijack/cty-hijack.gc index 5bc741fc9c0..7fc58f6f55c 100644 --- a/goal_src/jak3/levels/city/hijack/cty-hijack.gc +++ b/goal_src/jak3/levels/city/hijack/cty-hijack.gc @@ -34,7 +34,7 @@ (new 'static 'talker-speech-class :name "dax373" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -99,7 +99,7 @@ (new 'static 'talker-speech-class :name "dax381" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xa :neg #x1 :on-close #f @@ -236,7 +236,7 @@ (new 'static 'talker-speech-class :name "jak103" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1b :neg #x1 :on-close #f @@ -269,7 +269,7 @@ (new 'static 'talker-speech-class :name "jak107" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1f :neg #x1 :on-close #f @@ -294,7 +294,7 @@ (new 'static 'talker-speech-class :name "jak110" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x22 :neg #x1 :on-close #f @@ -311,7 +311,7 @@ (new 'static 'talker-speech-class :name "jak112" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x24 :neg #x1 :on-close #f @@ -320,7 +320,7 @@ (new 'static 'talker-speech-class :name "torn149" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x25 :neg #x1 :on-close #f @@ -353,7 +353,7 @@ (new 'static 'talker-speech-class :name "torn153" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x29 :neg #x1 :on-close #f @@ -813,7 +813,7 @@ ((= arg0 3) (let ((gp-1 (new 'static 'vector))) (if (-> this is-naughty-ottsel?) - (set! (-> gp-1 quad) (-> this root trans quad)) + (vector-copy! gp-1 (-> this root trans)) (vector<-cspace! gp-1 (-> this node-list data 16)) ) gp-1 @@ -922,7 +922,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-missile-lure" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 orient)) (set-vector! (-> self root scale) 3.0 3.0 3.0 1.0) (set! (-> self is-naughty-ottsel?) (-> arg0 is-naughty-ottsel?)) @@ -1013,7 +1013,7 @@ (defmethod find-and-lure-missiles ((this cty-missile-lure)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> this root trans quad)) + (vector-copy! v1-0 (-> this root trans)) (set! (-> v1-0 w) 327680.0) ) (when #f @@ -1366,7 +1366,7 @@ (set-setting! 'exclusive-load '((ignore lctyhijk)) 0.0 0) (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> gp-0 flags) (traffic-spawn-flags)) - (set! (-> gp-0 position quad) (-> *pickup-start-pos* quad)) + (vector-copy! (-> gp-0 position) *pickup-start-pos*) (quaternion-identity! (-> gp-0 rotation)) (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *pickup-start-angle*) (set! (-> gp-0 velocity quad) (the-as uint128 0)) @@ -1388,7 +1388,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-1 pos quad) (-> *pickup-start-pos* quad)) + (vector-copy! (-> gp-1 pos) *pickup-start-pos*) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags taf8)) (set! (-> gp-1 map-icon) (the-as uint 12)) @@ -1410,7 +1410,7 @@ (when (time-elapsed? (-> self last-check-vehicle-vis-time) (seconds 0.5)) (set-time! (-> self last-check-vehicle-vis-time)) (let ((s5-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-1 start-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s5-1 start-pos) (target-pos 0)) (vector-! (-> s5-1 move-dist) (get-trans gp-0 0) (-> s5-1 start-pos)) (let ((v1-20 s5-1)) (set! (-> v1-20 radius) 40.96) @@ -1759,7 +1759,7 @@ (set! (-> s4-0 is-leader?) #t) (set! (-> s4-0 is-leader?) #f) ) - (set! (-> s4-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 pos) arg0) (quaternion-copy! (-> s4-0 quat) arg1) (set! (-> s4-0 track-obj) (-> this hpickup)) (let* ((s3-0 (get-process *default-dead-pool* cty-hijack-missile #x4000 1)) @@ -1835,7 +1835,7 @@ (let ((gp-0 (new 'stack-no-clear 'cty-missile-lure-init-params))) (dotimes (s5-0 (-> *cty-hijack-lure-positions* length)) (let ((a0-21 (-> *cty-hijack-lure-positions* s5-0))) - (set! (-> gp-0 pos quad) (-> a0-21 pos quad)) + (vector-copy! (-> gp-0 pos) (-> a0-21 pos)) ) (quaternion-identity! (-> gp-0 orient)) (set! (-> gp-0 is-naughty-ottsel?) #f) @@ -1843,7 +1843,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'cty-missile-lure-init-params))) - (set! (-> gp-1 pos quad) (-> *naughty-ottsel-pos* quad)) + (vector-copy! (-> gp-1 pos) *naughty-ottsel-pos*) (quaternion-identity! (-> gp-1 orient)) (set! (-> gp-1 is-naughty-ottsel?) #t) (let ((s5-1 (get-process *default-dead-pool* cty-missile-lure #x4000 1))) @@ -1940,6 +1940,7 @@ ) (defmethod init-from-entity! ((this cty-missile-launcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) @@ -2137,11 +2138,11 @@ (dotimes (s5-0 (-> *guide-arrow-list* length)) (let ((a0-1 (new 'stack-no-clear 'guide-arrow-init-params))) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> *guide-arrow-list* s5-0 pos quad)) + (vector-copy! v1-0 (-> *guide-arrow-list* s5-0 pos)) (let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> *guide-arrow-list* s5-0 facing quad)) - (set! (-> a0-1 pos quad) (-> v1-0 quad)) - (set! (-> a0-1 facing quad) (-> a1-5 quad)) + (vector-copy! a1-5 (-> *guide-arrow-list* s5-0 facing)) + (vector-copy! (-> a0-1 pos) v1-0) + (vector-copy! (-> a0-1 facing) a1-5) ) ) (set! (-> a0-1 xz?) #t) diff --git a/goal_src/jak3/levels/city/hijack/guide-arrow.gc b/goal_src/jak3/levels/city/hijack/guide-arrow.gc index ce48fd977bd..f4644b8fd30 100644 --- a/goal_src/jak3/levels/city/hijack/guide-arrow.gc +++ b/goal_src/jak3/levels/city/hijack/guide-arrow.gc @@ -43,7 +43,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-guide-arrow" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (cond ((-> arg0 xz?) (let ((a1-5 (matrix-u-r-compose @@ -102,7 +102,7 @@ ) ) :enter (behavior () - (set! (-> self base-pos quad) (-> self root trans quad)) + (vector-copy! (-> self base-pos) (-> self root trans)) (set-time! (-> self state-time)) ) :trans (behavior () diff --git a/goal_src/jak3/levels/city/hijack/kg-vehicles.gc b/goal_src/jak3/levels/city/hijack/kg-vehicles.gc index 4f003c0e78a..eaf7793dafa 100644 --- a/goal_src/jak3/levels/city/hijack/kg-vehicles.gc +++ b/goal_src/jak3/levels/city/hijack/kg-vehicles.gc @@ -447,12 +447,12 @@ (defmethod reset-accum-force ((this pickup-sled-sim)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this mat uvec quad)) + (vector-copy! s5-0 (-> this mat uvec)) (set! (-> s5-0 y) 0.0) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this mat fvec quad)) + (vector-copy! s4-0 (-> this mat fvec)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this mat rvec quad)) + (vector-copy! s3-0 (-> this mat rvec)) (let ((s2-0 (new 'stack-no-clear 'matrix))) (set! (-> s4-0 y) 0.0) (set! (-> s3-0 y) 0.0) @@ -537,18 +537,7 @@ (set! (-> this sled drag) 0.05) (set! (-> this sled bounce-wall-friction) 0.3) (set! (-> this sled ball-friction) 0.05) - (let* ((v1-45 (-> this sled mat)) - (a3-2 (-> this rbody matrix)) - (a0-13 (-> a3-2 rvec quad)) - (a1-5 (-> a3-2 uvec quad)) - (a2-2 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> v1-45 rvec quad) a0-13) - (set! (-> v1-45 uvec quad) a1-5) - (set! (-> v1-45 fvec quad) a2-2) - (set! (-> v1-45 trans quad) a3-3) - ) + (matrix-copy! (-> this sled mat) (-> this rbody matrix)) (let ((s5-1 (new 'stack-no-clear 'vector))) (get-linear-accel! this s5-1) (let ((f0-10 (vector-normalize-ret-len! s5-1 1.0))) @@ -570,7 +559,7 @@ (-> this sled billiards data s5-2) (let ((s3-3 (new 'stack-no-clear 'vector))) (vector-matrix*! s3-3 (the-as vector (-> this sled billiards data s5-2)) (-> this sled mat)) - (set! (-> s4-2 root trans quad) (-> s3-3 quad)) + (vector-copy! (-> s4-2 root trans) s3-3) ) ) ) @@ -766,7 +755,7 @@ (defun spawn-pickup () (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> gp-0 proc) #f) - (set! (-> gp-0 position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> gp-0 position) (target-pos 0)) (quaternion-identity! (-> gp-0 rotation)) (set! (-> gp-0 velocity quad) (the-as uint128 0)) (set! (-> gp-0 behavior) (the-as uint 0)) @@ -823,7 +812,7 @@ (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (the-as quaternion (-> this rbody rot)))) (s4-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-2 quad) (-> this rbody lin-momentum quad)) + (vector-copy! s4-2 (-> this rbody lin-momentum)) 0.0 (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) @@ -833,7 +822,7 @@ (let ((f0-20 (vector-dot s4-2 s3-0))) (cond (#f - (set! (-> s4-2 quad) (-> s3-0 quad)) + (vector-copy! s4-2 s3-0) ) (else (let ((s2-1 (vector-cross! (new 'stack-no-clear 'vector) s4-2 s3-0)) diff --git a/goal_src/jak3/levels/city/industrial/ctyinda-obs.gc b/goal_src/jak3/levels/city/industrial/ctyinda-obs.gc index fdd350c54cb..ed787865d06 100644 --- a/goal_src/jak3/levels/city/industrial/ctyinda-obs.gc +++ b/goal_src/jak3/levels/city/industrial/ctyinda-obs.gc @@ -54,6 +54,7 @@ ) (defmethod init-from-entity! ((this ctyinda-vingate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (when (task-node-closed? (game-task-node sewer-hum-kg-resolution)) (process-entity-status! this (entity-perm-status dead) #t) (deactivate this) @@ -121,6 +122,7 @@ ) (defmethod init-from-entity! ((this ctyinda-evil-streetlamp) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc b/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc index 4869d38288a..32196cb12cb 100644 --- a/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc +++ b/goal_src/jak3/levels/city/port/attack/ctyport-attack-bbush.gc @@ -370,7 +370,7 @@ ) ) (dotimes (v1-46 (-> *ctyport-package-positions* length)) - (set! (-> *ctyport-attack-bbush-positions* v1-46 pos quad) (-> *ctyport-package-positions* v1-46 pos quad)) + (vector-copy! (-> *ctyport-attack-bbush-positions* v1-46 pos) (-> *ctyport-package-positions* v1-46 pos)) (set! (-> *ctyport-attack-bbush-positions* v1-46 on-water?) (-> *ctyport-package-positions* v1-46 on-water?)) ) (set! (-> *ctyport-attack-bbush-positions* length) (-> *ctyport-package-positions* length)) @@ -379,7 +379,7 @@ (dotimes (a0-35 (-> this actor-group 0 length)) (let ((a1-36 (-> this actor-group 0 data a0-35 actor))) (when a1-36 - (set! (-> *ctyport-attack-bbush-positions* v1-53 pos quad) (-> a1-36 extra trans quad)) + (vector-copy! (-> *ctyport-attack-bbush-positions* v1-53 pos) (-> a1-36 extra trans)) (set! (-> *ctyport-attack-bbush-positions* v1-53 on-water?) #f) (set! (-> *ctyport-attack-bbush-positions* v1-53 probe?) #t) (+! v1-53 1) @@ -426,7 +426,7 @@ (suspend) (while (or (not *target*) (not *spawn-actors*) - (!= (status-of-level-and-borrows *level* 'lpatkcs #f) 'active) + (!= (level-status? *level* 'lpatkcs #f) 'active) (focus-test? *target* board) ) (if *target* @@ -549,11 +549,11 @@ ;; WARN: Return type mismatch quaternion vs object. (defmethod ctyport-attack-manager-method-51 ((this ctyport-attack-manager-bbush) (arg0 traffic-object-spawn-params)) - (set! (-> arg0 position quad) (-> (new 'static 'vector :x 2492384.8 :y 34605.055 :z 6578958.5 :w 1.0) quad)) + (vector-copy! (-> arg0 position) (new 'static 'vector :x 2492384.8 :y 34605.055 :z 6578958.5 :w 1.0)) (quaternion-copy! (-> arg0 rotation) (new 'static 'quaternion :x 0.0002 :y 0.6305 :z 0.0011 :w -0.7761)) (let ((v1-1 (the-as entity-actor (entity-by-name "port-attack-bbush-1")))) (when v1-1 - (set! (-> arg0 position quad) (-> v1-1 extra trans quad)) + (vector-copy! (-> arg0 position) (-> v1-1 extra trans)) (quaternion-copy! (-> arg0 rotation) (-> v1-1 quat)) ) ) diff --git a/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc b/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc index 705d46875ad..b173dca343d 100644 --- a/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc +++ b/goal_src/jak3/levels/city/port/attack/ctyport-attack.gc @@ -21,7 +21,7 @@ (new 'static 'talker-speech-class :name "torn208" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1 :neg #x1 :on-close #f @@ -30,7 +30,7 @@ (new 'static 'talker-speech-class :name "torn209" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -39,7 +39,7 @@ (new 'static 'talker-speech-class :name "torn210" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :neg #x1 :on-close #f @@ -48,7 +48,7 @@ (new 'static 'talker-speech-class :name "torn211" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :neg #x1 :on-close #f @@ -121,7 +121,7 @@ (new 'static 'talker-speech-class :name "torn220" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xd :neg #x1 :on-close #f @@ -130,7 +130,7 @@ (new 'static 'talker-speech-class :name "torn221" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xe :neg #x1 :on-close #f @@ -403,7 +403,7 @@ (new 'static 'talker-speech-class :name "port-attack-jump-hint" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x30 :text-duration (seconds 3) :neg #x1 @@ -1045,7 +1045,7 @@ (defun record-pos () (when (cpad-pressed? 0 r1) - (set! (-> *recorded-pos* *recorded-length* quad) (-> (target-pos 0) quad)) + (vector-copy! (-> *recorded-pos* *recorded-length*) (target-pos 0)) (set! *recorded-length* (+ *recorded-length* 1)) ) (none) @@ -1649,7 +1649,7 @@ (case message (('activate) (let ((v1-1 (the-as object (-> block param 0)))) - (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + (vector-copy! (-> self root trans) (the-as vector v1-1)) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual idle) @@ -1887,7 +1887,7 @@ (let ((a0-42 *ctyport-barrier-pos*) (s5-1 (new 'stack-no-clear 'task-arrow-params)) ) - (set! (-> s5-1 pos quad) (-> a0-42 quad)) + (vector-copy! (-> s5-1 pos) a0-42) (quaternion-identity! (-> s5-1 quat)) (set! (-> s5-1 flags) (task-arrow-flags)) (set! (-> s5-1 map-icon) (the-as uint 12)) @@ -1923,7 +1923,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self hum-sound) (new-sound-id)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 530) self)) (go-virtual idle) @@ -1998,7 +1998,7 @@ ;; WARN: Return type mismatch int vs handle. (defmethod ctyport-attack-manager-method-45 ((this ctyport-attack-manager)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this package-positions (-> this current-package-index) pos quad)) + (vector-copy! s5-0 (-> this package-positions (-> this current-package-index) pos)) (let ((s4-0 (process-spawn ctyport-attack-package s5-0 :name "ctyport-attack-package" :to this)) (s3-1 (new 'stack-no-clear 'task-arrow-params)) ) @@ -2008,7 +2008,7 @@ (when (-> this package-positions (-> this current-package-index) probe?) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (let ((v1-21 (new 'stack-no-clear 'vector))) - (set! (-> v1-21 quad) (-> s5-0 quad)) + (vector-copy! v1-21 s5-0) (vector+float*! (-> s2-0 start-pos) v1-21 *up-vector* 24576.0) ) (set! (-> s2-0 move-dist quad) (the-as uint128 0)) @@ -2029,7 +2029,7 @@ ) ) ) - (set! (-> s3-1 pos quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 pos) s5-0) (quaternion-identity! (-> s3-1 quat)) (set! (-> s3-1 flags) (task-arrow-flags)) (set! (-> s3-1 map-icon) (the-as uint 13)) @@ -2045,12 +2045,12 @@ (defmethod ctyport-attack-manager-method-51 ((this ctyport-attack-manager) (arg0 traffic-object-spawn-params)) (cond ((task-node-closed? (game-task-node city-port-attack-mission)) - (set! (-> arg0 position quad) (-> (new 'static 'vector :x -197263.36 :y 52101.12 :z 5516165.0 :w 1.0) quad)) + (vector-copy! (-> arg0 position) (new 'static 'vector :x -197263.36 :y 52101.12 :z 5516165.0 :w 1.0)) (quaternion-identity! (-> arg0 rotation)) (quaternion-rotate-y! (-> arg0 rotation) (-> arg0 rotation) -9102.223) ) (else - (set! (-> arg0 position quad) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans quad)) + (vector-copy! (-> arg0 position) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans)) (quaternion-copy! (-> arg0 rotation) (-> (the-as entity-actor (entity-by-name "cty-dax-missile-launcher-1")) quat) @@ -2138,7 +2138,7 @@ (defstate wait (ctyport-attack-manager) :virtual #t :code (behavior () - (while (or (not *target*) (not *spawn-actors*) (!= (status-of-level-and-borrows *level* 'lpatkcs #f) 'active)) + (while (or (not *target*) (not *spawn-actors*) (!= (level-status? *level* 'lpatkcs #f) 'active)) (if *target* (process-grab? *target* #f) ) @@ -2298,7 +2298,7 @@ ) (a0-10 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-10 quad) (-> (the-as process-focusable a1-3) rbody position quad)) + (vector-copy! a0-10 (-> (the-as process-focusable a1-3) rbody position)) (if (and (< f30-0 (vector-dot *cutscene-trigger-plane-normal* a0-10)) (< (vector-vector-xz-distance a0-10 *cutscene-trigger-plane-pt*) 225280.0) ) @@ -2545,7 +2545,7 @@ :event ctyport-attack-manager-event-handler :trans (behavior () ((-> (method-of-type task-manager active) trans)) - (if (!= (status-of-level-and-borrows *level* 'hiphog #f) 'active) + (if (!= (level-status? *level* 'hiphog #f) 'active) (go-virtual get-on-nuke) ) ) @@ -2570,7 +2570,7 @@ (time-elapsed? (-> *port-attack-speech* 0 play-time) (seconds 1)) ) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans quad)) + (vector-copy! (-> gp-0 pos) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -2668,7 +2668,7 @@ 0.0 (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *x-vector* quad)) + (vector-copy! s4-0 *x-vector*) (let ((f30-0 (-> arg0 initial-angle))) (cond ((-> arg0 inout?) @@ -2686,7 +2686,7 @@ ) ) (else - (set! (-> s5-0 quad) (-> arg0 origin quad)) + (vector-copy! s5-0 (-> arg0 origin)) ) ) (if (-> arg0 spin?) @@ -2743,7 +2743,7 @@ (defun copy-record-pos () (dotimes (v1-0 *recorded-length*) - (set! (-> *ctyport-package-positions* v1-0 pos quad) (-> *recorded-pos* v1-0 quad)) + (vector-copy! (-> *ctyport-package-positions* v1-0 pos) (-> *recorded-pos* v1-0)) ) #f ) @@ -2805,6 +2805,7 @@ (defmethod init-from-entity! ((this cty-dax-missile-launcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) diff --git a/goal_src/jak3/levels/city/port/attack/h-torpedo.gc b/goal_src/jak3/levels/city/port/attack/h-torpedo.gc index f0e9eea0236..a9d58975066 100644 --- a/goal_src/jak3/levels/city/port/attack/h-torpedo.gc +++ b/goal_src/jak3/levels/city/port/attack/h-torpedo.gc @@ -163,7 +163,7 @@ (set! (-> *torpedo-wake-trail* zbuffer?) #f) -(set! (-> *torpedo-wake-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *torpedo-wake-trail* lie-vector) *up-vector*) (set! (-> *torpedo-wake-trail* use-tape-mode?) #t) @@ -563,7 +563,7 @@ (f2-0 8192.0) (f0-0 1024.0) ) - (set! (-> s5-0 start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 start-pos) (-> this rbody position)) (+! (-> s5-0 start-pos y) f2-0) (vector-reset! (-> s5-0 move-dist)) (set! (-> s5-0 move-dist y) (- (+ f2-0 f1-0))) @@ -1103,11 +1103,11 @@ (let ((v1-45 (cond ((logtest? (-> *part-group-id-table* 529 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 529)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 529)) ) ) @@ -1467,7 +1467,7 @@ (defmethod get-tracked-object-pos ((this light-trail-tracker-torpedo) (arg0 process-focusable) (arg1 vector)) (let ((v1-0 arg0)) (when v1-0 - (set! (-> arg1 quad) (-> v1-0 root trans quad)) + (vector-copy! arg1 (-> v1-0 root trans)) (set! (-> arg1 y) 4505.6) (vector+float*! arg1 arg1 (-> v1-0 node-list data 0 bone transform fvec) 49152.0) ) @@ -1613,14 +1613,14 @@ (quaternion-rotate-local-z! s1-0 s1-0 (-> this cam-roll)) (quaternion-normalize! s1-0) (quaternion->matrix s5-0 s1-0) - (set! (-> s5-0 trans quad) (-> this rbody matrix trans quad)) + (vector-copy! (-> s5-0 trans) (-> this rbody matrix trans)) (vector-matrix*! (-> s3-0 0 saved-pt) (the-as vector (-> this info camera look-pos-array)) s5-0) (vector+float*! (-> s3-0 0 saved-pt) (-> s3-0 0 saved-pt) s2-0 0.0) ) (let ((v1-18 (-> s3-0 0 tracking))) (set! (-> v1-18 inv-mat rvec quad) (-> s5-0 rvec quad)) - (set! (-> v1-18 inv-mat uvec quad) (-> s5-0 uvec quad)) - (set! (-> v1-18 inv-mat fvec quad) (-> s5-0 fvec quad)) + (vector-copy! (-> v1-18 inv-mat uvec) (-> s5-0 uvec)) + (vector-copy! (-> v1-18 inv-mat fvec) (-> s5-0 fvec)) ) ) (set! (-> gp-0 slave 0 saved-pt y) (fmax 6144.0 (-> gp-0 slave 0 saved-pt y))) diff --git a/goal_src/jak3/levels/city/port/ctyport-part.gc b/goal_src/jak3/levels/city/port/ctyport-part.gc index 07f9fd07cd1..fa8c437e19b 100644 --- a/goal_src/jak3/levels/city/port/ctyport-part.gc +++ b/goal_src/jak3/levels/city/port/ctyport-part.gc @@ -2167,6 +2167,7 @@ ) (defmethod init-from-entity! ((this hiphog-exterior-marquee) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause enemy)) @@ -2239,6 +2240,7 @@ ) (defmethod init-from-entity! ((this farthy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this root pause-adjust-distance) 1228800.0) diff --git a/goal_src/jak3/levels/city/protect/assault-enemies.gc b/goal_src/jak3/levels/city/protect/assault-enemies.gc index e4880e7c3d9..bed3a2eece0 100644 --- a/goal_src/jak3/levels/city/protect/assault-enemies.gc +++ b/goal_src/jak3/levels/city/protect/assault-enemies.gc @@ -111,7 +111,7 @@ (defmethod go-from-behavior ((this assault-metalhead-flitter) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else @@ -150,7 +150,7 @@ (defmethod go-from-behavior ((this assault-metalhead-grunt) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else @@ -222,7 +222,7 @@ (ja-eval) ) (cond - ((enemy-method-109 self) + ((out-of-bounds? self) (go-die self) ) ((< (vector-vector-xz-distance (-> self root trans) (-> self center-pos)) 16384.0) @@ -246,12 +246,12 @@ ) (defmethod go-from-behavior ((this assault-citizen-norm) (arg0 assault-object-spawn-params)) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (set! (-> this hit-points) (the float (the int (lerp-scale-clamp 10.0 20.0 (the float (-> arg0 suck-level)) 4.0 12.0))) ) (set! (-> this attacker-info max-num-attackers) (the-as uint 1)) - (set! (-> this center-pos quad) (-> (the-as vector (-> arg0 user-data)) quad)) + (vector-copy! (-> this center-pos) (the-as vector (-> arg0 user-data))) (set! (-> this min-flee-time) (-> arg0 flee-time)) (go (method-of-object this flee-madly)) ) @@ -273,7 +273,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-11 quad)) + (vector-copy! (-> a0-3 target-pos) v1-11) ) 0 ) @@ -302,7 +302,7 @@ (a2-0 (-> self nav state)) (a1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-0 (-> a2-0 target-pos)) (when (< (t9-1 a0-2 a1-0) 12288.0) (let* ((gp-0 vector-rotate-around-y!) (s5-0 (new 'stack-no-clear 'vector)) @@ -325,7 +325,7 @@ (let ((v1-23 (-> self nav state))) (logclear! (-> v1-23 flags) (nav-state-flag directional-mode)) (logior! (-> v1-23 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-23 target-pos quad) (-> gp-1 quad)) + (vector-copy! (-> v1-23 target-pos) gp-1) ) ) 0 @@ -335,6 +335,7 @@ ) (defmethod event-handler ((this assault-citizen-norm) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (let ((a0-3 (find-offending-process-focusable arg0 (the-as attack-info (-> arg3 param 1))))) @@ -353,7 +354,7 @@ :virtual #t :trans (behavior () (call-parent-state-handler trans) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-virtual die) ) ) @@ -458,11 +459,11 @@ (defmethod go-from-behavior ((this assault-roboguard) (arg0 assault-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else - (set! (-> this move-dest quad) (-> (the-as vector (-> arg0 user-data)) quad)) + (vector-copy! (-> this move-dest) (the-as vector (-> arg0 user-data))) (go (method-of-object this roll-initial)) ) ) @@ -518,9 +519,7 @@ :virtual #t :enter (behavior () (let ((a0-0 (new 'stack-no-clear 'vector))) - (set! (-> a0-0 quad) - (-> (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)) quad) - ) + (vector-copy! a0-0 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans))) (set! (-> a0-0 y) 0.0) (let ((a1-3 (vector-normalize! a0-0 1.0))) (quaternion-look-at! (-> self root quat) a1-3 *up-vector*) @@ -531,7 +530,7 @@ ) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> a0-2 target-pos) v1-5) ) 0 (nav-enemy-method-181 self) @@ -549,7 +548,7 @@ (let ((gp-0 (-> self nav state)) (v1-28 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-0 heading quad) (-> v1-28 quad)) + (vector-copy! (-> gp-0 heading) v1-28) ) 0 (let ((f30-0 81920.0)) @@ -561,7 +560,7 @@ ) ) ) - (set! (-> s5-0 velocity quad) (-> gp-2 quad)) + (vector-copy! (-> s5-0 velocity) gp-2) ) 0 (let ((v1-37 (-> self nav))) @@ -595,7 +594,7 @@ (a2-0 (-> self nav state)) (v1-7 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-7 quad) (-> a2-0 velocity quad)) + (vector-copy! v1-7 (-> a2-0 velocity)) (set! (-> a0-4 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z)))))) ) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) @@ -746,7 +745,8 @@ (defstate tracking (assault-cleanup) :virtual #t :code (behavior () - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) (set-time! (-> self offscreen-time)) (until #f (suspend) @@ -804,7 +804,7 @@ (return (the-as handle #f)) ) (quaternion-identity! (-> s5-0 rotation)) - (set! (-> s5-0 position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s5-0 position) (target-pos 0)) (set! (-> s5-0 lev) (-> *assault-levels* arg0)) (set! (-> s5-0 velocity quad) (the-as uint128 0)) (set! (-> s5-0 behavior) (the-as uint 1)) @@ -827,7 +827,7 @@ ) (defmethod go-from-behavior ((this assault-crimson-guard) (arg0 assault-object-spawn-params)) - (set! (-> this center-pos quad) (-> (the-as vector (-> arg0 user-data)) quad)) + (vector-copy! (-> this center-pos) (the-as vector (-> arg0 user-data))) (call-parent-method this arg0) ) @@ -863,6 +863,7 @@ ) (defmethod event-handler ((this assault-crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('weaken) (set! (-> this hit-points) (fmin 1.0 (-> this hit-points))) @@ -875,6 +876,7 @@ ;; WARN: Return type mismatch object vs none. (defmethod enemy-common-post ((this assault-crimson-guard)) + "Common implementation of post. Runs ja-post." (call-parent-method this) (when (and (or (not (logtest? (-> this draw status) (draw-control-status on-screen))) (< 102400.0 (vector-vector-xz-distance (-> this root trans) (-> this center-pos))) @@ -921,7 +923,7 @@ ) (logclear! (-> a0-5 flags) (nav-state-flag directional-mode)) (logior! (-> a0-5 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-5 target-pos quad) (-> v1-12 quad)) + (vector-copy! (-> a0-5 target-pos) v1-12) ) 0 ) @@ -1007,7 +1009,7 @@ (set! (-> self pickup-amount) (-> *FACT-bank* health-default-inc)) (set! (-> self pickup-type) (pickup-type health)) (initialize-allocations self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-effects self (-> self pickup-type)) (initialize-options self 0 1024.0 (the-as fact-info #f)) (update-transforms (-> self root)) @@ -1073,7 +1075,7 @@ ) (set! (-> this root) s2-0) ) - (set! (-> this root trans quad) (-> arg0 quad)) + (vector-copy! (-> this root trans) arg0) (set! (-> this ammo-type) arg1) (set! (-> this gun-type) arg2) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) @@ -1222,7 +1224,7 @@ (when (nonzero? (-> self collect-effect)) (cond ((logtest? (-> self collect-effect flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to *target* @@ -1231,7 +1233,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to *target* @@ -1330,6 +1332,7 @@ ) (defmethod enemy-common-post ((this assault-bombbot)) + "Common implementation of post. Runs ja-post." (call-parent-method this) (none) ) @@ -1349,6 +1352,7 @@ ;; WARN: Return type mismatch float vs none. (defmethod init-enemy! ((this assault-bombbot)) + "Typical place for shared init code. Runs from entity or process style init." (with-pp (set! (-> pp level) (level-get *level* 'lctyass)) (call-parent-method this) @@ -1381,8 +1385,8 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-orient-by-quat! s3-0 (-> s4-0 pos-offset) (-> this root quat)) (vector+! s3-0 s3-0 (-> this root trans)) - (set! (-> s4-0 next-position quad) (-> s3-0 quad)) - (set! (-> s4-0 position quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 next-position) s3-0) + (vector-copy! (-> s4-0 position) s3-0) ) (set! (-> s4-0 delta-y) 0.0) ) @@ -1468,7 +1472,7 @@ (set! (-> *assault-bombbot-trail* zbuffer?) #f) -(set! (-> *assault-bombbot-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *assault-bombbot-trail* lie-vector) *up-vector*) (set! (-> *assault-bombbot-trail* use-tape-mode?) #f) @@ -1525,7 +1529,7 @@ (set! (-> *assault-bombbot-trail-2* zbuffer?) #f) -(set! (-> *assault-bombbot-trail-2* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *assault-bombbot-trail-2* lie-vector) *up-vector*) (set! (-> *assault-bombbot-trail-2* use-tape-mode?) #f) @@ -1596,11 +1600,11 @@ (defmethod projectile-method-26 ((this assault-bombbot-shot)) (cond ((logtest? (-> *part-group-id-table* 1435 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1435)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1435)) ) ) @@ -1690,7 +1694,7 @@ (set! (-> gp-0 damage) f0-1) ) (logior! (-> gp-0 options) (projectile-options po14)) - (set! (-> gp-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 pos) arg0) (vector-normalize-copy! (-> gp-0 vel) v1-1 1.0) ) (the-as (pointer projectile) (spawn-projectile assault-bombbot-shot gp-0 this *default-dead-pool*)) @@ -1715,7 +1719,7 @@ ) (cond (gp-0 - (set! (-> this target-pos quad) (-> (get-trans gp-0 3) quad)) + (vector-copy! (-> this target-pos) (get-trans gp-0 3)) (let ((v1-3 (-> this target-pos))) (let ((a0-4 (-> gp-0 control trans))) (let ((a1-4 (-> gp-0 control transv))) @@ -1731,9 +1735,9 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> v1-3 quad) vf6) ) - (set! (-> this start-target-pos quad) (-> this target-pos quad)) - (set! (-> this start-target-vel quad) (-> gp-0 control transv quad)) - (try-update-focus (-> this focus) gp-0 this) + (vector-copy! (-> this start-target-pos) (-> this target-pos)) + (vector-copy! (-> this start-target-vel) (-> gp-0 control transv)) + (focus-on! (-> this focus) gp-0 this) ) (else (clear-focused (-> this focus)) @@ -1826,7 +1830,7 @@ ) (defmethod bombbot-method-208 ((this assault-bombbot) (arg0 vector) (arg1 vector)) - (set! (-> arg1 quad) (-> this target-pos quad)) + (vector-copy! arg1 (-> this target-pos)) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) 0.0 (let* ((f0-1 (vector-normalize-ret-len! s4-1 1.0)) @@ -1882,7 +1886,7 @@ ) (when (< (-> self next-target) (current-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 w) 204800.0) (bombbot-method-196 self a1-0) ) @@ -1894,8 +1898,8 @@ (when v1-33 (when (< (current-time) (+ (-> self next-target) (seconds -2))) (set-time! (-> self start-target)) - (set! (-> self start-target-pos quad) (-> v1-33 root trans quad)) - (set! (-> self start-target-vel quad) (-> v1-33 root transv quad)) + (vector-copy! (-> self start-target-pos) (-> v1-33 root trans)) + (vector-copy! (-> self start-target-vel) (-> v1-33 root transv)) (vector-! (-> self target-delta) (-> v1-33 root trans) (-> self root trans)) ) (let ((a2-2 (-> self target-pos))) @@ -1914,7 +1918,7 @@ (.svf (&-> a2-2 quad) vf6) ) (if (= (-> v1-33 type) target) - (set! (-> self target-pos quad) (-> self start-target-pos quad)) + (vector-copy! (-> self target-pos) (-> self start-target-pos)) ) (if (< (+ (-> self next-target) (seconds -1)) (current-time)) (bombbot-method-197 self) @@ -1977,7 +1981,7 @@ ) (logclear! (-> v1-29 flags) (nav-state-flag directional-mode)) (logior! (-> v1-29 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-29 target-pos quad) (-> a0-20 position quad)) + (vector-copy! (-> v1-29 target-pos) (-> a0-20 position)) ) 0 (nav-enemy-method-187 self) diff --git a/goal_src/jak3/levels/city/protect/assault-shared.gc b/goal_src/jak3/levels/city/protect/assault-shared.gc index dac2fa8f44d..6a588177d94 100644 --- a/goal_src/jak3/levels/city/protect/assault-shared.gc +++ b/goal_src/jak3/levels/city/protect/assault-shared.gc @@ -150,7 +150,7 @@ (new 'static 'talker-speech-class :name "dax238" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xe :neg #x1 :on-close #f @@ -191,7 +191,7 @@ (new 'static 'talker-speech-class :name "grds178a" :channel (gui-channel guard) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x13 :neg #x1 :on-close #f @@ -200,7 +200,7 @@ (new 'static 'talker-speech-class :name "grds178b" :channel (gui-channel guard) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x14 :neg #x1 :on-close #f diff --git a/goal_src/jak3/levels/city/protect/assault-task.gc b/goal_src/jak3/levels/city/protect/assault-task.gc index 757e6d81903..7de35c7285b 100644 --- a/goal_src/jak3/levels/city/protect/assault-task.gc +++ b/goal_src/jak3/levels/city/protect/assault-task.gc @@ -186,7 +186,7 @@ ) ) (let ((a0-8 s2-1)) - (set! (-> a0-8 quad) (-> s2-1 quad)) + (vector-copy! a0-8 s2-1) (set! (-> a0-8 y) 0.0) (vector-normalize! a0-8 1.0) ) @@ -259,7 +259,7 @@ (when v1-10 (let ((v1-11 (-> v1-10 slave))) (when v1-11 - (set! (-> self original-cam-point quad) (-> v1-11 0 saved-pt quad)) + (vector-copy! (-> self original-cam-point) (-> v1-11 0 saved-pt)) (matrix->quaternion (-> self original-cam-quat) (the-as matrix (-> v1-11 0 tracking))) ) ) @@ -305,7 +305,7 @@ (when a0-4 (let ((a0-5 (-> a0-4 slave))) (when a0-5 - (set! (-> a0-5 0 saved-pt quad) (-> self current-room cam-info pos quad)) + (vector-copy! (-> a0-5 0 saved-pt) (-> self current-room cam-info pos)) (let* ((v1-11 (-> a0-5 0 tracking)) (a3-1 (-> self current-room cam-info mat)) (a0-8 (-> a3-1 rvec quad)) @@ -379,7 +379,7 @@ ) ) (let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> self current-room node-positions gp-0 quad)) + (vector-copy! a1-5 (-> self current-room node-positions gp-0)) (move-to-point! (-> *target* control) a1-5) ) ) @@ -388,7 +388,7 @@ (when v1-40 (let ((v1-41 (-> v1-40 slave))) (when v1-41 - (set! (-> v1-41 0 saved-pt quad) (-> self current-room cam-info pos quad)) + (vector-copy! (-> v1-41 0 saved-pt) (-> self current-room cam-info pos)) (let* ((v0-9 (-> v1-41 0 tracking)) (a2-0 (-> self current-room cam-info mat)) (v1-45 (-> a2-0 rvec quad)) @@ -422,7 +422,7 @@ (let ((v1-4 (new 'stack-no-clear 'player-controller-init-params))) (set! (-> v1-4 mode) 'active) (set! (-> v1-4 flags) (player-controller-flag pc1 lock-features letterbox pc4)) - (set! (-> v1-4 targ-pos quad) (-> self current-room center-pos quad)) + (vector-copy! (-> v1-4 targ-pos) (-> self current-room center-pos)) (logclear! (-> v1-4 flags) (player-controller-flag lock-features)) (set! (-> v1-4 notify-proc) (process->handle self)) (send-event (handle->process (-> self h-player-controller)) 'set-params v1-4) @@ -487,7 +487,7 @@ (when v1-47 (let ((v1-48 (-> v1-47 slave))) (when v1-48 - (set! (-> v1-48 0 saved-pt quad) (-> self current-room cam-info pos quad)) + (vector-copy! (-> v1-48 0 saved-pt) (-> self current-room cam-info pos)) (let* ((v0-10 (-> v1-48 0 tracking)) (a2-0 (-> self current-room cam-info mat)) (v1-52 (-> a2-0 rvec quad)) @@ -973,7 +973,7 @@ ) (init-vf0-vector) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *x-vector* quad)) + (vector-copy! s4-0 *x-vector*) (let ((s3-0 (new 'stack-no-clear 'vector)) (f30-0 (/ 65536.0 (the float arg0))) (s2-0 (new 'stack-no-clear 'vector)) @@ -1002,7 +1002,7 @@ (let ((v1-12 (new 'stack-no-clear 'vector)) (s0-1 (new 'stack-no-clear 'collide-query)) ) - (set! (-> v1-12 quad) (-> s3-0 quad)) + (vector-copy! v1-12 s3-0) (vector+float*! (-> s0-1 start-pos) s3-0 *up-vector* 24576.0) (set! (-> s0-1 move-dist quad) (the-as uint128 0)) (set! (-> s0-1 move-dist y) -49152.0) @@ -1017,7 +1017,7 @@ (set! (-> v1-17 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s0-1) 0.0) - (set! (-> s3-0 quad) (-> s0-1 best-other-tri intersect quad)) + (vector-copy! s3-0 (-> s0-1 best-other-tri intersect)) ) ) (vector-! s2-0 s3-0 (-> this current-room center-pos)) @@ -1027,7 +1027,7 @@ (when (handle->process s0-2) (set! sv-880 (new 'stack 'assault-object-spawn-params)) (set! (-> sv-880 flags) (traffic-spawn-flags)) - (set! (-> sv-880 position quad) (-> s3-0 quad)) + (vector-copy! (-> sv-880 position) s3-0) (set! (-> sv-880 behavior) (the-as uint 2)) (set! (-> sv-880 flags) (traffic-spawn-flags)) (set! (-> sv-880 suck-level) (get-suck-level this)) @@ -1069,7 +1069,7 @@ ) (init-vf0-vector) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *x-vector* quad)) + (vector-copy! s4-0 *x-vector*) (let ((s3-0 (new 'stack-no-clear 'vector)) (f30-0 (/ 65536.0 (the float arg0))) (s2-0 (new 'stack-no-clear 'vector)) @@ -1098,7 +1098,7 @@ (let ((v1-13 (new 'stack-no-clear 'vector)) (s0-1 (new 'stack-no-clear 'collide-query)) ) - (set! (-> v1-13 quad) (-> s3-0 quad)) + (vector-copy! v1-13 s3-0) (vector+float*! (-> s0-1 start-pos) s3-0 *up-vector* 24576.0) (set! (-> s0-1 move-dist quad) (the-as uint128 0)) (set! (-> s0-1 move-dist y) -49152.0) @@ -1113,7 +1113,7 @@ (set! (-> v1-18 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s0-1) 0.0) - (set! (-> s3-0 quad) (-> s0-1 best-other-tri intersect quad)) + (vector-copy! s3-0 (-> s0-1 best-other-tri intersect)) ) ) (vector-! s2-0 s3-0 (-> this current-room center-pos)) @@ -1123,7 +1123,7 @@ (when (handle->process s0-2) (set! sv-880 (new 'stack 'assault-object-spawn-params)) (set! (-> sv-880 flags) (traffic-spawn-flags)) - (set! (-> sv-880 position quad) (-> s3-0 quad)) + (vector-copy! (-> sv-880 position) s3-0) (set! (-> sv-880 behavior) (the-as uint 2)) (set! (-> sv-880 flags) (traffic-spawn-flags)) (set! (-> sv-880 suck-level) (get-suck-level this)) @@ -1183,14 +1183,14 @@ (if (= s1-0 -1) (set! s1-0 0) ) - (set! (-> s5-0 quad) (-> this current-room node-positions s1-0 quad)) + (vector-copy! s5-0 (-> this current-room node-positions s1-0)) (vector-! s4-0 (-> this current-room center-pos) s5-0) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (let ((v1-14 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> v1-14 quad) (-> s5-0 quad)) + (vector-copy! v1-14 s5-0) (vector+float*! (-> s0-0 start-pos) s5-0 *up-vector* 16384.0) (set! (-> s0-0 move-dist quad) (the-as uint128 0)) (set! (-> s0-0 move-dist y) -32768.0) @@ -1205,7 +1205,7 @@ (set! (-> v1-19 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s0-0) 0.0) - (set! (-> s5-0 quad) (-> s0-0 best-other-tri intersect quad)) + (vector-copy! s5-0 (-> s0-0 best-other-tri intersect)) (+! (-> s5-0 y) 8192.0) ) ) @@ -1222,7 +1222,7 @@ (let ((s3-1 (get-last-unused-val! (-> *assault-squad* spawn-records s2-0)))) (when (>= s3-1 0) (let ((s1-1 (new 'stack 'assault-bombbot-spawn-params))) - (set! (-> s1-1 position quad) (-> s5-0 quad)) + (vector-copy! (-> s1-1 position) s5-0) (quaternion-look-at! (-> s1-1 quat) s4-0 *up-vector*) (set! (-> s1-1 path) (-> *assault-bombbot-paths* 0)) (set! (-> s1-1 path node 0 position quad) (-> s5-0 quad)) @@ -1243,7 +1243,7 @@ (when (handle->process s2-1) (let ((s0-1 (new 'stack 'assault-object-spawn-params))) (set! (-> s0-1 flags) (traffic-spawn-flags)) - (set! (-> s0-1 position quad) (-> s5-0 quad)) + (vector-copy! (-> s0-1 position) s5-0) (set! (-> s0-1 behavior) (the-as uint 2)) (when (and (< 2 s1-0) (= (-> this current-room-index) 4)) (+! (-> s0-1 position y) 61440.0) @@ -1458,10 +1458,10 @@ ) (while (or (not *target*) (not *spawn-actors*) - (!= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) - (!= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) - (!= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) - (!= (status-of-level-and-borrows *level* 'lctypalt #f) 'active) + (!= (level-status? *level* 'ctypesa #f) 'active) + (!= (level-status? *level* 'ctypesb #f) 'active) + (!= (level-status? *level* 'ctypesc #f) 'active) + (!= (level-status? *level* 'lctypalt #f) 'active) ) (suspend) ) @@ -1502,7 +1502,7 @@ (s3-1 (new 'stack-no-clear 'vector)) ) (let ((a0-9 s2-1)) - (set! (-> a0-9 quad) (-> s2-1 quad)) + (vector-copy! a0-9 s2-1) (set! (-> a0-9 y) 0.0) (vector-normalize! a0-9 1.0) ) @@ -1521,7 +1521,7 @@ (when a0-17 (when (nav-mesh-method-10 a0-17 s4-3 s3-1 (the-as nav-poly #f)) (set! (-> s4-3 y) (-> s3-1 y)) - (set! (-> s3-1 quad) (-> s4-3 quad)) + (vector-copy! s3-1 s4-3) ) ) ) diff --git a/goal_src/jak3/levels/city/protect/cty-protect.gc b/goal_src/jak3/levels/city/protect/cty-protect.gc index 6c2ca2030e9..e25d5692b0b 100644 --- a/goal_src/jak3/levels/city/protect/cty-protect.gc +++ b/goal_src/jak3/levels/city/protect/cty-protect.gc @@ -257,7 +257,7 @@ ) ) ) - (set! (-> arg0 quad) (-> *protect-path* s5-0 quad)) + (vector-copy! arg0 (-> *protect-path* s5-0)) ) arg0 ) @@ -280,7 +280,7 @@ (set! (-> s5-0 num-stages) 2) (set! (-> s5-0 self-index) arg1) (set! (-> s5-0 difficulty) arg2) - (set! (-> s5-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 pos) arg0) (quaternion-identity! (-> s5-0 quat)) (let ((f0-1 (get-protect-suck-t))) (set! (-> s5-0 difficulty-scalar) (lerp 0.29 1.0 (- 1.0 f0-1))) @@ -311,9 +311,11 @@ ((-> (method-of-type task-manager active) trans)) ) :code (behavior () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (talker-spawn-func (-> *talker-speech* 337) *entity-pool* (target-pos 0) (the-as region #f)) - (suspend-for (seconds 2.5)) + (suspend-for (seconds 2.5) + ) (talker-spawn-func (-> *talker-speech* 336) *entity-pool* (target-pos 0) (the-as region #f)) (send-event self 'complete) (sleep-code) @@ -341,7 +343,7 @@ (let ((gp-0 (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) *zero-vector* #f))) (dotimes (s5-0 2) (set! (-> self gunships s5-0) (spawn-gunship self gp-0 s5-0 1.0)) - (set! (-> gp-0 quad) (-> (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) gp-0 #f) quad)) + (vector-copy! gp-0 (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) gp-0 #f)) ) ) ) @@ -355,7 +357,8 @@ ) ) :code (behavior () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (talker-spawn-func (-> *talker-speech* 334) *entity-pool* (target-pos 0) (the-as region #f)) (sleep-code) ) @@ -364,7 +367,7 @@ (defmethod gunship-spawn ((this task-manager-protect-hq) (arg0 protect-gunship-enemy-spawn-params)) (let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params))) (set! (-> gp-0 velocity quad) (the-as uint128 0)) - (set! (-> gp-0 position quad) (-> arg0 pos quad)) + (vector-copy! (-> gp-0 position) (-> arg0 pos)) (quaternion-copy! (-> gp-0 rotation) (-> arg0 quat)) (set! (-> gp-0 behavior) (the-as uint 6)) (set! (-> gp-0 object-type) @@ -378,7 +381,7 @@ (set! (-> gp-0 nav-branch) #f) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((s2-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-0 quad) (-> arg0 pos quad)) + (vector-copy! s3-0 (-> arg0 pos)) (vector+float*! (-> s2-0 start-pos) (-> arg0 pos) *up-vector* 24576.0) (set! (-> s2-0 move-dist quad) (the-as uint128 0)) (set! (-> s2-0 move-dist y) -81920.0) @@ -393,7 +396,7 @@ (set! (-> v1-11 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) - (set! (-> s3-0 quad) (-> s2-0 best-other-tri intersect quad)) + (vector-copy! s3-0 (-> s2-0 best-other-tri intersect)) ) ) (set! (-> gp-0 nav-mesh) (find-nearest-nav-mesh-protect s3-0 (the-as float #x7f800000))) @@ -447,6 +450,7 @@ (defmethod init-from-entity! ((this prot-crate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this entity) arg0) @@ -479,7 +483,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'static 'fact-info)) ) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) 1.0) (set! (-> s4-0 pickup-type) (pickup-type ammo-random)) (let ((f30-0 (get-protect-suck-t))) diff --git a/goal_src/jak3/levels/city/protect/flying-turret.gc b/goal_src/jak3/levels/city/protect/flying-turret.gc index 622a71ee3e4..8d575ee17ee 100644 --- a/goal_src/jak3/levels/city/protect/flying-turret.gc +++ b/goal_src/jak3/levels/city/protect/flying-turret.gc @@ -79,34 +79,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -214,6 +214,7 @@ (defmethod init-enemy-collision! ((this flying-turret)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -261,6 +262,7 @@ ;; WARN: Return type mismatch vector vs process. (defmethod update-focus ((this flying-turret)) + "Potentially update the focus, if there is something better to focus on." (the-as process (when (handle->process (-> this focus handle)) (let* ((s5-1 (handle->process (-> this focus handle))) (a0-9 (if (type? s5-1 process-focusable) @@ -269,7 +271,7 @@ ) (s5-0 (-> this focus-pos)) ) - (set! (-> s5-0 quad) (-> (get-trans a0-9 3) quad)) + (vector-copy! s5-0 (get-trans a0-9 3)) s5-0 ) ) @@ -316,7 +318,7 @@ (not (logtest? (-> (the-as process-focusable a0-27) focus-status) (focus-status disable dead inactive))) ) (let* ((s5-1 this) - (s4-0 (method-of-object s5-1 enemy-method-70)) + (s4-0 (method-of-object s5-1 set-focus!)) (s3-0 (handle->process (-> this current-enemy))) ) (s4-0 @@ -376,7 +378,7 @@ (let ((v1-8 (vector-float*! (new 'stack-no-clear 'vector) (-> this thrust-dir) (-> this speed-target))) (a0-6 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-6 quad) (-> this root transv quad)) + (vector-copy! a0-6 (-> this root transv)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) v1-8 a0-6)) (f30-0 0.0) ) @@ -401,7 +403,7 @@ (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> this root transv quad)) + (vector-copy! s3-0 (-> this root transv)) (when s1-0 (set! (-> s3-0 y) 0.0) (clamp-vector-to-mesh-no-gaps (-> this nav) s4-0 s1-0 s3-0 s2-0) @@ -443,7 +445,7 @@ (s2-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> s4-2 quad)) + (vector-copy! s3-1 s4-2) (when s0-0 (set! (-> s3-1 y) 0.0) (clamp-vector-to-mesh-no-gaps (-> this nav) s1-1 s0-0 s3-1 s2-1) @@ -467,7 +469,7 @@ (let ((s2-2 (new 'stack-no-clear 'vector)) (s4-3 (quaternion-identity! (new 'stack-no-clear 'quaternion))) ) - (set! (-> s2-2 quad) (-> this thrust-dir quad)) + (vector-copy! s2-2 (-> this thrust-dir)) (set! (-> s2-2 y) 0.0) (vector-normalize! s2-2 1.0) (let ((s3-2 (new 'stack-no-clear 'quaternion)) @@ -482,7 +484,7 @@ ) (when (zero? (-> this thrust-mode)) (let ((s3-3 (new 'stack-no-clear 'vector))) - (set! (-> s3-3 quad) (-> s5-1 quad)) + (vector-copy! s3-3 s5-1) (let ((s5-2 (new 'stack-no-clear 'vector))) (let ((s2-3 *up-vector*)) (set! (-> s3-3 y) 0.0) @@ -517,7 +519,7 @@ (let ((s4-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> this root trans quad)) + (vector-copy! gp-0 (-> this root trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector+float*! gp-0 gp-0 (-> s4-0 fvec) -3276.8) (vector+float*! gp-0 gp-0 (-> s4-0 uvec) -409.6) @@ -543,6 +545,7 @@ ) (defmethod enemy-common-post ((this flying-turret)) + "Common implementation of post. Runs ja-post." (with-pp (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) (if (not (and (-> this next-state) (= (-> this next-state name) 'exit-transport))) @@ -622,7 +625,7 @@ (flying-turret-method-225 this) (set-vector! (-> this ground-point) (-> this root trans x) (-> this ground-height) (-> this root trans z) 1.0) (let ((a1-13 (new 'stack-no-clear 'vector))) - (set! (-> a1-13 quad) (-> this ground-point quad)) + (vector-copy! a1-13 (-> this ground-point)) (set-virtual-cur-pos! (-> this nav state) a1-13) ) (let ((f0-56 (+ (-> this desired-height-offset) (-> this ground-height)))) @@ -692,12 +695,13 @@ ) (defmethod init-enemy! ((this flying-turret)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flying-turret" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flying-turret-nav-enemy-info*) + (setup-enemy! this *flying-turret-nav-enemy-info*) (call-parent-method this) (set! (-> this align) (new 'process 'align-control this)) (set! (-> this anim-shuffle) 2) @@ -730,15 +734,15 @@ (let ((a2-0 (-> arg0 state)) (v1-8 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-8 quad) (-> a2-0 heading quad)) + (vector-copy! v1-8 (-> a2-0 heading)) (let ((f30-0 (-> arg0 state speed))) - (set! (-> this thrust-dir quad) (-> v1-8 quad)) + (vector-copy! (-> this thrust-dir) v1-8) (let ((t9-0 vector-vector-xz-distance) (a0-7 (-> this root trans)) (a2-3 (-> this nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-3 target-pos quad)) + (vector-copy! a1-1 (-> a2-3 target-pos)) (let ((f0-1 (t9-0 a0-7 a1-1))) (set! (-> this speed-target) f30-0) (if (!= (-> this chase-mode) 3) @@ -777,7 +781,7 @@ (s2-0 (new 'stack-no-clear 'vector)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> s4-0 focus-pos quad)) + (vector-copy! s3-0 (-> s4-0 focus-pos)) (cspace<-parented-transformq-joint! arg0 arg1) (vector-! s2-0 s3-0 (-> arg0 bone transform trans)) ) @@ -849,8 +853,8 @@ (set! (-> gp-0 vehicle-impulse-factor) 2.0) (logior! (-> gp-0 options) (projectile-options po16)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -861,7 +865,7 @@ (defmethod fire-shot-from-joint-idx ((this flying-turret) (arg0 int)) (local-vars (a0-12 city-attacker-info)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this node-list data arg0 bone transform uvec quad)) + (vector-copy! s5-0 (-> this node-list data arg0 bone transform uvec)) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0)))) (set! (-> s5-0 y) 0.0) (when (or (< (-> this num-shots-fired) 3) (not (logtest? (-> this draw status) (draw-control-status on-screen)))) @@ -985,6 +989,7 @@ ) (defmethod event-handler ((this flying-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('notify) (case (-> arg3 param 0) @@ -1034,7 +1039,7 @@ ) (cond ((< (* f1-0 f1-0) f0-0) - (set! (-> self move-dest quad) (-> self focus-pos quad)) + (vector-copy! (-> self move-dest) (-> self focus-pos)) (set! (-> self chase-mode) (the-as uint 0)) 0 ) @@ -1043,7 +1048,7 @@ ) ) (set! (-> self chase-mode) (the-as uint 1)) - (set! (-> self move-dest quad) (-> self root trans quad)) + (vector-copy! (-> self move-dest) (-> self root trans)) ) ) ) @@ -1069,7 +1074,7 @@ (set! (-> self num-shots-fired) 0) (set! (-> self hit-player?) #f) ) - (set! (-> self move-dest quad) (-> self root trans quad)) + (vector-copy! (-> self move-dest) (-> self root trans)) ) ) ) @@ -1189,7 +1194,7 @@ ) (logclear! (-> a0-71 flags) (nav-state-flag directional-mode)) (logior! (-> a0-71 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-71 target-pos quad) (-> v1-142 quad)) + (vector-copy! (-> a0-71 target-pos) v1-142) ) 0 ) @@ -1270,11 +1275,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 221)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 221)) ) ) @@ -1282,7 +1287,7 @@ (let ((v1-36 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> v1-36 hit-xz-reaction) 0.5) (set! (-> v1-36 hit-y-reaction) 0.6) - (set! (-> v1-36 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> v1-36 fountain-rand-transv-lo) (-> self incoming attack-position)) ) ) (if (not (-> *setting-control* user-current gun-special-mode)) @@ -1323,7 +1328,7 @@ (defmethod go-from-behavior ((this flying-turret) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (when (handle->process (-> arg0 handle)) (let ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) @@ -1337,7 +1342,7 @@ (let ((v1-13 (-> this nav state))) (logclear! (-> v1-13 flags) (nav-state-flag directional-mode)) (logior! (-> v1-13 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-13 target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> v1-13 target-pos) s5-1) ) ) 0 @@ -1367,7 +1372,7 @@ (let ((a0-4 (-> self nav state)) (v1-15 *null-vector*) ) - (set! (-> a0-4 velocity quad) (-> v1-15 quad)) + (vector-copy! (-> a0-4 velocity) v1-15) ) 0 (let ((v1-18 (-> self nav))) @@ -1382,7 +1387,7 @@ (a3-0 (-> self nav state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 target-pos quad)) + (vector-copy! a2-0 (-> a3-0 target-pos)) (t9-0 a0-0 (the-as bucket-id a1-0) a2-0 (meters 2) *color-red*) ) (let ((t9-1 vector-vector-xz-distance) @@ -1390,7 +1395,7 @@ (a2-1 (-> self nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-1 target-pos quad)) + (vector-copy! a1-1 (-> a2-1 target-pos)) (if (< (t9-1 a0-1 a1-1) 16384.0) (go-virtual active) ) @@ -1407,7 +1412,7 @@ (case arg0 ((3) (let ((s5-1 (new 'static 'vector))) - (set! (-> s5-1 quad) (-> this root trans quad)) + (vector-copy! s5-1 (-> this root trans)) (vector<-cspace! s5-1 (-> this node-list data (-> this enemy-info bullseye-joint))) (set! (-> s5-1 w) 10240.0) s5-1 diff --git a/goal_src/jak3/levels/city/protect/protect-gunship.gc b/goal_src/jak3/levels/city/protect/protect-gunship.gc index 2a50e4e179d..264ad6ad319 100644 --- a/goal_src/jak3/levels/city/protect/protect-gunship.gc +++ b/goal_src/jak3/levels/city/protect/protect-gunship.gc @@ -1158,7 +1158,7 @@ (case arg0 ((3) (let ((gp-1 (new 'static 'vector))) - (set! (-> gp-1 quad) (-> this root trans quad)) + (vector-copy! gp-1 (-> this root trans)) (vector+float*! gp-1 gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) 1638.4) (vector+float*! gp-1 gp-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) -6144.0) (set! (-> gp-1 w) 10240.0) @@ -1189,21 +1189,21 @@ (logclear! (-> self mask) (process-mask enemy)) (cond ((logtest? (-> *part-group-id-table* 997 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 997)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 997)) ) ) (cond ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) ) ) @@ -1508,8 +1508,8 @@ (set! (-> self base-difficulty) (-> arg0 difficulty)) (set! (-> self difficulty-scalar) (-> arg0 difficulty-scalar)) (init (-> self missile-info)) - (set! (-> self root trans quad) (-> arg0 pos quad)) - (set! (-> self basetrans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) + (vector-copy! (-> self basetrans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (set! (-> self num-stages) 4) (set-vector! (-> self root scale) 0.4 0.4 0.4 1.0) @@ -1561,7 +1561,7 @@ (defbehavior gunship-exploder-init-by-other gunship-exploder ((arg0 vector) (arg1 quaternion)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self @@ -1591,18 +1591,18 @@ (sound-play "gship-explode") (cond ((logtest? (-> *part-group-id-table* 1453 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1453)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1453)) ) ) ) :code (behavior () (process-spawn gunship-exploder (-> self root trans) (-> self root quat) :name "gunship-exploder" :to self) - (set! (-> self root trans quad) (-> self ground-pt quad)) + (vector-copy! (-> self root trans) (-> self ground-pt)) (let ((gp-1 (new 'static 'fact-info))) (set! (-> gp-1 process) self) (set! (-> gp-1 pickup-type) (pickup-type ammo-random)) @@ -1756,9 +1756,9 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-gunship-missile" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) - (set! (-> self dest-pos quad) (-> arg0 dest-pos quad)) - (set! (-> self launch-dir quad) (-> arg0 launch-dir quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) + (vector-copy! (-> self dest-pos) (-> arg0 dest-pos)) + (vector-copy! (-> self launch-dir) (-> arg0 launch-dir)) (set! (-> self index) (-> arg0 index)) (let ((a1-9 (matrix-f-compose (new 'stack-no-clear 'matrix) (-> self launch-dir)))) (matrix->quaternion (-> self root quat) a1-9) @@ -1789,7 +1789,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('attack-targ) - (set! (-> self dest-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self dest-pos) (the-as vector (-> block param 0))) (set! (-> self attack-time) (the float (-> block param 1))) (go-virtual attack-targ) ) @@ -1863,11 +1863,11 @@ (transform-post) (cond ((logtest? (-> *part-group-id-table* 104 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self dest-pos quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self dest-pos)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 104)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self dest-pos quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self dest-pos)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 104)) ) ) @@ -1884,7 +1884,7 @@ (f0-4 (fmax 0.0 (fmin 1.0 f1-2))) (f30-0 (lerp 10240.0 17920.0 f0-4)) ) - (set! (-> gp-0 quad) (-> self dest-pos quad)) + (vector-copy! gp-0 (-> self dest-pos)) (set! (-> gp-0 w) (* 2.0 f30-0)) (let ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-0 384)) @@ -1980,7 +1980,7 @@ (defmethod gunship-missile-method-31 ((this gunship-missile)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) - (set! (-> gp-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> gp-0 trans) (-> this root trans)) (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -3686.4) (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -4096.0) (init-with-mat! (-> this particle-trail) gp-0) @@ -2018,9 +2018,9 @@ ;; WARN: Return type mismatch int vs handle. (defmethod spawn-missile ((this protect-gunship) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int)) (let ((s5-0 (new 'stack-no-clear 'gunship-missile-init-params))) - (set! (-> s5-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 pos) arg0) (vector-normalize-copy! (-> s5-0 launch-dir) arg1 1.0) - (set! (-> s5-0 dest-pos quad) (-> arg2 quad)) + (vector-copy! (-> s5-0 dest-pos) arg2) (set! (-> s5-0 index) arg4) (set! (-> s5-0 time-to-targ) arg3) (the-as handle (ppointer->handle (process-spawn gunship-missile s5-0 :name "gunship-missile" :to this))) @@ -2152,7 +2152,7 @@ (dotimes (s3-2 s4-3) (when *target* (let ((s2-1 (new 'stack-no-clear 'vector))) - (set! (-> s2-1 quad) (-> (get-trans *target* 1) quad)) + (vector-copy! s2-1 (get-trans *target* 1)) 0.0 0.75 (let ((f30-3 (vector-length (get-transv *target*))) @@ -2171,7 +2171,7 @@ (f26-2 (+ f26-1 (* f24-0 (+ -1.0 (the-as float v1-116))))) (s1-3 (new 'stack-no-clear 'vector)) ) - (set! (-> s1-3 quad) (-> *x-vector* quad)) + (vector-copy! s1-3 *x-vector*) 0.0 (let* ((v1-121 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-122 (the-as number (logior #x3f800000 v1-121))) @@ -2195,7 +2195,7 @@ (let ((v1-138 (new 'stack-no-clear 'vector)) (s2-2 (new 'stack-no-clear 'collide-query)) ) - (set! (-> v1-138 quad) (-> this missile-info missile-dest-positions s5-5 quad)) + (vector-copy! v1-138 (-> this missile-info missile-dest-positions s5-5)) (vector+float*! (-> s2-2 start-pos) v1-138 *up-vector* 24576.0) (set! (-> s2-2 move-dist quad) (the-as uint128 0)) (set! (-> s2-2 move-dist y) -81920.0) @@ -2210,23 +2210,23 @@ (set! (-> v1-141 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-2) 0.0) - (set! (-> this missile-info missile-dest-positions s5-5 quad) (-> s2-2 best-other-tri intersect quad)) + (vector-copy! (-> this missile-info missile-dest-positions s5-5) (-> s2-2 best-other-tri intersect)) (set! (-> this missile-info missile-dest-positions s5-5 y) 0.0) ) ) (sound-play "gship-bombscan") (let ((v1-152 (new 'stack-no-clear 'vector))) - (set! (-> v1-152 quad) (-> this missile-info missile-dest-positions s5-5 quad)) + (vector-copy! v1-152 (-> this missile-info missile-dest-positions s5-5)) (+! (-> v1-152 y) 409.6) (set! (-> this missile-info beacon-handles s5-5) (ppointer->handle (cond ((logtest? (-> *part-group-id-table* 1452 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-152 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-152) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 1452)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-152 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-152) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 1452)) ) ) @@ -2304,7 +2304,7 @@ ) ) (else - (set! (-> s5-0 pos quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 pos) (-> this root trans)) (quaternion-copy! (-> s5-0 quat) (-> this root quat)) ) ) @@ -2319,7 +2319,7 @@ (defmethod probe-ground ((this protect-gunship)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> this ground-pt quad) (-> this basetrans quad)) + (vector-copy! (-> this ground-pt) (-> this basetrans)) (vector+float*! (-> s5-0 start-pos) (-> this ground-pt) *up-vector* 24576.0) (set! (-> s5-0 move-dist quad) (the-as uint128 0)) (set! (-> s5-0 move-dist y) -81920.0) @@ -2334,7 +2334,7 @@ (set! (-> v1-5 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) - (set! (-> this ground-pt quad) (-> s5-0 best-other-tri intersect quad)) + (vector-copy! (-> this ground-pt) (-> s5-0 best-other-tri intersect)) (set! (-> this ground-pt y) 7372.8) ) ) @@ -2362,7 +2362,7 @@ (protect-gunship-method-37 this) (set! (-> this want) (the-as uint 0)) (set! (-> this target) (the-as uint 0)) - (set! (-> this root trans quad) (-> this basetrans quad)) + (vector-copy! (-> this root trans) (-> this basetrans)) (let* ((f0-0 0.4) (f1-1 (* 0.0033333334 (the float (current-time)))) (f0-1 (* f0-0 (- f1-1 (* (the float (the int (/ f1-1 2.5))) 2.5)))) @@ -2370,7 +2370,7 @@ (set! (-> this root trans y) (+ 1228.8 (* 1228.8 (cos (* 65536.0 f0-1))) (-> this basetrans y))) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this last-thrust quad)) + (vector-copy! s5-0 (-> this last-thrust)) 0.0 0.0 (vector+! s5-0 s5-0 (-> this root transv)) @@ -2548,7 +2548,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-7 quad)) + (vector-copy! (-> a0-3 target-pos) v1-7) ) 0 (set! (-> this nav flags) (nav-control-flag display-marks)) @@ -2826,14 +2826,14 @@ ) (logclear! (-> a0-1 flags) (nav-state-flag directional-mode)) (logior! (-> a0-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-1 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> a0-1 target-pos) v1-5) ) 0 (open-doors self) ) :exit (behavior () (set! (-> self suppress-times (log2 16)) (+ (current-time) (seconds 5))) - (set! (-> self last-repo-pos quad) (-> self basetrans quad)) + (vector-copy! (-> self last-repo-pos) (-> self basetrans)) (set! (-> self next-spawn-time) (+ (current-time) (the int (* 300.0 (lerp 7.5 5.0 (-> self difficulty)))))) ) :trans (behavior () @@ -2986,7 +2986,7 @@ (.svf (&-> sv-176 quad) vf6) 0.0 (let ((a0-25 sv-176)) - (set! (-> a0-25 quad) (-> sv-176 quad)) + (vector-copy! a0-25 sv-176) (set! (-> a0-25 y) 0.0) (vector-normalize! a0-25 1.0) ) @@ -3095,7 +3095,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-2 quad)) + (vector-copy! (-> a0-3 target-pos) v1-2) ) 0 ) @@ -3104,7 +3104,7 @@ (defmethod fire-laser ((this protect-gunship) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-float*! (-> s5-0 move-dist) arg1 491520.0) (let ((v1-3 s5-0)) (set! (-> v1-3 radius) 40.96) @@ -3217,9 +3217,9 @@ (a2-0 (-> self nav state)) (a1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-0 (-> a2-0 target-pos)) (if (< (t9-4 a0-4 a1-0) 20480.0) - (set! (-> self last-repo-pos quad) (-> self basetrans quad)) + (vector-copy! (-> self last-repo-pos) (-> self basetrans)) ) ) (when (time-elapsed? (-> self choose-new-point-time) (seconds 3)) @@ -3242,7 +3242,7 @@ ) (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-10 target-pos quad) (-> v1-30 quad)) + (vector-copy! (-> a0-10 target-pos) v1-30) ) 0 ) @@ -3279,7 +3279,7 @@ (* (-> self current-laser-rotate-speed) (seconds-per-frame)) ) (let ((gp-4 (new 'stack-no-clear 'vector))) - (set! (-> gp-4 quad) (-> self root trans quad)) + (vector-copy! gp-4 (-> self root trans)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (the int (lerp 2.0 4.5 (-> self difficulty)))) ) @@ -3290,8 +3290,8 @@ (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((s1-0 *target*)) (when s1-0 - (set! (-> s2-0 quad) (-> (target-pos 0) quad)) - (set! (-> s3-0 quad) (-> (get-trans s1-0 3) quad)) + (vector-copy! s2-0 (target-pos 0)) + (vector-copy! s3-0 (get-trans s1-0 3)) (let ((s0-3 (vector-! (new 'stack-no-clear 'vector) s2-0 (-> self root trans))) (s1-2 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> self root trans))) ) @@ -3380,12 +3380,12 @@ (let ((a0-1 (-> this nav state)) (a1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> a0-1 target-pos quad)) + (vector-copy! a1-0 (-> a0-1 target-pos)) 0.0 (let ((a0-4 (-> this nav state)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> a0-4 heading quad)) + (vector-copy! s5-0 (-> a0-4 heading)) 0.0 (let* ((f0-2 (vector-vector-xz-distance (-> this basetrans) a1-0)) (f0-3 (fmin 102400.0 f0-2)) @@ -3509,7 +3509,7 @@ ) :exit (behavior () (set-time! (-> self last-land-time)) - (set! (-> self last-repo-pos quad) (-> self basetrans quad)) + (vector-copy! (-> self last-repo-pos) (-> self basetrans)) ) :trans (behavior () (let ((a0-0 (-> self state parent))) diff --git a/goal_src/jak3/levels/city/protect/roboguard-city.gc b/goal_src/jak3/levels/city/protect/roboguard-city.gc index 845cd4c319f..ea1cf1fd95f 100644 --- a/goal_src/jak3/levels/city/protect/roboguard-city.gc +++ b/goal_src/jak3/levels/city/protect/roboguard-city.gc @@ -239,34 +239,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 20480.0 - :knocked-soft-vxz-hi 28672.0 - :knocked-soft-vy-lo 36864.0 - :knocked-soft-vy-hi 45056.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 49152.0 - :knocked-hard-vxz-hi 57344.0 - :knocked-hard-vy-lo 49152.0 - :knocked-hard-vy-hi 57344.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 28672.0 - :knocked-yellow-vy-lo 36864.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 114688.0 - :knocked-red-vy-lo 53248.0 - :knocked-red-vy-hi 69632.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 20480.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 5) + :knocked-soft-vxz-hi (meters 7) + :knocked-soft-vy-lo (meters 9) + :knocked-soft-vy-hi (meters 11) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 12) + :knocked-hard-vxz-hi (meters 14) + :knocked-hard-vy-lo (meters 12) + :knocked-hard-vy-hi (meters 14) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 7) + :knocked-yellow-vy-lo (meters 9) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 28) + :knocked-red-vy-lo (meters 13) + :knocked-red-vy-hi (meters 17) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 5) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -356,6 +356,7 @@ ) (defmethod init-enemy-collision! ((this roboguard-city)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -417,7 +418,7 @@ (let ((v1-3 (joint-node roboguard-city-lod0-jg chest)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (vector-copy! gp-0 (-> v1-3 bone transform fvec)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) (set! (-> gp-0 y) 0.0) (set! (-> s5-1 y) 0.0) @@ -573,7 +574,7 @@ (let ((gp-0 (get-current-enemy self))) (when gp-0 (let* ((s5-0 self) - (s4-0 (method-of-object s5-0 enemy-method-70)) + (s4-0 (method-of-object s5-0 set-focus!)) (s3-0 (handle->process (-> self target-status handle))) ) (s4-0 @@ -621,9 +622,9 @@ (defmethod roboguard-city-method-233 ((this roboguard-city) (arg0 vector) (arg1 vector)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> this root trans quad)) + (vector-copy! a1-1 (-> this root trans)) (set! (-> a1-1 w) (-> this root nav-radius)) - (when (not (add-root-sphere-to-hash! (-> this nav) a1-1 255)) + (when (not (check-sphere-blocked! (-> this nav) a1-1 255)) (let* ((s3-0 (new 'stack-no-clear 'vector)) (s2-0 (closest-point-on-mesh (-> this nav) s3-0 arg0 (the-as nav-poly #f))) (s4-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) @@ -901,13 +902,13 @@ (let ((gp-0 (-> self nav state)) (v1-19 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-0 heading quad) (-> v1-19 quad)) + (vector-copy! (-> gp-0 heading) v1-19) ) 0 (let ((gp-1 (-> self nav state)) (v1-24 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-1 velocity quad) (-> v1-24 quad)) + (vector-copy! (-> gp-1 velocity) v1-24) ) 0 (set-time! (-> self state-time)) @@ -946,7 +947,7 @@ ) (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-pos quad) (-> v1-25 quad)) + (vector-copy! (-> a0-9 target-pos) v1-25) ) 0 (when (time-elapsed? (-> self state-time) (-> self reaction-time)) @@ -966,7 +967,7 @@ (a2-0 (-> self nav state)) (v1-7 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-7 quad) (-> a2-0 velocity quad)) + (vector-copy! v1-7 (-> a2-0 velocity)) (set! (-> a0-4 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z)))))) ) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) @@ -1116,13 +1117,13 @@ (let ((gp-0 (-> self nav state)) (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-0 heading quad) (-> v1-12 quad)) + (vector-copy! (-> gp-0 heading) v1-12) ) 0 (let ((gp-1 (-> self nav state)) (v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-1 velocity quad) (-> v1-17 quad)) + (vector-copy! (-> gp-1 velocity) v1-17) ) 0 (let ((v1-20 (-> self nav))) @@ -1142,7 +1143,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> gp-0 target-pos) v1-5) ) 0 ) @@ -1179,13 +1180,13 @@ (let ((gp-0 (-> self nav state)) (v1-18 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-0 heading quad) (-> v1-18 quad)) + (vector-copy! (-> gp-0 heading) v1-18) ) 0 (let ((gp-1 (-> self nav state)) (v1-23 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-1 velocity quad) (-> v1-23 quad)) + (vector-copy! (-> gp-1 velocity) v1-23) ) 0 ) @@ -1241,7 +1242,7 @@ ) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-2 target-pos) v1-1) ) 0 (nav-enemy-method-187 self) @@ -1341,7 +1342,7 @@ (< f0-0 (* f1-0 f1-0)) ) ) - (send-attack self s3-1 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) + (send-attack-from-tshape self s3-1 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) ) ) ) @@ -1366,7 +1367,7 @@ (< f0-2 (* f1-4 f1-4)) ) ) - (send-attack self s5-2 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) + (send-attack-from-tshape self s5-2 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) ) ) ) @@ -1624,6 +1625,7 @@ ) (defmethod go-die ((this roboguard-city)) + "Go to the die state." (go (method-of-object this explode)) ) @@ -1638,7 +1640,7 @@ (t9-0) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1646,6 +1648,7 @@ ) (defmethod go-hostile ((this roboguard-city)) + "Go to the hostile state, actively trying to attack the target." (local-vars (v1-3 enemy-flag) (v1-5 enemy-flag)) (logior! (-> this enemy-flags) (enemy-flag vulnerable)) (let ((v1-2 (-> this enemy-flags))) @@ -1697,11 +1700,11 @@ (let ((v1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node roboguard-city-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -1710,7 +1713,7 @@ (let ((v1-32 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> v1-32 hit-xz-reaction) 0.95) (set! (-> v1-32 hit-y-reaction) 0.6) - (set! (-> v1-32 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> v1-32 fountain-rand-transv-lo) (-> self incoming attack-position)) ) ) (cleanup-for-death self) @@ -1764,8 +1767,8 @@ (set! (-> gp-0 vehicle-impulse-factor) 2.0) (logior! (-> gp-0 options) (projectile-options po16)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -1798,6 +1801,7 @@ ) (defmethod knocked-anim ((this roboguard-city) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (let ((v1-0 #t)) (case (-> this incoming knocked-type) @@ -1837,6 +1841,7 @@ ) (defmethod knocked-land-anim ((this roboguard-city) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-0 #t)) (case (-> this incoming knocked-type) (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) @@ -1875,6 +1880,7 @@ ) (defmethod event-handler ((this roboguard-city) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (set-time! (-> this pursuit-start-time)) @@ -1894,7 +1900,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1920,14 +1926,16 @@ ;; WARN: Return type mismatch int vs process. (defmethod update-focus ((this roboguard-city)) + "Potentially update the focus, if there is something better to focus on." (the-as process 0) ) (defmethod enemy-common-post ((this roboguard-city)) + "Common implementation of post. Runs ja-post." (roboguard-city-method-237 this) (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans s5-0 3)) (los-control-method-9 (-> this los) s5-0 (-> this focus-pos) 819.2 4096.0) ) ) @@ -1965,7 +1973,7 @@ (let ((a1-9 (-> this nav state)) (v1-35 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-35 quad) (-> a1-9 heading quad)) + (vector-copy! v1-35 (-> a1-9 heading)) 0.0 (let* ((f0-8 (vector-dot s5-3 v1-35)) (f0-9 (+ 1.0 f0-8)) @@ -2002,6 +2010,7 @@ ) (defmethod coin-flip? ((this roboguard-city)) + "Return #t half the time, #f the other." #f ) @@ -2123,6 +2132,7 @@ ) (defmethod init-enemy! ((this roboguard-city)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-city" (the-as (pointer level) #f))) @@ -2132,7 +2142,7 @@ (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) ) - (init-enemy-defaults! this *roboguard-city-nav-enemy-info*) + (setup-enemy! this *roboguard-city-nav-enemy-info*) (let ((t9-4 (method-of-type kg-squad-member init-enemy!))) (t9-4 this) ) @@ -2241,7 +2251,7 @@ (logclear! (-> this flags) (citizen-flag persistent in-pursuit)) ) (let ((v1-26 (new 'stack-no-clear 'vector))) - (set! (-> v1-26 quad) (-> this root trans quad)) + (vector-copy! v1-26 (-> this root trans)) (+! (-> v1-26 y) 8192.0) ) (let* ((s5-0 (handle->process (-> this target-status handle))) @@ -2255,7 +2265,7 @@ (not (logtest? (-> (the-as process-focusable a0-36) focus-status) (focus-status disable dead inactive))) ) (let* ((s5-1 this) - (s4-0 (method-of-object s5-1 enemy-method-70)) + (s4-0 (method-of-object s5-1 set-focus!)) (s3-0 (handle->process (-> this target-status handle))) ) (s4-0 @@ -2330,7 +2340,8 @@ ) ) -(defmethod penetrate->next-state ((this roboguard-city) (arg0 process) (arg1 event-message-block) (arg2 float)) +(defmethod msg-for-incoming-attack ((this roboguard-city) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." (cond ((logtest? (penetrate emp-blast) (-> this incoming penetrate-using)) (set-time! (-> this dizzy-start-time)) @@ -2363,7 +2374,7 @@ ) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else diff --git a/goal_src/jak3/levels/city/slums/ctyslumc-obs.gc b/goal_src/jak3/levels/city/slums/ctyslumc-obs.gc index 8e7c82ee492..198a39f1e26 100644 --- a/goal_src/jak3/levels/city/slums/ctyslumc-obs.gc +++ b/goal_src/jak3/levels/city/slums/ctyslumc-obs.gc @@ -260,6 +260,7 @@ ) (defmethod init-from-entity! ((this ctyslumc-flag) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -273,7 +274,7 @@ (defbehavior ctyslumc-flag-init-by-other ctyslumc-flag ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyslumc-flag" (the-as (pointer level) #f))) diff --git a/goal_src/jak3/levels/city/slums/neon-baron-part.gc b/goal_src/jak3/levels/city/slums/neon-baron-part.gc index 30c69c9803b..b6c41929142 100644 --- a/goal_src/jak3/levels/city/slums/neon-baron-part.gc +++ b/goal_src/jak3/levels/city/slums/neon-baron-part.gc @@ -3473,8 +3473,9 @@ ) (defmethod init-from-entity! ((this neon-baron) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (matrix-rotate-y! (-> this mat) (quaternion-y-angle (-> arg0 quat))) - (set! (-> this mat trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this mat trans) (-> arg0 extra trans)) (set! (-> this master-enable) (the-as uint -1)) (set! (-> this flags) (neon-baron-flag nb0 nb3)) (set! (-> this mode) (the-as uint 0)) diff --git a/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc b/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc index 360641ed885..95595ea49a0 100644 --- a/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc +++ b/goal_src/jak3/levels/city/sniper/cty-sniper-battery.gc @@ -158,6 +158,7 @@ ) (defmethod init-from-entity! ((this cty-sniper-button-top) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-drawable-from-entity! this arg0) (initialize-skeleton this @@ -173,7 +174,7 @@ (defbehavior cty-sniper-button-top-init-by-other cty-sniper-button-top ((arg0 vector) (arg1 quaternion)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self @@ -304,7 +305,8 @@ (ja-channel-set! 1) (ja :group! cty-sniper-button-pushdown-ja :num! (identity (the float (ja-num-frames 0)))) (ja-post) - (suspend-for (-> self stay-down-time)) + (suspend-for (-> self stay-down-time) + ) (send-event (handle->process (-> self lid)) 'up #x3e800000) (ja-no-eval :group! cty-sniper-button-popup-ja :num! (seek! max 0.25) :frame-num 0.0) (until (ja-done? 0) @@ -374,6 +376,7 @@ ) (defmethod init-from-entity! ((this cty-sniper-button) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -795,11 +798,11 @@ (sound-play "destroy-battery") (cond ((logtest? (-> *part-group-id-table* 1464 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1464)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1464)) ) ) @@ -857,6 +860,7 @@ ) (defmethod init-from-entity! ((this cty-sniper-battery) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -950,7 +954,7 @@ (set! (-> s4-0 event-self) 'touched) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self diff --git a/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc b/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc index 70ac103561c..d81cbe35a1d 100644 --- a/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc +++ b/goal_src/jak3/levels/city/sniper/cty-sniper-turret.gc @@ -102,7 +102,7 @@ (when (not (logtest? (-> self actor-group 0 data v1-5 actor extra perm status) (entity-perm-status subtask-complete)) ) (if (-> self minimap) - (set! (-> self minimap position quad) (-> self actor-group 0 data v1-5 actor trans quad)) + (vector-copy! (-> self minimap position) (-> self actor-group 0 data v1-5 actor trans)) (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (the-as vector #f) 0)) ) (set! v1-4 #f) @@ -293,7 +293,7 @@ (suspend) ) (set-time-limit self) - (while (and (= (status-of-level-and-borrows *level* 'hiphog #t) 'active) + (while (and (= (level-status? *level* 'hiphog #t) 'active) (or (not (level-get-target-inside *level*)) (!= (-> (level-get-target-inside *level*) name) 'ctyport)) ) (suspend) @@ -1135,7 +1135,7 @@ (a1-4 (-> *part-id-table* 4849)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -1185,7 +1185,7 @@ ) (-> *part-id-table* 4847 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) (* f28-1 f30-1)) (launch-particles (-> *part-id-table* 4847) s4-1 :origin-is-matrix #t) (set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) f30-1) @@ -1261,7 +1261,7 @@ (let ((v1-5 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-5 sphere quad) (-> self root trans quad)) (set! (-> v1-5 sphere r) 40960.0) - (set! (-> v1-5 velocity quad) (-> self root transv quad)) + (vector-copy! (-> v1-5 velocity) (-> self root transv)) (set! (-> v1-5 notify-radius) 122880.0) (set! (-> v1-5 danger-level) 1.0) (set! (-> v1-5 decay-rate) 0.0) @@ -1370,7 +1370,7 @@ (defmethod init-proj-settings! ((this cty-sniper-turret-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'fac-robotank-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) cty-sniper-turret-shot-move) @@ -1405,8 +1405,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -1647,8 +1647,8 @@ (defbehavior cty-sniper-turret-reticle-init-by-other cty-sniper-turret-reticle ((arg0 vector) (arg1 vector) (arg2 texture-id)) (cty-sniper-turret-reticle-method-19 self) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root scale quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root scale) arg1) (matrix->quaternion (-> self root quat) (math-camera-matrix)) (set! (-> self wander-offset 0 quad) (the-as uint128 0)) (set! (-> self wander-offset 1 quad) (the-as uint128 0)) @@ -1721,7 +1721,7 @@ (let ((v1-14 (-> this ring-inner data))) (vector+! s2-0 gp-0 s0-0) (vector+! s2-0 s2-0 s1-0) - (set! (-> v1-14 0 pos quad) (-> s2-0 quad)) + (vector-copy! (-> v1-14 0 pos) s2-0) (set! (-> v1-14 0 stq z) 0.0) (set! (-> v1-14 0 stq x) 0.0) (set! (-> v1-14 0 stq y) 0.0) @@ -1730,7 +1730,7 @@ (let ((v1-15 (-> v1-14 1))) (vector+float*! s2-0 gp-0 s0-0 -1.0) (vector+! s2-0 s2-0 s1-0) - (set! (-> v1-15 pos quad) (-> s2-0 quad)) + (vector-copy! (-> v1-15 pos) s2-0) (set! (-> v1-15 stq z) 0.0) (set! (-> v1-15 stq x) 1.0) (set! (-> v1-15 stq y) 0.0) @@ -1739,7 +1739,7 @@ (let ((v1-16 (&+ v1-15 32))) (vector+! s2-0 gp-0 s0-0) (vector+float*! s2-0 s2-0 s1-0 -1.0) - (set! (-> v1-16 pos quad) (-> s2-0 quad)) + (vector-copy! (-> v1-16 pos) s2-0) (set! (-> v1-16 stq z) 0.0) (set! (-> v1-16 stq x) 0.0) (set! (-> v1-16 stq y) 1.0) @@ -1748,7 +1748,7 @@ (let ((v1-17 (&+ v1-16 32))) (vector+float*! s2-0 gp-0 s0-0 -1.0) (vector+float*! s2-0 s2-0 s1-0 -1.0) - (set! (-> v1-17 pos quad) (-> s2-0 quad)) + (vector-copy! (-> v1-17 pos) s2-0) (set! (-> v1-17 stq z) 0.0) (set! (-> v1-17 stq x) 1.0) (set! (-> v1-17 stq y) 1.0) @@ -1776,7 +1776,7 @@ (let ((v1-24 (-> this ring-middle data))) (vector+! s2-1 gp-0 s0-1) (vector+! s2-1 s2-1 s1-1) - (set! (-> v1-24 0 pos quad) (-> s2-1 quad)) + (vector-copy! (-> v1-24 0 pos) s2-1) (set! (-> v1-24 0 stq z) 0.0) (set! (-> v1-24 0 stq x) 0.0) (set! (-> v1-24 0 stq y) 0.0) @@ -1785,7 +1785,7 @@ (let ((v1-25 (-> v1-24 1))) (vector+float*! s2-1 gp-0 s0-1 -1.0) (vector+! s2-1 s2-1 s1-1) - (set! (-> v1-25 pos quad) (-> s2-1 quad)) + (vector-copy! (-> v1-25 pos) s2-1) (set! (-> v1-25 stq z) 0.0) (set! (-> v1-25 stq x) 1.0) (set! (-> v1-25 stq y) 0.0) @@ -1794,7 +1794,7 @@ (let ((v1-26 (&+ v1-25 32))) (vector+! s2-1 gp-0 s0-1) (vector+float*! s2-1 s2-1 s1-1 -1.0) - (set! (-> v1-26 pos quad) (-> s2-1 quad)) + (vector-copy! (-> v1-26 pos) s2-1) (set! (-> v1-26 stq z) 0.0) (set! (-> v1-26 stq x) 0.0) (set! (-> v1-26 stq y) 1.0) @@ -1803,7 +1803,7 @@ (let ((v1-27 (&+ v1-26 32))) (vector+float*! s2-1 gp-0 s0-1 -1.0) (vector+float*! s2-1 s2-1 s1-1 -1.0) - (set! (-> v1-27 pos quad) (-> s2-1 quad)) + (vector-copy! (-> v1-27 pos) s2-1) (set! (-> v1-27 stq z) 0.0) (set! (-> v1-27 stq x) 1.0) (set! (-> v1-27 stq y) 1.0) @@ -1828,7 +1828,7 @@ (let ((v1-34 (-> this ring-outer data))) (vector+! s2-2 gp-0 s0-2) (vector+! s2-2 s2-2 s1-2) - (set! (-> v1-34 0 pos quad) (-> s2-2 quad)) + (vector-copy! (-> v1-34 0 pos) s2-2) (set! (-> v1-34 0 stq z) 0.0) (set! (-> v1-34 0 stq x) 0.0) (set! (-> v1-34 0 stq y) 0.0) @@ -1837,7 +1837,7 @@ (let ((v1-35 (-> v1-34 1))) (vector+float*! s2-2 gp-0 s0-2 -1.0) (vector+! s2-2 s2-2 s1-2) - (set! (-> v1-35 pos quad) (-> s2-2 quad)) + (vector-copy! (-> v1-35 pos) s2-2) (set! (-> v1-35 stq z) 0.0) (set! (-> v1-35 stq x) 1.0) (set! (-> v1-35 stq y) 0.0) @@ -1846,7 +1846,7 @@ (let ((v1-36 (&+ v1-35 32))) (vector+! s2-2 gp-0 s0-2) (vector+float*! s2-2 s2-2 s1-2 -1.0) - (set! (-> v1-36 pos quad) (-> s2-2 quad)) + (vector-copy! (-> v1-36 pos) s2-2) (set! (-> v1-36 stq z) 0.0) (set! (-> v1-36 stq x) 0.0) (set! (-> v1-36 stq y) 1.0) @@ -1855,7 +1855,7 @@ (let ((v1-37 (&+ v1-36 32))) (vector+float*! s2-2 gp-0 s0-2 -1.0) (vector+float*! s2-2 s2-2 s1-2 -1.0) - (set! (-> v1-37 pos quad) (-> s2-2 quad)) + (vector-copy! (-> v1-37 pos) s2-2) (set! (-> v1-37 stq z) 0.0) (set! (-> v1-37 stq x) 1.0) (set! (-> v1-37 stq y) 1.0) @@ -1899,7 +1899,7 @@ (case arg2 (('update) (-> arg3 param 0) - (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self root trans) (the-as vector (-> arg3 param 0))) (matrix->quaternion (-> self root quat) (math-camera-matrix)) ) (('collide-dist) @@ -2175,8 +2175,8 @@ (set! (-> s5-2 charge) 1.0) (set! (-> s5-2 options) (projectile-options)) (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) - (set! (-> s5-2 pos quad) (-> s4-0 quad)) - (set! (-> s5-2 vel quad) (-> s3-2 quad)) + (vector-copy! (-> s5-2 pos) s4-0) + (vector-copy! (-> s5-2 vel) s3-2) (set! (-> s5-2 notify-handle) (process->handle this)) (set! (-> s5-2 owner-handle) (the-as handle #f)) (set! (-> s5-2 target-handle) (the-as handle #f)) @@ -2506,7 +2506,7 @@ (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> s4-1 quad)) + (vector-copy! s5-0 s4-1) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (set! (-> s5-0 y) 0.0) @@ -2775,7 +2775,7 @@ ) (vector+! s3-0 s3-0 (target-pos 0)) (+! (-> s3-0 y) 20480.0) - (set! (-> *camera* slave 0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> *camera* slave 0 trans) s3-0) ) (vector-! gp-1 (-> self root trans) (target-pos 0)) (vector-! s5-2 (camera-pos) (target-pos 0)) @@ -2854,7 +2854,7 @@ (logclear! (-> *target* focus-status) (focus-status ignore)) ) (logior! (-> self flags) (cty-sniper-turret-flag cst11)) - (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) + (vector-copy! (-> self firing-sight-pos) (-> self sight-pos)) (send-event (handle->process (-> self reticle)) 'lock) (let ((a1-17 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-17 from) (process->ppointer self)) @@ -2980,18 +2980,18 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 1465 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1465)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1465)) ) ) (suspend) (let ((gp-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *up-vector* quad)) + (vector-copy! s5-0 *up-vector*) (vector-normalize-copy! (-> gp-2 fountain-rand-transv-lo) s5-0 81920.0) (vector-normalize-copy! (-> gp-2 fountain-rand-transv-hi) s5-0 245760.0) ) @@ -3123,9 +3123,9 @@ ) (set! (-> this root) s1-0) ) - (set! (-> this root trans quad) (-> arg0 quad)) + (vector-copy! (-> this root trans) arg0) (quaternion-copy! (-> this root quat) arg1) - (set! (-> this offset quad) (-> arg2 quad)) + (vector-copy! (-> this offset) arg2) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-turret" (the-as (pointer level) #f))) @@ -3147,7 +3147,7 @@ (quaternion-copy! (-> this rotate-quat) arg1) (set! (-> this rotate-rate) 0.0) (set! (-> this rotate-mult) arg3) - (set! (-> this pos-cam-offset quad) (-> (new 'static 'vector :y 61440.0 :w 1.0) quad)) + (vector-copy! (-> this pos-cam-offset) (new 'static 'vector :y 61440.0 :w 1.0)) (set-time! (-> this gun-timer)) (set! (-> this flags) (cty-sniper-turret-flag)) (set! (-> this fov-mult) 1.0) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-chick.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-chick.gc index 2e2f718b880..1aa5dc9d406 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-chick.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-chick.gc @@ -161,34 +161,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 20480.0 - :knocked-soft-vy-hi 40960.0 - :knocked-medium-vxz-lo 40960.0 - :knocked-medium-vxz-hi 73728.0 - :knocked-medium-vy-lo 24576.0 - :knocked-medium-vy-hi 53248.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 102400.0 - :knocked-hard-vy-lo 40960.0 - :knocked-hard-vy-hi 81920.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 8192.0 - :knocked-yellow-vxz-hi 16384.0 - :knocked-yellow-vy-lo 12288.0 - :knocked-yellow-vy-hi 24576.0 - :knocked-red-vxz-lo 12288.0 - :knocked-red-vxz-hi 24576.0 - :knocked-red-vy-lo 20480.0 - :knocked-red-vy-hi 36864.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 32768.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 5) + :knocked-soft-vy-hi (meters 10) + :knocked-medium-vxz-lo (meters 10) + :knocked-medium-vxz-hi (meters 18) + :knocked-medium-vy-lo (meters 6) + :knocked-medium-vy-hi (meters 13) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 25) + :knocked-hard-vy-lo (meters 10) + :knocked-hard-vy-hi (meters 20) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 2) + :knocked-yellow-vxz-hi (meters 4) + :knocked-yellow-vy-lo (meters 3) + :knocked-yellow-vy-hi (meters 6) + :knocked-red-vxz-lo (meters 3) + :knocked-red-vxz-hi (meters 6) + :knocked-red-vy-lo (meters 5) + :knocked-red-vy-hi (meters 9) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 8) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd player-list) @@ -455,6 +455,7 @@ (set! (-> *citizen-chick-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod coin-flip? ((this citizen-chick)) + "Return #t half the time, #f the other." #f ) @@ -464,6 +465,7 @@ ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this citizen-chick)) + "Get the yaw angle for the current knock." (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) @@ -471,7 +473,7 @@ (when a0-5 (get-trans a0-5 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -484,7 +486,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this root transv quad)) + (vector-copy! s5-1 (-> this root transv)) (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) @@ -524,6 +526,7 @@ ) (defmethod knocked-anim-handler ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (case (-> this incoming knocked-type) @@ -574,11 +577,12 @@ ) (defmethod knocked-anim ((this citizen-chick) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) - (v1-3 (enemy-method-131 this 1 a2-0)) + (v1-3 (rnd-int-excluding-masked this 1 a2-0)) (a1-7 (-> this draw @@ -605,7 +609,7 @@ (((knocked-type blue-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) - (v1-12 (enemy-method-131 this 3 a2-2)) + (v1-12 (rnd-int-excluding-masked this 3 a2-2)) (a1-14 (-> this draw @@ -651,6 +655,7 @@ ) (defmethod knocked-land-anim ((this citizen-chick) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -751,6 +756,7 @@ ) (defmethod init-enemy-collision! ((this citizen-chick)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -808,12 +814,13 @@ ) (defmethod init-enemy! ((this citizen-chick)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-chick" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *citizen-chick-nav-enemy-info*) + (setup-enemy! this *citizen-chick-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -821,7 +828,7 @@ (set! (-> this draw lod-set lod 0 dist) 204800.0) (set! (-> this draw lod-set lod 1 dist) 491520.0) (set! (-> this info) *citizen-chick-global-info*) - (try-update-focus (-> this focus) *target* this) + (focus-on! (-> this focus) *target* this) (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) (set! (-> this anim-shuffle) 26) (let ((v1-18 (rnd-int this 3))) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-enemy.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-enemy.gc index 45456fcee04..0fd11e4bf25 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-enemy.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-enemy.gc @@ -19,6 +19,7 @@ (defmethod enemy-common-post ((this citizen-enemy)) + "Common implementation of post. Runs ja-post." (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-0 options) (overlaps-others-options)) (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) @@ -39,13 +40,14 @@ (none) ) -(defmethod send-attack-on-jump-or-knocked ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'knocked) (= v1-3 'jump)) ) ) - ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type citizen enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -80,7 +82,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -94,6 +96,7 @@ ) (defmethod event-handler ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('event-death) #f @@ -138,7 +141,7 @@ (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> a1-0 velocity) (-> this root transv)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) (set! (-> a1-0 decay-rate) 0.0) @@ -154,7 +157,7 @@ ;; WARN: Return type mismatch int vs object. (defmethod find-new-focus ((this citizen-enemy)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) 122880.0) (let ((s4-0 (the-as process-drawable #f))) (let ((f30-0 122880.0)) @@ -200,7 +203,7 @@ ) ) (when s4-0 - (try-update-focus (-> this focus) (the-as process-focusable s4-0) this) + (focus-on! (-> this focus) (the-as process-focusable s4-0) this) (go-hostile this) ) ) @@ -279,10 +282,12 @@ ) (defmethod go-die ((this citizen-enemy)) + "Go to the die state." ((method-of-type nav-enemy go-die) this) ) (defmethod go-hostile ((this citizen-enemy)) + "Go to the hostile state, actively trying to attack the target." (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) (go (method-of-object this hostile)) ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-fat.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-fat.gc index 7afc93ffa4e..16c8ee27e7d 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-fat.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-fat.gc @@ -161,34 +161,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 20480.0 - :knocked-soft-vy-hi 40960.0 - :knocked-medium-vxz-lo 40960.0 - :knocked-medium-vxz-hi 73728.0 - :knocked-medium-vy-lo 24576.0 - :knocked-medium-vy-hi 53248.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 102400.0 - :knocked-hard-vy-lo 40960.0 - :knocked-hard-vy-hi 81920.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 8192.0 - :knocked-yellow-vxz-hi 16384.0 - :knocked-yellow-vy-lo 12288.0 - :knocked-yellow-vy-hi 24576.0 - :knocked-red-vxz-lo 12288.0 - :knocked-red-vxz-hi 24576.0 - :knocked-red-vy-lo 20480.0 - :knocked-red-vy-hi 36864.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 32768.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 5) + :knocked-soft-vy-hi (meters 10) + :knocked-medium-vxz-lo (meters 10) + :knocked-medium-vxz-hi (meters 18) + :knocked-medium-vy-lo (meters 6) + :knocked-medium-vy-hi (meters 13) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 25) + :knocked-hard-vy-lo (meters 10) + :knocked-hard-vy-hi (meters 20) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 2) + :knocked-yellow-vxz-hi (meters 4) + :knocked-yellow-vy-lo (meters 3) + :knocked-yellow-vy-hi (meters 6) + :knocked-red-vxz-lo (meters 3) + :knocked-red-vxz-hi (meters 6) + :knocked-red-vy-lo (meters 5) + :knocked-red-vy-hi (meters 9) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 8) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9956 :y 0.0755 :z -0.0549 :w 34275.477) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -419,6 +419,7 @@ (set! (-> *citizen-fat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod coin-flip? ((this citizen-fat)) + "Return #t half the time, #f the other." #f ) @@ -428,6 +429,7 @@ ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this citizen-fat)) + "Get the yaw angle for the current knock." (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) @@ -435,7 +437,7 @@ (when a0-5 (get-trans a0-5 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -448,7 +450,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this root transv quad)) + (vector-copy! s5-1 (-> this root transv)) (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) @@ -488,6 +490,7 @@ ) (defmethod knocked-anim-handler ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (case (-> this incoming knocked-type) @@ -538,11 +541,12 @@ ) (defmethod knocked-anim ((this citizen-fat) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) - (v1-3 (enemy-method-131 this 1 a2-0)) + (v1-3 (rnd-int-excluding-masked this 1 a2-0)) (a1-7 (-> this draw @@ -569,7 +573,7 @@ (((knocked-type blue-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) - (v1-12 (enemy-method-131 this 3 a2-2)) + (v1-12 (rnd-int-excluding-masked this 3 a2-2)) (a1-14 (-> this draw @@ -615,6 +619,7 @@ ) (defmethod knocked-land-anim ((this citizen-fat) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -752,6 +757,7 @@ ) (defmethod init-enemy-collision! ((this citizen-fat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -809,12 +815,13 @@ ) (defmethod init-enemy! ((this citizen-fat)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-fat" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *citizen-fat-nav-enemy-info*) + (setup-enemy! this *citizen-fat-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -822,7 +829,7 @@ (set! (-> this draw lod-set lod 0 dist) 204800.0) (set! (-> this draw lod-set lod 1 dist) 491520.0) (set! (-> this info) *citizen-fat-global-info*) - (try-update-focus (-> this focus) *target* this) + (focus-on! (-> this focus) *target* this) (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) (set! (-> this anim-shuffle) 12) (let ((v1-18 (rnd-int this 3))) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-h.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-h.gc index c5eba609835..7520d93844b 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-h.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-h.gc @@ -80,7 +80,6 @@ in-ditch ) (:methods - (init-enemy-defaults! (_type_ nav-enemy-info) none :replace) (set-squad (_type_) none) (citizen-method-194 (_type_) none) (citizen-method-195 (_type_) none) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc index 1be442fee37..845ebe4bca2 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen-norm.gc @@ -169,34 +169,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 49152.0 - :knocked-soft-vy-lo 36864.0 - :knocked-soft-vy-hi 73728.0 - :knocked-medium-vxz-lo 81920.0 - :knocked-medium-vxz-hi 143360.0 - :knocked-medium-vy-lo 49152.0 - :knocked-medium-vy-hi 102400.0 - :knocked-hard-vxz-lo 102400.0 - :knocked-hard-vxz-hi 122880.0 - :knocked-hard-vy-lo 81920.0 - :knocked-hard-vy-hi 102400.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 16384.0 - :knocked-yellow-vxz-hi 32768.0 - :knocked-yellow-vy-lo 24576.0 - :knocked-yellow-vy-hi 49152.0 - :knocked-red-vxz-lo 40960.0 - :knocked-red-vxz-hi 61440.0 - :knocked-red-vy-lo 36864.0 - :knocked-red-vy-hi 73728.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 12) + :knocked-soft-vy-lo (meters 9) + :knocked-soft-vy-hi (meters 18) + :knocked-medium-vxz-lo (meters 20) + :knocked-medium-vxz-hi (meters 35) + :knocked-medium-vy-lo (meters 12) + :knocked-medium-vy-hi (meters 25) + :knocked-hard-vxz-lo (meters 25) + :knocked-hard-vxz-hi (meters 30) + :knocked-hard-vy-lo (meters 20) + :knocked-hard-vy-hi (meters 25) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 4) + :knocked-yellow-vxz-hi (meters 8) + :knocked-yellow-vy-lo (meters 6) + :knocked-yellow-vy-hi (meters 12) + :knocked-red-vxz-lo (meters 10) + :knocked-red-vxz-hi (meters 15) + :knocked-red-vy-lo (meters 9) + :knocked-red-vy-hi (meters 18) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 8) + :knocked-blue-vy-hi (meters 12) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 35283.07) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -429,11 +429,13 @@ (set! (-> *citizen-norm-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod coin-flip? ((this citizen-norm)) + "Return #t half the time, #f the other." #f ) ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this citizen-norm)) + "Get the yaw angle for the current knock." (the-as degrees (cond @@ -448,7 +450,7 @@ (when a0-6 (get-trans a0-6 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -461,7 +463,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this root transv quad)) + (vector-copy! s5-1 (-> this root transv)) (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) @@ -504,6 +506,7 @@ ) (defmethod knocked-anim-handler ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (case (-> this incoming knocked-type) @@ -554,6 +557,7 @@ ) (defmethod knocked-anim ((this citizen-norm) (arg0 enemy-knocked-info)) + "start the knocked animation." (local-vars (v1-36 knocked-type)) (cond ((logtest? (-> this flags) (citizen-flag knocked-out-car)) @@ -585,7 +589,7 @@ ((begin (set! v1-36 (-> this incoming knocked-type)) (= v1-36 (knocked-type yellow-shot))) (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-2 (ash 1 (-> this info prev-yellow-hit))) - (v1-39 (enemy-method-131 this 1 a2-2)) + (v1-39 (rnd-int-excluding-masked this 1 a2-2)) (a1-11 (-> this draw @@ -612,7 +616,7 @@ ((= v1-36 (knocked-type blue-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-4 (ash 1 (-> this info prev-blue-hit))) - (v1-48 (enemy-method-131 this 3 a2-4)) + (v1-48 (rnd-int-excluding-masked this 3 a2-4)) (a1-18 (-> this draw @@ -663,6 +667,7 @@ ) (defmethod knocked-land-anim ((this citizen-norm) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.1)) (set! (-> arg0 anim-speed) 1.0) (let ((a0-2 (-> this skel root-channel 0))) @@ -804,7 +809,7 @@ (case (-> arg0 behavior) ((11) (speech-control-method-12 *speech-control* this (speech-type civ-m-player-stealing-vehicle)) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (quaternion-copy! (-> this root quat) (-> arg0 rotation)) (set! (-> this vehicle) (-> arg0 handle)) (ja-channel-set! 1) @@ -895,6 +900,7 @@ ) (defmethod init-enemy-collision! ((this citizen-norm)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -958,19 +964,20 @@ ) (defmethod init-enemy! ((this citizen-norm)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *citizen-norm-nav-enemy-info*) + (setup-enemy! this *citizen-norm-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 (set! (-> this draw lod-set lod 0 dist) 204800.0) (set! (-> this draw lod-set lod 1 dist) 491520.0) - (try-update-focus (-> this focus) *target* this) + (focus-on! (-> this focus) *target* this) (-> this neck) (set! (-> this info) *citizen-norm-global-info*) (set! (-> this anim-shuffle) 11) diff --git a/goal_src/jak3/levels/city/traffic/citizen/citizen.gc b/goal_src/jak3/levels/city/traffic/citizen/citizen.gc index b8c42a13767..4c39acd5a42 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/citizen.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/citizen.gc @@ -104,13 +104,14 @@ ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod get-awareness-of-proc ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) + "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (when arg1 (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))) (when (< f0-0 (-> arg1 rating)) (set! (-> arg1 rating) f0-0) (set! (-> arg1 proc) arg0) - (set! (-> arg1 aware) (enemy-aware ea3)) + (set! (-> arg1 aware) (enemy-aware hostile)) ) ) ) @@ -118,7 +119,8 @@ ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod get-enemy-aware ((this citizen) (arg0 enemy-aware)) +(defmethod modify-awareness ((this citizen) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." (the-as enemy-aware 3) ) @@ -128,18 +130,22 @@ ;; WARN: Return type mismatch none vs object. (defmethod go-hostile ((this citizen)) + "Go to the hostile state, actively trying to attack the target." (go-inactive this) ) (defmethod go-flee ((this citizen)) + "Go to the flee state, running away." (go (method-of-object this flee)) ) -(defmethod go-best-state ((this citizen)) +(defmethod go-state-for-focused ((this citizen)) + "Go to the appropriate state for the current awareness of the focused process." (go (method-of-object this active)) ) -(defmethod penetrate->next-state ((this citizen) (arg0 process) (arg1 event-message-block) (arg2 float)) +(defmethod msg-for-incoming-attack ((this citizen) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." (if (logtest? (penetrate jak-dark-nuke) (-> this incoming penetrate-using)) 'traffic-off-force (call-parent-method this arg0 arg1 arg2) @@ -148,6 +154,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod go-die ((this citizen)) + "Go to the die state." (send-event (ppointer->process (-> this parent)) 'child-killed) (go-inactive this) ) @@ -185,7 +192,10 @@ (none) ) -(defmethod enemy-method-63 ((this citizen) (arg0 float)) +(defmethod apply-incoming-hitpoint-mods ((this citizen) (arg0 float)) + "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (let ((v0-1 (call-parent-method this arg0))) (when (and (logtest? (-> this incoming penetrate-using) (penetrate board)) (not (logtest? (-> this incoming penetrate-using) (penetrate spin))) @@ -294,6 +304,7 @@ ;; WARN: disable def twice: 164. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-3 object)) (case arg2 (('hit 'hit-flinch 'hit-knocked) @@ -342,7 +353,7 @@ ) (logclear! (-> a0-20 flags) (nav-state-flag directional-mode)) (logior! (-> a0-20 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-20 target-pos quad) (-> (the-as vector v1-21) quad)) + (vector-copy! (-> a0-20 target-pos) (the-as vector v1-21)) ) 0 (if (and (and (-> this next-state) (= (-> this next-state name) 'wait)) (-> this wait-return-state)) @@ -401,9 +412,9 @@ (logclear! (-> this flags) (citizen-flag in-mission)) ) (set! (-> this root penetrated-by) (get-penetrated-by this)) - (set! (-> this root trans quad) (-> s5-1 position quad)) + (vector-copy! (-> this root trans) (-> s5-1 position)) (quaternion-copy! (-> this root quat) (-> s5-1 rotation)) - (set! (-> this root transv quad) (-> s5-1 velocity quad)) + (vector-copy! (-> this root transv) (-> s5-1 velocity)) (let ((a0-46 (-> s5-1 nav-mesh))) (when a0-46 (change-to a0-46 this) @@ -422,14 +433,14 @@ ) (logclear! (-> a0-50 flags) (nav-state-flag directional-mode)) (logior! (-> a0-50 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-50 target-pos quad) (-> v1-84 quad)) + (vector-copy! (-> a0-50 target-pos) v1-84) ) 0 ) ) (citizen-method-195 this) (citizen-method-194 this) - (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) (set! (-> this gnd-height) (-> this root gspot-pos y)) (go-from-behavior this s5-1) ) @@ -453,7 +464,7 @@ (set! (-> this root transv z) 0.0) (when (-> this enemy-info move-to-ground) (if (focus-test? this under-water) - (accelerate-fall! this (-> this root transv)) + (adjust-transv-under-water! this (-> this root transv)) (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) ) @@ -475,6 +486,7 @@ ) (defmethod enemy-common-post ((this citizen)) + "Common implementation of post. Runs ja-post." (with-pp (when (and (not (logtest? (-> this flags) (citizen-flag in-mission))) *cty-faction-manager* @@ -515,17 +527,17 @@ ) (cond (a0-11 - (set! (-> s5-3 quad) (-> (get-trans a0-11 2) quad)) + (vector-copy! s5-3 (get-trans a0-11 2)) ) (*target* - (set! (-> s5-3 quad) (-> (get-trans *target* 2) quad)) + (vector-copy! s5-3 (get-trans *target* 2)) ) (else - (set! (-> s5-3 quad) (-> (camera-pos) quad)) + (vector-copy! s5-3 (camera-pos)) ) ) (if (and (-> this next-state) (= (-> this next-state name) 'flee)) - (set! (-> s5-3 quad) (-> this danger-pos quad)) + (vector-copy! s5-3 (-> this danger-pos)) ) (when (< (vector-vector-distance s5-3 (-> this root trans)) 122880.0) (set-look-at-mode! this 1) @@ -600,6 +612,7 @@ ) (defmethod move-above-ground! ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -611,14 +624,14 @@ (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) - (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) - (set! (-> arg1 old-gspot-normal quad) (-> gp-0 gspot-normal quad)) + (vector-copy! (-> arg1 old-gspot-pos) (-> gp-0 gspot-pos)) + (vector-copy! (-> arg1 old-gspot-normal) (-> gp-0 gspot-normal)) (set! (-> gp-0 trans-old-old-old quad) (-> gp-0 trans-old-old quad)) (set! (-> gp-0 trans-old-old quad) (-> gp-0 trans-old quad)) (set! (-> gp-0 trans-old quad) (-> gp-0 trans quad)) (set! (-> gp-0 prev-status) (-> gp-0 status)) (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) - (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) + (vector-copy! (-> arg1 new-pos) (-> gp-0 trans)) (when (not (logtest? (logxor (-> this traffic-id) (the-as int (-> this probe-counter))) 7)) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (logclear! (-> gp-0 status) (collide-status on-ground)) @@ -641,9 +654,9 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a2-2 quad) vf6) (when (t9-1 a0-10 a1-2 a2-2 (-> arg1 gnd-collide-with) 16384.0 81920.0 1024.0) - (set! (-> gp-0 gspot-pos quad) (-> gp-0 trans quad)) + (vector-copy! (-> gp-0 gspot-pos) (-> gp-0 trans)) (set! (-> gp-0 gspot-pos y) (-> s2-0 best-other-tri intersect y)) - (set! (-> gp-0 gspot-normal quad) (-> s2-0 best-other-tri normal quad)) + (vector-copy! (-> gp-0 gspot-normal) (-> s2-0 best-other-tri normal)) (logior! (-> gp-0 status) (collide-status on-ground)) (set! (-> gp-0 ground-pat) (-> s2-0 best-other-tri pat)) ) @@ -672,7 +685,7 @@ (set! (-> gp-0 ground-impact-vel) (- (vector-dot arg0 (-> gp-0 dynam gravity-normal)))) (set! (-> arg0 y) 0.0) ) - (set! (-> gp-0 trans quad) (-> arg1 new-pos quad)) + (vector-copy! (-> gp-0 trans) (-> arg1 new-pos)) (when (-> arg1 do-move?) (cond ((-> arg1 on-ground?) @@ -680,11 +693,11 @@ (a0-18 (-> gp-0 gspot-normal)) (v1-42 (-> arg1 pat)) ) - (set! (-> gp-0 ground-touch-point quad) (-> a1-3 quad)) - (set! (-> gp-0 poly-normal quad) (-> a0-18 quad)) - (set! (-> gp-0 surface-normal quad) (-> a0-18 quad)) - (set! (-> gp-0 local-normal quad) (-> a0-18 quad)) - (set! (-> gp-0 ground-poly-normal quad) (-> a0-18 quad)) + (vector-copy! (-> gp-0 ground-touch-point) a1-3) + (vector-copy! (-> gp-0 poly-normal) a0-18) + (vector-copy! (-> gp-0 surface-normal) a0-18) + (vector-copy! (-> gp-0 local-normal) a0-18) + (vector-copy! (-> gp-0 ground-poly-normal) a0-18) (set! (-> gp-0 poly-pat) v1-42) (set! (-> gp-0 cur-pat) v1-42) (set! (-> gp-0 ground-pat) v1-42) @@ -711,9 +724,9 @@ ) (when (not (logtest? (-> gp-0 root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-52 (-> gp-0 dynam gravity-normal))) - (set! (-> gp-0 local-normal quad) (-> v1-52 quad)) - (set! (-> gp-0 surface-normal quad) (-> v1-52 quad)) - (set! (-> gp-0 poly-normal quad) (-> v1-52 quad)) + (vector-copy! (-> gp-0 local-normal) v1-52) + (vector-copy! (-> gp-0 surface-normal) v1-52) + (vector-copy! (-> gp-0 poly-normal) v1-52) ) (set! (-> gp-0 coverage) 0.0) (set! (-> gp-0 touch-angle) 0.0) @@ -733,7 +746,7 @@ (a3-0 (-> arg0 state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (vector-copy! a2-0 (-> a3-0 heading)) (t9-0 this v1-1 a2-0) ) 0 @@ -766,7 +779,7 @@ (cond ((logtest? (enemy-flag ef39) (-> this enemy-flags)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) - (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (vector-copy! (-> this root gspot-pos) (-> this root trans)) (set! (-> this gnd-height) (-> this root gspot-pos y)) ) (else @@ -783,18 +796,20 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod go-idle2 ((this citizen)) +(defmethod go-fallback-init ((this citizen)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this active)) 0 ) -(defmethod init-enemy-defaults! ((this citizen) (arg0 nav-enemy-info)) +;; WARN: Return type mismatch int vs object. +(defmethod setup-enemy! ((this citizen) (arg0 nav-enemy-info)) (set-squad this) (if (not (-> this squad)) (format 0 "citizen::initialize-enemy: error: no squad-control~%") ) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-2 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-2 (method-of-type nav-enemy setup-enemy!))) (t9-2 this arg0) ) (set! (-> this speed-scale) (rnd-float-range this 0.9 1.1)) @@ -807,11 +822,11 @@ ) (set! (-> this travel-anim-scale-speed) 1.0) 0 - (none) ) ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this citizen) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -820,7 +835,7 @@ (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask enemy)) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 rotation)) (if (not (logtest? (-> arg0 flags) (traffic-spawn-flags tsf0))) (traffic-entity-hack (-> arg0 object-type)) @@ -954,11 +969,11 @@ ) (let ((s1-0 (-> this nav state current-poly))) (let ((a1-2 (-> this nav state))) - (set! (-> s5-0 quad) (-> a1-2 heading quad)) + (vector-copy! s5-0 (-> a1-2 heading)) ) (set! (-> s5-0 y) 0.0) (vector-xz-normalize! s5-0 20480.0) - (set! (-> s4-0 quad) (-> s5-0 quad)) + (vector-copy! s4-0 s5-0) (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s1-0 s4-0 s2-0) ) (cond @@ -972,7 +987,7 @@ (vector-rotate90-around-y! s1-2 s1-2) (if (< 0.0 (vector-dot s1-2 s0-1)) (vector-negate! arg0 s1-2) - (set! (-> arg0 quad) (-> s1-2 quad)) + (vector-copy! arg0 s1-2) ) ) (vector-xz-normalize! arg0 8192.0) @@ -990,9 +1005,9 @@ (let ((s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (let ((a1-1 (-> this nav state))) - (set! (-> s2-0 quad) (-> a1-1 heading quad)) + (vector-copy! s2-0 (-> a1-1 heading)) ) (set! (-> s2-0 y) 0.0) (vector-xz-normalize! s2-0 20480.0) @@ -1011,7 +1026,7 @@ (vector-rotate90-around-y! s2-2 s2-2) (if (< 0.0 (vector-dot s2-2 s1-1)) (vector-negate! arg1 s2-2) - (set! (-> arg1 quad) (-> s2-2 quad)) + (vector-copy! arg1 s2-2) ) ) (vector-xz-normalize! arg1 (* 5.0 (- (-> arg0 w) (vector-vector-xz-distance arg0 s5-0)))) @@ -1029,7 +1044,7 @@ (vector-xz-normalize! s5-1 20480.0) (if (< 0.0 f30-1) (vector-negate! arg1 s5-1) - (set! (-> arg1 quad) (-> s5-1 quad)) + (vector-copy! arg1 s5-1) ) ) ) @@ -1053,7 +1068,7 @@ (set! (-> arg0 quad) (the-as uint128 0)) (when (-> this cp-valid?) (set! (-> this cp-valid?) #f) - (set! (-> s2-0 quad) (-> this cp-vec quad)) + (vector-copy! s2-0 (-> this cp-vec)) (set! (-> s2-0 y) 0.0) (vector-xz-normalize! s2-0 1.0) (vector-rotate90-around-y! s2-0 s2-0) @@ -1086,21 +1101,21 @@ (cond ((< 0.0 (vector-dot s2-0 s3-1)) (if (< 4096.0 f0-11) - (set! (-> s1-0 quad) (-> s0-0 quad)) - (set! (-> s1-0 quad) (-> sv-320 quad)) + (vector-copy! s1-0 s0-0) + (vector-copy! s1-0 sv-320) ) ) ((< 4096.0 f1-10) - (set! (-> s1-0 quad) (-> sv-320 quad)) + (vector-copy! s1-0 sv-320) ) (else - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! s1-0 s0-0) ) ) ) - (set! (-> arg0 quad) (-> s1-0 quad)) + (vector-copy! arg0 s1-0) (let ((a1-11 (new 'stack-no-clear 'vector))) - (set! (-> a1-11 quad) (-> this root trans quad)) + (vector-copy! a1-11 (-> this root trans)) (set! (-> a1-11 y) 0.0) (let ((f0-15 (- f28-0 (vector-vector-xz-distance s4-0 a1-11)))) (if (< f0-15 0.0) @@ -1144,12 +1159,12 @@ (a0-1 (-> arg1 branch src-node)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> a0-1 position quad)) + (vector-copy! s4-0 (-> a0-1 position)) (set! (-> s4-0 w) 1.0) (let ((a0-4 (-> arg1 branch dest-node)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> a0-4 position quad)) + (vector-copy! s3-0 (-> a0-4 position)) (set! (-> s3-0 w) 1.0) (set! (-> s4-0 y) 0.0) (set! (-> s3-0 y) 0.0) @@ -1188,7 +1203,7 @@ (let ((s1-3 (vector-! (new 'stack-no-clear 'vector) s3-0 (the-as vector (-> s2-0 cp-sphere)))) (s0-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s0-2 quad) (-> s2-0 cp-vec quad)) + (vector-copy! s0-2 (-> s2-0 cp-vec)) (set! (-> s0-2 y) 0.0) (vector-normalize! s0-2 1.0) (set! (-> s1-3 y) 0.0) @@ -1238,8 +1253,8 @@ (gp-0 (new 'stack-no-clear 'iter-seg)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this cp-vec quad)) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this cp-vec)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) 81920.0) (set! (-> gp-0 seg) #f) (set! (-> gp-0 score) (the-as float #xff800000)) @@ -1282,10 +1297,10 @@ (defmethod citizen-method-205 ((this citizen)) (when (-> this cp-valid?) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this cp-force quad)) + (vector-copy! s4-0 (-> this cp-force)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((a1-0 (-> this nav state))) - (set! (-> s5-0 quad) (-> a1-0 heading quad)) + (vector-copy! s5-0 (-> a1-0 heading)) ) (set! (-> s5-0 y) 0.0) (vector-xz-normalize! s5-0 1.0) @@ -1311,12 +1326,12 @@ (let ((a1-1 (-> arg1 branch src-node)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> a1-1 position quad)) + (vector-copy! v1-2 (-> a1-1 position)) (set! (-> v1-2 w) 1.0) (let ((a2-0 (-> arg1 branch dest-node)) (a0-4 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-4 quad) (-> a2-0 position quad)) + (vector-copy! a0-4 (-> a2-0 position)) (set! (-> a0-4 w) 1.0) (set! (-> v1-2 y) 0.0) (set! (-> a0-4 y) 0.0) @@ -1351,12 +1366,12 @@ (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> this cp-vec quad)) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> this cp-vec)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) arg1) (set! (-> gp-0 seg) #f) (set! (-> gp-0 score) (the-as float #xff800000)) - (set! (-> gp-0 desired-dir quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 desired-dir) arg0) (vector-normalize! (-> gp-0 desired-dir) 1.0) (set! (-> gp-0 self) this) (nav-segment-callback @@ -1449,13 +1464,13 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) ) 0 - (set! (-> self wait-time) (set-reaction-time! self (seconds 1) (seconds 5))) + (set! (-> self wait-time) (rnd-time-frame self (seconds 1) (seconds 5))) (if (= (-> self water-anim) -1) (go-inactive self) ) (when (focus-test? self touch-water) (let ((a1-3 (new 'stack-no-clear 'vector))) - (set! (-> a1-3 quad) (-> self root trans quad)) + (vector-copy! a1-3 (-> self root trans)) (set! (-> a1-3 y) (+ 40.96 (-> self water-surface-height))) (splash-spawn 0.2 a1-3 1) ) @@ -1473,7 +1488,7 @@ (ja-no-eval :group! (-> self draw art-group data (-> self water-anim)) :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (set! (-> gp-0 y) (+ 40.96 (-> self water-surface-height))) (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) (zero? (-> self draw cur-lod))) (let ((f0-6 (y-angle (-> self root)))) @@ -1590,7 +1605,7 @@ ) (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-18 target-pos quad) (-> v1-17 quad)) + (vector-copy! (-> a0-18 target-pos) v1-17) ) 0 ) @@ -1602,14 +1617,14 @@ (let ((a0-21 (-> self nav state)) (v1-26 *null-vector*) ) - (set! (-> a0-21 velocity quad) (-> v1-26 quad)) + (vector-copy! (-> a0-21 velocity) v1-26) ) 0 (let ((v1-29 (-> self nav))) (set! (-> v1-29 target-speed) (* (-> self speed-scale) (-> self speed-walk))) ) 0 - (set! (-> self wait-time) (set-reaction-time! self (seconds 4) (seconds 30))) + (set! (-> self wait-time) (rnd-time-frame self (seconds 4) (seconds 30))) (if (zero? (-> self controller branch)) (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) @@ -1651,7 +1666,7 @@ 0 (when (= (-> self nav state speed) 0.0) (set! (-> self wait-return-state) (the-as (state citizen) (-> self state))) - (set! (-> self wait-time) (set-reaction-time! self (seconds 1) (seconds 5))) + (set! (-> self wait-time) (rnd-time-frame self (seconds 1) (seconds 5))) (go-virtual wait) ) ) @@ -1701,7 +1716,7 @@ (let ((a0-5 (-> self nav state)) (a1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-2 quad) (-> a0-5 heading quad)) + (vector-copy! a1-2 (-> a0-5 heading)) (vector-float*! a1-2 a1-2 -1.0) (citizen-method-208 self a1-2) ) @@ -1713,7 +1728,7 @@ ) (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-10 target-pos quad) (-> v1-21 quad)) + (vector-copy! (-> a0-10 target-pos) v1-21) ) 0 ) @@ -1726,7 +1741,7 @@ (a2-2 (-> self nav state)) (a1-12 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-12 quad) (-> a2-2 target-pos quad)) + (vector-copy! a1-12 (-> a2-2 target-pos)) (let ((f0-2 (t9-4 a0-16 a1-12)) (f1-3 4096.0) ) @@ -1826,6 +1841,7 @@ ) (defmethod get-penetrated-by ((this citizen)) + "Figure out the penetrated-by mask for this process." (logior (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (the int (-> this hit-points))) (penetrate vehicle) ) @@ -1838,6 +1854,7 @@ ) ) -(defmethod enemy-method-152 ((this citizen)) +(defmethod gem-chance ((this citizen)) + "The chance of this enemy having a gem." 0.5 ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/civilian.gc b/goal_src/jak3/levels/city/traffic/citizen/civilian.gc index e0349534f71..343e296942f 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/civilian.gc @@ -102,7 +102,8 @@ ) ) -(defmethod within-gspot-range? ((this civilian)) +(defmethod invalid-height? ((this civilian)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) @@ -112,7 +113,7 @@ (let ((a1-1 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-1 sphere quad) (-> this root trans quad)) (set! (-> a1-1 sphere r) 40960.0) - (set! (-> a1-1 velocity quad) (-> this root transv quad)) + (vector-copy! (-> a1-1 velocity) (-> this root transv)) (set! (-> a1-1 notify-radius) 122880.0) (set! (-> a1-1 danger-level) 1.0) (set! (-> a1-1 decay-rate) 0.0) @@ -126,17 +127,22 @@ (none) ) -(defmethod send-attack-to-all-tshapes ((this civilian) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this civilian) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." 0 ) ;; WARN: Return type mismatch none vs object. (defmethod go-hostile ((this civilian)) + "Go to the hostile state, actively trying to attack the target." (cleanup-for-death this) ) ;; WARN: Return type mismatch none vs object. (defmethod go-die ((this civilian)) + "Go to the die state." (cleanup-for-death this) ) @@ -186,7 +192,7 @@ (defmethod civilian-method-230 ((this civilian) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> this root trans quad)) + (vector-copy! v1-0 (-> this root trans)) (set! (-> v1-0 w) 81920.0) (let ((s5-0 (find-segment this v1-0 arg0))) (if s5-0 @@ -198,11 +204,13 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this civilian)) +(defmethod get-search-info-flag ((this civilian)) + "Get search-info-flag for this process." (the-as search-info-flag 0) ) (defmethod event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('combo) #f @@ -243,7 +251,7 @@ (let ((v1-22 (the-as traffic-danger-info (-> arg3 param 0)))) (set! (-> this cp-valid?) #t) (set! (-> this cp-sphere quad) (-> v1-22 sphere quad)) - (set! (-> this cp-vec quad) (-> v1-22 velocity quad)) + (vector-copy! (-> this cp-vec) (-> v1-22 velocity)) (let ((v1-23 (-> v1-22 danger-type))) (cond ((zero? v1-23) @@ -321,7 +329,7 @@ (a2-1 s3-0) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-1 position quad)) + (vector-copy! a1-1 (-> a2-1 position)) (set! (-> a1-1 w) 1.0) (let ((s1-0 (t9-0 a0-1 a1-1)) (s2-0 (-> s3-0 branch-count)) @@ -385,15 +393,15 @@ (when s5-0 (vehicle-controller-method-11 gp-0) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> gp-0 turn-exit-point quad)) + (vector-copy! s4-1 (-> gp-0 turn-exit-point)) (vehicle-controller-method-10 gp-0 s5-0) - (set! (-> gp-0 path-prev-point quad) (-> s4-1 quad)) + (vector-copy! (-> gp-0 path-prev-point) s4-1) ) (set! (-> gp-0 branch) s5-0) (let ((a1-3 (-> s5-0 dest-node)) (v1-23 (-> gp-0 turn-exit-point)) ) - (set! (-> v1-23 quad) (-> a1-3 position quad)) + (vector-copy! v1-23 (-> a1-3 position)) (set! (-> v1-23 w) 1.0) ) ) @@ -402,7 +410,7 @@ ) ) (when (< (-> self cp-next-time) (current-time)) - (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 2) (seconds 4)))) + (set! (-> self cp-next-time) (+ (current-time) (rnd-time-frame self (seconds 2) (seconds 4)))) (citizen-method-203 self (-> self cp-force)) ) (add-offset-to-target! (-> self nav state) (-> self cp-force)) @@ -422,10 +430,10 @@ ) (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-18 target-pos quad) (-> v1-42 quad)) + (vector-copy! (-> a0-18 target-pos) v1-42) ) 0 - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self nav state target-pos quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self nav state target-pos)) (nav-enemy-method-187 self) (none) ) @@ -538,15 +546,15 @@ (cond ((< 0.0 (vector-dot s1-1 gp-1)) (if (< 8192.0 f0-7) - (set! (-> s4-0 quad) (-> s3-0 quad)) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s3-0) + (vector-copy! s4-0 s2-0) ) ) ((< 8192.0 f1-7) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s2-0) ) (else - (set! (-> s4-0 quad) (-> s3-0 quad)) + (vector-copy! s4-0 s3-0) ) ) ) @@ -565,7 +573,7 @@ (if (< 0.8 f0-15) (set! f0-15 0.8) ) - (set! (-> gp-1 quad) (-> s4-0 quad)) + (vector-copy! gp-1 s4-0) (vector-xz-normalize! gp-1 (* 16384.0 f0-15)) ) ) @@ -581,7 +589,7 @@ ) (logclear! (-> a0-27 flags) (nav-state-flag directional-mode)) (logior! (-> a0-27 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-27 target-pos quad) (-> v1-41 quad)) + (vector-copy! (-> a0-27 target-pos) v1-41) ) ) 0 @@ -625,7 +633,7 @@ ) (logclear! (-> a0-6 flags) (nav-state-flag directional-mode)) (logior! (-> a0-6 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-6 target-pos quad) (-> v1-23 quad)) + (vector-copy! (-> a0-6 target-pos) v1-23) ) 0 (nav-enemy-method-187 self) @@ -654,8 +662,8 @@ (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk))) ) 0 - (set! (-> self next-time) (+ (current-time) (set-reaction-time! self (seconds 1) (seconds 2)))) - (set! (-> self last-second-pos quad) (-> self root trans quad)) + (set! (-> self next-time) (+ (current-time) (rnd-time-frame self (seconds 1) (seconds 2)))) + (vector-copy! (-> self last-second-pos) (-> self root trans)) (set! (-> self last-distance) (vector-vector-xz-distance (-> self dest-point) (-> self root trans))) (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.0 0.0 1.0 1.0) @@ -696,7 +704,7 @@ (s1-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self cp-vec quad)) + (vector-copy! gp-0 (-> self cp-vec)) (set! (-> gp-0 y) 0.0) (vector-xz-normalize! gp-0 1.0) (vector-rotate90-around-y! gp-0 gp-0) @@ -729,19 +737,19 @@ (cond ((< 0.0 (vector-dot gp-0 s5-1)) (if (< 4096.0 f0-9) - (set! (-> s4-0 quad) (-> s3-0 quad)) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s3-0) + (vector-copy! s4-0 s2-0) ) ) ((< 4096.0 f1-8) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s2-0) ) (else - (set! (-> s4-0 quad) (-> s3-0 quad)) + (vector-copy! s4-0 s3-0) ) ) ) - (set! (-> gp-0 quad) (-> s4-0 quad)) + (vector-copy! gp-0 s4-0) ) ) ) @@ -761,7 +769,7 @@ ) (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-21 target-pos quad) (-> v1-34 quad)) + (vector-copy! (-> a0-21 target-pos) v1-34) ) ) 0 @@ -773,7 +781,7 @@ (citizen-method-205 self) (when (< (-> self cp-next-time) (current-time)) (citizen-method-203 self (-> self cp-force)) - (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 4) (seconds 8)))) + (set! (-> self cp-next-time) (+ (current-time) (rnd-time-frame self (seconds 4) (seconds 8)))) ) (let ((gp-1 (new 'stack-no-clear 'vector))) (citizen-method-201 self gp-1) @@ -796,7 +804,7 @@ ) (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-pos quad) (-> v1-25 quad)) + (vector-copy! (-> a0-9 target-pos) v1-25) ) 0 (nav-enemy-method-187 self) @@ -825,7 +833,7 @@ (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk))) ) 0 - (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 4) (seconds 8)))) + (set! (-> self cp-next-time) (+ (current-time) (rnd-time-frame self (seconds 4) (seconds 8)))) (set! (-> self cp-force quad) (the-as uint128 0)) (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.0 1.0 0.0 1.0) @@ -996,11 +1004,11 @@ 0 (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a1-4 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-4 heading quad)) + (vector-copy! gp-0 (-> a1-4 heading)) ) (vector-normalize! gp-0 614400.0) (vector+! (-> self dive-target-point) (-> self root trans) gp-0) - (set! (-> self dive-target-point quad) (-> gp-0 quad)) + (vector-copy! (-> self dive-target-point) gp-0) ) (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) @@ -1049,7 +1057,7 @@ (v1-1 *null-vector*) ) (logior! (-> a0-0 flags) (nav-state-flag directional-mode)) - (set! (-> a0-0 travel quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 travel) v1-1) ) 0 (if (-> self dive-finished?) @@ -1146,7 +1154,7 @@ (v1-1 *null-vector*) ) (logior! (-> a0-0 flags) (nav-state-flag directional-mode)) - (set! (-> a0-0 travel quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 travel) v1-1) ) 0 (enemy-common-post self) @@ -1187,10 +1195,10 @@ (v1-5 *null-vector*) ) (logior! (-> a0-3 flags) (nav-state-flag directional-mode)) - (set! (-> a0-3 travel quad) (-> v1-5 quad)) + (vector-copy! (-> a0-3 travel) v1-5) ) 0 - (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (move-to-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) (set! (-> self gnd-height) (-> self root gspot-pos y)) (vector-reset! (-> self root transv)) (if *citizen-debug* @@ -1221,7 +1229,7 @@ (suspend) (ja-eval) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-virtual flee) ) @@ -1264,12 +1272,12 @@ (go-virtual flee) ) :post (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (let ((a0-1 (-> self nav state)) (v1-3 *null-vector*) ) (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) - (set! (-> a0-1 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-1 travel) v1-3) ) 0 (enemy-common-post self) @@ -1312,12 +1320,12 @@ (go-virtual flee) ) :post (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (let ((a0-1 (-> self nav state)) (v1-3 *null-vector*) ) (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) - (set! (-> a0-1 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-1 travel) v1-3) ) 0 (enemy-common-post self) @@ -1328,7 +1336,7 @@ (let ((gp-0 (-> self root))) (cond ((focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) ) (else (let ((a1-1 (new-stack-vector0))) @@ -1350,7 +1358,10 @@ (none) ) -(defmethod enemy-method-90 ((this civilian) (arg0 ragdoll-proc)) +(defmethod copy-ragdoll-orientation-to-root ((this civilian) (arg0 ragdoll-proc)) + "Apply rotational offset from ragdolling back to the enemy. + Used when disabling a ragdoll to update the enemy + orientation to match the end of ragdoll orientation." (let* ((s3-0 (-> arg0 ragdoll)) (s2-0 (-> s3-0 ragdoll-joints)) (s1-0 @@ -1421,7 +1432,7 @@ (t9-0) ) ) - (reset-penetrate! self) + (reset-penetrate-later! self) ) ) @@ -1460,7 +1471,7 @@ (v1-10 *null-vector*) ) (logior! (-> a0-5 flags) (nav-state-flag directional-mode)) - (set! (-> a0-5 travel quad) (-> v1-10 quad)) + (vector-copy! (-> a0-5 travel) v1-10) ) 0 (set! (-> self vehicle) (the-as handle #f)) @@ -1657,8 +1668,8 @@ ) (let ((s3-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (set! (-> s2-0 quad) (-> self root trans quad)) - (set! (-> s1-0 quad) (-> gp-0 quad)) + (vector-copy! s2-0 (-> self root trans)) + (vector-copy! s1-0 gp-0) (vector-! s5-0 gp-0 (-> s0-0 root trans)) (vector-z-quaternion! s4-0 (-> self root quat)) (let ((f30-1 (* 0.5 (vector-vector-xz-distance s2-0 s1-0)))) @@ -1669,7 +1680,7 @@ (let ((v1-21 (-> self nav state))) (logclear! (-> v1-21 flags) (nav-state-flag directional-mode)) (logior! (-> v1-21 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-21 target-pos quad) (-> s3-0 quad)) + (vector-copy! (-> v1-21 target-pos) s3-0) ) ) 0 @@ -1762,7 +1773,7 @@ ) ) (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> self root trans quad)) + (vector-copy! gp-2 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) :num! (seek! (ja-aframe 5.0 0) 0.86956525) @@ -1845,7 +1856,7 @@ (case message (('exit-vehicle) (let ((a0-1 (the-as object (-> block param 0)))) - (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) + (vector-copy! (-> self event-param-point) (the-as vector a0-1)) ) (if (time-elapsed? (-> self state-time) (seconds 1)) (go-virtual exit-vehicle) @@ -1932,7 +1943,7 @@ ) (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-7 target-pos quad) (-> v1-14 quad)) + (vector-copy! (-> a0-7 target-pos) v1-14) ) 0 (citizen-method-195 self) diff --git a/goal_src/jak3/levels/city/traffic/citizen/guard.gc b/goal_src/jak3/levels/city/traffic/citizen/guard.gc index ef62c51c758..e5cc8278e36 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/guard.gc @@ -155,34 +155,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 61440.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 15) + :knocked-soft-vy-hi (meters 15) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 24) + :knocked-hard-vy-hi (meters 26) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 15) + :knocked-red-vy-hi (meters 15) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -269,7 +269,7 @@ (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) - (set! (-> s0-0 quad) (-> this root trans quad)) + (vector-copy! s0-0 (-> this root trans)) (cond ((logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags)) (let ((a1-6 s0-0)) @@ -366,6 +366,7 @@ ;; WARN: Return type mismatch time-frame vs none. (defmethod enemy-common-post ((this crimson-guard)) + "Common implementation of post. Runs ja-post." (when (nonzero? (-> this controller branch)) (let* ((v1-2 *cty-faction-manager*) (a1-0 (-> this controller branch clock-type)) @@ -400,11 +401,13 @@ ) (defmethod go-die ((this crimson-guard)) + "Go to the die state." (set! *guard-died-recently?* #t) ((method-of-type nav-enemy go-die) this) ) -(defmethod go-best-state ((this crimson-guard)) +(defmethod go-state-for-focused ((this crimson-guard)) + "Go to the appropriate state for the current awareness of the focused process." (if (not (logtest? (-> this flags) (citizen-flag hostile))) (go (method-of-object this active)) (go-hostile this) @@ -412,6 +415,7 @@ ) (defmethod get-damage-from-attack ((this crimson-guard) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let ((v0-0 ((method-of-type nav-enemy get-damage-from-attack) this arg0 arg1))) (-> arg1 param 1) v0-0 @@ -419,7 +423,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this crimson-guard)) +(defmethod get-search-info-flag ((this crimson-guard)) + "Get search-info-flag for this process." (the-as search-info-flag (cond ((not (-> *setting-control* user-current gun-target-guards?)) 1 @@ -439,6 +444,7 @@ ;; WARN: disable def twice: 182. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-0 object)) (case arg2 (('victory) @@ -552,7 +558,7 @@ (let ((v1-69 (the-as traffic-danger-info (-> arg3 param 0)))) (set! (-> this cp-valid?) #t) (set! (-> this cp-sphere quad) (-> v1-69 sphere quad)) - (set! (-> this cp-vec quad) (-> v1-69 velocity quad)) + (vector-copy! (-> this cp-vec) (-> v1-69 velocity)) (let ((v1-70 (-> v1-69 danger-type))) (cond ((zero? v1-70) @@ -646,6 +652,7 @@ ) (defmethod knocked-land-anim ((this crimson-guard) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((>= 0.0 (-> this hit-points)) (ja-channel-push! 1 (seconds 0.1)) @@ -753,7 +760,7 @@ (set! (-> s4-0 shield-type) (shield-type shield-type-0)) (set! (-> s4-0 enable-time) (seconds 3)) (set! (-> s4-0 disable-time) (seconds 1.5)) - (set! (-> s4-0 offset-vec quad) (-> *up-vector* quad)) + (vector-copy! (-> s4-0 offset-vec) *up-vector*) (vector-float*! (-> s4-0 offset-vec) (-> s4-0 offset-vec) 8192.0) (let ((s3-0 (the-as process #f))) (let* ((s2-0 (get-process *default-dead-pool* shield-sphere #x4000 1)) @@ -782,7 +789,7 @@ (logior! (-> this flags) (citizen-flag persistent)) ) (let ((s4-1 (-> this focus)) - (s3-1 (method-of-type enemy-focus enemy-focus-method-13)) + (s3-1 (method-of-type enemy-focus focus-on-with-awareness!)) (s5-1 (handle->process (-> arg0 handle))) ) (s3-1 @@ -791,7 +798,7 @@ s5-1 ) ) - (enemy-aware ea3) + (enemy-aware hostile) ) ) (go (method-of-object this arrest)) @@ -808,7 +815,7 @@ (s5-2 (get-focus s4-2)) ) (if (and (>= (the-as uint (get-alert-level s4-2)) (the-as uint 1)) s5-2) - (try-update-focus (-> this focus) s5-2 this) + (focus-on! (-> this focus) s5-2 this) ) ) (go (method-of-object this exit-transport)) @@ -827,7 +834,7 @@ (go-hostile this) ) ((11) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (quaternion-copy! (-> this root quat) (-> arg0 rotation)) (set! (-> this vehicle) (-> arg0 handle)) (ja-channel-set! 1) @@ -877,7 +884,7 @@ (let ((f0-0 1228.8) (f30-0 6144.0) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-! (-> s5-0 move-dist) arg1 arg0) (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) @@ -911,7 +918,7 @@ ) ) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (let ((a0-19 (-> s5-0 start-pos))) (let ((v1-15 (-> s5-0 move-dist))) (let ((a1-10 -0.1)) @@ -1033,11 +1040,11 @@ (logclear! (-> this flags) (citizen-flag in-pursuit)) ) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> this root trans quad)) + (vector-copy! a1-4 (-> this root trans)) (+! (-> a1-4 y) 8192.0) (let ((s4-1 (squad-control-method-17 (-> this squad) a1-4 (-> this traffic-id) (-> this target-status)))) (let* ((s3-0 this) - (s2-0 (method-of-object s3-0 enemy-method-70)) + (s2-0 (method-of-object s3-0 set-focus!)) (s1-0 (handle->process (-> this target-status handle))) ) (s2-0 @@ -1059,8 +1066,8 @@ :delay (nop!) ) ) - (set! (-> this target-pos quad) (-> this target-status position quad)) - (set! (-> this target-vel-vec quad) (-> this target-status velocity quad)) + (vector-copy! (-> this target-pos) (-> this target-status position)) + (vector-copy! (-> this target-vel-vec) (-> this target-status velocity)) (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) (when (logtest? (-> s4-1 flags) (squad-target-flag updated)) (if (crimson-guard-method-256 this) @@ -1087,7 +1094,7 @@ (vector+! (-> this target-pos-predict-miss) (-> this root trans) s5-2) ) (vector-! (-> this target-self) (-> this target-pos) (-> this root trans)) - (set! (-> this target-self-xz quad) (-> this target-self quad)) + (vector-copy! (-> this target-self-xz) (-> this target-self)) (set! (-> this target-self-xz y) 0.0) (set! (-> this target-self-dist) (vector-length (-> this target-self))) (set! (-> this target-self-xz-dist) (vector-length (-> this target-self-xz))) @@ -1250,7 +1257,7 @@ (set! (-> arg2 sv-16) (fmin sv-28 (-> arg1 circle-range sv-16))) ) (else - (set! (-> this move-position quad) (-> this root trans quad)) + (vector-copy! (-> this move-position) (-> this root trans)) ) ) (!= sv-16 -1) @@ -1260,7 +1267,7 @@ (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> a1-0 velocity) (-> this root transv)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) (set! (-> a1-0 decay-rate) 0.0) @@ -1275,7 +1282,7 @@ (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> this target-pos quad)) + (vector-copy! s4-0 (-> this target-pos)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0))) (vector-normalize! s3-1 409600.0) (set! (-> this los-status) @@ -1368,15 +1375,15 @@ #f ) ((let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> s4-0 quad)) + (vector-copy! a1-4 s4-0) (set! (-> a1-4 w) (-> arg0 root nav-radius)) - (add-root-sphere-to-hash! (-> arg0 nav) a1-4 #x10046e) + (check-sphere-blocked! (-> arg0 nav) a1-4 #x10046e) ) #f ) (else (let ((a1-5 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-5 start-pos quad) (-> arg1 trans quad)) + (vector-copy! (-> a1-5 start-pos) (-> arg1 trans)) (vector-! (-> a1-5 move-dist) s4-0 (-> a1-5 start-pos)) (let ((v1-10 a1-5)) (set! (-> v1-10 radius) 2048.0) @@ -1522,9 +1529,9 @@ (let ((f28-0 f0-8)) (new 'stack-no-clear 'vector) (let ((a1-8 (new 'stack-no-clear 'vector))) - (set! (-> a1-8 quad) (-> s1-0 quad)) + (vector-copy! a1-8 s1-0) (set! (-> a1-8 w) 8192.0) - (when (not (add-root-sphere-to-hash! (-> this nav) a1-8 32)) + (when (not (check-sphere-blocked! (-> this nav) a1-8 32)) (when (< f30-0 f28-0) (set! f30-0 f28-0) (set! sv-784 (new 'stack-no-clear 'vector)) @@ -1554,7 +1561,7 @@ (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) - (set! (-> arg0 quad) (-> s1-0 quad)) + (vector-copy! arg0 s1-0) ) ) ) @@ -1568,36 +1575,39 @@ ) ) -(defmethod go-directed2 ((this crimson-guard)) +(defmethod go-next-state-auto ((this crimson-guard)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (let ((s5-0 (-> this nav state)) (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (set! (-> s5-0 heading quad) (-> v1-2 quad)) + (vector-copy! (-> s5-0 heading) v1-2) ) 0 (let ((s5-1 (-> this nav state)) (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (logior! (-> s5-1 flags) (nav-state-flag directional-mode)) - (set! (-> s5-1 travel quad) (-> v1-7 quad)) + (vector-copy! (-> s5-1 travel) v1-7) ) 0 (let ((s5-2 (-> this nav state)) (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (set! (-> s5-2 velocity quad) (-> v1-12 quad)) + (vector-copy! (-> s5-2 velocity) v1-12) ) 0 (crimson-guard-method-261 this) - (set! (-> this move-position quad) (-> this target-pos quad)) + (vector-copy! (-> this move-position) (-> this target-pos)) (go-hostile this) ) (defmethod jump-wind-up-anim ((this crimson-guard) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" #f ) (defmethod jump-in-air-anim ((this crimson-guard) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -1614,6 +1624,7 @@ ) (defmethod jump-land-anim ((this crimson-guard) (arg0 enemy-jump-info)) + "Play the landing anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -1629,58 +1640,57 @@ #t ) -(defmethod jump-anim-handler ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this crimson-guard) (arg0 jump-stage) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) - (let ((v1-0 arg0)) - (cond - ((zero? v1-0) - (not (jump-wind-up-anim this arg1)) - ) - ((= v1-0 1) - (set! s5-0 (ja-done? 0)) - (let ((s4-1 (-> this skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) - (set! (-> s4-1 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 - ) - ((= v1-0 2) - (jump-in-air-anim this arg1) - #f - ) - ((= v1-0 3) - (set! s5-0 (ja-done? 0)) - (let ((s4-2 (-> this skel root-channel 0))) - (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) - (set! (-> s4-2 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 + (case arg0 + (((jump-stage init)) + (not (jump-wind-up-anim this arg1)) + ) + (((jump-stage winding-up)) + (set! s5-0 (ja-done? 0)) + (let ((s4-1 (-> this skel root-channel 0))) + (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-1 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) ) - ((= v1-0 4) - (not (jump-land-anim this arg1)) + (ja-blend-eval) + s5-0 + ) + (((jump-stage takeoff)) + (jump-in-air-anim this arg1) + #f + ) + (((jump-stage in-air)) + (set! s5-0 (ja-done? 0)) + (let ((s4-2 (-> this skel root-channel 0))) + (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-2 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) ) - ((= v1-0 5) - (set! s5-0 (ja-done? 0)) - (let ((s4-3 (-> this skel root-channel 0))) - (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) - (set! (-> s4-3 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 + (ja-blend-eval) + s5-0 + ) + (((jump-stage touchdown)) + (not (jump-land-anim this arg1)) + ) + (((jump-stage landing)) + (set! s5-0 (ja-done? 0)) + (let ((s4-3 (-> this skel root-channel 0))) + (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) + (set! (-> s4-3 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) ) - (else - #t - ) + (ja-blend-eval) + s5-0 + ) + (else + #t ) ) ) (defmethod init-enemy-collision! ((this crimson-guard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'crimson-guard-collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1762,6 +1772,7 @@ ) (defmethod init-enemy! ((this crimson-guard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard" (the-as (pointer level) #f))) @@ -1771,7 +1782,7 @@ (set! (-> this state-stack) (new 'process 'boxed-array state 6)) (set! (-> this state-stack length) 0) (set! (-> this info) *crimson-guard-global-info*) - (init-enemy-defaults! this *crimson-guard-nav-enemy-info*) + (setup-enemy! this *crimson-guard-nav-enemy-info*) (let ((v1-9 (-> this nav))) (set! (-> v1-9 speed-scale) 1.0) ) @@ -1971,7 +1982,7 @@ (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 25) (the-as int #f) (the-as vector #t) 0)) ) (set! (-> this move-index) -1) - (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.15))) + (set! (-> this reaction-time) (rnd-time-frame this (seconds 0.1) (seconds 0.15))) (ja-channel-set! 0) 0 (none) @@ -2059,7 +2070,10 @@ #f ) -(defmethod send-attack-to-all-tshapes ((this crimson-guard) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this crimson-guard) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when s4-0 (let ((s3-0 (-> s4-0 head))) @@ -2067,7 +2081,7 @@ (get-touched-prim s3-0 (-> arg0 root) s4-0) (when (logtest? (-> (get-touched-prim s3-0 (-> this root) s4-0) prim-core action) (collide-action deadly)) (let* ((a0-3 this) - (t9-2 (method-of-object a0-3 send-attack)) + (t9-2 (method-of-object a0-3 send-attack-from-tshape)) (a1-3 arg0) (a2-3 s4-0) (v1-10 *game-info*) @@ -2087,19 +2101,21 @@ 0 ) -(defmethod get-incoming-attack! ((this crimson-guard) - (arg0 process-drawable) - (arg1 event-message-block) - (arg2 penetrate) - (arg3 attack-info) - (arg4 touching-shapes-entry) - ) +(defmethod handle-incoming-attack! ((this crimson-guard) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + "Set up this enemy to handle an incoming attack event." (call-parent-method this arg0 arg1 arg2 arg3 arg4) 0 (none) ) (defmethod get-penetrated-by ((this crimson-guard)) + "Figure out the penetrated-by mask for this process." (let ((gp-0 4160)) (if (and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'knocked) (= v1-3 'get-up-front) (= v1-3 'get-up-back)) @@ -2129,14 +2145,15 @@ (a3-0 (-> arg0 state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (vector-copy! a2-0 (-> a3-0 heading)) (t9-0 this v1-1 a2-0) ) 0 (none) ) -(defmethod enemy-method-50 ((this crimson-guard) (arg0 int)) +(defmethod update-collision-action ((this crimson-guard) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" 0 (none) ) @@ -2198,7 +2215,8 @@ ) ) -(defmethod enemy-method-69 ((this crimson-guard)) +(defmethod focus-on-attacker! ((this crimson-guard)) + "If possible, update this enemies focus to the attacker." 0 (none) ) @@ -2221,7 +2239,8 @@ (none) ) -(defmethod damage-enemy! ((this crimson-guard) (arg0 object) (arg1 event-message-block)) +(defmethod damage-enemy-from-attack! ((this crimson-guard) (arg0 object) (arg1 event-message-block)) + "Given an attack message, apply damage." (when (-> *setting-control* user-current gun-target-guards?) (let ((v1-4 (handle->process (-> this incoming attacker-handle)))) (when v1-4 diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc index 89805c625f2..20dfa3d659f 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-flitter.gc @@ -130,34 +130,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 275251.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 67.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -212,6 +212,7 @@ ) (defmethod knocked-anim ((this metalhead-flitter) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (let ((a0-2 (-> this skel root-channel 0))) @@ -254,6 +255,7 @@ ) (defmethod knocked-land-anim ((this metalhead-flitter) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type blue-shot)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -276,7 +278,7 @@ ) (defmethod go-stare2 ((this metalhead-flitter)) - (if (and (= (-> this focus aware) (enemy-aware ea2)) (not (nav-enemy-method-174 this))) + (if (and (= (-> this focus aware) (enemy-aware aware2)) (not (nav-enemy-method-174 this))) (go (method-of-object this pacing)) (go (method-of-object this stare)) ) @@ -315,11 +317,11 @@ (('ruins) (cond ((logtest? (-> *part-group-id-table* 255 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 255)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 255)) ) ) @@ -327,11 +329,11 @@ (('strip) (cond ((logtest? (-> *part-group-id-table* 256 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 256)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 256)) ) ) @@ -378,11 +380,11 @@ (when (< (-> self base-height) (-> self root trans y)) (cond ((logtest? (-> *part-group-id-table* 257 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 257)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 257)) ) ) @@ -437,7 +439,8 @@ :post nav-enemy-falling-post ) -(defmethod enemy-method-108 ((this metalhead-flitter) (arg0 process-focusable)) +(defmethod should-flee-from? ((this metalhead-flitter) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (focus-test? arg0 mech) ) @@ -454,18 +457,18 @@ (f30-0 (vector-length s4-1)) ) (cond - ((enemy-method-108 this s3-0) + ((should-flee-from? this s3-0) (go-flee this) ) ((and (< f30-0 32768.0) (not (metalhead-flitter-method-226 this s3-0))) (go (method-of-object this circling)) ) ((and (< f30-0 (-> this enemy-info notice-nav-radius)) (time-elapsed? (-> this state-time) (seconds 0.2))) - (set! (-> this target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> this target-pos) s5-1) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s4-1 quad)) + (vector-copy! s3-1 s4-1) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> this root transv quad)) + (vector-copy! s5-2 (-> this root transv)) (vector-normalize! s5-2 f30-0) (if (>= (vector-dot s3-1 s5-2) 0.98) (go (method-of-object this attack)) @@ -474,7 +477,7 @@ ) ) ((< f30-0 32768.0) - (set! (-> this target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> this target-pos) s5-1) ) ((or (time-elapsed? (-> this last-change-dir) (-> this change-dir-time)) (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) @@ -498,7 +501,7 @@ ) (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-0 s5-1 s3-2) - (set! (-> this target-pos quad) (-> s2-0 quad)) + (vector-copy! (-> this target-pos) s2-0) ) ) ) @@ -566,7 +569,7 @@ (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) (until #f - (when (not (enemy-method-105 self 2730.6667 #t)) + (when (not (pointing-toward-focus? self 2730.6667 #t)) (let ((v1-5 self)) (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) ) @@ -575,7 +578,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data 9)) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -640,7 +643,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -719,7 +722,7 @@ ) (logclear! (-> s5-1 flags) (nav-state-flag directional-mode)) (logior! (-> s5-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> s5-1 target-pos quad) (-> v1-10 quad)) + (vector-copy! (-> s5-1 target-pos) v1-10) ) 0 (set! s5-2 (-> self attack-pos)) @@ -767,7 +770,7 @@ (ja :num! (seek!)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-travel-post ) @@ -786,7 +789,7 @@ (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) (until #f - (when (not (enemy-method-105 self 2730.6667 #t)) + (when (not (pointing-toward-focus? self 2730.6667 #t)) (let ((v1-5 self)) (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) ) @@ -795,7 +798,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data 9)) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -846,12 +849,12 @@ :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) (if (the-as process-focusable gp-0) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-11 (-> self focus aware))) (cond - ((= v1-11 (enemy-aware ea3)) + ((= v1-11 (enemy-aware hostile)) (cond ((when gp-0 (let* ((gp-1 self) @@ -874,7 +877,7 @@ ) ) ) - ((= v1-11 (enemy-aware ea2)) + ((= v1-11 (enemy-aware aware2)) (go-stare self) ) ((>= 1 (the-as int v1-11)) @@ -921,6 +924,7 @@ ) (defmethod init-enemy-collision! ((this metalhead-flitter)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -973,12 +977,13 @@ ) (defmethod init-enemy! ((this metalhead-flitter)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-flitter" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *metalhead-flitter-nav-enemy-info*) + (setup-enemy! this *metalhead-flitter-nav-enemy-info*) (set! (-> this move-angle) 10922.667) (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) #t diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-grunt.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-grunt.gc index 5ed5520c1cf..c48aa2e74ea 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-grunt.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-grunt.gc @@ -168,34 +168,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 51609.6 - :knocked-soft-vxz-hi 87654.4 - :knocked-soft-vy-lo 49152.0 - :knocked-soft-vy-hi 73728.0 - :knocked-medium-vxz-lo 73728.0 - :knocked-medium-vxz-hi 98304.0 - :knocked-medium-vy-lo 65536.0 - :knocked-medium-vy-hi 73728.0 - :knocked-hard-vxz-lo 41779.2 - :knocked-hard-vxz-hi 60620.8 - :knocked-hard-vy-lo 93388.8 - :knocked-hard-vy-hi 103219.2 - :knocked-huge-vxz-lo 82739.2 - :knocked-huge-vxz-hi 126156.8 - :knocked-huge-vy-lo 101580.8 - :knocked-huge-vy-hi 111411.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 12288.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 49152.0 - :knocked-red-vy-hi 73728.0 - :knocked-blue-vxz-lo 20480.0 - :knocked-blue-vxz-hi 24576.0 - :knocked-blue-vy-lo 12288.0 - :knocked-blue-vy-hi 40960.0 + :knocked-soft-vxz-lo (meters 12.6) + :knocked-soft-vxz-hi (meters 21.4) + :knocked-soft-vy-lo (meters 12) + :knocked-soft-vy-hi (meters 18) + :knocked-medium-vxz-lo (meters 18) + :knocked-medium-vxz-hi (meters 24) + :knocked-medium-vy-lo (meters 16) + :knocked-medium-vy-hi (meters 18) + :knocked-hard-vxz-lo (meters 10.2) + :knocked-hard-vxz-hi (meters 14.8) + :knocked-hard-vy-lo (meters 22.8) + :knocked-hard-vy-hi (meters 25.2) + :knocked-huge-vxz-lo (meters 20.2) + :knocked-huge-vxz-hi (meters 30.8) + :knocked-huge-vy-lo (meters 24.8) + :knocked-huge-vy-hi (meters 27.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 3) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 12) + :knocked-red-vy-hi (meters 18) + :knocked-blue-vxz-lo (meters 5) + :knocked-blue-vxz-hi (meters 6) + :knocked-blue-vy-lo (meters 3) + :knocked-blue-vy-hi (meters 10) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 10625.897) :scale (new 'static 'vector :x 0.6399 :y 0.6399 :z 0.6399) @@ -680,6 +680,7 @@ ) (defmethod event-handler ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -691,7 +692,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -737,7 +738,8 @@ ) ) -(defmethod go-ambush-delay ((this metalhead-grunt)) +(defmethod go-ambush ((this metalhead-grunt)) + "May go to ambush-delay first, if set in the res-lump." (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -802,13 +804,14 @@ :post nav-enemy-falling-post ) -(defmethod go-directed2 ((this metalhead-grunt)) +(defmethod go-next-state-auto ((this metalhead-grunt)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type mh-squad-member go-directed2) this) + ((method-of-type mh-squad-member go-next-state-auto) this) ) ) ) @@ -858,7 +861,7 @@ ) (if (< v1-1 (-> a0-0 curve num-cverts)) (set! (-> self jumping-ambush-path-pt) v1-1) - (go-best-state self) + (go-state-for-focused self) ) ) (until #f @@ -908,7 +911,7 @@ ) 0 (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + (s5-0 (rnd-time-frame self 1 (seconds 0.027))) ) (let ((v1-37 (ja-group))) (if (not (and v1-37 (= v1-37 gp-0))) @@ -932,7 +935,7 @@ ) 0 (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (s5-1 (rnd-time-frame self (seconds 0.007) (seconds 0.017))) ) (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -965,7 +968,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -1060,7 +1063,7 @@ ) ) (sound-play "grunt-warn") - (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + (set! (-> self next-warn-time) (+ gp-0 (rnd-time-frame self (seconds 1) (seconds 1.2)))) ) ) ) @@ -1103,7 +1106,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-10 *game-info*) (a0-5 (+ (-> v1-10 attack-id) 1)) ) @@ -1118,7 +1121,7 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (when (logtest? (-> self enemy-flags) (enemy-flag victory)) (logclear! (-> self enemy-flags) (enemy-flag victory)) (sound-play "grunt-hit") @@ -1205,7 +1208,7 @@ (if (not gp-0) (go-stare self) ) - (set! (-> self focus-pos quad) (-> (get-trans gp-0 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans gp-0 0)) ) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-21 *game-info*) @@ -1241,7 +1244,7 @@ (until (ja-done? 0) (let ((a0-9 (the-as process-focusable (handle->process (-> self focus handle))))) (if a0-9 - (set! (-> self focus-pos quad) (-> (get-trans a0-9 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans a0-9 0)) ) ) (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) @@ -1351,6 +1354,7 @@ ) (defmethod init-enemy-collision! ((this metalhead-grunt)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1473,12 +1477,13 @@ ) (defmethod init-enemy! ((this metalhead-grunt)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-grunt" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this (get-nav-info this)) + (setup-enemy! this (get-nav-info this)) (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) @@ -1530,7 +1535,7 @@ (suspend) (ja :num! (seek!)) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) diff --git a/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc index 6a38da24be8..ddd419ee6d1 100644 --- a/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak3/levels/city/traffic/citizen/metalhead-predator.gc @@ -83,7 +83,7 @@ ) (defmethod init-proj-settings! ((this metalhead-predator-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'predator-shot) (set! (-> this max-speed) 532480.0) (set! (-> this move) metalhead-shot-move) @@ -219,34 +219,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 81920.0 - :knocked-soft-vxz-hi 81920.0 - :knocked-soft-vy-lo 69632.0 - :knocked-soft-vy-hi 69632.0 - :knocked-medium-vxz-lo 81920.0 - :knocked-medium-vxz-hi 81920.0 - :knocked-medium-vy-lo 69632.0 - :knocked-medium-vy-hi 69632.0 - :knocked-hard-vxz-lo 81920.0 - :knocked-hard-vxz-hi 81920.0 - :knocked-hard-vy-lo 69632.0 - :knocked-hard-vy-hi 69632.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 53248.0 - :knocked-yellow-vy-lo 40960.0 - :knocked-yellow-vy-hi 53248.0 - :knocked-red-vxz-lo 102400.0 - :knocked-red-vxz-hi 102400.0 - :knocked-red-vy-lo 81920.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 + :knocked-soft-vxz-lo (meters 20) + :knocked-soft-vxz-hi (meters 20) + :knocked-soft-vy-lo (meters 17) + :knocked-soft-vy-hi (meters 17) + :knocked-medium-vxz-lo (meters 20) + :knocked-medium-vxz-hi (meters 20) + :knocked-medium-vy-lo (meters 17) + :knocked-medium-vy-hi (meters 17) + :knocked-hard-vxz-lo (meters 20) + :knocked-hard-vxz-hi (meters 20) + :knocked-hard-vy-lo (meters 17) + :knocked-hard-vy-hi (meters 17) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 13) + :knocked-yellow-vy-lo (meters 10) + :knocked-yellow-vy-hi (meters 13) + :knocked-red-vxz-lo (meters 25) + :knocked-red-vxz-hi (meters 25) + :knocked-red-vy-lo (meters 20) + :knocked-red-vy-hi (meters 20) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 8) + :knocked-blue-vy-hi (meters 12) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -387,10 +387,11 @@ ) (defmethod enemy-common-post ((this metalhead-predator)) + "Common implementation of post. Runs ja-post." (when (< 1 (the-as int (-> this focus aware))) (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans s5-0 5) quad)) + (vector-copy! (-> this focus-pos) (get-trans s5-0 5)) (los-control-method-9 (-> this los) s5-0 (-> this focus-pos) 819.2 4096.0) ) ) @@ -404,6 +405,7 @@ ;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (set! (-> this shock-effect-end) (+ (current-time) (seconds 1))) @@ -421,6 +423,7 @@ ) (defmethod knocked-anim ((this metalhead-predator) (arg0 enemy-knocked-info)) + "start the knocked animation." (cond ((= (-> this hit-points) 0.0) (case (-> this incoming knocked-type) @@ -513,6 +516,7 @@ ) (defmethod knocked-land-anim ((this metalhead-predator) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this hit-points) 0.0) (case (-> this incoming knocked-type) @@ -596,7 +600,7 @@ (let ((f0-0 1228.8) (f30-0 6144.0) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-! (-> s5-0 move-dist) arg1 arg0) (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) @@ -629,7 +633,7 @@ ) ) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (let ((v1-14 s5-0)) (set! (-> v1-14 radius) f30-0) (set! (-> v1-14 collide-with) (collide-spec enemy hit-by-player-list hit-by-others-list)) @@ -700,7 +704,7 @@ ) (when s3-0 (seek! (-> this miss-amount) (* 0.2 (vector-length (-> s3-0 root transv))) 4096.0) - (set! (-> s2-0 quad) (-> (get-trans s3-0 3) quad)) + (vector-copy! s2-0 (get-trans s3-0 3)) (set! sv-272 (new 'stack-no-clear 'vector)) (let ((v1-28 (-> s5-0 pos)) (a0-19 s2-0) @@ -953,7 +957,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-9 *game-info*) (a0-5 (+ (-> v1-9 attack-id) 1)) ) @@ -974,7 +978,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1022,6 +1026,7 @@ ) (defmethod init-enemy-collision! ((this metalhead-predator)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1105,12 +1110,13 @@ ) (defmethod init-enemy! ((this metalhead-predator)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalhead-predator" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *metalhead-predator-nav-enemy-info*) + (setup-enemy! this *metalhead-predator-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) diff --git a/goal_src/jak3/levels/city/traffic/traffic-engine.gc b/goal_src/jak3/levels/city/traffic/traffic-engine.gc index aaa69f88b7e..92419eddebc 100644 --- a/goal_src/jak3/levels/city/traffic/traffic-engine.gc +++ b/goal_src/jak3/levels/city/traffic/traffic-engine.gc @@ -986,7 +986,7 @@ (set! (-> v1-1 0 sphere quad) (-> s5-0 control trans quad)) (set! (-> v1-1 0 sphere r) f0-1) ) - (set! (-> v1-1 0 velocity quad) (-> s5-0 control transv quad)) + (vector-copy! (-> v1-1 0 velocity) (-> s5-0 control transv)) (let ((f0-3 (- (-> v1-1 0 danger-level) (* (-> v1-1 0 decay-rate) (seconds-per-frame))))) (set! (-> v1-1 0 danger-level) (fmax 0.0 f0-3)) ) @@ -995,7 +995,7 @@ (f30-0 0.0) (s4-0 (new 'stack-no-clear 'inline-array 'traffic-suppression-box 2)) ) - (set! (-> s4-0 0 bbox max quad) (-> s5-0 control transv quad)) + (vector-copy! (-> s4-0 0 bbox max) (-> s5-0 control transv)) (vector-z-quaternion! (the-as vector (-> s4-0 1)) (get-quat s5-0 3)) (set! (-> s4-0 1 data 16) (the-as uint 3)) (cond @@ -1068,7 +1068,7 @@ (set! (-> s2-1 sphere quad) (-> s5-0 control trans quad)) (set! (-> s2-1 danger-type) (-> s4-0 1 data 16)) (set! (-> s2-1 sphere r) f30-0) - (set! (-> s2-1 velocity quad) (-> s4-0 0 bbox min quad)) + (vector-copy! (-> s2-1 velocity) (-> s4-0 0 bbox min)) (let ((gp-1 (fill-actor-list-for-sphere (-> this object-hash) (-> s2-1 sphere) @@ -1111,7 +1111,7 @@ (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 40)) (a1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> s4-0 sphere quad)) + (vector-copy! a1-0 (-> s4-0 sphere)) (set! (-> a1-0 w) (-> s4-0 notify-radius)) (let ((s2-0 (fill-actor-list-for-box (-> this object-hash) a1-0 s3-0 40))) (dotimes (s1-0 s2-0) @@ -1228,14 +1228,14 @@ (when (nonzero? (-> a2-0 pilot)) (let ((a2-1 (handle->process (-> a2-0 pilot vehicle)))) (when a2-1 - (set! (-> s5-0 quad) (-> (the-as process-focusable a2-1) root root-prim prim-core world-sphere quad)) + (vector-copy! s5-0 (-> (the-as process-focusable a2-1) root root-prim prim-core world-sphere)) (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) a2-1)) ) ) ) ) (else - (set! (-> s5-0 quad) (-> a2-0 control trans quad)) + (vector-copy! s5-0 (-> a2-0 control trans)) (set! (-> s5-0 w) 20480.0) (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) a2-0)) ) @@ -1252,7 +1252,7 @@ ) ((begin (let ((v1-32 (-> (the-as process-focusable s3-0) root))) - (set! (-> s5-0 quad) (-> v1-32 trans quad)) + (vector-copy! s5-0 (-> v1-32 trans)) (set! (-> s5-0 w) (-> v1-32 root-prim prim-core world-sphere w)) ) (sphere-in-loaded-city-infos? this s5-0 0) @@ -1282,7 +1282,7 @@ ) (else (let ((v1-53 (-> (the-as process-focusable s3-1) root))) - (set! (-> s5-0 quad) (-> v1-53 trans quad)) + (vector-copy! s5-0 (-> v1-53 trans)) (set! (-> s5-0 w) (-> v1-53 root-prim prim-core world-sphere w)) ) (when (logtest? (-> (the-as citizen s3-1) flags) (citizen-flag in-formation)) @@ -1450,7 +1450,7 @@ (defmethod find-best-segment ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) (let ((gp-0 (new 'stack-no-clear 'traffic-find-segment-struct))) - (set! (-> gp-0 dir quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 dir) arg1) (set! (-> gp-0 best-rating) -10000000000000000000000000000000000000.0) (set! (-> gp-0 best-seg) #f) (callback-on-nav-segments-in-sphere @@ -1680,7 +1680,7 @@ (while (>= (the-as uint s2-0) (the-as uint s3-0)) (let ((s1-0 (-> this object-type-info-array s3-0))) (if (and (logtest? (-> s1-0 flags) (traffic-type-flag ttf3)) - (= (status-of-level-and-borrows *level* (-> s1-0 level) 'ignore-borrow) 'active) + (= (level-status? *level* (-> s1-0 level) 'ignore-borrow) 'active) ) (+! s4-0 (-> s1-0 parking-spot-prob)) ) @@ -1695,7 +1695,7 @@ (while (>= (the-as uint s2-1) (the-as uint s3-1)) (let ((s1-1 (-> this object-type-info-array s3-1))) (when (and (logtest? (-> s1-1 flags) (traffic-type-flag ttf3)) - (= (status-of-level-and-borrows *level* (-> s1-1 level) #f) 'active) + (= (level-status? *level* (-> s1-1 level) #f) 'active) ) (+! s5-0 (-> s1-1 parking-spot-prob)) (if (< s4-1 s5-0) diff --git a/goal_src/jak3/levels/city/traffic/traffic-manager.gc b/goal_src/jak3/levels/city/traffic/traffic-manager.gc index 29a0eaef9c3..6c0dd6e66fd 100644 --- a/goal_src/jak3/levels/city/traffic/traffic-manager.gc +++ b/goal_src/jak3/levels/city/traffic/traffic-manager.gc @@ -84,7 +84,7 @@ (defmethod traffic-manager-method-16 ((this traffic-manager)) (traffic-manager-method-22 this) - (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (= (level-status? *level* 'ctywide #f) 'active) (set-setting! 'gem-pool-index #f 0.0 1) ) (update-traffic (-> this traffic-engine)) @@ -166,7 +166,7 @@ (dotimes (s5-0 29) (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) (logclear! (-> s4-0 flags) (traffic-type-flag ttf3)) - (if (= (status-of-level-and-borrows *level* (-> s4-0 level) #f) 'active) + (if (= (level-status? *level* (-> s4-0 level) #f) 'active) (logior! (-> s4-0 flags) (traffic-type-flag ttf3)) ) ) @@ -417,7 +417,7 @@ ) (defmethod traffic-manager-method-21 ((this traffic-manager)) - (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (= (level-status? *level* 'ctywide #f) 'active) (set-setting! 'gem-pool-index #f 0.0 1) ) (let ((s5-1 (new 'stack-no-clear 'array 'int8 29))) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/bike.gc b/goal_src/jak3/levels/city/traffic/vehicle/bike.gc index 48653e45b8b..ed4c850b3c8 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/bike.gc @@ -1497,18 +1497,7 @@ (not (logtest? (-> this v-flags) (vehicle-flag dead))) ) (let ((s5-0 (new 'stack-no-clear 'bike-stack-var0))) - (let* ((v1-6 (-> s5-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-7 (-> a3-0 rvec quad)) - (a1-1 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-6 rvec quad) a0-7) - (set! (-> v1-6 uvec quad) a1-1) - (set! (-> v1-6 fvec quad) a2-0) - (set! (-> v1-6 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat) (-> this node-list data 0 bone transform)) (set-vector! (-> s5-0 vec4) 0.0 -1.0 0.0 1.0) (vector-rotate*! (-> s5-0 vec4) (-> s5-0 vec4) (-> s5-0 mat)) (let ((s4-0 (new 'static 'inline-array vector 2 @@ -1526,8 +1515,8 @@ (when (< 0.0 (-> this roll-thrust s2-0)) (vector-rotate*! (-> s5-0 vec4) (-> s3-0 s2-0) (-> s5-0 mat)) (vector-matrix*! (-> s5-0 vec3) (-> s4-0 s2-0) (-> s5-0 mat)) - (set! (-> s5-0 vec5 quad) (-> this rbody matrix uvec quad)) - (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (vector-copy! (-> s5-0 vec5) (-> this rbody matrix uvec)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 vec3)) (set! (-> s5-0 vec2 y) 1638.4) (set! (-> s5-0 vec2 z) 12288.0) (let ((f0-9 (* (-> this roll-thrust s2-0) (-> this force-scale) (-> this info info inv-mass))) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-control.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-control.gc index 8761f580beb..abcc9f0c695 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-control.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-control.gc @@ -107,7 +107,7 @@ (set! (-> this max-turn-speed) (sqrtf (* (fmax 16384.0 arg1) (-> this turn-accel)))) (let ((v1-1 (new 'stack-no-clear 'inline-array 'vector 2))) (vector-! (-> v1-1 1) (-> this turn-exit-point) arg0) - (set! (-> v1-1 0 quad) (-> this turn-exit-dir quad)) + (vector-copy! (-> v1-1 0) (-> this turn-exit-dir)) (set! (-> v1-1 0 x) (-> this turn-exit-dir z)) (set! (-> v1-1 0 z) (- (-> this turn-exit-dir x))) (logior! (-> this flags) (vehicle-controller-flag left-turn)) @@ -134,7 +134,7 @@ (set! (-> this dest-circle w) arg1) 0 (vehicle-controller-method-16 this (-> this path-prev-point) (-> this turn-enter-point)) - (set! (-> this target-point quad) (-> this turn-enter-point quad)) + (vector-copy! (-> this target-point) (-> this turn-enter-point)) (vector-! (-> this turn-enter-dir) (-> this turn-enter-point) (-> this path-prev-point)) (set! (-> this turn-enter-dir y) 0.0) (vector-normalize! (-> this turn-enter-dir) 1.0) @@ -154,11 +154,11 @@ ) (defmethod vehicle-controller-method-19 ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) - (set! (-> this path-prev-point quad) (-> arg0 quad)) + (vector-copy! (-> this path-prev-point) arg0) (vector-vector-distance arg0 arg2) (set! (-> this target-speed) (vector-length arg3)) - (set! (-> this turn-exit-point quad) (-> arg2 quad)) - (set! (-> this turn-exit-dir quad) (-> arg3 quad)) + (vector-copy! (-> this turn-exit-point) arg2) + (vector-copy! (-> this turn-exit-dir) arg3) (set! (-> this turn-exit-dir y) 0.0) (vector-normalize! (-> this turn-exit-dir) 1.0) (vehicle-controller-method-20 this arg0 (the-as float arg1)) @@ -169,7 +169,7 @@ (defmethod vehicle-controller-method-13 ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) (vehicle-controller-method-10 this arg0) - (set! (-> this path-prev-point quad) (-> arg1 quad)) + (vector-copy! (-> this path-prev-point) arg1) (set! (-> this branch) arg0) (let ((v1-3 arg0)) (set! (-> this target-speed) (* 1024.0 (the float (-> v1-3 speed-limit)))) @@ -178,7 +178,7 @@ (let ((a1-2 s4-1) (v1-6 (-> this turn-exit-point)) ) - (set! (-> v1-6 quad) (-> a1-2 position quad)) + (vector-copy! v1-6 (-> a1-2 position)) (set! (-> v1-6 w) 1.0) ) (let ((v1-7 s4-1) @@ -247,7 +247,7 @@ ) (when gp-0 (vehicle-controller-method-11 this) - (set! (-> s4-0 quad) (-> this turn-exit-point quad)) + (vector-copy! s4-0 (-> this turn-exit-point)) (vehicle-controller-method-13 this gp-0 s4-0) ) gp-0 @@ -284,7 +284,7 @@ (f0-15 (/ (* f28-0 f1-6) f30-0)) ) (let ((f1-9 (/ (* f1-6 f1-6) f30-0))) - (set! (-> arg1 quad) (-> arg0 quad)) + (vector-copy! arg1 arg0) (let ((a1-5 arg1)) (let ((v1-12 arg1)) (let ((a0-5 (-> s4-0 0))) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc index 9c0461e28e4..c783deca3ad 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-effects.gc @@ -141,18 +141,7 @@ ) ) (let ((s5-0 (new 'stack-no-clear 'vehicle-stack-type3))) - (let* ((v1-38 (-> s5-0 mat0)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-14 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-38 rvec quad) a0-14) - (set! (-> v1-38 uvec quad) a1-3) - (set! (-> v1-38 fvec quad) a2-1) - (set! (-> v1-38 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat0) (-> this node-list data 0 bone transform)) (set-vector! (-> s5-0 vec1) 0.0 0.0 -1.0 1.0) (vector-rotate*! (-> s5-0 vec1) (-> s5-0 vec1) (-> s5-0 mat0)) (set! (-> this fog-fade) (calc-fade-from-fog (-> this root trans))) @@ -169,7 +158,7 @@ (a1-8 (-> s5-0 vec0)) (f0-15 (-> v1-46 position w)) ) - (set! (-> v1-46 position quad) (-> a1-8 quad)) + (vector-copy! (-> v1-46 position) a1-8) (set! (-> v1-46 position w) f0-15) ) 0 @@ -205,7 +194,7 @@ (a1-20 (-> s5-0 vec0)) (f0-29 (-> v1-70 position w)) ) - (set! (-> v1-70 position quad) (-> a1-20 quad)) + (vector-copy! (-> v1-70 position) a1-20) (set! (-> v1-70 position w) f0-29) ) 0 @@ -247,7 +236,7 @@ (a1-33 s4-2) (a2-9 *launch-matrix*) ) - (set! (-> a2-9 trans quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> a2-9 trans) (-> s5-0 vec0)) (t9-23 a0-41 a1-33 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (set! (-> this exhaust-part-accum s3-0) (the-as sparticle-launch-control (-> s4-2 birthaccum))) @@ -300,7 +289,7 @@ (a1-43 sv-228) (a2-12 *launch-matrix*) ) - (set! (-> a2-12 trans quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> a2-12 trans) (-> s5-0 vec0)) (t9-35 a0-51 a1-43 a2-12 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (+! (-> s5-0 byte0) 1) @@ -311,7 +300,7 @@ (a1-44 sv-224) (a2-13 *launch-matrix*) ) - (set! (-> a2-13 trans quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> a2-13 trans) (-> s5-0 vec0)) (t9-36 a0-52 a1-44 a2-13 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (set! (-> this smoke-part-accum s4-3) (the-as sparticle-launch-control (-> sv-224 birthaccum))) @@ -327,7 +316,7 @@ (a0-55 (-> this info particle-common sp-system2d)) (a2-15 *launch-matrix*) ) - (set! (-> a2-15 trans quad) (-> this impact-pos quad)) + (vector-copy! (-> a2-15 trans) (-> this impact-pos)) (t9-38 a0-55 a1-46 a2-15 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -347,11 +336,11 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vehicle-thruster-work))) - (set! (-> s5-0 vec2 quad) (-> arg1 trans quad)) + (vector-copy! (-> s5-0 vec2) (-> arg1 trans)) (quaternion-copy! (-> s5-0 quat1) (-> arg1 quat)) (quaternion-rotate-local-x! (-> s5-0 quat1) (-> s5-0 quat1) 32768.0) (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) - (set! (-> s5-0 vec4 quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec4) (-> s5-0 vec0)) (let ((f0-0 (rand-vu-float-range 1.0 1.33))) (set! (-> s5-0 float0) (* f0-0 (-> arg1 length) (-> arg1 thrust))) (set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (/ (-> s5-0 float0) 2))) @@ -376,7 +365,7 @@ (a1-7 (-> s5-0 vec3)) (f0-5 (-> v1-5 position w)) ) - (set! (-> v1-5 position quad) (-> a1-7 quad)) + (vector-copy! (-> v1-5 position) a1-7) (set! (-> v1-5 position w) f0-5) ) 0 @@ -405,7 +394,7 @@ ) (set! (-> arg0 part-thruster-x initial-valuef) (-> s5-0 float1)) (set! (-> arg0 part-spec2 initial-valuef) (-> s5-0 float0)) - (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 vec3)) (launch-particles :system (-> arg0 sp-system3d) (-> arg0 part-thruster) @@ -414,7 +403,7 @@ ) (quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667) (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) - (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 vec3)) (launch-particles :system (-> arg0 sp-system3d) (-> arg0 part-thruster) @@ -423,7 +412,7 @@ ) (quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667) (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) - (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 vec3)) (launch-particles :system (-> arg0 sp-system3d) (-> arg0 part-thruster) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc index 230a81dddf6..c49f5bceb43 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-physics.gc @@ -11,7 +11,7 @@ (let ((f0-1 (- (-> arg0 y) (-> arg0 w)))) (when (< f0-1 (-> this water-height)) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 rvec) arg0) (let ((s3-0 (-> this info)) (f1-3 (fmin (-> this water-height) (+ (-> arg0 y) (-> arg0 w)))) ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-rider.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-rider.gc index 15786c6ac94..c4cb70edf9b 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-rider.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-rider.gc @@ -156,7 +156,7 @@ (squad-control-method-18 (-> self squad) 2 *target*) (set! (-> gp-0 object-type) (traffic-type guard-a)) ) - (set! (-> gp-0 position quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 position) (-> self root trans)) (quaternion-copy! (-> gp-0 rotation) (-> self root quat)) (send-event *traffic-manager* 'activate-object gp-0) ) @@ -239,13 +239,14 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this vehicle-rider) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) (defbehavior vehicle-rider-init-by-other vehicle-rider ((arg0 traffic-object-spawn-params)) (set! (-> self squad) *ff-squad-control*) (initialize-collision self) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 rotation)) (logior! (-> self focus-status) (focus-status pilot-riding)) (setup-lods self) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc index a48a82df79a..f94843fe5ca 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-util.gc @@ -140,6 +140,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this vehicle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -195,21 +196,10 @@ (if (logtest? (vehicle-flag ai-driving) (-> this v-flags)) (set! (-> s5-0 floats 4) (* 1.5 (-> s5-0 floats 4))) ) - (set! (-> s5-0 mat 0 uvec quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s5-0 mat 0 uvec) (target-pos 0)) (+! (-> s5-0 mat 0 uvec y) 8192.0) - (let* ((v1-14 (-> s5-0 mat 1)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-5 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-14 rvec quad) a0-5) - (set! (-> v1-14 uvec quad) a1-0) - (set! (-> v1-14 fvec quad) a2-0) - (set! (-> v1-14 trans quad) a3-1) - ) - (set! (-> s5-0 mat 0 fvec quad) (-> s5-0 mat 1 trans quad)) + (matrix-copy! (-> s5-0 mat 1) (-> this node-list data 0 bone transform)) + (vector-copy! (-> s5-0 mat 0 fvec) (-> s5-0 mat 1 trans)) (set! (-> s5-0 floats 2) (- (-> s5-0 mat 0 uvec y) (-> s5-0 mat 0 fvec y))) (let ((f0-9 (vector-vector-xz-distance-squared (-> s5-0 mat 0 uvec) (-> s5-0 mat 0 fvec))) (f1-7 (-> s5-0 floats 4)) @@ -233,7 +223,7 @@ (f1-12 81920.0) ) (when (< f0-14 (* f1-12 f1-12)) - (set! (-> s5-0 cquery start-pos quad) (-> s5-0 mat 0 uvec quad)) + (vector-copy! (-> s5-0 cquery start-pos) (-> s5-0 mat 0 uvec)) (vector-! (-> s5-0 cquery move-dist) (-> s5-0 mat 0 fvec) (-> s5-0 mat 0 uvec)) (let ((v1-38 (-> s5-0 cquery))) (set! (-> v1-38 radius) 4096.0) @@ -420,7 +410,7 @@ (defmethod vehicle-method-66 ((this vehicle) (arg0 vector) (arg1 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> this info rider seat-array arg1 position quad)) + (vector-copy! v1-0 (-> this info rider seat-array arg1 position)) (set! (-> v1-0 w) 1.0) (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) ) @@ -532,7 +522,7 @@ ) (defmethod get-linear-accel! ((this vehicle) (arg0 vector)) - (set! (-> arg0 quad) (-> this lin-acceleration quad)) + (vector-copy! arg0 (-> this lin-acceleration)) 0 (none) ) @@ -759,9 +749,9 @@ (vector-normalize! (-> s4-1 0 trans) 1.0) (vector-cross! (-> s4-1 1 fvec) (-> s4-1 0 trans) (-> s4-1 0 uvec)) (set! (-> s4-1 1 rvec quad) (-> s4-1 0 trans quad)) - (set! (-> s4-1 1 uvec quad) (-> s4-1 0 uvec quad)) - (set! (-> s4-1 1 fvec quad) (-> s4-1 0 fvec quad)) - (set! (-> s4-1 1 trans quad) (-> s4-1 0 rvec quad)) + (vector-copy! (-> s4-1 1 uvec) (-> s4-1 0 uvec)) + (vector-copy! (-> s4-1 1 fvec) (-> s4-1 0 fvec)) + (vector-copy! (-> s4-1 1 trans) (-> s4-1 0 rvec)) (if (logtest? (-> *part-group-id-table* 225 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1008,7 +998,7 @@ (when (not (logtest? (-> s5-0 flags) (rigid-body-flag enable-physics))) (logior! (-> s5-0 flags) (rigid-body-flag enable-physics)) (rigid-body-control-method-28 s5-0 (-> this root trans) (-> this root quat)) - (set! (-> s5-0 lin-velocity quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 lin-velocity) (-> this root transv)) (vector-float*! (-> s5-0 lin-momentum) (-> s5-0 lin-velocity) (-> this info info mass)) (vector-reset! (-> s5-0 ang-momentum)) (vector-reset! (-> this lin-acceleration)) @@ -1194,7 +1184,7 @@ (let ((s4-0 (handle->process (-> this rider-array s5-0)))) (when (and s4-0 (focus-test? (the-as process-focusable s4-0) pilot-riding)) (vehicle-method-66 this (-> (the-as process-focusable s4-0) root trans) s5-0) - (set! (-> (the-as process-focusable s4-0) root transv quad) (-> this root transv quad)) + (vector-copy! (-> (the-as process-focusable s4-0) root transv) (-> this root transv)) (let ((f0-1 (the float (-> this info rider seat-array s5-0 angle)))) (quaternion-rotate-local-y! (-> (the-as process-focusable s4-0) root quat) (-> this root quat) f0-1) ) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc index 25953369bef..072313fefa4 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc @@ -47,7 +47,7 @@ ) (init-vf0-vector) (logior! (-> this v-flags) (vehicle-flag impact)) - (set! (-> this impact-pos quad) (-> arg0 point quad)) + (vector-copy! (-> this impact-pos) (-> arg0 point)) (let ((s4-0 (new 'stack-no-clear 'matrix))) (matrix-inverse-of-rot-trans! (the-as matrix (-> s4-0 rvec)) (-> this rbody matrix)) (vector-matrix*! (-> this impact-local-pos) (-> this impact-pos) (the-as matrix (-> s4-0 rvec))) @@ -375,10 +375,10 @@ ) ) (when *target* - (set! (-> s5-0 vec0 quad) (-> *target* draw shadow-ctrl settings shadow-dir quad)) + (vector-copy! (-> s5-0 vec0) (-> *target* draw shadow-ctrl settings shadow-dir)) (let ((v1-75 (-> this draw shadow-ctrl settings shadow-dir))) (set! (-> s5-0 vec0 w) (-> v1-75 w)) - (set! (-> v1-75 quad) (-> s5-0 vec0 quad)) + (vector-copy! v1-75 (-> s5-0 vec0)) ) ) (let ((s4-0 (new 'stack-no-clear 'inline-array 'collide-query 2))) @@ -477,7 +477,7 @@ ) (set! (-> v1-96 action-mask) (collide-action solid)) ) - (set! (-> s4-0 0 start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> s4-0 0 start-pos) (-> this rbody position)) (vector-! (-> s4-0 0 move-dist) (the-as vector (-> s4-0 1 bbox)) (-> s4-0 0 start-pos)) (let ((f0-23 (fill-and-probe-using-line-sphere *collide-cache* (-> s4-0 0)))) (if (>= f0-23 0.0) @@ -485,11 +485,11 @@ ) ) ) - (set! (-> s3-0 0 saved-pt quad) (-> s4-0 1 bbox min quad)) + (vector-copy! (-> s3-0 0 saved-pt) (-> s4-0 1 bbox min)) (let ((v1-107 (-> s3-0 0 tracking))) (set! (-> v1-107 inv-mat rvec quad) (-> s4-0 1 best-other-tri vertex 0 quad)) - (set! (-> v1-107 inv-mat uvec quad) (-> s4-0 1 best-other-tri vertex 1 quad)) - (set! (-> v1-107 inv-mat fvec quad) (-> s4-0 1 best-other-tri vertex 2 quad)) + (vector-copy! (-> v1-107 inv-mat uvec) (-> s4-0 1 best-other-tri vertex 1)) + (vector-copy! (-> v1-107 inv-mat fvec) (-> s4-0 1 best-other-tri vertex 2)) ) ) ) @@ -519,18 +519,7 @@ (set! (-> a0-72 rvec z) -1.0) (set! (-> a0-72 rvec w) 1.0) ) - (let* ((a0-73 (-> v1-132 0)) - (t0-10 (-> this rbody matrix)) - (a1-37 (-> t0-10 rvec quad)) - (a2-24 (-> t0-10 uvec quad)) - (a3-12 (-> t0-10 fvec quad)) - (t0-11 (-> t0-10 trans quad)) - ) - (set! (-> a0-73 rvec quad) a1-37) - (set! (-> a0-73 uvec quad) a2-24) - (set! (-> a0-73 fvec quad) a3-12) - (set! (-> a0-73 trans quad) t0-11) - ) + (matrix-copy! (-> v1-132 0) (-> this rbody matrix)) (vector-rotate*! s5-1 (the-as vector (-> v1-132 1)) (-> v1-132 0)) ) (persist-with-delay @@ -609,7 +598,7 @@ (set! (-> s5-0 mat trans w) (-> s5-0 mat fvec x)) ) (set! (-> this water-height) (-> s5-0 mat trans w)) - (set! (-> s5-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 cquery start-pos) (-> this rbody position)) (vector-float*! (-> s5-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) (let ((v1-15 (-> s5-0 cquery))) (set! (-> v1-15 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) @@ -672,26 +661,15 @@ (defmethod clear-impulse-force-flag! ((this vehicle)) (with-pp (let ((v1-0 (new 'stack-no-clear 'matrix))) - (set! (-> v1-0 rvec quad) (-> this root transv quad)) + (vector-copy! (-> v1-0 rvec) (-> this root transv)) (vector-! (-> v1-0 uvec) (-> this rbody lin-velocity) (-> v1-0 rvec)) (vector-float*! (-> this lin-acceleration) (-> v1-0 uvec) (-> pp clock frames-per-second)) ) - (set! (-> this root transv quad) (-> this rbody lin-velocity quad)) + (vector-copy! (-> this root transv) (-> this rbody lin-velocity)) (quaternion-copy! (-> this root quat) (the-as quaternion (-> this rbody rot))) (rigid-body-control-method-25 (-> this rbody) (-> this root trans)) - (let* ((v1-11 (-> this node-list data 0 bone transform)) - (a3-0 (-> this rbody matrix)) - (a0-12 (-> a3-0 rvec quad)) - (a1-8 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-11 rvec quad) a0-12) - (set! (-> v1-11 uvec quad) a1-8) - (set! (-> v1-11 fvec quad) a2-1) - (set! (-> v1-11 trans quad) a3-1) - ) - (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (matrix-copy! (-> this node-list data 0 bone transform) (-> this rbody matrix)) + (vector-copy! (-> this node-list data 0 bone transform trans) (-> this root trans)) (vehicle-method-77 this) (rigid-body-object-method-30 this) (update-transforms (-> this root)) @@ -1070,7 +1048,7 @@ (init-rbody-impact-from-tshape! this (-> s5-0 0) arg2) (cond ((logtest? (attack-mask attacker-velocity) (-> arg1 mask)) - (set! (-> s5-0 0 velocity quad) (-> arg1 attacker-velocity quad)) + (vector-copy! (-> s5-0 0 velocity) (-> arg1 attacker-velocity)) ) (else (let ((s0-0 arg0)) @@ -1153,7 +1131,7 @@ (when (not (logtest? (vehicle-flag ignore-impulse) (-> this v-flags))) (impulse-handler this) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s5-0 0 velocity quad)) + (vector-copy! s3-1 (-> s5-0 0 velocity)) (vector-normalize! s3-1 1.0) (vector-float*! s3-1 s3-1 (-> s5-0 0 impulse)) (apply-impact! (-> this rbody) (the-as vector (-> s5-0 0)) s3-1) diff --git a/goal_src/jak3/levels/city/vinroom/power-game.gc b/goal_src/jak3/levels/city/vinroom/power-game.gc index 24d1fd38c21..5c21282d129 100644 --- a/goal_src/jak3/levels/city/vinroom/power-game.gc +++ b/goal_src/jak3/levels/city/vinroom/power-game.gc @@ -805,7 +805,7 @@ (new 'static 'talker-speech-class :name "dax766" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -814,7 +814,7 @@ (new 'static 'talker-speech-class :name "dax767" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :neg #x1 :on-close #f @@ -1192,6 +1192,7 @@ ) (defmethod init-from-entity! ((this power-game) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1300,7 +1301,7 @@ ) (defmethod get-center-pos! ((this power-game) (arg0 vector) (arg1 float) (arg2 float)) - (set! (-> arg0 quad) (-> this corner 0 quad)) + (vector-copy! arg0 (-> this corner 0)) (+! (-> arg0 x) (* 16384.0 arg1)) (+! (-> arg0 z) (* 16384.0 arg2)) arg0 @@ -1426,19 +1427,19 @@ (cond ((zero? v1-0) (set! v0-0 arg0) - (set! (-> v0-0 quad) (-> (new 'static 'vector :z -1.0 :w 1.0) quad)) + (vector-copy! v0-0 (new 'static 'vector :z -1.0 :w 1.0)) ) ((= v1-0 1) (set! v0-0 arg0) - (set! (-> v0-0 quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + (vector-copy! v0-0 (new 'static 'vector :x 1.0 :w 1.0)) ) ((= v1-0 2) (set! v0-0 arg0) - (set! (-> v0-0 quad) (-> (new 'static 'vector :z 1.0 :w 1.0) quad)) + (vector-copy! v0-0 (new 'static 'vector :z 1.0 :w 1.0)) ) (else (set! v0-0 arg0) - (set! (-> v0-0 quad) (-> (new 'static 'vector :x -1.0 :w 1.0) quad)) + (vector-copy! v0-0 (new 'static 'vector :x -1.0 :w 1.0)) ) ) ) @@ -1464,7 +1465,7 @@ (defmethod power-game-method-42 ((this power-game) (arg0 vector) (arg1 int) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-copy! v1-0 arg0) (let ((f0-0 0.0) (f1-0 16.0) (f2-0 (-> v1-0 x)) @@ -1492,18 +1493,7 @@ (set! (-> s3-0 y) 0.0) (set! (-> s3-0 z) (cos (-> *cpad-list* cpads 0 stick0-dir))) (set! (-> s3-0 w) 0.0) - (let* ((s1-0 s2-0) - (a2-0 (matrix-local->world #t #f)) - (v1-4 (-> a2-0 rvec quad)) - (a0-4 (-> a2-0 uvec quad)) - (a1-2 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s1-0 rvec quad) v1-4) - (set! (-> s1-0 uvec quad) a0-4) - (set! (-> s1-0 fvec quad) a1-2) - (set! (-> s1-0 trans quad) a2-1) - ) + (matrix-copy! s2-0 (matrix-local->world #t #f)) (vector-matrix*! s3-0 s3-0 s2-0) (warp-vector-into-surface! gp-0 s3-0 *up-vector* s2-0) ) @@ -1628,7 +1618,7 @@ (s1-3 s0-6 (the-as bucket-id sv-128) sv-144 a3-6 (the-as rgba t0-1) t1-0 (the-as rgba t2-0)) ) ) - (set! (-> s2-0 quad) (-> s3-0 quad)) + (vector-copy! s2-0 s3-0) (+! arg3 -1) ) ) @@ -1668,7 +1658,7 @@ (power-game-method-35 this (-> s5-0 x) (-> s5-0 z) s4-1) (cond ((not (time-elapsed? (-> this game-start-time) (seconds 0.1))) - (set! (-> sv-56 cam-pos quad) (-> sv-52 quad)) + (vector-copy! (-> sv-56 cam-pos) sv-52) ) (else (if (< (fabs (-> sv-48 x)) 4.0) @@ -1822,7 +1812,7 @@ (s4-0 (-> this local)) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 quad) (-> this local quad)) + (vector-copy! s2-0 (-> this local)) (vector+float*! (-> this local) (-> this local) v1-13 (* (-> this speed) (seconds-per-frame))) (cond ((power-game-method-42 s5-0 s2-0 (-> this dir) (-> this dir)) @@ -1862,7 +1852,7 @@ (let ((f0-9 (-> s4-0 data s3-0))) (set! (-> s4-0 data s3-0) (the float (the int (+ 0.5 f0-9)))) ) - (set! (-> this turn-pos quad) (-> this local quad)) + (vector-copy! (-> this turn-pos) (-> this local)) (set! (-> this slide-lock) #f) ) ) @@ -1873,7 +1863,7 @@ (when (= (-> this local data s5-1) (-> this slide-dest data s5-1)) (set! (-> this slide-dir) -1) (when (>= (-> this slide-count) (-> this slide-dist)) - (set! (-> this turn-pos quad) (-> this local quad)) + (vector-copy! (-> this turn-pos) (-> this local)) (set! (-> this slide-count) 0) (set! (-> this slide-lock) #f) ) @@ -1979,7 +1969,7 @@ ((-> self slide-lock) ) ((power-game-method-40 gp-0 s5-0) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) 8.0) (when (power-game-method-42 gp-0 (-> self slide-dest) -1 s5-0) (power-game-method-39 gp-0 (-> self dir)) @@ -1996,7 +1986,7 @@ ) ) ((power-game-method-40 gp-0 s4-0) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) 8.0) (when (power-game-method-42 gp-0 (-> self slide-dest) -1 s4-0) (power-game-method-39 gp-0 (-> self dir)) @@ -2109,11 +2099,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 911 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 911)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 911)) ) ) @@ -2130,7 +2120,7 @@ (defbehavior power-game-player-init power-game-player ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-power-game-player" (the-as (pointer level) #f))) @@ -2206,7 +2196,7 @@ ((= s3-0 s2-0) ) ((or (and (> s0-0 0) (< s2-0 s3-0)) (and (< s0-0 0) (< s3-0 s2-0))) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s4-1 (-> self slide-dist)) (when (power-game-method-42 s5-1 (-> self slide-dest) -1 s1-0) @@ -2222,7 +2212,7 @@ ) ) ((or (and (> s0-0 0) (< s3-0 s2-0)) (and (< s0-0 0) (< s2-0 s3-0))) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s3-3 (-> self slide-dist)) (when (power-game-method-42 s5-1 (-> self slide-dest) -1 s4-0) @@ -2288,7 +2278,7 @@ (defbehavior power-game-chaser-init power-game-chaser ((arg0 vector) (arg1 entity-actor) (arg2 handle)) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-power-game-chaser" (the-as (pointer level) #f))) @@ -2421,7 +2411,7 @@ ) (cond ((rand-vu-percent? 0.01) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s4-1 (-> self slide-dist)) (when (power-game-method-42 gp-0 (-> self slide-dest) -1 s5-0) @@ -2438,7 +2428,7 @@ ) ) ((rand-vu-percent? 0.01) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s5-1 (-> self slide-dist)) (when (power-game-method-42 gp-0 (-> self slide-dest) -1 s4-0) @@ -2520,11 +2510,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 908 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 908)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 908)) ) ) @@ -2545,7 +2535,7 @@ (local-vars (v1-11 symbol)) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-power-game-switcher" (the-as (pointer level) #f))) @@ -2670,7 +2660,7 @@ ((= (-> self lane-target) s5-1) ) ((or (and (> s3-0 0) (< s5-1 (-> self lane-target))) (and (< s3-0 0) (< (-> self lane-target) s5-1))) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s3-1 (-> self slide-dist)) (when (power-game-method-42 s4-0 (-> self slide-dest) -1 s1-0) @@ -2687,7 +2677,7 @@ ) ) ((or (and (> s3-0 0) (< (-> self lane-target) s5-1)) (and (< s3-0 0) (< s5-1 (-> self lane-target)))) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s3-2 (-> self slide-dist)) (when (power-game-method-42 s4-0 (-> self slide-dest) -1 s2-0) @@ -2808,7 +2798,7 @@ (let ((f30-0 (you-suck-scale *game-info* #f 175))) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-power-game-zapper" (the-as (pointer level) #f))) @@ -2939,11 +2929,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 910 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 910)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 910)) ) ) @@ -2960,7 +2950,7 @@ (set! (-> self pickup-type) arg3) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (if (zero? arg3) (initialize-skeleton self @@ -2991,11 +2981,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 909 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 909)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 909)) ) ) @@ -3005,7 +2995,7 @@ (defstate hide (power-game) :virtual #t :trans (behavior () - (when (= (status-of-level-and-borrows *level* 'powergd #f) 'active) + (when (= (level-status? *level* 'powergd #f) 'active) (case (-> (get-current-task-event (-> self task)) action) (((game-task-action idle) (game-task-action talk)) (go-virtual idle) @@ -3552,7 +3542,7 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 diff --git a/goal_src/jak3/levels/comb/comb-field.gc b/goal_src/jak3/levels/comb/comb-field.gc index 501275403b4..d219c0d7179 100644 --- a/goal_src/jak3/levels/comb/comb-field.gc +++ b/goal_src/jak3/levels/comb/comb-field.gc @@ -299,7 +299,7 @@ (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) (set! (-> s1-0 scale y) (/ arg1 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) - (set! (-> s2-2 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-copy! (-> s2-2 uvec) (new 'static 'vector :y 1.0 :w 1.0)) (vector-cross! (-> s2-2 fvec) (-> s2-2 rvec) (-> s2-2 uvec)) (vector-normalize! (-> s2-2 fvec) 1.0) (matrix->quaternion (-> s1-0 quat) s2-2) @@ -323,6 +323,7 @@ ) (defmethod init-from-entity! ((this comb-field) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this breach) #f) (set! (-> this hum-sound-id) (new 'static 'sound-id)) (set! (-> this pass) (res-lump-value arg0 'pickup-type pickup-type :time -1000000000.0)) diff --git a/goal_src/jak3/levels/comb/comb-mood.gc b/goal_src/jak3/levels/comb/comb-mood.gc index b05d62b7387..7bfd5787def 100644 --- a/goal_src/jak3/levels/comb/comb-mood.gc +++ b/goal_src/jak3/levels/comb/comb-mood.gc @@ -243,16 +243,16 @@ ;; WARN: Return type mismatch vector vs none. (defun set-comb-field-color! ((arg0 vector)) (let ((v1-1 (-> *comb-field-texture-anim-array* array-data 0))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-1 data 0 start-color) arg0) + (vector-copy! (-> v1-1 data 0 end-color) arg0) + (vector-copy! (-> v1-1 data 1 start-color) arg0) + (vector-copy! (-> v1-1 data 1 end-color) arg0) ) (let ((v1-5 (-> *comb-field-texture-anim-array* array-data 1))) - (set! (-> v1-5 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 1 end-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 2 start-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 2 end-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-5 data 1 start-color) arg0) + (vector-copy! (-> v1-5 data 1 end-color) arg0) + (vector-copy! (-> v1-5 data 2 start-color) arg0) + (vector-copy! (-> v1-5 data 2 end-color) arg0) ) (none) ) @@ -260,8 +260,8 @@ ;; WARN: Return type mismatch vector vs none. (defun set-comb-field-flash! ((arg0 vector)) (let ((v1-1 (-> *comb-field-texture-anim-array* array-data 1))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-1 data 0 start-color) arg0) + (vector-copy! (-> v1-1 data 0 end-color) arg0) ) (none) ) diff --git a/goal_src/jak3/levels/comb/comb-obs.gc b/goal_src/jak3/levels/comb/comb-obs.gc index 9320e25dc68..1a7eff3aa58 100644 --- a/goal_src/jak3/levels/comb/comb-obs.gc +++ b/goal_src/jak3/levels/comb/comb-obs.gc @@ -139,6 +139,7 @@ ) (defmethod init-from-entity! ((this comb-pillar) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -250,7 +251,7 @@ ) (defmethod set-attack-vel! ((this comb-pillar) (arg0 vector)) - (set! (-> this attack-vel quad) (-> arg0 quad)) + (vector-copy! (-> this attack-vel) arg0) (if (< 81920.0 (vector-length (-> this attack-vel))) (vector-normalize! (-> this attack-vel) 81920.0) ) @@ -355,7 +356,8 @@ :unk 0 ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (cleanup-for-death self) ) :post #f @@ -447,6 +449,7 @@ ) (defmethod init-from-entity! ((this comb-block) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -549,7 +552,7 @@ ) (defmethod set-attack-vel! ((this comb-block) (arg0 vector)) - (set! (-> this attack-vel quad) (-> arg0 quad)) + (vector-copy! (-> this attack-vel) arg0) (if (< 81920.0 (vector-length (-> this attack-vel))) (vector-normalize! (-> this attack-vel) 81920.0) ) @@ -632,7 +635,7 @@ :code (behavior () (sound-play "sentry-explode") (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self node-list data 5 bone transform trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 40960.0) (set! (-> gp-1 scale) 1.0) @@ -672,7 +675,8 @@ :unk 0 ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (cleanup-for-death self) ) :post #f @@ -780,9 +784,9 @@ (set! (-> gp-0 spans data v1-6 inner-random-offset-size) 4096.0) ) (set! (-> gp-0 span-pts-start data 0 quad) (-> arg0 quad)) - (set! (-> gp-0 span-pts-start data 2 quad) (-> arg0 quad)) - (set! (-> gp-0 span-pts-start data 1 quad) (-> arg1 quad)) - (set! (-> gp-0 span-pts-start data 3 quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 span-pts-start data 2) arg0) + (vector-copy! (-> gp-0 span-pts-start data 1) arg1) + (vector-copy! (-> gp-0 span-pts-start data 3) arg1) (set! (-> gp-0 spans data 0 random-offset-size-start) 0.0) (set! (-> gp-0 spans data 1 random-offset-size-start) 0.0) (set! (-> gp-0 spans data 2 random-offset-size-start) 0.0) @@ -799,6 +803,7 @@ ) (defmethod init-from-entity! ((this comb-energy-ring) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (the-as penetrate -1)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -1054,8 +1059,8 @@ (quaternion-rotate-local-y! s4-0 (-> this root quat) 16384.0) (quaternion->matrix s5-0 s4-0) ) - (set! (-> s5-0 trans quad) (-> this root trans quad)) - (set! (-> this plane quad) (-> s5-0 rvec quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) + (vector-copy! (-> this plane) (-> s5-0 rvec)) ) (set! (-> this plane w) (- (vector-dot (-> this plane) (-> this root trans)))) (update-transforms (-> this root)) @@ -1067,6 +1072,7 @@ ) (defmethod init-from-entity! ((this comb-turbo) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (init-fields! this) @@ -1137,7 +1143,9 @@ (print-text self (text-id text-05f8)) (suspend) ) - (suspend-for (seconds 6) (print-text self (text-id light-jak-shield-how-to))) + (suspend-for (seconds 6) + (print-text self (text-id light-jak-shield-how-to)) + ) (send-event *target* 'end-mode 'lightjak) (go-virtual complete) ) diff --git a/goal_src/jak3/levels/comb/comb-sentry.gc b/goal_src/jak3/levels/comb/comb-sentry.gc index 65a98e122e6..926cf131119 100644 --- a/goal_src/jak3/levels/comb/comb-sentry.gc +++ b/goal_src/jak3/levels/comb/comb-sentry.gc @@ -38,7 +38,7 @@ (a1-4 (-> *part-id-table* 4241)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -88,7 +88,7 @@ (f28-1 (-> *part-id-table* 4239 init-specs 4 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 4239) s4-1 :origin-is-matrix #t) @@ -106,28 +106,28 @@ (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> s4-0 trans quad)) + (vector-copy! gp-0 (-> s4-0 trans)) (vector+! gp-0 gp-0 v1-1) (cond ((-> this hit-actor?) (sound-play "sentry-hit") (cond ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) ) ) ) ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) ) ) @@ -230,6 +230,7 @@ ) (defmethod init-from-entity! ((this comb-sentry) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -256,7 +257,7 @@ (the-as pair 0) ) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this up-dir quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-copy! (-> this up-dir) (new 'static 'vector :y 1.0 :w 1.0)) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) (if (nonzero? (-> this path)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) @@ -361,7 +362,7 @@ (a1-3 (-> gp-0 vec)) (f0-0 (-> v1-2 position w)) ) - (set! (-> v1-2 position quad) (-> a1-3 quad)) + (vector-copy! (-> v1-2 position) a1-3) (set! (-> v1-2 position w) f0-0) ) 0 @@ -374,7 +375,7 @@ (a1-10 (-> gp-0 vec)) (f0-5 (-> v1-10 position w)) ) - (set! (-> v1-10 position quad) (-> a1-10 quad)) + (vector-copy! (-> v1-10 position) a1-10) (set! (-> v1-10 position w) f0-5) ) 0 @@ -393,30 +394,19 @@ (sound-play "sentry-fire") (let ((s5-1 (new 'stack-no-clear 'comb-sentry-stack-var0))) (set! (-> s5-1 byte0) 0) - (let* ((v1-1 (-> s5-1 mat)) - (a3-1 (-> this node-list data 0 bone transform)) - (a0-5 (-> a3-1 rvec quad)) - (a1-1 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-1 rvec quad) a0-5) - (set! (-> v1-1 uvec quad) a1-1) - (set! (-> v1-1 fvec quad) a2-1) - (set! (-> v1-1 trans quad) a3-2) - ) + (matrix-copy! (-> s5-1 mat) (-> this node-list data 0 bone transform)) (let ((v1-2 (new 'static 'inline-array vector 1 (new 'static 'vector :z 14336.0 :w 1.0)))) (vector-matrix*! (-> s5-1 vec2) (-> v1-2 (-> s5-1 byte0)) (-> s5-1 mat)) ) 0 - (set! (-> s5-1 vec3 quad) (-> s5-1 mat fvec quad)) + (vector-copy! (-> s5-1 vec3) (-> s5-1 mat fvec)) (vector-float*! (-> s5-1 vec4) (-> s5-1 vec3) 2048000.0) (set! (-> s5-1 params ent) (-> this entity)) (set! (-> s5-1 params charge) 1.0) (set! (-> s5-1 params options) (projectile-options)) (logclear! (-> s5-1 params options) (projectile-options po14 po15 po16)) (set! (-> s5-1 params pos quad) (-> s5-1 vec2 quad)) - (set! (-> s5-1 params vel quad) (-> s5-1 vec4 quad)) + (vector-copy! (-> s5-1 params vel) (-> s5-1 vec4)) (set! (-> s5-1 params notify-handle) (the-as handle #f)) (set! (-> s5-1 params owner-handle) (the-as handle #f)) (set! (-> s5-1 params target-handle) (the-as handle #f)) @@ -474,10 +464,10 @@ (set! (-> this should-attack) #t) ) (let ((v1-23 (new 'stack-no-clear 'matrix))) - (set! (-> v1-23 rvec quad) (-> s5-0 root trans quad)) - (set! (-> v1-23 uvec quad) (-> s5-0 root transv quad)) + (vector-copy! (-> v1-23 rvec) (-> s5-0 root trans)) + (vector-copy! (-> v1-23 uvec) (-> s5-0 root transv)) (vector+float*! (-> this target-pos) (-> v1-23 rvec) (-> v1-23 uvec) 0.1) - (set! (-> v1-23 fvec quad) (-> s5-0 node-list data 0 bone transform fvec quad)) + (vector-copy! (-> v1-23 fvec) (-> s5-0 node-list data 0 bone transform fvec)) (vector-! (-> v1-23 trans) (-> this root trans) (-> v1-23 rvec)) (set! (-> this target-dist) (vector-dot (-> v1-23 fvec) (-> v1-23 trans))) (let* ((v1-24 (-> v1-23 trans)) @@ -512,11 +502,11 @@ (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 5))) (vector-! (-> s5-1 0) (-> this target-pos) (-> this root trans)) (vector-normalize! (-> s5-1 0) 1.0) - (set! (-> s5-1 1 quad) (-> this up-dir quad)) + (vector-copy! (-> s5-1 1) (-> this up-dir)) (set! (-> s5-1 4 x) (vector-dot (-> s5-1 0) (-> s5-1 1))) (vector+float*! (-> s5-1 1) (-> s5-1 1) (-> s5-1 0) (- (-> s5-1 4 x))) (vector-normalize! (-> s5-1 1) 1.0) - (set! (-> this up-dir quad) (-> s5-1 1 quad)) + (vector-copy! (-> this up-dir) (-> s5-1 1)) (forward-up-nopitch->quaternion (the-as quaternion (-> s5-1 2)) (-> s5-1 0) (-> s5-1 1)) (+! (-> this angle) (* (-> this spin) (seconds-per-frame))) (set! (-> this angle) (the float (sar (shl (the int (-> this angle)) 48) 48))) @@ -587,7 +577,7 @@ ) (defmethod set-attack-vel! ((this comb-sentry) (arg0 vector)) - (set! (-> this attack-vel quad) (-> arg0 quad)) + (vector-copy! (-> this attack-vel) arg0) (if (< 81920.0 (vector-length (-> this attack-vel))) (vector-normalize! (-> this attack-vel) 81920.0) ) @@ -694,11 +684,11 @@ (sound-play "sentry-expl") (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217)) ) ) diff --git a/goal_src/jak3/levels/comb/comb-travel.gc b/goal_src/jak3/levels/comb/comb-travel.gc index 3f29de29b1c..64fd424fd4e 100644 --- a/goal_src/jak3/levels/comb/comb-travel.gc +++ b/goal_src/jak3/levels/comb/comb-travel.gc @@ -255,24 +255,20 @@ (set! (-> this end-sphere quad) (-> (new 'static 'vector :x 14454784.0 :y -163840.0 :z 607027.2 :w 409600.0) quad) ) - (set! (-> this end-plane quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + (vector-copy! (-> this end-plane) (new 'static 'vector :x 1.0 :w 1.0)) (set! (-> this end-plane w) (- (vector-dot (-> this end-plane) (the-as vector (-> this end-sphere))))) (set! (-> this intro-sequence) (the-as basic #t)) (set! (-> this intro-sphere quad) (-> (new 'static 'vector :x 1083801.6 :y -81920.0 :z 45056.0 :w 122880.0) quad) ) - (set! (-> this intro-target quad) (-> this intro-sphere quad)) + (vector-copy! (-> this intro-target) (-> this intro-sphere)) (set! (-> this outro-sequence) (the-as basic #t)) (set! (-> this outro-sphere quad) (-> (new 'static 'vector :x 13798605.0 :y -226099.2 :z 614400.0 :w 491520.0) quad) ) - (set! (-> this outro-target quad) - (-> (new 'static 'vector :x 13798605.0 :y -4096000.0 :z 614400.0 :w 1.0) quad) - ) - (set! (-> this outro-target2 quad) - (-> (new 'static 'vector :x 13549568.0 :y -225280.0 :z 614400.0 :w 1.0) quad) - ) - (set! (-> this outro-plane2 quad) (-> this end-plane quad)) + (vector-copy! (-> this outro-target) (new 'static 'vector :x 13798605.0 :y -4096000.0 :z 614400.0 :w 1.0)) + (vector-copy! (-> this outro-target2) (new 'static 'vector :x 13549568.0 :y -225280.0 :z 614400.0 :w 1.0)) + (vector-copy! (-> this outro-plane2) (-> this end-plane)) (set! (-> this outro-plane2 w) (- (vector-dot (-> this outro-plane2) (-> this outro-target2)))) 0 (none) @@ -283,7 +279,8 @@ :code (behavior () (send-event *target* 'end-mode 'pilot) (send-event (handle->process (-> self player-vehicle)) 'sled-disable) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (call-parent-state-handler code) ) ) @@ -299,7 +296,7 @@ (set! (-> this end-sphere quad) (-> (new 'static 'vector :x 68403.2 :y -14056653.0 :z -3796582.5 :w 409600.0) quad) ) - (set! (-> this end-plane quad) (-> (new 'static 'vector :x -0.0162 :y -0.3505 :z -0.9364 :w 1.0) quad)) + (vector-copy! (-> this end-plane) (new 'static 'vector :x -0.0162 :y -0.3505 :z -0.9364 :w 1.0)) (set! (-> this end-plane w) (- (vector-dot (-> this end-plane) (the-as vector (-> this end-sphere))))) (set-blackout-frames (seconds 0.3)) 0 diff --git a/goal_src/jak3/levels/comb/combx-obs.gc b/goal_src/jak3/levels/comb/combx-obs.gc index 3715fedc171..52c3819a6b1 100644 --- a/goal_src/jak3/levels/comb/combx-obs.gc +++ b/goal_src/jak3/levels/comb/combx-obs.gc @@ -93,6 +93,7 @@ ) (defmethod init-from-entity! ((this combx-elevator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (setup-skel-and-draw-masks this) diff --git a/goal_src/jak3/levels/comb/h-sled.gc b/goal_src/jak3/levels/comb/h-sled.gc index 1c0a7dc8419..b1cee500c54 100644 --- a/goal_src/jak3/levels/comb/h-sled.gc +++ b/goal_src/jak3/levels/comb/h-sled.gc @@ -94,6 +94,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this pre-sled) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (vector+! (-> this root trans) (-> this root trans) (new 'static 'vector :w 1.0)) @@ -111,7 +112,7 @@ (set! (-> s4-0 guard-type) (the-as uint 11)) (set! (-> s4-0 entity) arg0) (vector-reset! (-> s4-0 velocity)) - (set! (-> s4-0 position quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 position) (-> this root trans)) (quaternion-copy! (-> s4-0 rotation) (-> this root quat)) (vehicle-spawn (vehicle-type h-sled) s4-0) ) @@ -147,7 +148,7 @@ ) ) (if (< (-> s4-0 byte0) 2) - (set! (-> s4-0 vec (-> s4-0 byte0) quad) (-> s4-0 vec 2 quad)) + (vector-copy! (-> s4-0 vec (-> s4-0 byte0)) (-> s4-0 vec 2)) ) (dotimes (s3-0 2) (let ((s2-0 (-> s4-0 vec1 s3-0))) @@ -158,7 +159,7 @@ (set! f0-5 (* -1.0 f0-5)) ) (if (>= f0-5 0.866) - (set! (-> arg0 quad) (-> s2-0 quad)) + (vector-copy! arg0 s2-0) ) ) ) @@ -185,7 +186,7 @@ (a1-4 (-> *part-id-table* 4235)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -233,7 +234,7 @@ (-> *part-id-table* 4233 init-specs 3 initial-valuef) (-> *part-id-table* 4233 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (launch-particles (-> *part-id-table* 4233) s4-1 :origin-is-matrix #t) ) ) @@ -247,15 +248,15 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector-copy! v1-2 (-> gp-0 trans)) (vector+! v1-2 v1-2 a0-3) (cond ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) ) ) @@ -294,7 +295,7 @@ (* -1.01 (vector-dot arg3 (-> arg0 surface-normal))) ) (vector-normalize! (-> s4-0 0) 1024000.0) - (set! (-> arg2 quad) (-> s4-0 0 quad)) + (vector-copy! arg2 (-> s4-0 0)) ) (-> arg0 status) ) @@ -398,7 +399,7 @@ (set! (-> this damage) 1.0) (set! (-> this timeout) (seconds 1)) (set! (-> this sound-id) (new-sound-id)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (none) ) @@ -873,18 +874,7 @@ (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) (let ((s4-1 (new 'stack-no-clear 'comb-sentry-stack-var0))) (set! (-> s4-1 byte0) (-> this i-barrel)) - (let* ((v1-5 (-> s4-1 mat)) - (a3-1 (-> this rbody matrix)) - (a0-4 (-> a3-1 rvec quad)) - (a1-1 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-5 rvec quad) a0-4) - (set! (-> v1-5 uvec quad) a1-1) - (set! (-> v1-5 fvec quad) a2-1) - (set! (-> v1-5 trans quad) a3-2) - ) + (matrix-copy! (-> s4-1 mat) (-> this rbody matrix)) (let ((v1-6 (new 'static 'inline-array vector 2 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) @@ -909,7 +899,7 @@ (set! (-> s4-1 params options) (projectile-options)) (logclear! (-> s4-1 params options) (projectile-options po14 po15 po16)) (set! (-> s4-1 params pos quad) (-> s4-1 vec2 quad)) - (set! (-> s4-1 params vel quad) (-> s4-1 vec4 quad)) + (vector-copy! (-> s4-1 params vel) (-> s4-1 vec4)) (set! (-> s4-1 params notify-handle) (the-as handle #f)) (set! (-> s4-1 params owner-handle) (the-as handle #f)) (set! (-> s4-1 params target-handle) (the-as handle #f)) @@ -1067,7 +1057,7 @@ (set! (-> this draw lod-set lod 3 dist) 2457600.0) (set! (-> this rider-hand-joint-array 0) 3) (set! (-> this rider-hand-joint-array 1) 3) - (set! (-> this path-pos quad) (-> this root trans quad)) + (vector-copy! (-> this path-pos) (-> this root trans)) (set! (-> this shoot-delay) (the-as uint 30)) (set! (-> this in-tunnel) #f) (dotimes (s5-1 4) @@ -1129,14 +1119,14 @@ (let ((gp-0 (new 'stack-no-clear 'h-sled-physics-work))) (mem-set32! (the-as pointer (-> gp-0 mat)) 6 0) (set! (-> gp-0 p-body y) (seconds-per-frame)) - (set! (-> gp-0 mat fvec quad) (-> this rbody position quad)) - (set! (-> gp-0 mat trans quad) (-> this rbody lin-velocity quad)) - (set! (-> gp-0 steering-axis quad) (-> this rbody matrix fvec quad)) - (set! (-> gp-0 local-pos quad) (-> this rbody matrix rvec quad)) + (vector-copy! (-> gp-0 mat fvec) (-> this rbody position)) + (vector-copy! (-> gp-0 mat trans) (-> this rbody lin-velocity)) + (vector-copy! (-> gp-0 steering-axis) (-> this rbody matrix fvec)) + (vector-copy! (-> gp-0 local-pos) (-> this rbody matrix rvec)) (set! (-> gp-0 tmp x) (vector-length (-> gp-0 mat trans))) (set! (-> gp-0 p-body x) (vector-dot (-> gp-0 mat trans) (-> gp-0 steering-axis))) (set! (-> gp-0 tmp z) (-> this ai-target-speed)) - (set! (-> gp-0 world-pos quad) (-> this ai-target-pos quad)) + (vector-copy! (-> gp-0 world-pos) (-> this ai-target-pos)) (vector-! (-> gp-0 lift-dir) (-> gp-0 world-pos) (-> gp-0 mat fvec)) (set! (-> gp-0 tmp w) (* 0.00036621094 @@ -1175,7 +1165,7 @@ ) (defmethod on-impact ((this h-sled) (arg0 rigid-body-impact)) - (set! (-> this impact-normal quad) (-> arg0 normal quad)) + (vector-copy! (-> this impact-normal) (-> arg0 normal)) (call-parent-method this arg0) (none) ) @@ -1223,7 +1213,7 @@ ) (('in-tunnel) (set! (-> this in-tunnel) (the-as symbol (-> arg3 param 0))) - (set! (-> this whoosh-pos quad) (-> this root trans quad)) + (vector-copy! (-> this whoosh-pos) (-> this root trans)) (set! v0-4 (current-time)) (set! (-> this whoosh-time) (the-as time-frame v0-4)) v0-4 @@ -1250,15 +1240,15 @@ (let ((a0-4 (camera-matrix))) (vector-float*! (-> s5-0 rvec) (-> a0-4 uvec) -1.0) ) - (set! (-> s5-0 uvec quad) (-> this tunnel-dir quad)) + (vector-copy! (-> s5-0 uvec) (-> this tunnel-dir)) (vector+float*! (-> s5-0 rvec) (-> s5-0 rvec) (-> s5-0 uvec) (- (vector-dot (-> s5-0 rvec) (-> s5-0 uvec)))) (vector-normalize! (-> s5-0 rvec) 1.0) - (set! (-> this gravity-dir quad) (-> s5-0 rvec quad)) + (vector-copy! (-> this gravity-dir) (-> s5-0 rvec)) ) (if (or (not (logtest? (-> this v-flags) (vehicle-flag on-ground))) (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) ) - (set! (-> this gravity-dir quad) (-> (new 'static 'vector :y -1.0 :w 1.0) quad)) + (vector-copy! (-> this gravity-dir) (new 'static 'vector :y -1.0 :w 1.0)) ) (cond ((logtest? (vehicle-flag ignition) (-> this v-flags)) @@ -1362,7 +1352,7 @@ (set! (-> s5-0 fvec x) (fmax 0.0 (fmin 2.0 (* 0.0000030517579 (vector-dot (-> this tunnel-dir) (-> this root transv))))) ) - (set! (-> s5-0 uvec quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 uvec) (-> this root trans)) (vector-! (-> s5-0 rvec) (-> s5-0 uvec) (-> this whoosh-pos)) (when (< 131072.0 (vector-dot (-> this tunnel-dir) (-> s5-0 rvec))) (sound-play-by-name @@ -1374,7 +1364,7 @@ (sound-group) #t ) - (set! (-> this whoosh-pos quad) (-> s5-0 uvec quad)) + (vector-copy! (-> this whoosh-pos) (-> s5-0 uvec)) (set-time! (-> this whoosh-time)) ) (set! (-> s5-0 fvec x) @@ -1500,21 +1490,21 @@ (let ((v1-18 (-> this info physics-model lift-thruster-array s1-0)) (s0-0 (-> (the-as h-sled-physics-work arg1) probe-work-array s1-0)) ) - (set! (-> s0-0 local-pos quad) (-> v1-18 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-18 rot quad)) + (vector-copy! (-> s0-0 local-pos) (-> v1-18 local-pos)) + (vector-copy! (-> s0-0 local-normal) (-> v1-18 rot)) (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> (the-as h-sled-physics-work arg1) mat)) - (set! (-> s0-0 probe-pos quad) (-> s0-0 world-pos quad)) + (vector-copy! (-> s0-0 probe-pos) (-> s0-0 world-pos)) (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) (vector-reset! (-> s0-0 ground-normal)) (vector-reset! (-> s0-0 u-dir)) (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos)) (set! (-> s0-0 probe-uu) (probe-using-line-sphere *collide-cache* s2-0)) (cond ((and (>= (-> s0-0 probe-uu) 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) (logclear! (-> this v-flags) (vehicle-flag in-air)) (logior! (-> this v-flags) (vehicle-flag on-ground)) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) + (vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal)) (vector+! (-> this sum-ground-normal) (-> this sum-ground-normal) (-> s0-0 ground-normal)) (sled-find-mesh-dir (-> s0-0 u-dir) (-> this path-dir) (-> s2-0 best-other-tri)) ) @@ -1533,7 +1523,7 @@ ) ) ) - (set! (-> this prev-tunnel-dir quad) (-> this tunnel-dir quad)) + (vector-copy! (-> this prev-tunnel-dir) (-> this tunnel-dir)) (vector-reset! (-> this tunnel-dir)) (dotimes (v1-55 (-> this info physics-model lift-thruster-count)) (let ((a2-5 (-> (the-as h-sled-physics-work arg1) probe-work-array v1-55))) @@ -1550,7 +1540,7 @@ (.mov v1-59 vf1) (if (< f0-9 v1-59) (vector-normalize! (-> this tunnel-dir) 1.0) - (set! (-> this tunnel-dir quad) (-> this path-dir quad)) + (vector-copy! (-> this tunnel-dir) (-> this path-dir)) ) ) (let ((f0-10 0.0)) @@ -1562,7 +1552,7 @@ (.add.mul.z.vf.x vf1 vf2 vf1 acc) (.mov v1-63 vf1) (when (< f0-10 v1-63) - (set! (-> this normal-dir quad) (-> this sum-ground-normal quad)) + (vector-copy! (-> this normal-dir) (-> this sum-ground-normal)) (vector-normalize! (-> this normal-dir) 1.0) (vector-float*! (-> this gravity-dir) (-> this normal-dir) -1.0) (vector-cross! (-> this side-dir) (-> this normal-dir) (-> this tunnel-dir)) @@ -1578,8 +1568,8 @@ ) (dotimes (s2-2 (-> this info physics-model lift-thruster-count)) (let ((v1-78 (-> (the-as h-sled-physics-work arg1) probe-work-array s2-2))) - (set! (-> (the-as h-sled-physics-work arg1) world-pos quad) (-> v1-78 world-pos quad)) - (set! (-> (the-as h-sled-physics-work arg1) velocity quad) (-> v1-78 velocity quad)) + (vector-copy! (-> (the-as h-sled-physics-work arg1) world-pos) (-> v1-78 world-pos)) + (vector-copy! (-> (the-as h-sled-physics-work arg1) velocity) (-> v1-78 velocity)) (let ((s1-1 (new 'stack-no-clear 'vector))) (when (< (-> v1-78 probe-uu) 1.0) (set! (-> s1-1 x) (- 0.5 (-> v1-78 probe-uu))) @@ -1647,7 +1637,7 @@ (set! (-> s1-0 fvec x) (path-control-method-24 (-> this path) (-> s3-0 position))) (displacement-between-two-points-normalized! (-> this path) (-> s1-0 rvec) (-> s1-0 fvec x)) (get-point-in-path! (-> this path) (-> s1-0 uvec) (-> s1-0 fvec x) 'interp) - (set! (-> this path-pos quad) (-> s1-0 uvec quad)) + (vector-copy! (-> this path-pos) (-> s1-0 uvec)) (vector-float*! (-> this path-dir) (-> s1-0 rvec) -1.0) ) 0 @@ -1660,14 +1650,14 @@ (dotimes (v1-20 4) (let ((a0-15 (-> s4-0 probe-work-array v1-20))) (if (< (-> a0-15 probe-uu) 1.0) - (set! (-> this ground-pos-array v1-20 quad) (-> a0-15 ground-pos quad)) + (vector-copy! (-> this ground-pos-array v1-20) (-> a0-15 ground-pos)) ) ) ) (let ((s1-1 (new 'stack-no-clear 'matrix))) - (set! (-> s1-1 fvec quad) (-> s3-0 matrix fvec quad)) - (set! (-> s1-1 uvec quad) (-> s3-0 matrix uvec quad)) - (set! (-> s1-1 trans quad) (-> s3-0 matrix rvec quad)) + (vector-copy! (-> s1-1 fvec) (-> s3-0 matrix fvec)) + (vector-copy! (-> s1-1 uvec) (-> s3-0 matrix uvec)) + (vector-copy! (-> s1-1 trans) (-> s3-0 matrix rvec)) (vector-! (-> s1-1 rvec) (-> this tunnel-dir) (-> s1-1 fvec)) (vector+float*! (-> s1-1 rvec) (-> s1-1 rvec) (-> s1-1 uvec) (- (vector-dot (-> s1-1 rvec) (-> s1-1 uvec)))) (vector+float*! (-> s4-0 world-pos) (-> s3-0 position) (-> s1-1 fvec) 4096.0) @@ -1683,8 +1673,8 @@ ) (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) (let ((v1-39 (new 'stack-no-clear 'matrix))) - (set! (-> v1-39 rvec quad) (-> s3-0 matrix rvec quad)) - (set! (-> v1-39 rvec quad) (-> this side-dir quad)) + (vector-copy! (-> v1-39 rvec) (-> s3-0 matrix rvec)) + (vector-copy! (-> v1-39 rvec) (-> this side-dir)) (set! (-> v1-39 uvec w) (vector-dot (-> v1-39 rvec) (-> s3-0 lin-velocity))) (set! (-> v1-39 uvec z) (* (fabs (-> v1-39 uvec w)) (-> s2-0 info mass) (/ 1.0 arg0))) (set! (-> v1-39 uvec y) @@ -1720,7 +1710,7 @@ (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) (when (logtest? (vehicle-flag ignition) (-> this v-flags)) (vector-matrix*! (-> s4-0 world-pos) (-> s2-0 physics-model engine-thrust-local-pos) (-> s4-0 mat)) - (set! (-> s4-0 dir quad) (-> s4-0 mat fvec quad)) + (vector-copy! (-> s4-0 dir) (-> s4-0 mat fvec)) (let ((f0-42 (* (-> this engine-thrust) (-> s2-0 handling max-engine-thrust) (-> s2-0 info mass)))) (vector-float*! (-> s4-0 force) (-> s4-0 dir) f0-42) ) @@ -1740,7 +1730,7 @@ ) (apply-impact! s3-0 (-> s4-0 world-pos) (-> s4-0 force)) ) - (set! (-> s4-0 dir quad) (-> this tunnel-dir quad)) + (vector-copy! (-> s4-0 dir) (-> this tunnel-dir)) (let ((f0-47 (vector-dot (-> s4-0 dir) (-> s3-0 lin-velocity)))) (vector-float*! (-> s4-0 force) @@ -1750,18 +1740,18 @@ ) (add-force! s3-0 (-> s4-0 force)) ) - (set! (-> s4-0 local-pos quad) (-> (new 'static 'vector :z -16384.0 :w 1.0) quad)) + (vector-copy! (-> s4-0 local-pos) (new 'static 'vector :z -16384.0 :w 1.0)) (vector-matrix*! (-> s4-0 world-pos) (-> s4-0 local-pos) (-> s4-0 mat)) (rigid-body-control-method-23 s3-0 (-> s4-0 world-pos) (-> s4-0 velocity)) (vector-reset! (-> s4-0 force)) - (set! (-> s4-0 dir quad) (-> s4-0 mat uvec quad)) + (vector-copy! (-> s4-0 dir) (-> s4-0 mat uvec)) (vector+float*! (-> s4-0 force) (-> s4-0 force) (-> s4-0 dir) (* -1.0 (vector-dot (-> s4-0 dir) (-> s4-0 velocity))) ) - (set! (-> s4-0 dir quad) (-> s4-0 mat rvec quad)) + (vector-copy! (-> s4-0 dir) (-> s4-0 mat rvec)) (vector+float*! (-> s4-0 force) (-> s4-0 force) @@ -1798,7 +1788,7 @@ (disable-physics! self) (rigid-body-object-method-43 self) (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) @@ -1870,18 +1860,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'h-sled-stack-var1))) - (let* ((v1-0 (-> s5-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-3 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-3) - (set! (-> v1-0 uvec quad) a1-0) - (set! (-> v1-0 fvec quad) a2-0) - (set! (-> v1-0 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat) (-> this node-list data 0 bone transform)) (let ((s4-0 (new 'static 'inline-array vector 8 (new 'static 'vector :x 6144.0 :y 4096.0 :z -20480.0 :w 1.0) (new 'static 'vector :x -6144.0 :y 4096.0 :z -20480.0 :w 1.0) @@ -1906,7 +1885,7 @@ (a1-3 (-> s5-0 vec0)) (f0-0 (-> v1-7 position w)) ) - (set! (-> v1-7 position quad) (-> a1-3 quad)) + (vector-copy! (-> v1-7 position) a1-3) (set! (-> v1-7 position w) f0-0) ) 0 @@ -1932,7 +1911,7 @@ (.add.mul.z.vf.x vf1 vf2 vf1 acc) (.mov a0-13 vf1) (when (< f0-8 a0-13) - (set! (-> s5-0 mat trans quad) (-> v1-21 quad)) + (vector-copy! (-> s5-0 mat trans) v1-21) (spawn-from-mat (-> this parts s4-1) (-> s5-0 mat)) ) ) diff --git a/goal_src/jak3/levels/comb/pecker/pecker-ingame.gc b/goal_src/jak3/levels/comb/pecker/pecker-ingame.gc index 1e31e0907a0..ca16379075b 100644 --- a/goal_src/jak3/levels/comb/pecker/pecker-ingame.gc +++ b/goal_src/jak3/levels/comb/pecker/pecker-ingame.gc @@ -96,6 +96,7 @@ ) (defmethod init-from-entity! ((this pecker-ingame) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((v1-1 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (cond ((zero? v1-1) diff --git a/goal_src/jak3/levels/comb/railx-obs.gc b/goal_src/jak3/levels/comb/railx-obs.gc index d0cb46a2ad6..28eb446f5f2 100644 --- a/goal_src/jak3/levels/comb/railx-obs.gc +++ b/goal_src/jak3/levels/comb/railx-obs.gc @@ -36,6 +36,7 @@ ) (defmethod init-from-entity! ((this rail-warp-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak3/levels/common-obs/ladder.gc b/goal_src/jak3/levels/common-obs/ladder.gc index 00b1b8975eb..e38829b8f80 100644 --- a/goal_src/jak3/levels/common-obs/ladder.gc +++ b/goal_src/jak3/levels/common-obs/ladder.gc @@ -181,19 +181,8 @@ (defmethod ladder-method-25 ((this ladder) (arg0 matrix) (arg1 float)) (let ((s4-0 (-> this node-list data 4 bone transform)) - (s3-0 (new 'stack-no-clear 'matrix)) + (s3-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 5 bone transform))) ) - (let* ((a2-1 (-> this node-list data 5 bone transform)) - (v1-4 (-> a2-1 rvec quad)) - (a0-1 (-> a2-1 uvec quad)) - (a1-1 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> s3-0 rvec quad) v1-4) - (set! (-> s3-0 uvec quad) a0-1) - (set! (-> s3-0 fvec quad) a1-1) - (set! (-> s3-0 trans quad) a2-2) - ) (vector+! (-> s3-0 trans) (-> s3-0 trans) @@ -209,6 +198,7 @@ ) (defmethod init-from-entity! ((this ladder) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (init-skel! this) diff --git a/goal_src/jak3/levels/common/ai/ashelin/ash-shot.gc b/goal_src/jak3/levels/common/ai/ashelin/ash-shot.gc index ae7ad3197cd..0ba93ae619f 100644 --- a/goal_src/jak3/levels/common/ai/ashelin/ash-shot.gc +++ b/goal_src/jak3/levels/common/ai/ashelin/ash-shot.gc @@ -315,11 +315,11 @@ (defmethod projectile-method-26 ((this ashelin-shot)) (cond ((logtest? (-> *part-group-id-table* 222 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 222)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 222)) ) ) @@ -379,7 +379,7 @@ (let ((v1-9 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-5 (-> arg0 hit-pos)) ) - (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector-copy! a1-5 (-> s5-0 trans)) (vector+! a1-5 a1-5 v1-9) (move-to-point! (-> arg0 root) a1-5) ) @@ -452,7 +452,7 @@ ) (defmethod init-proj-settings! ((this ashelin-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 307200.0) (set! (-> this move) ashelin-shot-move) diff --git a/goal_src/jak3/levels/common/ai/ashelin/ash-states.gc b/goal_src/jak3/levels/common/ai/ashelin/ash-states.gc index 9610e43c76b..b98620162e6 100644 --- a/goal_src/jak3/levels/common/ai/ashelin/ash-states.gc +++ b/goal_src/jak3/levels/common/ai/ashelin/ash-states.gc @@ -374,7 +374,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 center quad)) + (vector-copy! (-> a0-0 target-pos) (-> v1-1 center)) ) 0 (nav-enemy-travel-post) @@ -457,7 +457,7 @@ (nav-enemy-method-178 self) (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (if (not (handle->process (-> self focus handle))) - (go-best-state self) + (go-state-for-focused self) ) (set! (-> self travel-anim-interp) 0.0) ) @@ -467,7 +467,7 @@ :code (behavior () (bot-method-235 self #t) (if (or (not (bot-method-226 self)) (not (ashelin-method-247 self #f))) - (go-best-state self) + (go-state-for-focused self) ) (let ((v1-12 (ja-group))) (if (and v1-12 (or (= v1-12 ashelin-standing-idle-ja) (= v1-12 ashelin-standing-fire-ja))) @@ -495,7 +495,7 @@ (ashelin-method-256 self) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -547,7 +547,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-6 quad)) + (vector-copy! (-> gp-0 target-pos) v1-6) ) 0 (nav-enemy-travel-post) @@ -606,7 +606,7 @@ (let ((a0-14 (-> self nav state)) (v1-33 gp-1) ) - (set! (-> a0-14 heading quad) (-> v1-33 quad)) + (vector-copy! (-> a0-14 heading) v1-33) ) 0 (let ((v1-36 (-> self nav))) @@ -636,7 +636,7 @@ (ja-no-eval :group! ashelin-back-spring-loop-ja :num! (seek! max 1.4) :frame-num 0.0) (until (ja-done? 0) (let ((a1-12 (-> self nav state))) - (set! (-> gp-1 quad) (-> a1-12 heading quad)) + (vector-copy! gp-1 (-> a1-12 heading)) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -668,7 +668,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -676,7 +676,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -734,7 +734,7 @@ (let ((a0-14 (-> self nav state)) (v1-31 gp-1) ) - (set! (-> a0-14 heading quad) (-> v1-31 quad)) + (vector-copy! (-> a0-14 heading) v1-31) ) 0 (let ((v1-34 (-> self nav))) @@ -764,7 +764,7 @@ (ja-no-eval :group! ashelin-cartwheel-left-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((a1-11 (-> self nav state))) - (set! (-> gp-1 quad) (-> a1-11 heading quad)) + (vector-copy! gp-1 (-> a1-11 heading)) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -790,7 +790,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -798,7 +798,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -856,7 +856,7 @@ (let ((a0-14 (-> self nav state)) (v1-31 gp-1) ) - (set! (-> a0-14 heading quad) (-> v1-31 quad)) + (vector-copy! (-> a0-14 heading) v1-31) ) 0 (let ((v1-34 (-> self nav))) @@ -886,7 +886,7 @@ (ja-no-eval :group! ashelin-tumble-right-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((a1-11 (-> self nav state))) - (set! (-> gp-1 quad) (-> a1-11 heading quad)) + (vector-copy! gp-1 (-> a1-11 heading)) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -912,7 +912,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -920,7 +920,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -968,7 +968,7 @@ (set! (-> self enemy-flags) v1-11) (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) (logclear! (-> self focus-status) (focus-status hit)) - (go-best-state self) + (go-state-for-focused self) ) ) diff --git a/goal_src/jak3/levels/common/ai/ashelin/ash.gc b/goal_src/jak3/levels/common/ai/ashelin/ash.gc index e5889207f0d..d9d76e04f0a 100644 --- a/goal_src/jak3/levels/common/ai/ashelin/ash.gc +++ b/goal_src/jak3/levels/common/ai/ashelin/ash.gc @@ -162,34 +162,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 57344.0 - :knocked-soft-vxz-hi 57344.0 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 81920.0 - :knocked-medium-vxz-lo 57344.0 - :knocked-medium-vxz-hi 57344.0 - :knocked-medium-vy-lo 81920.0 - :knocked-medium-vy-hi 81920.0 - :knocked-hard-vxz-lo 57344.0 - :knocked-hard-vxz-hi 57344.0 - :knocked-hard-vy-lo 81920.0 - :knocked-hard-vy-hi 81920.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 57344.0 - :knocked-yellow-vxz-hi 57344.0 - :knocked-yellow-vy-lo 81920.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 57344.0 - :knocked-red-vxz-hi 57344.0 - :knocked-red-vy-lo 81920.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 40960.0 + :knocked-soft-vxz-lo (meters 14) + :knocked-soft-vxz-hi (meters 14) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 20) + :knocked-medium-vxz-lo (meters 14) + :knocked-medium-vxz-hi (meters 14) + :knocked-medium-vy-lo (meters 20) + :knocked-medium-vy-hi (meters 20) + :knocked-hard-vxz-lo (meters 14) + :knocked-hard-vxz-hi (meters 14) + :knocked-hard-vy-lo (meters 20) + :knocked-hard-vy-hi (meters 20) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 14) + :knocked-yellow-vxz-hi (meters 14) + :knocked-yellow-vy-lo (meters 20) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 14) + :knocked-red-vxz-hi (meters 14) + :knocked-red-vy-lo (meters 20) + :knocked-red-vy-hi (meters 20) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 10) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -228,6 +228,7 @@ (set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod get-penetrated-by ((this ashelin)) + "Figure out the penetrated-by mask for this process." (let* ((t9-0 (method-of-type bot get-penetrated-by)) (v0-0 (t9-0 this)) ) @@ -263,14 +264,15 @@ ) ) -(defmethod get-incoming-attack! ((this ashelin) - (arg0 process-drawable) - (arg1 event-message-block) - (arg2 penetrate) - (arg3 attack-info) - (arg4 touching-shapes-entry) - ) - (let ((t9-0 (method-of-type bot get-incoming-attack!))) +(defmethod handle-incoming-attack! ((this ashelin) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + "Set up this enemy to handle an incoming attack event." + (let ((t9-0 (method-of-type bot handle-incoming-attack!))) (t9-0 this arg0 arg1 arg2 arg3 arg4) ) (if (!= (-> this incoming knocked-type) (knocked-type blue-shot)) @@ -279,7 +281,8 @@ (none) ) -(defmethod send-attack ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (if (and (= (-> arg0 type) target) (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -287,11 +290,12 @@ ) ) #f - ((method-of-type bot send-attack) this arg0 arg1 arg2) + ((method-of-type bot send-attack-from-tshape) this arg0 arg1 arg2) ) ) (defmethod find-best-focus ((this ashelin)) + "Search for the best thing to focus on." (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -374,7 +378,7 @@ ) (cond (s5-1 - (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (focus-on! (-> this focus) (the-as process-focusable s5-1) this) (if (and (logtest? (-> this bot-flags) (bot-flag attacked)) (!= (-> s5-1 type) target)) (logclear! (-> this bot-flags) (bot-flag attacked)) ) @@ -403,6 +407,7 @@ ) (defmethod init-enemy-collision! ((this ashelin)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -457,6 +462,7 @@ ) (defmethod init-enemy! ((this ashelin)) + "Typical place for shared init code. Runs from entity or process style init." (init-fields! this) (set! (-> this channel) (gui-channel ashelin)) (set! (-> this travel-anim-interp) 0.0) @@ -469,7 +475,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *ashelin-nav-enemy-info*) + (setup-enemy! this *ashelin-nav-enemy-info*) (let ((v1-12 (-> this neck))) (set! (-> v1-12 up) (the-as uint 1)) (set! (-> v1-12 nose) (the-as uint 2)) @@ -677,7 +683,7 @@ (a0-8 (new 'stack-no-clear 'vector)) ) (vector-float*! a2-0 (the-as vector (-> this frontline)) (- (-> this frontline w))) - (set! (-> a0-8 quad) (-> this root trans quad)) + (vector-copy! a0-8 (-> this root trans)) (set! (-> a0-8 y) 0.0) (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> this frontline)) 8192.0) ) @@ -712,10 +718,11 @@ ) (defmethod go-hostile ((this ashelin)) + "Go to the hostile state, actively trying to attack the target." (bot-method-235 this #t) (cond ((not (bot-method-226 this)) - (go-best-state this) + (go-state-for-focused this) ) ((ashelin-method-250 this #t #f) (go (method-of-object this standing-idle)) @@ -729,7 +736,8 @@ ) ) -(defmethod go-best-state ((this ashelin)) +(defmethod go-state-for-focused ((this ashelin)) + "Go to the appropriate state for the current awareness of the focused process." (if (bot-method-226 this) (go-hostile this) (go-idle this) @@ -737,13 +745,15 @@ ) (defmethod go-idle ((this ashelin)) + "Go to an idle state." (if (bot-method-226 this) (go (method-of-object this standing-idle)) (go (method-of-object this waiting-idle)) ) ) -(defmethod go-idle2 ((this ashelin)) +(defmethod go-fallback-init ((this ashelin)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this hidden)) ) @@ -768,7 +778,7 @@ ) (set! (-> s4-0 timeout) (seconds 4)) (vector<-cspace! (-> s4-0 pos) (-> this node-list data 22)) - (set! (-> s4-0 vel quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 vel) arg0) (vector-! (-> s4-0 vel) (-> s4-0 vel) (-> s4-0 pos)) (vector-normalize! (-> s4-0 vel) 307200.0) (spawn-projectile ashelin-shot s4-0 this *default-dead-pool*) @@ -906,6 +916,7 @@ ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this ashelin)) + "Get the yaw angle for the current knock." (local-vars (v1-36 art-element)) (let ((f28-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) @@ -914,7 +925,7 @@ (when a0-4 (get-trans a0-4 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -967,6 +978,7 @@ ) (defmethod knocked-anim ((this ashelin) (arg0 enemy-knocked-info)) + "start the knocked animation." (local-vars (a2-0 int)) (case (-> this incoming knocked-type) (((knocked-type blue-shot)) @@ -988,7 +1000,7 @@ ) ) ) - (let* ((v1-9 (enemy-method-131 this 6 a2-0)) + (let* ((v1-9 (rnd-int-excluding-masked this 6 a2-0)) (s5-2 (-> this draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9 anim-index))) ) (set! (-> *ashelin-global-info* prev-blue-hit) v1-9) @@ -1034,6 +1046,7 @@ ) (defmethod knocked-land-anim ((this ashelin) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-0 (-> this incoming knocked-type))) (cond ((= v1-0 (knocked-type blue-shot)) @@ -1118,6 +1131,7 @@ ) (defmethod knocked-anim-handler ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (cond ((= arg0 3) (let ((s5-0 (ja-done? 0))) @@ -1263,9 +1277,9 @@ (set! (-> sv-272 z) (cos arg1)) (set! (-> sv-272 w) 1.0) (vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3) - (set! (-> s0-0 pref-dir quad) (-> s0-0 travel quad)) + (vector-copy! (-> s0-0 pref-dir) (-> s0-0 travel)) (avoid-spheres-1! (-> this nav) s0-0) - (set! (-> arg0 quad) (-> s0-0 out-travel 0 quad)) + (vector-copy! arg0 (-> s0-0 out-travel 0)) ) 0 (when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z))))) @@ -1360,7 +1374,7 @@ ) ) (when (>= s5-0 0) - (set! (-> this victory-speech-time) (+ (set-reaction-time! this (seconds 4) (seconds 7)) (current-time))) + (set! (-> this victory-speech-time) (+ (rnd-time-frame this (seconds 4) (seconds 7)) (current-time))) (play-speech-by-id this s5-0) ) ) @@ -1369,7 +1383,8 @@ ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod check-victory ((this ashelin)) +(defmethod clear-stale-victory ((this ashelin)) + "Remove victory flag if needed." (if (time-elapsed? (-> this hit-focus-time) (seconds 2)) (logclear! (-> this enemy-flags) (enemy-flag victory)) ) diff --git a/goal_src/jak3/levels/common/ai/bot-h.gc b/goal_src/jak3/levels/common/ai/bot-h.gc index e1209f67cd3..287132f46a3 100644 --- a/goal_src/jak3/levels/common/ai/bot-h.gc +++ b/goal_src/jak3/levels/common/ai/bot-h.gc @@ -708,7 +708,7 @@ (set! s2-0 0) ) ) - (let* ((s1-0 (enemy-method-131 arg0 (-> this speech-indexes length) s2-0)) + (let* ((s1-0 (rnd-int-excluding-masked arg0 (-> this speech-indexes length) s2-0)) (s0-0 (-> this speech-indexes s1-0)) (v1-47 (-> arg1 s0-0 flags)) ) diff --git a/goal_src/jak3/levels/common/ai/bot-states.gc b/goal_src/jak3/levels/common/ai/bot-states.gc index a857be961a8..f6bb42b681d 100644 --- a/goal_src/jak3/levels/common/ai/bot-states.gc +++ b/goal_src/jak3/levels/common/ai/bot-states.gc @@ -67,7 +67,7 @@ (set! (-> self enemy-flags) v1-41) (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) (logclear! (-> self focus-status) (focus-status hit)) - (go-best-state self) + (go-state-for-focused self) ) ) diff --git a/goal_src/jak3/levels/common/ai/bot.gc b/goal_src/jak3/levels/common/ai/bot.gc index 3b8ac7499bb..233d65bd609 100644 --- a/goal_src/jak3/levels/common/ai/bot.gc +++ b/goal_src/jak3/levels/common/ai/bot.gc @@ -107,7 +107,10 @@ ) ) -(defmethod send-attack-to-all-tshapes ((this bot) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this bot) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." 0 ) @@ -291,14 +294,15 @@ ) ) -(defmethod get-incoming-attack! ((this bot) - (arg0 process-drawable) - (arg1 event-message-block) - (arg2 penetrate) - (arg3 attack-info) - (arg4 touching-shapes-entry) - ) - (let ((t9-0 (method-of-type nav-enemy get-incoming-attack!))) +(defmethod handle-incoming-attack! ((this bot) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + "Set up this enemy to handle an incoming attack event." + (let ((t9-0 (method-of-type nav-enemy handle-incoming-attack!))) (t9-0 this arg0 arg1 arg2 arg3 arg4) ) (logclear! (-> this bot-flags) (bot-flag bf03 bf04)) @@ -350,6 +354,7 @@ ) (defmethod get-damage-from-attack ((this bot) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let* ((t9-0 (method-of-type nav-enemy get-damage-from-attack)) (v0-0 (t9-0 this arg0 arg1)) (v1-1 (-> this bot-flags)) @@ -371,8 +376,9 @@ ) ) -(defmethod penetrate->next-state ((this bot) (arg0 process) (arg1 event-message-block) (arg2 float)) - (let* ((t9-0 (method-of-type nav-enemy penetrate->next-state)) +(defmethod msg-for-incoming-attack ((this bot) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." + (let* ((t9-0 (method-of-type nav-enemy msg-for-incoming-attack)) (v0-0 (t9-0 this arg0 arg1 arg2)) ) (if (logtest? (-> this bot-flags) (bot-flag bf03)) @@ -414,17 +420,20 @@ ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-awareness! ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod get-awareness-of-proc ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) + "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (the-as enemy-aware 3) ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod get-enemy-aware ((this bot) (arg0 enemy-aware)) +(defmethod modify-awareness ((this bot) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." (the-as enemy-aware 3) ) ;; WARN: Return type mismatch object vs process. (defmethod update-focus ((this bot)) + "Potentially update the focus, if there is something better to focus on." (local-vars (s5-1 process)) (let ((s5-0 (-> this focus))) (cond @@ -457,6 +466,7 @@ ) (defmethod find-best-focus ((this bot)) + "Search for the best thing to focus on." (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -539,7 +549,7 @@ ) (cond (s5-1 - (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (focus-on! (-> this focus) (the-as process-focusable s5-1) this) (if (and (logtest? (-> this bot-flags) (bot-flag attacked)) (!= (-> s5-1 type) target)) (logclear! (-> this bot-flags) (bot-flag attacked)) ) @@ -568,9 +578,9 @@ ) (set! (-> gp-0 proc) #f) (set! (-> gp-0 rating) 409600000.0) - (set! (-> gp-0 aware) (enemy-aware ea0)) + (set! (-> gp-0 aware) (enemy-aware unaware)) (when (< 0.0 f0-0) - (set! (-> s3-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this root trans)) (set! (-> s3-0 w) (-> this notice-enemy-dist)) (set! *actor-list-length* 0) (if (logtest? s4-0 512) @@ -702,12 +712,14 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this bot)) +(defmethod get-search-info-flag ((this bot)) + "Get search-info-flag for this process." (the-as search-info-flag 0) ) ;; WARN: disable def twice: 272. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-0 object)) (case arg2 (('combo) @@ -834,7 +846,7 @@ #t ) (('follow-dir) - (set! (-> this follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! (-> this follow-dir) (the-as vector (-> arg3 param 1))) #t ) (else @@ -883,7 +895,7 @@ ) (else (if (and (-> this next-state) (= (-> this next-state name) 'hidden)) - (go-best-state this) + (go-state-for-focused this) ) ) ) @@ -907,7 +919,8 @@ ) ) -(defmethod send-attack ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (cond ((and (= (-> arg0 type) target) (not (logtest? (-> this bot-flags) (bot-flag attacked)))) (when (send-event arg0 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) @@ -920,7 +933,7 @@ ) ) (set! (-> this root penetrated-by) (the-as penetrate -1)) - (reset-penetrate! this) + (reset-penetrate-later! this) #t ) ) @@ -946,13 +959,14 @@ ) ) -(defmethod send-attack-on-jump-or-knocked ((this bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this bot) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'knocked) (= v1-3 'jump)) ) ) - ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type nav-enemy enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -987,7 +1001,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -1075,7 +1089,7 @@ (set-time! (-> this started-warning-time)) ) (if (and (>= (current-time) (-> this next-too-far-warn-time)) (bot-method-216 this)) - (set! (-> this next-too-far-warn-time) (+ (current-time) (set-reaction-time! + (set! (-> this next-too-far-warn-time) (+ (current-time) (rnd-time-frame this (the-as time-frame (-> this warn-min-delay)) (the-as time-frame (-> this warn-max-delay)) @@ -1099,7 +1113,7 @@ ;; WARN: Return type mismatch time-frame vs none. (defmethod reset-warn-time ((this bot)) (set! (-> this started-warning-time) 0) - (set! (-> this next-too-far-warn-time) (+ (current-time) (set-reaction-time! + (set! (-> this next-too-far-warn-time) (+ (current-time) (rnd-time-frame this (the-as time-frame (-> this warn-min-delay)) (the-as time-frame (-> this warn-max-delay)) @@ -1110,6 +1124,7 @@ ) (defmethod enemy-common-post ((this bot)) + "Common implementation of post. Runs ja-post." (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) (set! (-> this travel-prev-ry1) (quaternion-y-angle (-> this root quat))) (let ((f0-3 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) @@ -1395,6 +1410,7 @@ ) (defmethod init-enemy! ((this bot)) + "Typical place for shared init code. Runs from entity or process style init." (process-entity-status! this (entity-perm-status bit-4) #t) (set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) (logclear! (-> this mask) (process-mask enemy)) @@ -1452,7 +1468,7 @@ (when (logtest? (-> this bot-flags) (bot-flag bf00)) (let ((a1-0 (handle->process (-> this focus handle)))) (and a1-0 - (= (-> this focus aware) (enemy-aware ea3)) + (= (-> this focus aware) (enemy-aware hostile)) (attacked-by-player? this (the-as process-focusable a1-0)) (not (logtest? (-> this focus-status) (focus-status grabbed))) ) @@ -1470,8 +1486,8 @@ (set! (-> gp-0 fproc) (the-as process-focusable s3-0)) (set! (-> gp-0 los) 0) (when (the-as process-focusable s3-0) - (set! (-> gp-0 pos quad) (-> (get-trans (the-as process-focusable s3-0) 0) quad)) - (set! (-> gp-0 bullseye quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) + (vector-copy! (-> gp-0 pos) (get-trans (the-as process-focusable s3-0) 0)) + (vector-copy! (-> gp-0 bullseye) (get-trans (the-as process-focusable s3-0) 3)) (vector-z-quaternion! (-> gp-0 my-facing-xz-dir) (-> this root quat)) (set! (-> gp-0 my-facing-xz-dir y) 0.0) (vector-normalize! (-> gp-0 my-facing-xz-dir) 1.0) @@ -1488,7 +1504,7 @@ ) (when (and arg0 s3-0 (zero? (-> gp-0 los))) (let ((s4-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-1 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-1 start-pos) (-> this root trans)) (+! (-> s4-1 start-pos y) 8192.0) (vector-! (-> s4-1 move-dist) (-> gp-0 bullseye) (-> s4-1 start-pos)) (let ((f0-19 (fmax 1.0 (+ -1638.4 (vector-length (-> s4-1 move-dist)))))) @@ -1556,7 +1572,7 @@ (quaternion-copy! (-> arg0 src-quat) (-> s5-0 quat)) (vector-z-quaternion! (-> arg0 facing-dir) (-> s5-0 quat)) (set! (-> arg0 facing-ry) (atan (-> arg0 facing-dir x) (-> arg0 facing-dir z))) - (set! (-> arg0 targ-pos quad) (-> (get-trans arg1 3) quad)) + (vector-copy! (-> arg0 targ-pos) (get-trans arg1 3)) (set! (-> arg0 targ-ry) (atan (- (-> arg0 targ-pos x) (-> s5-0 trans x)) (- (-> arg0 targ-pos z) (-> s5-0 trans z))) ) @@ -1618,11 +1634,12 @@ ) ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-91 ((this bot) (arg0 enemy-jump-info)) +(defmethod check-jump-blocked? ((this bot) (arg0 enemy-jump-info)) + "Is this jump blocked by something?" (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (vector-copy! v1-0 (-> arg0 dest-pos)) (set! (-> v1-0 w) (-> this nav-radius-backup)) - (add-root-sphere-to-hash! (-> this nav) v1-0 #x10006a) + (check-sphere-blocked! (-> this nav) v1-0 #x10006a) ) ) @@ -1634,7 +1651,7 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-0 quad) (-> this root trans quad)) + (vector-copy! v1-0 (-> this root trans)) (+! (-> v1-0 y) 9216.0) (vector-! s1-0 arg0 v1-0) (vector-normalize! s1-0 1.0) @@ -1852,6 +1869,7 @@ ) (defmethod coin-flip? ((this bot)) + "Return #t half the time, #f the other." #f ) diff --git a/goal_src/jak3/levels/common/battle.gc b/goal_src/jak3/levels/common/battle.gc index e4b48672bf0..731eb4188b0 100644 --- a/goal_src/jak3/levels/common/battle.gc +++ b/goal_src/jak3/levels/common/battle.gc @@ -645,7 +645,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (f0-0 (-> this info spawner-blocked-by-collide-radius)) ) - (set! (-> gp-0 quad) (-> arg0 attack-pos quad)) + (vector-copy! gp-0 (-> arg0 attack-pos)) (set! (-> gp-0 w) f0-0) (let ((s5-0 (-> this info spawner-collide-with)) (f30-0 (* f0-0 f0-0)) @@ -899,7 +899,7 @@ (else (set! (-> arg0 creature-index) 0) (let ((v1-7 (-> arg0 entity))) - (set! (-> s3-0 quad) (-> v1-7 extra trans quad)) + (vector-copy! s3-0 (-> v1-7 extra trans)) (quaternion-copy! s4-0 (-> v1-7 quat)) ) ) @@ -908,7 +908,7 @@ (s2-1 (!= s2-0 #f)) (s0-1 (get-random-breed this arg0)) ) - (set! (-> s1-1 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s1-1 trans) s3-0) (quaternion-copy! (-> s1-1 quat) s4-0) (set! (-> s1-1 entity) (-> arg0 entity)) (set! (-> s1-1 directed?) #t) @@ -1480,7 +1480,7 @@ ) ) (else - (set! (-> arg0 attack-pos quad) (-> arg0 entity extra trans quad)) + (vector-copy! (-> arg0 attack-pos) (-> arg0 entity extra trans)) ) ) ) @@ -1607,10 +1607,11 @@ ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this battle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'trsqv))) (set! (-> this root) s4-0) - (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> s4-0 trans) (-> arg0 extra trans)) (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) (vector-identity! (-> s4-0 scale)) ) diff --git a/goal_src/jak3/levels/common/elec-gate.gc b/goal_src/jak3/levels/common/elec-gate.gc index 94b7871b55a..9fcb96df560 100644 --- a/goal_src/jak3/levels/common/elec-gate.gc +++ b/goal_src/jak3/levels/common/elec-gate.gc @@ -142,7 +142,7 @@ (let ((a0-5 (-> s2-0 bolt)) (v1-6 s3-0) ) - (set! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1) quad) (-> v1-6 quad)) + (vector-copy! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1)) v1-6) ) (when (-> gp-0 ring-spec) (let ((s1-0 (-> gp-0 ring-spec num-points)) @@ -858,6 +858,7 @@ ) (defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this entity) arg0) @@ -893,12 +894,12 @@ ) (vector-cross! v1-31 v1-31 *up-vector*) (set! (-> this dividing-wall pos quad) (-> s5-3 quad)) - (set! (-> this dividing-wall dir quad) (-> v1-31 quad)) + (vector-copy! (-> this dividing-wall dir) v1-31) (vector+float*! (the-as vector (-> this plane)) s5-3 v1-31 12288.0) - (set! (-> this plane 0 dir quad) (-> v1-31 quad)) + (vector-copy! (-> this plane 0 dir) v1-31) (vector-float*! v1-31 v1-31 -1.0) (vector+float*! (the-as vector (-> this plane 1)) s5-3 v1-31 12288.0) - (set! (-> this plane 1 dir quad) (-> v1-31 quad)) + (vector-copy! (-> this plane 1 dir) v1-31) ) (set! (-> this wall-xz) (vector-vector-distance @@ -948,6 +949,7 @@ ) (defmethod init-from-entity! ((this sewer-elec-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this gate-index) (res-lump-value (-> this entity) 'index int :time -1000000000.0)) (call-parent-method this arg0) ) diff --git a/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal-shot.gc b/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal-shot.gc index 6938d1831c1..b734588a0cc 100644 --- a/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal-shot.gc +++ b/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal-shot.gc @@ -16,11 +16,11 @@ (defmethod projectile-method-26 ((this dp-bipedal-grenade-shot)) (cond ((logtest? (-> *part-group-id-table* 246 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 246)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 246)) ) ) @@ -65,7 +65,7 @@ (a1-3 (new 'stack 'collide-query)) ) 0.0 - (set! (-> a1-3 start-pos quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> a1-3 start-pos) (-> self root root-prim prim-core world-sphere)) (vector-! (-> a1-3 move-dist) (the-as vector (-> (the-as collide-shape s4-1) root-prim prim-core)) @@ -249,7 +249,7 @@ (set! (-> gp-0 attack-id) a2-12) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) (the-as diff --git a/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc b/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc index 90b396cd13e..5f8532506ec 100644 --- a/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc +++ b/goal_src/jak3/levels/common/enemy/darkprec/dp-bipedal.gc @@ -356,34 +356,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 73728.0 - :knocked-medium-vxz-hi 102400.0 - :knocked-medium-vy-lo 81920.0 - :knocked-medium-vy-hi 122880.0 - :knocked-hard-vxz-lo 81920.0 - :knocked-hard-vxz-hi 122880.0 - :knocked-hard-vy-lo 90112.0 - :knocked-hard-vy-hi 143360.0 - :knocked-huge-vxz-lo 102400.0 - :knocked-huge-vxz-hi 143360.0 - :knocked-huge-vy-lo 102400.0 - :knocked-huge-vy-hi 163840.0 - :knocked-yellow-vxz-lo 32768.0 - :knocked-yellow-vxz-hi 40960.0 - :knocked-yellow-vy-lo 36864.0 - :knocked-yellow-vy-hi 57344.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 65536.0 - :knocked-red-vy-lo 65536.0 - :knocked-red-vy-hi 102400.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 18) + :knocked-medium-vxz-hi (meters 25) + :knocked-medium-vy-lo (meters 20) + :knocked-medium-vy-hi (meters 30) + :knocked-hard-vxz-lo (meters 20) + :knocked-hard-vxz-hi (meters 30) + :knocked-hard-vy-lo (meters 22) + :knocked-hard-vy-hi (meters 35) + :knocked-huge-vxz-lo (meters 25) + :knocked-huge-vxz-hi (meters 35) + :knocked-huge-vy-lo (meters 25) + :knocked-huge-vy-hi (meters 40) + :knocked-yellow-vxz-lo (meters 8) + :knocked-yellow-vxz-hi (meters 10) + :knocked-yellow-vy-lo (meters 9) + :knocked-yellow-vy-hi (meters 14) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 16) + :knocked-red-vy-lo (meters 16) + :knocked-red-vy-hi (meters 25) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 34422.13) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -967,6 +967,7 @@ (set! (-> *dp-bipedal-nav-enemy-info* fact-defaults) *fact-info-dp-bipedal-defaults*) (defmethod init-enemy-collision! ((this dp-bipedal)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1053,6 +1054,7 @@ ) (defmethod get-damage-from-attack ((this dp-bipedal) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (if (type? arg0 guard-shot) 0.5 ((method-of-type nav-enemy get-damage-from-attack) this arg0 arg1) @@ -1158,14 +1160,14 @@ (defmethod dp-bipedal-method-209 ((this dp-bipedal) (arg0 vector) (arg1 float)) (local-vars (s4-0 vector)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> arg0 quad)) + (vector-copy! a1-1 arg0) (set! (-> a1-1 w) arg1) - (and (not (add-root-sphere-to-hash! (-> this nav) a1-1 #x100068)) + (and (not (check-sphere-blocked! (-> this nav) a1-1 #x100068)) (let ((a0-5 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) arg0))) (and (< (vector-x-angle a0-5) 5461.3335) (begin (set! s4-0 (new 'stack-no-clear 'vector)) - (set! (-> s4-0 quad) (-> arg0 quad)) + (vector-copy! s4-0 arg0) (+! (-> s4-0 y) 15974.399) (region-check-has-los s4-0 (-> this focus-bullseye) 8192.0) ) @@ -1186,9 +1188,9 @@ ) (not (dp-bipedal-method-209 self (-> self formation-position) 13977.6)) ) - (set! (-> self focus-formation-source quad) (-> self focus-pos quad)) + (vector-copy! (-> self focus-formation-source) (-> self focus-pos)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self focus-formation-source)))) (when (< 0.0 (vector-length s5-1)) (dotimes (s4-0 (-> *dp-bipedal-formation-table* length)) @@ -1202,7 +1204,7 @@ (when (and (closest-point-on-mesh (-> self nav) s3-0 s3-0 (the-as nav-poly #f)) (dp-bipedal-method-209 self s3-0 13977.6) ) - (set! (-> gp-0 quad) (-> s3-0 quad)) + (vector-copy! gp-0 s3-0) #t (goto cfg-26) ) @@ -1211,7 +1213,7 @@ ) ) (label cfg-26) - (set! (-> self formation-position quad) (-> gp-0 quad)) + (vector-copy! (-> self formation-position) gp-0) ) ) 0 @@ -1229,7 +1231,7 @@ ) (logclear! (-> a0-1 flags) (nav-state-flag directional-mode)) (logior! (-> a0-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-1 target-pos quad) (-> v1-4 quad)) + (vector-copy! (-> a0-1 target-pos) v1-4) ) 0 (nav-enemy-method-187 self) @@ -1245,7 +1247,7 @@ (-> self focus-pos) (* (vector-length (ja-linear-vel 0)) (seconds-per-frame)) ) - (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (move-to-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) ) ) (nav-enemy-simple-post) @@ -1549,11 +1551,11 @@ (set! (-> self effect-rate) 0.4) (cond ((logtest? (-> *part-group-id-table* 242 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 242)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 242)) ) ) @@ -1626,7 +1628,7 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) - (let ((gp-0 (set-reaction-time! self 1 (seconds 0.01)))) + (let ((gp-0 (rnd-time-frame self 1 (seconds 0.01)))) (dotimes (s5-0 gp-0) (ja-no-eval :group! dp-bipedal-idle0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1674,7 +1676,7 @@ (when (time-elapsed? (-> self state-time) (seconds 0.05)) (let ((v1-25 (new 'stack-no-clear 'inline-array 'vector 1))) (let ((a2-0 (-> self nav state))) - (set! (-> v1-25 0 quad) (-> a2-0 target-pos quad)) + (vector-copy! (-> v1-25 0) (-> a2-0 target-pos)) ) (when (< (vector-vector-xz-distance (-> self root trans) (-> v1-25 0)) 4096.0) (if (should-check-los? (-> self los) (seconds 0.3)) @@ -1790,7 +1792,7 @@ (set! (-> gp-0 shield-strength) 10) (set! (-> gp-0 shield-type) (shield-type shield-type-0)) (if (new 'static 'vector :z -7168.0 :w 1.0) - (set! (-> gp-0 offset-vec quad) (-> (new 'static 'vector :z -7168.0 :w 1.0) quad)) + (vector-copy! (-> gp-0 offset-vec) (new 'static 'vector :z -7168.0 :w 1.0)) (vector-reset! (-> gp-0 offset-vec)) ) (let ((s5-0 (the-as process #f))) @@ -1833,7 +1835,7 @@ ((>= 1 (the-as int v1-10)) (go-virtual active) ) - ((= v1-10 (enemy-aware ea4)) + ((= v1-10 (enemy-aware flee)) (go-flee self) ) ) @@ -1913,7 +1915,7 @@ (set-collide-spec! self #t) (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-7 *game-info*) (v0-2 (+ (-> v1-7 attack-id) 1)) ) @@ -1930,7 +1932,7 @@ (set-collide-spec! self #f) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -2053,13 +2055,13 @@ :virtual #t :trans (behavior () (if (and (time-elapsed? (-> self state-time) (seconds 0.01)) - (and (not (handle->process (-> self ragdoll-proc))) (within-gspot-range? self)) + (and (not (handle->process (-> self ragdoll-proc))) (invalid-height? self)) ) (go-die self) ) ) :code (behavior () - (local-vars (v1-31 object) (v1-72 symbol)) + (local-vars (v1-31 symbol) (v1-72 symbol)) (cond ((handle->process (-> self ragdoll-proc)) (ja-channel-push! 1 0) @@ -2092,7 +2094,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -2103,12 +2105,12 @@ (a1-1 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> gp-0 gspot-pos quad)) + (vector-copy! s5-0 (-> gp-0 gspot-pos)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> gp-0 gspot-normal quad)) + (vector-copy! s4-0 (-> gp-0 gspot-normal)) (when (not (find-ground gp-0 a1-1 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f))) - (set! (-> gp-0 gspot-pos quad) (-> s5-0 quad)) - (set! (-> gp-0 gspot-normal quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 gspot-pos) s5-0) + (vector-copy! (-> gp-0 gspot-normal) s4-0) ) ) ) @@ -2248,7 +2250,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-11 quad)) + (vector-copy! (-> a0-3 target-pos) v1-11) ) 0 (nav-enemy-travel-post) @@ -2296,7 +2298,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.05)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! dp-bipedal-turret-jump-on-start-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -2449,7 +2451,7 @@ (a1-2 (-> self move-dest)) (f0-0 (-> v1-14 extra-nav-sphere w)) ) - (set! (-> v1-14 extra-nav-sphere quad) (-> a1-2 quad)) + (vector-copy! (-> v1-14 extra-nav-sphere) a1-2) (set! (-> v1-14 extra-nav-sphere w) f0-0) ) 0 @@ -2486,7 +2488,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! dp-bipedal-turret-jump-off-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -2504,7 +2506,7 @@ (suspend) (nav-enemy-falling-post) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -2519,8 +2521,8 @@ (defun trajectory-prediction ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float) (arg6 float)) (let ((s2-0 (new 'stack-no-clear 'inline-array 'vector 6))) - (set! (-> s2-0 0 quad) (-> arg3 quad)) - (set! (-> s2-0 1 quad) (-> arg4 quad)) + (vector-copy! (-> s2-0 0) arg3) + (vector-copy! (-> s2-0 1) arg4) (vector-! (-> s2-0 5) (-> s2-0 0) arg1) (set! (-> s2-0 2 x) (vector-length (-> s2-0 5))) (vector-normalize! (-> s2-0 5) 1.0) @@ -2671,10 +2673,12 @@ ) (defmethod go-idle ((this dp-bipedal)) + "Go to an idle state." (go (method-of-object this de-ambush)) ) (defmethod go-hostile ((this dp-bipedal)) + "Go to the hostile state, actively trying to attack the target." (cond ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> this enemy-flags))) (nav-enemy-method-174 this) @@ -2701,6 +2705,7 @@ ) (defmethod knocked-anim ((this dp-bipedal) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (set! (-> arg0 anim-speed) 1.5) @@ -2753,6 +2758,7 @@ ) (defmethod knocked-land-anim ((this dp-bipedal) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.1)) @@ -2807,7 +2813,8 @@ ) ) -(defmethod enemy-method-123 ((this dp-bipedal)) +(defmethod allow-ragdoll? ((this dp-bipedal)) + "Can this enemy ragdoll now?" (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) (= (-> this hit-points) 0.0) @@ -2820,15 +2827,17 @@ ;; WARN: Return type mismatch float vs vector. (defmethod ragdoll-spawn! ((this dp-bipedal) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." (let ((t9-0 (method-of-type nav-enemy ragdoll-spawn!))) (t9-0 this arg0 arg1) ) (let ((v1-2 (handle->process (-> this ragdoll-proc)))) (the-as vector (when v1-2 (set-vector! (-> (the-as ragdoll-proc v1-2) ragdoll gravity) 0.0 -1.4 0.0 1.0) - (set! (-> (the-as ragdoll-proc v1-2) ragdoll gravity-target quad) - (-> (the-as ragdoll-proc v1-2) ragdoll gravity quad) - ) + (vector-copy! + (-> (the-as ragdoll-proc v1-2) ragdoll gravity-target) + (-> (the-as ragdoll-proc v1-2) ragdoll gravity) + ) (set! (-> (the-as ragdoll-proc v1-2) ragdoll maximum-stretch) 0.8) ) ) @@ -2860,6 +2869,7 @@ ) (defmethod enemy-common-post ((this dp-bipedal)) + "Common implementation of post. Runs ja-post." (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) (if (or (logtest? (-> this fact enemy-options) (enemy-option user0)) (and (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -2891,8 +2901,8 @@ (when (< 1 (the-as int (-> this focus aware))) (let ((s5-2 (handle->process (-> this focus handle)))) (when s5-2 - (set! (-> this focus-bullseye quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-2) 0) quad)) + (vector-copy! (-> this focus-bullseye) (get-trans (the-as process-focusable s5-2) 3)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s5-2) 0)) (vector-! (-> this focus-dir) (-> this focus-pos) (-> this root trans)) (vector-normalize! (-> this focus-dir) 1.0) (-> this focus-dir) @@ -2945,7 +2955,8 @@ (none) ) -(defmethod enemy-method-108 ((this dp-bipedal) (arg0 process-focusable)) +(defmethod should-flee-from? ((this dp-bipedal) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (focus-test? arg0 invulnerable) (and (focus-test? arg0 mech) (< (vector-vector-distance (-> this root trans) (get-trans arg0 1)) 28672.0)) ) @@ -2971,6 +2982,7 @@ ) (defmethod go-gun-dark-2-stretch ((this dp-bipedal)) + "Go to the gun-dark-2-stretch state." (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -2992,6 +3004,7 @@ ) (defmethod event-handler ((this dp-bipedal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked 'hit-flinch) (logclear! (-> this mask) (process-mask actor-pause)) @@ -3003,7 +3016,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -3043,6 +3056,7 @@ ) (defmethod coin-flip? ((this dp-bipedal)) + "Return #t half the time, #f the other." #f ) @@ -3068,13 +3082,14 @@ ) (defmethod init-enemy! ((this dp-bipedal)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dp-bipedal" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *dp-bipedal-nav-enemy-info*) + (setup-enemy! this *dp-bipedal-nav-enemy-info*) (set! (-> this state-stack) (new 'process 'boxed-array state 4)) (set! (-> this state-stack length) 0) (set! (-> this root pause-adjust-distance) 163840.0) @@ -3166,7 +3181,7 @@ (let ((a2-1 (new 'stack-no-clear 'array 'collide-shape 1)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> self entity extra trans quad)) + (vector-copy! a1-1 (-> self entity extra trans)) (set! (-> a1-1 w) 24576.0) (zero? (fill-actor-list-for-box *actor-hash* a1-1 a2-1 1)) ) @@ -3174,7 +3189,7 @@ (let ((s5-0 (-> self entity)) (gp-2 (new 'stack-no-clear 'enemy-init-by-other-params)) ) - (set! (-> gp-2 trans quad) (-> s5-0 extra trans quad)) + (vector-copy! (-> gp-2 trans) (-> s5-0 extra trans)) (quaternion-copy! (-> gp-2 quat) (-> s5-0 quat)) (set! (-> gp-2 entity) s5-0) (set! (-> gp-2 directed?) #f) @@ -3211,7 +3226,8 @@ ) (defmethod init-from-entity! ((this dp-bipedal-spawner) (arg0 entity-actor)) - (set! (-> this spawn-pos quad) (-> arg0 extra trans quad)) + "Set up a newly created process from the entity that created it." + (vector-copy! (-> this spawn-pos) (-> arg0 extra trans)) (set! (-> this spawn-timer) 0) (set! (-> this enemies-spawned) 0) (set! (-> this enemies-to-spawn) diff --git a/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc b/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc index e0d64babc78..c92a34804b2 100644 --- a/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc +++ b/goal_src/jak3/levels/common/enemy/darkprec/neo-wasp.gc @@ -23,7 +23,7 @@ ) (defmethod init-proj-settings! ((this neo-wasp-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'neo-wasp-shot) (set! (-> this max-speed) 491520.0) (set! (-> this move) metalhead-shot-move) @@ -158,34 +158,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 101580.8 - :knocked-hard-vy-lo 60620.8 - :knocked-hard-vy-hi 95027.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 24.8) + :knocked-hard-vy-lo (meters 14.8) + :knocked-hard-vy-hi (meters 23.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -200,6 +200,7 @@ (set! (-> *neo-wasp-enemy-info* fact-defaults) *fact-info-neo-wasp-defaults*) (defmethod event-handler ((this neo-wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -211,7 +212,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -230,6 +231,7 @@ ) (defmethod knocked-handler ((this neo-wasp) (arg0 vector)) + "Called when this enemy is knocked." (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type explode-or-darkjak)) @@ -265,7 +267,8 @@ ) ) -(defmethod go-idle2 ((this neo-wasp)) +(defmethod go-fallback-init ((this neo-wasp)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) (go (method-of-object this ambush)) (go (method-of-object this notice)) @@ -273,19 +276,23 @@ ) (defmethod go-hostile ((this neo-wasp)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this hostile)) ) -(defmethod go-best-state ((this neo-wasp)) +(defmethod go-state-for-focused ((this neo-wasp)) + "Go to the appropriate state for the current awareness of the focused process." (go-hostile this) ) (defmethod go-dormant ((this neo-wasp)) + "Go to the dormant state. This disables drawing/processing/collision, and runs no logic." (send-event (ppointer->process (-> this parent)) 'going-dormant) ((method-of-type hover-enemy go-dormant) this) ) (defmethod enemy-common-post ((this neo-wasp)) + "Common implementation of post. Runs ja-post." (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this on-screen-timer)) ) @@ -507,7 +514,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> self focus-pos quad)) + (vector-copy! v1-4 (-> self focus-pos)) (+! (-> v1-4 y) (-> self attack-miss-dist-curr)) (vector-! gp-0 v1-4 a0-2) ) @@ -552,7 +559,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> self focus-pos quad)) + (vector-copy! v1-4 (-> self focus-pos)) (+! (-> v1-4 y) (-> self attack-miss-dist-curr)) (vector-! gp-0 v1-4 a0-2) ) @@ -630,11 +637,11 @@ (spawn-debris self) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -678,7 +685,7 @@ (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-1 hit-xz-reaction) 0.95) (set! (-> a1-1 hit-y-reaction) 0.6) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> this incoming attack-position quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> this incoming attack-position)) (vector-! (-> a1-1 fountain-rand-transv-lo) (-> a1-1 fountain-rand-transv-lo) (-> this root transv)) (debris-spawn this a1-1 *neo-wasp-debris-params* (the-as process-drawable #f)) ) @@ -704,7 +711,7 @@ (and (time-elapsed? (-> this on-screen-timer) (seconds 0.5)) (< (vector-vector-distance s4-1 (-> this focus-pos)) 225280.0) (and (< (fabs (vector-x-angle s3-2)) 7281.778) - (enemy-method-104 this (-> this focus-pos) 4551.1113) + (pointing-toward? this (-> this focus-pos) 4551.1113) (should-check-los? (-> this los) (seconds 0.4)) ) ) @@ -719,6 +726,7 @@ ) (defmethod knocked-anim ((this neo-wasp) (arg0 enemy-knocked-info)) + "start the knocked animation." (cond ((rnd-chance? this 0.5) (set! (-> this knocked-anim) 10) @@ -743,6 +751,7 @@ ) (defmethod knocked-land-anim ((this neo-wasp) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -755,16 +764,19 @@ #t ) -(defmethod enemy-method-88 ((this neo-wasp) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this neo-wasp) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" (-> this root) (>= (-> arg0 on-surface-count) 1) ) -(defmethod within-gspot-range? ((this neo-wasp)) +(defmethod invalid-height? ((this neo-wasp)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) (defmethod go-die ((this neo-wasp)) + "Go to the die state." (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) (go (method-of-object this die-now)) @@ -860,14 +872,14 @@ (set! sv-152 (matrix-with-scale->quaternion (new 'stack-no-clear 'quaternion) (-> arg1 bone transform))) (set! sv-156 (new 'stack-no-clear 'quaternion)) (let ((v1-3 (new 'stack-no-clear 'vector))) - (set! (-> v1-3 quad) (-> arg0 root scale quad)) + (vector-copy! v1-3 (-> arg0 root scale)) (set! sv-160 v1-3) ) (vector-float*! sv-160 sv-160 arg4) (quaternion-rotate-local-x! sv-156 sv-152 (the-as float arg2)) (quaternion->matrix sv-148 sv-156) (scale-matrix! sv-148 sv-160 sv-148) - (set! (-> sv-148 trans quad) (-> sv-144 quad)) + (vector-copy! (-> sv-148 trans) sv-144) (spawn-from-mat (-> arg0 engine-part) sv-148) (none) ) @@ -897,6 +909,7 @@ ) (defmethod init-enemy-collision! ((this neo-wasp)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1057,8 +1070,9 @@ ) (defmethod init-enemy! ((this neo-wasp)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) - (when (= (status-of-level-and-borrows *level* 'precura #f) 'active) + (when (= (level-status? *level* 'precura #f) 'active) (let ((v1-4 (level-get *level* 'lprenme))) (if (and v1-4 (= (-> v1-4 status) 'active)) (set! (-> this level) v1-4) @@ -1066,7 +1080,7 @@ ) ) (hover-enemy-method-170 this) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (hover-enemy-method-176 this) (set! (-> this mech-flame-texture-id) (the-as sound-id (lookup-texture-id-by-name "mech-flame" (the-as string #f))) @@ -1232,7 +1246,7 @@ (let ((s5-0 (-> self entity)) (gp-0 (new 'stack-no-clear 'enemy-init-by-other-params)) ) - (set! (-> gp-0 trans quad) (-> s5-0 extra trans quad)) + (vector-copy! (-> gp-0 trans) (-> s5-0 extra trans)) (quaternion-copy! (-> gp-0 quat) (-> s5-0 quat)) (set! (-> gp-0 entity) s5-0) (set! (-> gp-0 directed?) #f) @@ -1269,7 +1283,8 @@ ) (defmethod init-from-entity! ((this neo-wasp-spawner) (arg0 entity-actor)) - (set! (-> this spawn-pos quad) (-> arg0 extra trans quad)) + "Set up a newly created process from the entity that created it." + (vector-copy! (-> this spawn-pos) (-> arg0 extra trans)) (set-time! (-> this spawn-timer)) (set! (-> this enemies-spawned) 0) (set! (-> this enemies-to-spawn) diff --git a/goal_src/jak3/levels/common/enemy/flitter.gc b/goal_src/jak3/levels/common/enemy/flitter.gc index d364c3d3194..0b0627682f4 100644 --- a/goal_src/jak3/levels/common/enemy/flitter.gc +++ b/goal_src/jak3/levels/common/enemy/flitter.gc @@ -514,34 +514,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 275251.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 67.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -596,6 +596,7 @@ ) (defmethod knocked-anim ((this flitter) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (let ((a0-2 (-> this skel root-channel 0))) @@ -638,6 +639,7 @@ ) (defmethod knocked-land-anim ((this flitter) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type blue-shot)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -660,7 +662,7 @@ ) (defmethod go-stare2 ((this flitter)) - (if (and (= (-> this focus aware) (enemy-aware ea2)) + (if (and (= (-> this focus aware) (enemy-aware aware2)) (not (nav-enemy-method-174 this)) (not (and (-> this next-state) (= (-> this next-state name) 'pacing))) ) @@ -691,11 +693,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 1412 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1412)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1412)) ) ) @@ -755,11 +757,11 @@ (when (< (-> self base-height) (-> self root trans y)) (cond ((logtest? (-> *part-group-id-table* 257 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 257)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 257)) ) ) @@ -814,7 +816,8 @@ :post nav-enemy-falling-post ) -(defmethod enemy-method-108 ((this flitter) (arg0 process-focusable)) +(defmethod should-flee-from? ((this flitter) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (focus-test? arg0 mech) ) @@ -831,18 +834,18 @@ (f30-0 (vector-length s4-1)) ) (cond - ((enemy-method-108 this (the-as process-focusable s3-0)) + ((should-flee-from? this (the-as process-focusable s3-0)) (go-flee this) ) ((and (< f30-0 32768.0) (not (flitter-method-194 this (the-as process-focusable s3-0)))) (go (method-of-object this circling)) ) ((< f30-0 (-> this enemy-info notice-nav-radius)) - (set! (-> this target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> this target-pos) s5-1) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s4-1 quad)) + (vector-copy! s3-1 s4-1) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> this root transv quad)) + (vector-copy! s5-2 (-> this root transv)) (vector-normalize! s5-2 f30-0) (if (>= (vector-dot s3-1 s5-2) 0.98) (go (method-of-object this attack)) @@ -851,7 +854,7 @@ ) ) ((< f30-0 32768.0) - (set! (-> this target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> this target-pos) s5-1) ) ((or (time-elapsed? (-> this last-change-dir) (-> this change-dir-time)) (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) @@ -875,7 +878,7 @@ ) (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-0 s5-1 s3-2) - (set! (-> this target-pos quad) (-> s2-0 quad)) + (vector-copy! (-> this target-pos) s2-0) ) ) ) @@ -943,7 +946,7 @@ (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) (until #f - (when (not (enemy-method-105 self 2730.6667 #t)) + (when (not (pointing-toward-focus? self 2730.6667 #t)) (let ((v1-5 self)) (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) ) @@ -952,7 +955,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! flitter-turn-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -1002,12 +1005,12 @@ :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) (if gp-0 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-11 (-> self focus aware))) (cond - ((= v1-11 (enemy-aware ea3)) + ((= v1-11 (enemy-aware hostile)) (cond ((when gp-0 (let* ((gp-1 self) @@ -1030,7 +1033,7 @@ ) ) ) - ((= v1-11 (enemy-aware ea2)) + ((= v1-11 (enemy-aware aware2)) (go-stare self) ) ((>= 1 (the-as int v1-11)) @@ -1087,7 +1090,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1169,7 +1172,7 @@ ) (logclear! (-> s5-1 flags) (nav-state-flag directional-mode)) (logior! (-> s5-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> s5-1 target-pos quad) (-> v1-10 quad)) + (vector-copy! (-> s5-1 target-pos) v1-10) ) 0 (set! s5-2 (-> self attack-pos)) @@ -1218,7 +1221,7 @@ (ja :num! (seek!)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-travel-post ) @@ -1241,6 +1244,7 @@ ) (defmethod init-enemy-collision! ((this flitter)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1293,12 +1297,13 @@ ;; WARN: Return type mismatch connection-minimap vs none. (defmethod init-enemy! ((this flitter)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flitter-nav-enemy-info*) + (setup-enemy! this *flitter-nav-enemy-info*) (set! (-> this move-angle) 10922.667) (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) #t diff --git a/goal_src/jak3/levels/common/enemy/grunt.gc b/goal_src/jak3/levels/common/enemy/grunt.gc index b64d3970e80..88d9a0bc627 100644 --- a/goal_src/jak3/levels/common/enemy/grunt.gc +++ b/goal_src/jak3/levels/common/enemy/grunt.gc @@ -370,34 +370,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 73728.0 - :knocked-red-vy-hi 114688.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 18) + :knocked-red-vy-hi (meters 28) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 10625.897) :scale (new 'static 'vector :x 0.6399 :y 0.6399 :z 0.6399) @@ -866,6 +866,7 @@ (set! (-> *grunt-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod event-handler ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -877,7 +878,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -923,7 +924,8 @@ ) ) -(defmethod go-ambush-delay ((this grunt)) +(defmethod go-ambush ((this grunt)) + "May go to ambush-delay first, if set in the res-lump." (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -985,7 +987,8 @@ ) ) :code (behavior () - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) @@ -1008,13 +1011,14 @@ :post nav-enemy-falling-post ) -(defmethod go-directed2 ((this grunt)) +(defmethod go-next-state-auto ((this grunt)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type nav-enemy go-directed2) this) + ((method-of-type nav-enemy go-next-state-auto) this) ) ) ) @@ -1064,7 +1068,7 @@ ) (if (< v1-1 (-> a0-0 curve num-cverts)) (set! (-> self jumping-ambush-path-pt) v1-1) - (go-best-state self) + (go-state-for-focused self) ) ) (until #f @@ -1116,7 +1120,7 @@ ) 0 (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + (s5-0 (rnd-time-frame self 1 (seconds 0.027))) ) (let ((v1-37 (ja-group))) (if (not (and v1-37 (= v1-37 gp-0))) @@ -1140,7 +1144,7 @@ ) 0 (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (s5-1 (rnd-time-frame self (seconds 0.007) (seconds 0.017))) ) (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -1173,7 +1177,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -1268,7 +1272,7 @@ ) ) (sound-play "grunt-warn") - (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + (set! (-> self next-warn-time) (+ gp-0 (rnd-time-frame self (seconds 1) (seconds 1.2)))) ) ) ) @@ -1335,7 +1339,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-10 *game-info*) (v0-1 (+ (-> v1-10 attack-id) 1)) ) @@ -1351,7 +1355,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (when (logtest? (-> self enemy-flags) (enemy-flag victory)) (logclear! (-> self enemy-flags) (enemy-flag victory)) (sound-play "grunt-hit") @@ -1438,7 +1442,7 @@ (if (not gp-0) (go-stare self) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-21 *game-info*) @@ -1475,7 +1479,7 @@ (until (ja-done? 0) (let ((a0-9 (handle->process (-> self focus handle)))) (if a0-9 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-9) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-9) 0)) ) ) (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) @@ -1733,7 +1737,7 @@ (defstate knocked-recover (grunt) :virtual #t :code (behavior () - (local-vars (v1-49 object)) + (local-vars (v1-49 symbol)) (ja-channel-push! 1 0) (let ((gp-0 (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll))) (when gp-0 @@ -1755,7 +1759,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1763,6 +1767,7 @@ ) (defmethod ragdoll-settled? ((this grunt)) + "Has the ragdoll stopped moving?" (let ((t9-0 (method-of-type nav-enemy ragdoll-settled?))) (and (t9-0 this) (or (= (-> this root gspot-pos y) -40959590.0) (< (- (-> this root trans y) (-> this root gspot-pos y)) 4096.0) @@ -1789,6 +1794,7 @@ ) (defmethod init-enemy-collision! ((this grunt)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1888,16 +1894,18 @@ ) (defmethod coin-flip? ((this grunt)) + "Return #t half the time, #f the other." #f ) (defmethod init-enemy! ((this grunt)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) @@ -1945,7 +1953,8 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod go-idle2 ((this grunt)) +(defmethod go-fallback-init ((this grunt)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (-> this fact enemy-options) (enemy-option user9)) (go (method-of-object this wait-for-focus)) (go (method-of-object this idle)) diff --git a/goal_src/jak3/levels/common/enemy/hover/hover-enemy.gc b/goal_src/jak3/levels/common/enemy/hover/hover-enemy.gc index 81f5bdebe1e..c5eed276741 100644 --- a/goal_src/jak3/levels/common/enemy/hover/hover-enemy.gc +++ b/goal_src/jak3/levels/common/enemy/hover/hover-enemy.gc @@ -10,6 +10,7 @@ (define *current-hover-id* 0) (defmethod event-handler ((this hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked 'hit-flinch) (logclear! (-> this mask) (process-mask actor-pause)) @@ -21,7 +22,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -135,7 +136,7 @@ ) ) (set! (-> self main-joint-movement 0 quad) (-> a0-18 quad)) - (set! (-> self main-joint-movement 1 quad) (-> v1-22 quad)) + (vector-copy! (-> self main-joint-movement 1) v1-22) ) 0 (hover-enemy-method-163 self) @@ -178,7 +179,7 @@ ) ) (else - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) ) ) ) @@ -227,6 +228,7 @@ ) (defmethod coin-flip? ((this hover-enemy)) + "Return #t half the time, #f the other." #f ) @@ -240,7 +242,8 @@ (none) ) -(defmethod is-pfoc-in-mesh? ((this hover-enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this hover-enemy) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (not arg1) (set! arg1 (get-trans arg0 1)) ) @@ -270,11 +273,12 @@ ) (defmethod enemy-common-post ((this hover-enemy)) + "Common implementation of post. Runs ja-post." (hover-enemy-method-169 this) (when (< 1 (the-as int (-> this focus aware))) (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-0) 1) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s5-0) 1)) (los-control-method-9 (-> this los) (the-as process-focusable s5-0) @@ -313,7 +317,7 @@ (set! sv-600 (new 'stack-no-clear 'collide-query)) (set! sv-604 (-> this draw shadow-ctrl settings shadow-dir)) (set! sv-608 (the-as float 61440.0)) - (set! (-> sv-600 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> sv-600 start-pos) (-> this root trans)) (vector-normalize-copy! (-> sv-600 move-dist) sv-604 sv-608) (let ((v1-19 sv-600)) (set! (-> v1-19 radius) 819.2) @@ -462,7 +466,7 @@ :virtual #t :trans (behavior () (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (< 1 (the-as int (-> self focus aware)))) - (go-ambush-delay self) + (go-ambush self) ) ) ) @@ -498,14 +502,14 @@ ) ) (if s1-0 - (set! (-> self focus-pos quad) (-> (get-trans s1-0 3) quad)) - (set! (-> self focus-pos quad) (-> s0-0 quad)) + (vector-copy! (-> self focus-pos) (get-trans s1-0 3)) + (vector-copy! (-> self focus-pos) s0-0) ) (vector-! s2-0 (-> self focus-pos) (-> s4-0 trans)) (vector-normalize! s2-0 1.0) (set-vector! (-> self rotation-vec) (- (vector-x-angle s2-0)) (vector-y-angle s2-0) 0.0 0.0) (hover-enemy-method-167 self) - (set! (-> s4-0 trans quad) (-> s5-0 quad)) + (vector-copy! (-> s4-0 trans) s5-0) (if (logtest? (-> self fact enemy-options) (enemy-option user0)) (vector-! (-> s4-0 trans) @@ -544,12 +548,12 @@ :event enemy-event-handler :enter (behavior () (if (or (zero? (-> self path)) (logtest? (-> self path flags) (path-control-flag not-found))) - (set! (-> self dest-pos quad) (-> self entity extra trans quad)) + (vector-copy! (-> self dest-pos) (-> self entity extra trans)) (get-point-in-path! (-> self path) (-> self dest-pos) 1.0 'interp) ) (let ((gp-0 (new 'stack-no-clear 'vector))) (if (hover-nav-control-method-24 (-> self hover) gp-0 (-> self dest-pos)) - (set! (-> self dest-pos quad) (-> gp-0 quad)) + (vector-copy! (-> self dest-pos) gp-0) ) ) (hover-enemy-method-175 self) @@ -635,7 +639,7 @@ ((>= 1 (the-as int v1-3)) (go-virtual land-approach) ) - ((and (= v1-3 (enemy-aware ea3)) (get-focus! self)) + ((and (= v1-3 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) ) @@ -677,7 +681,7 @@ (when (logtest? (-> gp-0 status) (collide-status on-surface)) (when (not (-> self hit-surface?)) (set! (-> self hit-surface?) #t) - (set! (-> self surface-normal quad) (-> gp-0 poly-normal quad)) + (vector-copy! (-> self surface-normal) (-> gp-0 poly-normal)) ) ) (when (and (-> self hit-surface?) (= (-> self hit-points) 0.0)) @@ -768,7 +772,7 @@ ) ) ) - (set! (-> self flying-death-spin-axis quad) (-> *y-vector* quad)) + (vector-copy! (-> self flying-death-spin-axis) *y-vector*) (vector-rotate-x! (-> self flying-death-spin-axis) (-> self flying-death-spin-axis) @@ -898,24 +902,27 @@ (none) ) -(defmethod get-enemy-aware ((this hover-enemy) (arg0 enemy-aware)) +(defmethod modify-awareness ((this hover-enemy) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." arg0 ) (defmethod go-idle ((this hover-enemy)) + "Go to an idle state." (go (method-of-object this land-approach)) ) -(defmethod go-best-state ((this hover-enemy)) +(defmethod go-state-for-focused ((this hover-enemy)) + "Go to the appropriate state for the current awareness of the focused process." (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware ea3)) (get-focus! this)) + ((and (= s5-0 (enemy-aware hostile)) (get-focus! this)) (go-hostile this) ) ((>= 1 (the-as int s5-0)) (go (method-of-object this land-approach)) ) - ((= s5-0 (enemy-aware ea4)) + ((= s5-0 (enemy-aware flee)) (go-flee this) ) (else @@ -961,12 +968,14 @@ (none) ) -(defmethod within-gspot-range? ((this hover-enemy)) +(defmethod invalid-height? ((this hover-enemy)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) ;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this hover-enemy)) + "Has the ragdoll stopped moving?" #f ) @@ -1044,9 +1053,10 @@ (set! (-> t0-2 y) (-> v1-22 hover-y-offset)) (set! (-> t0-2 z) (-> v1-22 hover-xz-offset)) (set! (-> t0-2 w) 1.0) - (set! (-> s5-0 quad) - (-> (the-as vector (t9-7 a0-10 a1-5 a2-4 a3-2 t0-2 (the-as (pointer res-tag) #f) *res-static-buf*)) quad) - ) + (vector-copy! + s5-0 + (the-as vector (t9-7 a0-10 a1-5 a2-4 a3-2 t0-2 (the-as (pointer res-tag) #f) *res-static-buf*)) + ) ) (set! (-> this restart-fly-anims) #t) (set! (-> this knocked-fall-dist) 2048.0) diff --git a/goal_src/jak3/levels/common/enemy/hover/hover-formation.gc b/goal_src/jak3/levels/common/enemy/hover/hover-formation.gc index 503088e4568..e2157bc86f6 100644 --- a/goal_src/jak3/levels/common/enemy/hover/hover-formation.gc +++ b/goal_src/jak3/levels/common/enemy/hover/hover-formation.gc @@ -83,9 +83,9 @@ (let ((s2-0 (get-trans (the-as process-focusable s1-0) 3)) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> (get-trans (the-as process-focusable s1-0) 1) quad)) + (vector-copy! s3-1 (get-trans (the-as process-focusable s1-0) 1)) (if (= (-> s3-1 y) -40959590.0) - (set! (-> s3-1 quad) (-> s2-0 quad)) + (vector-copy! s3-1 s2-0) (+! (-> s3-1 y) 6144.0) ) (cond @@ -99,14 +99,14 @@ (set! (-> arg0 y) (-> s3-1 y)) ) (else - (set! (-> arg0 quad) (-> s3-1 quad)) + (vector-copy! arg0 s3-1) (set! (-> arg0 w) 1.0) ) ) ) ) (else - (set! (-> arg0 quad) (-> this center quad)) + (vector-copy! arg0 (-> this center)) ) ) ) @@ -164,9 +164,10 @@ (displacement-between-points-at-percent-normalized! s5-0 s4-2 f30-1) (forward-up-nopitch->inv-matrix (-> this zone-to-world) s4-2 *up-vector*) ) - (set! (-> this zone-to-world trans quad) - (-> (get-point-at-percent-along-path! s5-0 (new 'stack-no-clear 'vector) f30-1 'interp) quad) - ) + (vector-copy! + (-> this zone-to-world trans) + (get-point-at-percent-along-path! s5-0 (new 'stack-no-clear 'vector) f30-1 'interp) + ) ) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) @@ -176,7 +177,7 @@ (vector-normalize! s4-5 1.0) (forward-up-nopitch->inv-matrix (-> this zone-to-world) s4-5 *up-vector*) ) - (set! (-> this zone-to-world trans quad) (-> s5-1 quad)) + (vector-copy! (-> this zone-to-world trans) s5-1) ) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) @@ -193,9 +194,10 @@ ) (forward-up-nopitch->inv-matrix (-> this zone-to-world) a1-16 *up-vector*) ) - (set! (-> this zone-to-world trans quad) - (-> (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) quad) - ) + (vector-copy! + (-> this zone-to-world trans) + (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) + ) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) ) @@ -215,11 +217,11 @@ (let ((s5-5 (vector-! (new 'stack-no-clear 'vector) s4-7 (-> this zone-to-world trans))) (s4-8 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-8 quad) (-> this zone-to-world trans quad)) + (vector-copy! s4-8 (-> this zone-to-world trans)) (set! (-> s5-5 y) 0.0) (vector-normalize! s5-5 1.0) (forward-up-nopitch->inv-matrix (-> this zone-to-world) s5-5 *up-vector*) - (set! (-> this zone-to-world trans quad) (-> s4-8 quad)) + (vector-copy! (-> this zone-to-world trans) s4-8) ) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) @@ -340,7 +342,7 @@ (let ((s4-0 (hover-formation-control-method-15 this (new 'stack-no-clear 'vector) arg0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> this zone-to-world trans quad)) + (vector-copy! s3-0 (-> this zone-to-world trans)) (let ((s5-1 (new 'stack-no-clear 'collide-query)) (gp-1 (new 'stack-no-clear 'collide-query)) ) @@ -351,14 +353,14 @@ (vector+! s4-0 s4-0 s2-0) (vector-normalize! (vector-! s2-0 s3-0 s4-0) (+ 204.8 f30-0)) (vector-! s3-0 s3-0 s2-0) - (set! (-> s5-1 start-pos quad) (-> s4-0 quad)) + (vector-copy! (-> s5-1 start-pos) s4-0) (vector-! (-> s5-1 move-dist) s3-0 (-> s5-1 start-pos)) (let ((f0-2 (vector-length (-> s5-1 move-dist)))) (if (< 81920.0 f0-2) (vector-float*! (-> s5-1 move-dist) (-> s5-1 move-dist) (/ 81920.0 f0-2)) ) ) - (set! (-> gp-1 start-pos quad) (-> s3-0 quad)) + (vector-copy! (-> gp-1 start-pos) s3-0) (vector-! (-> gp-1 move-dist) s4-0 (-> gp-1 start-pos)) (let ((f0-4 (vector-length (-> gp-1 move-dist)))) (if (< 81920.0 f0-4) @@ -419,7 +421,7 @@ ) (cond (a0-8 - (set! (-> s5-0 actor-position s4-0 quad) (-> (get-trans (the-as process-focusable a0-8) 3) quad)) + (vector-copy! (-> s5-0 actor-position s4-0) (get-trans (the-as process-focusable a0-8) 3)) (set! (-> s5-0 actor-valid? s4-0) #t) (+! (-> s5-0 count) 1) ) @@ -438,17 +440,17 @@ ) (let ((s2-0 (new 'stack-no-clear 'vector))) (when (and (> (-> s5-0 count) 0) (hover-formation-control-method-10 this s2-0 (the-as vector (-> this offset)) 0.0)) - (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) + (vector-copy! (-> s5-0 pos-table s4-1) s2-0) (+! s4-1 1) ) (let ((s1-0 0)) (while (not (or (>= s1-0 s3-2) (>= s4-1 (-> s5-0 count)))) (when (hover-formation-control-method-10 this s2-0 (-> this offset (logand (+ s1-0 1) 1)) f28-0) - (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) + (vector-copy! (-> s5-0 pos-table s4-1) s2-0) (+! s4-1 1) ) (when (hover-formation-control-method-10 this s2-0 (-> this offset (logand (+ s1-0 1) 1)) (- f28-0)) - (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) + (vector-copy! (-> s5-0 pos-table s4-1) s2-0) (+! s4-1 1) ) (+! f28-0 f30-0) @@ -601,7 +603,7 @@ (set! (-> a0-2 w) 1.0) (vector+! a1-2 (the-as vector v1-3) a0-2) ) - (set! (-> gp-0 center quad) (-> gp-0 entity extra trans quad)) + (vector-copy! (-> gp-0 center) (-> gp-0 entity extra trans)) (quaternion-copy! (-> gp-0 focus-quat) *unity-quaternion*) (let ((v1-6 (res-lump-value (-> gp-0 entity) 'options uint128 :time -1000000000.0))) (if (logtest? (the-as int v1-6) 256) @@ -623,7 +625,7 @@ (let ((f0-6 (res-lump-float (-> gp-0 entity) 'rotoffset))) (matrix-rotate-y! (-> gp-0 zone-to-world) f0-6) ) - (set! (-> gp-0 zone-to-world trans quad) (-> gp-0 center quad)) + (vector-copy! (-> gp-0 zone-to-world trans) (-> gp-0 center)) (matrix-inverse-of-rot-trans! (-> gp-0 world-to-zone) (-> gp-0 zone-to-world)) (set! (-> gp-0 formation-type) (res-lump-value (-> gp-0 entity) @@ -742,6 +744,7 @@ ) (defmethod init-from-entity! ((this hover-formation) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-32 vector)) (stack-size-set! (-> this main-thread) 32) (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) diff --git a/goal_src/jak3/levels/common/enemy/hover/hover-nav-control.gc b/goal_src/jak3/levels/common/enemy/hover/hover-nav-control.gc index 8cc17b42424..6b23fca95bf 100644 --- a/goal_src/jak3/levels/common/enemy/hover/hover-nav-control.gc +++ b/goal_src/jak3/levels/common/enemy/hover/hover-nav-control.gc @@ -504,7 +504,7 @@ (set! (-> v1-2 next) #f) ) (set! (-> gp-0 curve-matrix rvec quad) (-> arg1 quad)) - (set! (-> gp-0 curve-matrix uvec quad) (-> arg2 quad)) + (vector-copy! (-> gp-0 curve-matrix uvec) arg2) (set! (-> gp-0 pos-index 0) arg3) (set! (-> gp-0 pos-index 1) arg4) (set! (-> gp-0 dist) @@ -862,7 +862,7 @@ (when (or (= gp-0 -1) (< f0-0 f30-0)) (set! gp-0 s0-0) (set! f30-0 f0-0) - (set! (-> arg1 quad) (-> sv-32 quad)) + (vector-copy! arg1 sv-32) ) ) ) @@ -895,7 +895,7 @@ (when (or (= sv-32 -1) (< f0-2 (the-as float sv-24))) (set! sv-32 s3-0) (set! sv-24 f0-2) - (set! (-> arg1 quad) (-> sv-64 quad)) + (vector-copy! arg1 sv-64) ) ) ) @@ -914,7 +914,7 @@ ) (cond ((>= (-> this edge a0-2 radius) f0-0) - (set! (-> arg1 quad) (-> arg0 quad)) + (vector-copy! arg1 arg0) ) (else (vector-float*! v1-3 v1-3 (/ (-> this edge a0-2 radius) f0-0)) @@ -1060,8 +1060,8 @@ (defmethod probe-background ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) - (set! (-> gp-0 start-pos quad) (-> arg0 quad)) - (set! (-> gp-0 move-dist quad) (-> v1-1 quad)) + (vector-copy! (-> gp-0 start-pos) arg0) + (vector-copy! (-> gp-0 move-dist) v1-1) (vector-normalize! (-> gp-0 move-dist) (fmin (vector-length v1-1) (fmax 16384.0 (* 2.0 arg2)))) ) (let ((v1-5 gp-0)) @@ -1200,10 +1200,10 @@ (set! sv-280 v1-32) ) (set! sv-288 0) - (set! (-> sv-276 0 quad) (-> arg0 quad)) - (set! (-> sv-276 1 quad) (-> s2-0 quad)) - (set! (-> sv-276 2 quad) (-> s3-0 quad)) - (set! (-> sv-276 3 quad) (-> arg1 quad)) + (vector-copy! (-> sv-276 0) arg0) + (vector-copy! (-> sv-276 1) s2-0) + (vector-copy! (-> sv-276 2) s3-0) + (vector-copy! (-> sv-276 3) arg1) (dotimes (s4-1 4) (let ((s3-2 (+ s4-1 1))) (while (< s3-2 4) @@ -1219,7 +1219,7 @@ (f0-4 (-> sv-52 sv-56 radius)) ) (while (begin (label cfg-30) (< v1-50 4)) - (set! (-> sv-280 sv-288 quad) (-> sv-276 v1-50 quad)) + (vector-copy! (-> sv-280 sv-288) (-> sv-276 v1-50)) (set! sv-288 (+ sv-288 1)) (+! v1-50 1) (while (< v1-50 4) @@ -1235,7 +1235,7 @@ ) (label cfg-32) (when (< sv-288 4) - (set! (-> sv-280 sv-288 quad) (-> sv-276 3 quad)) + (vector-copy! (-> sv-280 sv-288) (-> sv-276 3)) (set! sv-288 (+ sv-288 1)) ) (if (< 1 sv-288) @@ -1283,7 +1283,7 @@ (vector-float*! (-> v1-0 curve-matrix fvec) (-> a2-0 curve-matrix trans) -1.0) ) (arg0 - (set! (-> v1-0 curve-matrix fvec quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 curve-matrix fvec) arg0) ) (else (vector-! (-> v1-0 curve-matrix fvec) (-> v1-0 curve-matrix uvec) (the-as vector (-> v1-0 curve-matrix))) @@ -1404,11 +1404,12 @@ ) (defmethod hover-nav-control-method-10 ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) - (set! (-> this dest-pos quad) (-> arg0 quad)) + (vector-copy! (-> this dest-pos) arg0) (cond ;; og:preserve-this condition has been changed from `arg2` because some places call this method with #t as arg2 ((and (!= arg2 #t) arg2) ; arg2 - (set! (-> this root transv quad) (-> arg2 quad)) + (vector-copy! (-> this dest-vel) arg2) + (vector-copy! (-> this root transv) arg2) ) (else (set! (-> this dest-vel quad) (the-as uint128 0)) @@ -1497,7 +1498,7 @@ (let ((a3-9 (get-point-in-path! s5-1 (new 'stack-no-clear 'vector) (the float (+ s3-1 1)) 'interp))) (nav-network-method-23 (-> this nav) (-> this path-info) s1-3 a3-9 -1 -1) ) - (set! (-> s2-4 quad) (-> s1-3 quad)) + (vector-copy! s2-4 s1-3) ) (+! s3-1 -1) ) diff --git a/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc b/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc index 79d5192a234..db5b42aa448 100644 --- a/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc +++ b/goal_src/jak3/levels/common/enemy/hover/robo-hover.gc @@ -373,34 +373,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.135 :y 0.9566 :z 0.258 :w 1296.2657) :scale (new 'static 'vector :x 1.3 :y 1.3 :z 1.3) @@ -664,6 +664,7 @@ ;; WARN: Return type mismatch int vs sound-id. (defmethod play-damage-sound ((this robo-hover) (arg0 int)) + "Pick and play the damage/death sound." (if (and (zero? arg0) (logtest? (penetrate enemy-yellow-shot) (-> this incoming penetrate-using))) (sound-play "hover-take-hit") (call-parent-method this arg0) @@ -767,7 +768,7 @@ :trans (behavior () (exit-ambush?) (if (or (los-control-method-11 (-> self los) (seconds 0.2)) - (not (enemy-method-104 self (-> self focus-pos) 9102.223)) + (not (pointing-toward? self (-> self focus-pos) 9102.223)) ) (go-virtual ambush-fly) ) @@ -864,7 +865,7 @@ ) ) ) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-6) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-6) 0)) ) (+! (-> gp-0 y) -20480.0) (hover-nav-control-method-12 (-> self hover) gp-0) @@ -955,7 +956,7 @@ ) :trans (behavior () (if (or (los-control-method-11 (-> self los) (seconds 0.2)) - (not (enemy-method-104 self (-> self focus-pos) 9102.223)) + (not (pointing-toward? self (-> self focus-pos) 9102.223)) ) (go-hostile self) ) @@ -977,7 +978,7 @@ (set! (-> self gun-blend) (seek-ease (-> self gun-blend) 1.0 (* 3.0 (seconds-per-frame)) 0.9 (* 0.4 (seconds-per-frame))) ) - (set! (-> self aim-position quad) (-> self focus-pos quad)) + (vector-copy! (-> self aim-position) (-> self focus-pos)) (set! (-> self aim-position y) (+ 6144.0 (-> self attack-miss-dist-curr) (-> self aim-position y))) (hover-enemy-hostile-post) ) @@ -1036,7 +1037,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1059,17 +1060,17 @@ (let ((a1-3 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-3 hit-xz-reaction) 0.95) (set! (-> a1-3 hit-y-reaction) 0.6) - (set! (-> a1-3 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> a1-3 fountain-rand-transv-lo) (-> self incoming attack-position)) (debris-spawn self a1-3 *robo-hover-debris-params* (the-as process-drawable #f)) ) (let ((v1-16 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node robo-hover-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-16 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-16) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-16 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-16) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -1089,6 +1090,7 @@ ) (defmethod event-handler ((this robo-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v1-15 enemy-flag)) (case arg2 (('attack-invinc) @@ -1168,7 +1170,7 @@ (get-focus! this) (< f30-0 225280.0) (and (< (fabs (vector-x-angle s5-2)) 3640.889) - (enemy-method-104 this (-> this focus-pos) 5461.3335) + (pointing-toward? this (-> this focus-pos) 5461.3335) (should-check-los? (-> this los) (seconds 0.4)) ) ) @@ -1203,6 +1205,7 @@ ) (defmethod knocked-handler ((this robo-hover) (arg0 vector)) + "Called when this enemy is knocked." (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type explode-or-darkjak)) @@ -1251,6 +1254,7 @@ ) (defmethod enemy-common-post ((this robo-hover)) + "Common implementation of post. Runs ja-post." ((method-of-type hover-enemy enemy-common-post) this) 0 (none) @@ -1276,7 +1280,7 @@ (-> arg0 scale) (quaternion-rotate-local-z! (the-as quaternion sv-208) a1-3 sv-192) (quaternion->matrix s5-0 (the-as quaternion sv-208)) - (set! (-> s2-1 quad) (-> arg0 root scale quad)) + (vector-copy! s2-1 (-> arg0 root scale)) (scale-matrix! s5-0 s2-1 s5-0) (let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat))) (t9-6 vector-inv-orient-by-quat!) @@ -1318,7 +1322,7 @@ ) ) ) - (set! (-> s5-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 trans) s4-0) (spawn-from-mat (-> arg0 engine-part) s5-0) (let ((f0-17 (lerp-scale 0.4 1.0 f28-0 1638.4 f30-0))) (sound-play-by-name @@ -1426,6 +1430,7 @@ ) (defmethod go-die ((this robo-hover)) + "Go to the die state." (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) (go (method-of-object this explode)) @@ -1450,6 +1455,7 @@ ) (defmethod init-enemy-collision! ((this robo-hover)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1584,6 +1590,7 @@ ) (defmethod coin-flip? ((this robo-hover)) + "Return #t half the time, #f the other." #f ) @@ -1660,9 +1667,10 @@ ) (defmethod init-enemy! ((this robo-hover)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) (hover-enemy-method-170 this) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (hover-enemy-method-176 this) (set! (-> this neck up) (the-as uint 1)) (set! (-> this neck nose) (the-as uint 2)) diff --git a/goal_src/jak3/levels/common/enemy/kg-grunt.gc b/goal_src/jak3/levels/common/enemy/kg-grunt.gc index f2e5e218fb3..85a52cab478 100644 --- a/goal_src/jak3/levels/common/enemy/kg-grunt.gc +++ b/goal_src/jak3/levels/common/enemy/kg-grunt.gc @@ -601,34 +601,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -671,6 +671,7 @@ ) (defmethod event-handler ((this kg-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -682,7 +683,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -695,7 +696,7 @@ (let ((s5-1 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> s5-1 hit-xz-reaction) 0.95) (set! (-> s5-1 hit-y-reaction) 0.6) - (set! (-> s5-1 fountain-rand-transv-lo quad) (-> this incoming attack-position quad)) + (vector-copy! (-> s5-1 fountain-rand-transv-lo) (-> this incoming attack-position)) (dotimes (s4-0 8) (let ((v1-32 (rand-vu-int-count-excluding 18 (the-as int (-> this debris-mask))))) (logior! (-> this debris-mask) (ash 1 v1-32)) @@ -731,7 +732,8 @@ ) ) -(defmethod go-ambush-delay ((this kg-grunt)) +(defmethod go-ambush ((this kg-grunt)) + "May go to ambush-delay first, if set in the res-lump." (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -763,17 +765,17 @@ (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-1 hit-xz-reaction) 0.95) (set! (-> a1-1 hit-y-reaction) 0.6) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> self incoming attack-position)) (debris-spawn self a1-1 *kg-grunt-debris-params* (the-as process-drawable #f)) ) (let ((v1-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node kg-grunt-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 220 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-6 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-6) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 220)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-6 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-6) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 220)) ) ) @@ -832,7 +834,8 @@ ) ) :code (behavior () - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) @@ -855,13 +858,14 @@ :post nav-enemy-falling-post ) -(defmethod go-directed2 ((this kg-grunt)) +(defmethod go-next-state-auto ((this kg-grunt)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type nav-enemy go-directed2) this) + ((method-of-type nav-enemy go-next-state-auto) this) ) ) ) @@ -911,7 +915,7 @@ ) (if (and (nonzero? a0-0) (< v1-1 (-> a0-0 curve num-cverts))) (set! (-> self jumping-ambush-path-pt) v1-1) - (go-best-state self) + (go-state-for-focused self) ) ) (until #f @@ -966,7 +970,7 @@ ) 0 (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + (s5-0 (rnd-time-frame self 1 (seconds 0.027))) ) (let ((v1-37 (ja-group))) (if (not (and v1-37 (= v1-37 gp-0))) @@ -990,7 +994,7 @@ ) 0 (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (s5-1 (rnd-time-frame self (seconds 0.007) (seconds 0.017))) ) (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -1023,7 +1027,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -1118,7 +1122,7 @@ ) ) (sound-play "kg-grunt-warn") - (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + (set! (-> self next-warn-time) (+ gp-0 (rnd-time-frame self (seconds 1) (seconds 1.2)))) ) ) ) @@ -1185,7 +1189,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-10 *game-info*) (v0-1 (+ (-> v1-10 attack-id) 1)) ) @@ -1201,7 +1205,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (when (logtest? (-> self enemy-flags) (enemy-flag victory)) (logclear! (-> self enemy-flags) (enemy-flag victory)) (sound-play "kg-grunt-hit") @@ -1288,7 +1292,7 @@ (if (not gp-0) (go-stare self) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-21 *game-info*) @@ -1325,7 +1329,7 @@ (until (ja-done? 0) (let ((a0-9 (handle->process (-> self focus handle)))) (if a0-9 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-9) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-9) 0)) ) ) (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) @@ -1534,6 +1538,7 @@ ) (defmethod knocked-anim ((this kg-grunt) (arg0 enemy-knocked-info)) + "start the knocked animation." (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) @@ -1553,7 +1558,7 @@ (set! a2-3 (logior v1-2 8)) ) ) - (let ((s4-0 (enemy-method-131 this 4 a2-3))) + (let ((s4-0 (rnd-int-excluding-masked this 4 a2-3))) (set! (-> *kg-grunt-global-info* prev-yellow-hit-anim-index) s4-0) (set! (-> this yellow-hit-anim) (-> *kg-grunt-global-info* yellow-hit-anim s4-0)) (let ((v1-11 (rnd-int this 3))) @@ -1615,7 +1620,7 @@ (set! a2-5 (logior v1-42 7)) ) ) - (let ((v1-46 (enemy-method-131 this 6 a2-5))) + (let ((v1-46 (rnd-int-excluding-masked this 6 a2-5))) (set! (-> *kg-grunt-global-info* prev-blue-hit-anim-index) v1-46) (set! (-> this blue-hit-anim) (-> *kg-grunt-global-info* blue-hit-anim v1-46)) ) @@ -1626,7 +1631,7 @@ (set! a2-6 (logior a2-6 4)) ) ) - (set! (-> this use-charge-anim-index) (enemy-method-131 this 3 a2-6)) + (set! (-> this use-charge-anim-index) (rnd-int-excluding-masked this 3 a2-6)) ) ) (let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index))) @@ -1655,7 +1660,7 @@ (set! s4-3 (logior s4-3 4)) ) ) - (set! v1-72 (enemy-method-131 this 3 s4-3)) + (set! v1-72 (rnd-int-excluding-masked this 3 s4-3)) ) ) ) @@ -1678,6 +1683,7 @@ ) (defmethod knocked-land-anim ((this kg-grunt) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this incoming knocked-type) (knocked-type blue-shot)) #f @@ -1704,6 +1710,7 @@ ) (defmethod go-die ((this kg-grunt)) + "Go to the die state." (go (method-of-object this explode)) ) @@ -1772,6 +1779,7 @@ ) (defmethod init-enemy-collision! ((this kg-grunt)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1871,6 +1879,7 @@ ) (defmethod init-enemy! ((this kg-grunt)) + "Typical place for shared init code. Runs from entity or process style init." (if (and (-> this entity) (= (-> this entity extra level name) 'factoryd)) (initialize-skeleton this @@ -1884,7 +1893,7 @@ ) ) (logior! (-> this mask) (process-mask kg-robot)) - (init-enemy-defaults! this (get-nav-enemy-info this)) + (setup-enemy! this (get-nav-enemy-info this)) (let ((v1-17 (-> this neck))) (set! (-> v1-17 up) (the-as uint 1)) (set! (-> v1-17 nose) (the-as uint 2)) @@ -1918,7 +1927,8 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod go-idle2 ((this kg-grunt)) +(defmethod go-fallback-init ((this kg-grunt)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (-> this fact enemy-options) (enemy-option user9)) (go (method-of-object this wait-for-focus)) (go (method-of-object this idle)) diff --git a/goal_src/jak3/levels/common/enemy/mantis.gc b/goal_src/jak3/levels/common/enemy/mantis.gc index 6ba03c0c9b2..e24e85322c8 100644 --- a/goal_src/jak3/levels/common/enemy/mantis.gc +++ b/goal_src/jak3/levels/common/enemy/mantis.gc @@ -360,34 +360,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.3 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 106496.0 - :knocked-red-vxz-hi 106496.0 - :knocked-red-vy-lo 55296.0 - :knocked-red-vy-hi 55296.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 26) + :knocked-red-vxz-hi (meters 26) + :knocked-red-vy-lo (meters 13.5) + :knocked-red-vy-hi (meters 13.5) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9971 :y -0.0748 :z -0.0134 :w 36483.785) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -677,7 +677,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.2)) (until #f - (let ((gp-0 (set-reaction-time! self (seconds 0.01) (seconds 0.017)))) + (let ((gp-0 (rnd-time-frame self (seconds 0.01) (seconds 0.017)))) (dotimes (s5-0 gp-0) (ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -745,15 +745,15 @@ ) :code (behavior () (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> self root trans quad)) + (vector-copy! v1-0 (-> self root trans)) (+! (-> v1-0 y) -18841.6) (cond ((logtest? (-> *part-group-id-table* 1406 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-0 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1406)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-0 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1406)) ) ) @@ -768,7 +768,7 @@ (a1-7 (-> self root trans)) (f0-6 (-> v1-45 extra-nav-sphere w)) ) - (set! (-> v1-45 extra-nav-sphere quad) (-> a1-7 quad)) + (vector-copy! (-> v1-45 extra-nav-sphere) a1-7) (set! (-> v1-45 extra-nav-sphere w) f0-6) ) 0 @@ -960,7 +960,7 @@ (when (and (and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) - (and (time-elapsed? (-> self attack-timer) (seconds 5)) (enemy-method-104 self s4-0 8192.0) (< f30-1 32768.0)) + (and (time-elapsed? (-> self attack-timer) (seconds 5)) (pointing-toward? self s4-0 8192.0) (< f30-1 32768.0)) ) (cond ((< 24576.0 f30-1) @@ -974,7 +974,7 @@ ) ) ) - (if (enemy-method-104 self s4-0 10922.667) + (if (pointing-toward? self s4-0 10922.667) (mantis-method-199 self) ) (if (logtest? (-> self flags) (mantis-flag tracked)) @@ -1024,7 +1024,7 @@ (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) ) 0 - (dotimes (gp-0 (set-reaction-time! self 1 (seconds 0.007))) + (dotimes (gp-0 (rnd-time-frame self 1 (seconds 0.007))) (ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1085,7 +1085,7 @@ ) (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-21 target-pos quad) (-> v1-70 quad)) + (vector-copy! (-> a0-21 target-pos) v1-70) ) 0 ) @@ -1100,7 +1100,7 @@ (set! (-> v1-73 nav callback-info) (-> v1-73 enemy-info callback-info)) ) 0 - (dotimes (gp-2 (set-reaction-time! self (seconds 0.01) (seconds 0.017))) + (dotimes (gp-2 (rnd-time-frame self (seconds 0.01) (seconds 0.017))) (ja-no-eval :group! mantis-run0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1262,7 +1262,7 @@ (defbehavior mantis-roll-post mantis () (let ((gp-0 (new 'stack-no-clear 'collide-query))) - (if (set-ground-pat! self gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f)) + (if (find-ground-and-set-pat! self gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f)) (set! (-> self root trans y) (-> gp-0 best-other-tri intersect y)) ) ) @@ -1399,7 +1399,7 @@ ) ) ) - (dotimes (gp-1 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (dotimes (gp-1 (rnd-time-frame self (seconds 0.007) (seconds 0.015))) (ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1413,7 +1413,8 @@ :post nav-enemy-face-focus-post ) -(defmethod go-ambush-delay ((this mantis)) +(defmethod go-ambush ((this mantis)) + "May go to ambush-delay first, if set in the res-lump." (let ((s5-0 (new 'stack-no-clear 'collide-query))) (if (enemy-above-ground? this s5-0 (-> this root trans) (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> this base-height) (-> s5-0 best-other-tri intersect y)) @@ -1448,6 +1449,7 @@ ) (defmethod event-handler ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('track) (if (and (-> arg3 param 0) (time-elapsed? (-> this track-timer) (seconds 0.5))) @@ -1472,7 +1474,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1519,14 +1521,17 @@ ) ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod set-ground-pat! ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) +(defmethod find-ground-and-set-pat! ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) + "Figure out what ground we're standing on and update the ground-pat. + Usually this will be done automatically by the collision system. + This method should be called after manually repositioning an enemy." (the-as pat-surface (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4 (the-as process #f)) (set! (-> this root ground-pat) (-> arg0 best-other-tri pat)) (when (time-elapsed? (-> this gspot-timer) (seconds 0.2)) (let ((a1-2 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-2 start-pos quad) (-> this root gspot-pos quad)) + (vector-copy! (-> a1-2 start-pos) (-> this root gspot-pos)) (+! (-> a1-2 start-pos y) 2048.0) (set-vector! (-> a1-2 move-dist) 0.0 -6144.0 0.0 0.0) (let ((v1-10 a1-2)) @@ -1585,7 +1590,7 @@ ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *up-vector* quad)) + (vector-copy! s4-0 *up-vector*) (let ((s3-0 (new 'stack-no-clear 'quaternion))) (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this gspot-normal) 10922.667) (vector-orient-by-quat! s4-0 s4-0 s3-0) @@ -1609,7 +1614,7 @@ (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-0 heading quad)) + (vector-copy! a1-1 (-> a2-0 heading)) (t9-0 this a1-1) ) 0 @@ -1618,6 +1623,7 @@ ;; WARN: Return type mismatch vector vs none. (defmethod enemy-common-post ((this mantis)) + "Common implementation of post. Runs ja-post." (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) @@ -1626,7 +1632,7 @@ (let ((a0-4 (handle->process (-> this focus handle)))) (set! s5-0 (when a0-4 (set! s5-0 (-> this focus-pos)) - (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-4) 0) quad)) + (vector-copy! s5-0 (get-trans (the-as process-focusable a0-4) 0)) s5-0 ) ) @@ -1657,16 +1663,16 @@ #f ) ((let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> s3-0 quad)) + (vector-copy! a1-5 s3-0) (set! (-> a1-5 w) (-> arg0 root nav-radius)) - (add-root-sphere-to-hash! (-> arg0 nav) a1-5 1134) + (check-sphere-blocked! (-> arg0 nav) a1-5 1134) ) #f ) (else (let ((a1-6 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-6 start-pos quad) (-> arg1 trans quad)) - (set! (-> a1-6 move-dist quad) (-> arg2 quad)) + (vector-copy! (-> a1-6 start-pos) (-> arg1 trans)) + (vector-copy! (-> a1-6 move-dist) arg2) (let ((v1-14 a1-6)) (set! (-> v1-14 radius) 2048.0) (set! (-> v1-14 collide-with) (-> arg1 root-prim prim-core collide-with)) @@ -1849,8 +1855,8 @@ (when (< 0.8 (/ (vector-length s2-0) arg2)) (vector+! s5-1 s3-0 s2-0) (let ((a1-7 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-7 start-pos quad) (-> s3-0 quad)) - (set! (-> a1-7 move-dist quad) (-> s2-0 quad)) + (vector-copy! (-> a1-7 start-pos) s3-0) + (vector-copy! (-> a1-7 move-dist) s2-0) (+! (-> a1-7 start-pos y) (* 1.5 (-> arg0 enemy-info jump-height-min))) (let ((v1-17 a1-7)) (set! (-> v1-17 radius) 409.6) @@ -1864,8 +1870,8 @@ ) (when (< (fill-and-probe-using-line-sphere *collide-cache* a1-7) 0.0) (set! (-> s5-1 w) (-> arg0 root nav-radius)) - (when (not (add-root-sphere-to-hash! (-> arg0 nav) s5-1 #x10046e)) - (set! (-> arg4 quad) (-> s5-1 quad)) + (when (not (check-sphere-blocked! (-> arg0 nav) s5-1 #x10046e)) + (vector-copy! arg4 s5-1) (return arg4) v0-3 ) @@ -1894,6 +1900,7 @@ ) (defmethod jump-wind-up-anim ((this mantis) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump start-anim))) (a0-4 (-> this skel root-channel 0)) @@ -1908,6 +1915,7 @@ ) (defmethod jump-in-air-anim ((this mantis) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -1922,38 +1930,40 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-101 ((this mantis) (arg0 int) (arg1 enemy-jump-info)) - (let ((v1-0 arg0)) - (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) - (let ((a0-4 this)) - (when (logtest? (enemy-flag ef38) (-> a0-4 enemy-flags)) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 dest-pos) (-> this root trans)))) - (vector-normalize! s5-1 1.0) - (let ((v1-5 (-> this jump direction))) - (cond - ((zero? v1-5) - ) - ((= v1-5 1) - (vector-negate! s5-1 s5-1) - ) - ((= v1-5 2) - (vector-rotate-y! s5-1 s5-1 -16384.0) - ) - ((= v1-5 3) - (vector-rotate-y! s5-1 s5-1 16384.0) - ) +(defmethod adjust-heading-for-jump ((this mantis) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Can be overriden. Yaw the enemy in response to an ongoing jump." + (case arg0 + (((jump-stage init) (jump-stage winding-up) (jump-stage takeoff) (jump-stage in-air)) + (let ((a0-4 this)) + (when (logtest? (enemy-flag ef38) (-> a0-4 enemy-flags)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 dest-pos) (-> this root trans)))) + (vector-normalize! s5-1 1.0) + (let ((v1-5 (-> this jump direction))) + (cond + ((zero? v1-5) ) - ) - (seek-toward-heading-vec! (-> this root) s5-1 (-> this nav max-rotation-rate) (seconds 0.02)) - ) - ) - ) - ) + ((= v1-5 1) + (vector-negate! s5-1 s5-1) + ) + ((= v1-5 2) + (vector-rotate-y! s5-1 s5-1 -16384.0) + ) + ((= v1-5 3) + (vector-rotate-y! s5-1 s5-1 16384.0) + ) + ) + ) + (seek-toward-heading-vec! (-> this root) s5-1 (-> this nav max-rotation-rate) (seconds 0.02)) + ) + ) + ) + ) ) (none) ) (defmethod jump-land-anim ((this mantis) (arg0 enemy-jump-info)) + "Play the landing anim" (cond ((zero? (-> this jump land-anim)) #f @@ -1975,11 +1985,13 @@ ) (defmethod coin-flip? ((this mantis)) + "Return #t half the time, #f the other." #f ) ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod init-enemy-collision! ((this mantis)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2082,15 +2094,16 @@ ) (defmethod init-enemy! ((this mantis)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mantis" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *mantis-nav-enemy-info*) + (setup-enemy! this *mantis-nav-enemy-info*) (set! (-> this flags) (mantis-flag)) - (set! (-> this my-up-vector quad) (-> *y-vector* quad)) - (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> this my-up-vector) *y-vector*) + (vector-copy! (-> this gspot-normal) *y-vector*) (set! (-> this gspot-timer) 0) (set! (-> this attack-timer) (+ (current-time) (seconds -5))) (set! (-> this track-timer) 0) diff --git a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc index a0782167177..6fd1be01b89 100644 --- a/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc +++ b/goal_src/jak3/levels/common/enemy/prebot-eco-creature.gc @@ -288,34 +288,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 16384.0 - :knocked-red-vxz-hi 40960.0 - :knocked-red-vy-lo 49152.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 20480.0 - :knocked-blue-vxz-hi 28672.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 40960.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 4) + :knocked-red-vxz-hi (meters 10) + :knocked-red-vy-lo (meters 12) + :knocked-red-vy-hi (meters 15) + :knocked-blue-vxz-lo (meters 5) + :knocked-blue-vxz-hi (meters 7) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 10) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd player-list) @@ -688,28 +688,33 @@ (set! (-> *prebot-large-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod go-ambush-delay ((this prebot-large-eco-creature)) +(defmethod go-ambush ((this prebot-large-eco-creature)) + "May go to ambush-delay first, if set in the res-lump." (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) - (go-idle2 this) - ((method-of-type nav-enemy go-ambush-delay) this) + (go-fallback-init this) + ((method-of-type nav-enemy go-ambush) this) ) ) (defmethod go-dormant ((this prebot-large-eco-creature)) + "Go to the dormant state. This disables drawing/processing/collision, and runs no logic." (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) - (go-idle2 this) + (go-fallback-init this) ((method-of-type nav-enemy go-dormant) this) ) ) (defmethod go-dormant-aware ((this prebot-large-eco-creature)) + "Go to the dormat aware state. + Similar to dormant, drawing/collision are disabled, but enemies can exit dormant-aware." (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) - (go-idle2 this) + (go-fallback-init this) ((method-of-type nav-enemy go-dormant-aware) this) ) ) (defmethod event-handler ((this prebot-large-eco-creature) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (let ((s4-0 (the-as object (-> arg3 param 1)))) @@ -780,10 +785,12 @@ ) (defmethod coin-flip? ((this prebot-large-eco-creature)) + "Return #t half the time, #f the other." #f ) (defmethod enemy-common-post ((this prebot-large-eco-creature)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -945,7 +952,7 @@ (logclear! (-> self flags) (eco-creature-flag ecf1)) (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-9 *game-info*) (a0-5 (+ (-> v1-9 attack-id) 1)) @@ -977,7 +984,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) nav-state (if (logtest? (-> self enemy-flags) (enemy-flag victory)) (logior! (-> self flags) (eco-creature-flag ecf1)) @@ -1026,7 +1033,7 @@ (t9-0) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1187,7 +1194,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1203,7 +1210,7 @@ :trans (behavior () (ja :num! (seek!)) (if (ja-done? 0) - (go-best-state self) + (go-state-for-focused self) ) ) :code sleep-code @@ -1295,13 +1302,13 @@ (set! (-> self which-trajectory) 0) (set! (-> self x-rotate) 0.0) (set! (-> self y-rotate) 0.0) - (set! (-> self root trans quad) (-> (the-as vector s5-0) quad)) - (set! (-> self launch-pos quad) (-> (the-as vector s5-0) quad)) - (set! (-> self launch quad) (-> (the-as vector s5-0) quad)) + (vector-copy! (-> self root trans) (the-as vector s5-0)) + (vector-copy! (-> self launch-pos) (the-as vector s5-0)) + (vector-copy! (-> self launch) (the-as vector s5-0)) (let* ((v1-36 (-> self nav)) (f0-25 (-> v1-36 extra-nav-sphere w)) ) - (set! (-> v1-36 extra-nav-sphere quad) (-> (the-as vector gp-0) quad)) + (vector-copy! (-> v1-36 extra-nav-sphere) (the-as vector gp-0)) (set! (-> v1-36 extra-nav-sphere w) f0-25) ) ) @@ -1448,12 +1455,14 @@ ) ) -(defmethod go-idle2 ((this prebot-large-eco-creature)) +(defmethod go-fallback-init ((this prebot-large-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." (set! (-> this event-hook) (-> (method-of-object this fly-to-dest) event)) (go (method-of-object this fly-to-dest)) ) (defmethod init-enemy-collision! ((this prebot-large-eco-creature)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1633,12 +1642,13 @@ ) (defmethod init-enemy! ((this prebot-large-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *prebot-large-eco-creature-nav-enemy-info*) + (setup-enemy! this *prebot-large-eco-creature-nav-enemy-info*) (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) @@ -1691,8 +1701,8 @@ (let ((gp-1 (new 'stack-no-clear 'enemy-init-by-other-params))) (let ((v1-2 (new 'stack-no-clear 'vector))) (-> self root transv) - (set! (-> v1-2 quad) (-> self root trans quad)) - (set! (-> gp-1 trans quad) (-> v1-2 quad)) + (vector-copy! v1-2 (-> self root trans)) + (vector-copy! (-> gp-1 trans) v1-2) ) (quaternion-copy! (-> gp-1 quat) (-> self root quat)) (set! (-> gp-1 entity) (-> self entity)) @@ -1899,34 +1909,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 49152.0 - :knocked-red-vy-lo 57344.0 - :knocked-red-vy-hi 69632.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 40960.0 - :knocked-blue-vy-lo 20480.0 - :knocked-blue-vy-hi 53248.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 12) + :knocked-red-vy-lo (meters 14) + :knocked-red-vy-hi (meters 17) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 10) + :knocked-blue-vy-lo (meters 5) + :knocked-blue-vy-hi (meters 13) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd player-list) @@ -2400,12 +2410,14 @@ (none) ) -(defmethod go-idle2 ((this prebot-medium-eco-creature)) +(defmethod go-fallback-init ((this prebot-medium-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." (set-vector! (-> this root scale) (-> this initial-scale) (-> this initial-scale) (-> this initial-scale) 1.0) (go (method-of-object this knocked)) ) (defmethod init-enemy-collision! ((this prebot-medium-eco-creature)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2534,12 +2546,13 @@ ) (defmethod init-enemy! ((this prebot-medium-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *prebot-medium-eco-creature-nav-enemy-info*) + (setup-enemy! this *prebot-medium-eco-creature-nav-enemy-info*) (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) @@ -2654,7 +2667,7 @@ ) (set! (-> self is-top) #f) (set! (-> self is-bottom) #f) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -2797,34 +2810,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 32768.0 - :knocked-red-vxz-hi 57344.0 - :knocked-red-vy-lo 65536.0 - :knocked-red-vy-hi 77824.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 61440.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 8) + :knocked-red-vxz-hi (meters 14) + :knocked-red-vy-lo (meters 16) + :knocked-red-vy-hi (meters 19) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 15) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd player-list) @@ -3198,6 +3211,7 @@ (set! (-> *prebot-small-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod init-enemy-collision! ((this prebot-small-eco-creature)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -3326,12 +3340,13 @@ ) (defmethod init-enemy! ((this prebot-small-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *prebot-small-eco-creature-nav-enemy-info*) + (setup-enemy! this *prebot-small-eco-creature-nav-enemy-info*) (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) @@ -3385,13 +3400,15 @@ ;; WARN: Return type mismatch vector vs none. (defmethod init-enemy! ((this medium-eco-creature-launched)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) (none) ) -(defmethod go-idle2 ((this medium-eco-creature-launched)) - ((method-of-type prebot-large-eco-creature go-idle2) this) +(defmethod go-fallback-init ((this medium-eco-creature-launched)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type prebot-large-eco-creature go-fallback-init) this) ) (deftype small-eco-creature-launched (prebot-small-eco-creature) @@ -3401,13 +3418,15 @@ ;; WARN: Return type mismatch vector vs none. (defmethod init-enemy! ((this small-eco-creature-launched)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) (none) ) -(defmethod go-idle2 ((this small-eco-creature-launched)) - ((method-of-type prebot-large-eco-creature go-idle2) this) +(defmethod go-fallback-init ((this small-eco-creature-launched)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type prebot-large-eco-creature go-fallback-init) this) ) (deftype large-eco-creature (prebot-large-eco-creature) @@ -3415,12 +3434,14 @@ ) -(defmethod go-idle2 ((this large-eco-creature)) - ((method-of-type nav-enemy go-idle2) this) +(defmethod go-fallback-init ((this large-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type nav-enemy go-fallback-init) this) ) ;; WARN: Return type mismatch eco-creature-flag vs none. (defmethod init-enemy! ((this large-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (logior! (-> this flags) (eco-creature-flag ecf2)) (none) @@ -3431,12 +3452,14 @@ ) -(defmethod go-idle2 ((this medium-eco-creature)) - ((method-of-type nav-enemy go-idle2) this) +(defmethod go-fallback-init ((this medium-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type nav-enemy go-fallback-init) this) ) ;; WARN: Return type mismatch eco-creature-flag vs none. (defmethod init-enemy! ((this medium-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) (logior! (-> this flags) (eco-creature-flag ecf2)) @@ -3448,12 +3471,14 @@ ) -(defmethod go-idle2 ((this small-eco-creature)) - ((method-of-type nav-enemy go-idle2) this) +(defmethod go-fallback-init ((this small-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type nav-enemy go-fallback-init) this) ) ;; WARN: Return type mismatch eco-creature-flag vs none. (defmethod init-enemy! ((this small-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) (logior! (-> this flags) (eco-creature-flag ecf2)) diff --git a/goal_src/jak3/levels/common/enemy/roboguard.gc b/goal_src/jak3/levels/common/enemy/roboguard.gc index 657e2d4cb2e..b5e1ea3d429 100644 --- a/goal_src/jak3/levels/common/enemy/roboguard.gc +++ b/goal_src/jak3/levels/common/enemy/roboguard.gc @@ -322,34 +322,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 61440.0 - :knocked-soft-vy-lo 49152.0 - :knocked-soft-vy-hi 65536.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 73728.0 - :knocked-hard-vxz-hi 114688.0 - :knocked-hard-vy-lo 49152.0 - :knocked-hard-vy-hi 73728.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 28672.0 - :knocked-yellow-vy-lo 36864.0 - :knocked-yellow-vy-hi 4096.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 114688.0 - :knocked-red-vy-lo 53248.0 - :knocked-red-vy-hi 69632.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 20480.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 15) + :knocked-soft-vy-lo (meters 12) + :knocked-soft-vy-hi (meters 16) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 18) + :knocked-hard-vxz-hi (meters 28) + :knocked-hard-vy-lo (meters 12) + :knocked-hard-vy-hi (meters 18) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 7) + :knocked-yellow-vy-lo (meters 9) + :knocked-yellow-vy-hi (meters 1) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 28) + :knocked-red-vy-lo (meters 13) + :knocked-red-vy-hi (meters 17) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 5) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -439,6 +439,7 @@ ) (defmethod init-enemy-collision! ((this roboguard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -499,7 +500,7 @@ (let ((v1-3 (joint-node roboguard-lod0-jg chest)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (vector-copy! gp-0 (-> v1-3 bone transform fvec)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) (set! (-> gp-0 y) 0.0) (set! (-> s5-1 y) 0.0) @@ -521,7 +522,8 @@ (defbehavior roboguard-turret-code roboguard () (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! roboguard-idle-shoot0-loop-ja :num! zero) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (let ((gp-1 (lambda ((arg0 roboguard) (arg1 symbol)) (quaternion-rotate-y! (-> arg0 root quat) (-> arg0 root quat) (* 20480.0 (seconds-per-frame) (if arg1 @@ -536,7 +538,8 @@ ) (until #f (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -557,7 +560,8 @@ ) ) (when (< (fabs (-> self me-to-focus-angle)) f30-0) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (while (< (fabs (-> self me-to-focus-angle)) f30-0) (suspend) ) @@ -648,7 +652,7 @@ (defstate notice (roboguard) :virtual #t :exit (behavior () - (set! (-> self formation-position quad) (-> self root trans quad)) + (vector-copy! (-> self formation-position) (-> self root trans)) (let ((t9-0 (-> (method-of-type nav-enemy notice) exit))) (if t9-0 (t9-0) @@ -673,7 +677,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -731,7 +735,7 @@ ) (logclear! (-> a0-4 flags) (nav-state-flag directional-mode)) (logior! (-> a0-4 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-4 target-pos quad) (-> v1-8 quad)) + (vector-copy! (-> a0-4 target-pos) v1-8) ) 0 (nav-enemy-method-187 self) @@ -949,7 +953,7 @@ (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 bone transform uvec) -1.0) (let ((s5-1 (new 'stack-no-clear 'matrix))) (vector-! (-> s5-1 rvec) (-> self fire-at-pos) v1-2) - (set! (-> s5-1 uvec quad) (-> s5-1 rvec quad)) + (vector-copy! (-> s5-1 uvec) (-> s5-1 rvec)) (set! (-> s5-1 uvec y) 0.0) (vector-normalize! (-> s5-1 uvec) 1.0) (vector-normalize-copy! (-> s5-1 fvec) (-> s5-1 rvec) 1.0) @@ -992,29 +996,27 @@ ) ) (dotimes (gp-0 (- (-> self last-hit-points) (the int (-> self hit-points)))) - (let ((s5-0 (enemy-method-131 self 8 (the-as int (logior (-> self draw seg-mask) 1))))) + (let ((s5-0 (rnd-int-excluding-masked self 8 (the-as int (logior (-> self draw seg-mask) 1))))) (when (> s5-0 0) (let ((a1-2 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-2 hit-xz-reaction) 0.5) (set! (-> a1-2 hit-y-reaction) 0.3) - (set! (-> a1-2 fountain-rand-transv-lo quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> a1-2 fountain-rand-transv-lo) (-> self root root-prim prim-core world-sphere)) (let ((s3-0 (-> *roboguard-debris-array-params* (+ s5-0 -1)))) (debris-spawn self a1-2 s3-0 (the-as process-drawable #f)) (cond ((logtest? (-> *part-group-id-table* 223 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) - quad - ) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) + ) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 223)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) - quad - ) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) + ) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 223)) ) ) @@ -1045,7 +1047,7 @@ (t9-0) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1131,7 +1133,7 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> v1-14 quad) vf6) ) - (set! (-> s5-1 quad) (-> self incoming attack-direction quad)) + (vector-copy! s5-1 (-> self incoming attack-direction)) (vector-normalize-copy! (-> gp-1 fountain-rand-transv-lo) s5-1 -20480.0) (vector-normalize-copy! (-> gp-1 fountain-rand-transv-hi) s5-1 122880.0) ) @@ -1151,11 +1153,11 @@ (let ((v1-25 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node roboguard-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-25) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-25) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -1172,9 +1174,9 @@ (defmethod roboguard-method-194 ((this roboguard) (arg0 vector) (arg1 float)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> arg0 quad)) + (vector-copy! a1-1 arg0) (set! (-> a1-1 w) arg1) - (and (not (add-root-sphere-to-hash! (-> this nav) a1-1 #x100068)) + (and (not (check-sphere-blocked! (-> this nav) a1-1 #x100068)) (let ((a0-5 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) arg0))) (< (vector-x-angle a0-5) 5461.3335) ) @@ -1251,9 +1253,9 @@ ) (not (roboguard-method-194 this (-> this formation-position) 9011.2)) ) - (set! (-> this focus-formation-source quad) (-> this focus-pos quad)) + (vector-copy! (-> this focus-formation-source) (-> this focus-pos)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this formation-position) (-> this focus-formation-source))) ) (when (< 0.0 (vector-length s4-1)) @@ -1269,7 +1271,7 @@ (when (and (closest-point-on-mesh (-> this nav) s2-0 s2-0 (the-as nav-poly #f)) (roboguard-method-194 this s2-0 9011.2) ) - (set! (-> s5-0 quad) (-> s2-0 quad)) + (vector-copy! s5-0 s2-0) #t (goto cfg-26) ) @@ -1279,7 +1281,7 @@ ) (label cfg-26) (set! (-> this formation-angle-sign) (* -1.0 (-> this formation-angle-sign))) - (set! (-> this formation-position quad) (-> s5-0 quad)) + (vector-copy! (-> this formation-position) s5-0) ) ) 0 @@ -1306,6 +1308,7 @@ ) (defmethod knocked-anim ((this roboguard) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (case (-> this incoming knocked-type) (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) @@ -1335,6 +1338,7 @@ ) (defmethod knocked-land-anim ((this roboguard) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) (let ((v1-4 (-> this skel root-channel 0))) @@ -1364,6 +1368,7 @@ ;; WARN: Return type mismatch int vs penetrate. (defmethod get-penetrated-by ((this roboguard)) + "Figure out the penetrated-by mask for this process." (the-as penetrate 0) ) @@ -1371,7 +1376,9 @@ 2.0 ) -(defmethod enemy-method-109 ((this roboguard)) +(defmethod out-of-bounds? ((this roboguard)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (let ((gp-0 (-> this root)) (s3-0 (-> this nav state)) ) @@ -1379,7 +1386,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (cond ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ) (else (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) @@ -1398,6 +1405,7 @@ ) (defmethod event-handler ((this roboguard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1409,7 +1417,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1590,13 +1598,14 @@ ) (defmethod enemy-common-post ((this roboguard)) + "Common implementation of post. Runs ja-post." (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) (vector-rotate-around-y! (the-as vector (-> this upper-rotation-matrix)) (the-as vector (-> this rotation-matrix)) (-> this torso-angle) ) - (set! (-> this upper-rotation-matrix uvec quad) (-> this rotation-matrix uvec quad)) + (vector-copy! (-> this upper-rotation-matrix uvec) (-> this rotation-matrix uvec)) (vector-rotate-around-y! (-> this upper-rotation-matrix fvec) (-> this rotation-matrix fvec) @@ -1606,7 +1615,7 @@ (when (-> this update-focus-pos) (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-0) 5) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s5-0) 5)) (los-control-method-9 (-> this los) (the-as process-focusable s5-0) (-> this focus-pos) 819.2 4096.0) ) ) @@ -1629,10 +1638,12 @@ ) (defmethod coin-flip? ((this roboguard)) + "Return #t half the time, #f the other." #f ) (defmethod init-enemy! ((this roboguard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard" (the-as (pointer level) #f))) @@ -1642,7 +1653,7 @@ (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) ) - (init-enemy-defaults! this *roboguard-nav-enemy-info*) + (setup-enemy! this *roboguard-nav-enemy-info*) (init-los! (-> this los) this @@ -1663,9 +1674,9 @@ ) (cspace<-parented-transformq-joint! arg0 arg1) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> s3-0 rotation-matrix rvec quad)) + (vector-copy! s2-0 (-> s3-0 rotation-matrix rvec)) (let ((s0-0 (new 'stack-no-clear 'vector))) - (set! (-> s0-0 quad) (-> s3-0 rotation-matrix fvec quad)) + (vector-copy! s0-0 (-> s3-0 rotation-matrix fvec)) (let ((s1-0 (new 'stack-no-clear 'vector))) (set! sv-96 (-> s3-0 focus-pos)) (let* ((v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) arg0)) diff --git a/goal_src/jak3/levels/common/enemy/spyder.gc b/goal_src/jak3/levels/common/enemy/spyder.gc index f4b746fe6d6..600ace31b1a 100644 --- a/goal_src/jak3/levels/common/enemy/spyder.gc +++ b/goal_src/jak3/levels/common/enemy/spyder.gc @@ -210,34 +210,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 90112.0 - :knocked-soft-vxz-hi 131072.0 - :knocked-soft-vy-lo 114688.0 - :knocked-soft-vy-hi 155648.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 131072.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 139264.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 57344.0 - :knocked-blue-vy-hi 98304.0 + :knocked-soft-vxz-lo (meters 22) + :knocked-soft-vxz-hi (meters 32) + :knocked-soft-vy-lo (meters 28) + :knocked-soft-vy-hi (meters 38) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 32) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 34) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 14) + :knocked-blue-vy-hi (meters 24) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -278,6 +278,7 @@ (set! (-> *spyder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod event-handler ((this spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -289,7 +290,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -408,7 +409,7 @@ (vector+! s4-0 s5-0 s2-1) ) ) - (set! (-> this move-dest quad) (-> s5-0 quad)) + (vector-copy! (-> this move-dest) s5-0) (closest-point-on-mesh (-> this nav) (-> this move-dest) s4-0 (the-as nav-poly #f)) ) ) @@ -418,6 +419,7 @@ ) (defmethod knocked-anim ((this spyder) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (let ((a0-2 (-> this skel root-channel 0))) @@ -437,7 +439,7 @@ (s5-0 (new 'static 'array int64 3 17 18 19)) (s4-0 (new 'static 'array int32 4 0 0 0 0)) (a2-1 (ash 1 (-> s4-0 0))) - (v1-20 (enemy-method-131 this a1-4 a2-1)) + (v1-20 (rnd-int-excluding-masked this a1-4 a2-1)) (s5-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-20 8) (the-as int s5-0)))))) ) (set! (-> s4-0 0) v1-20) @@ -487,6 +489,7 @@ ) (defmethod knocked-land-anim ((this spyder) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (cond @@ -520,6 +523,7 @@ ) (defmethod jump-in-air-anim ((this spyder) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) (let ((v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -551,7 +555,7 @@ ) (defbehavior spyder-travel-post spyder () - (set! (-> self face-pos quad) (-> self move-dest quad)) + (vector-copy! (-> self face-pos) (-> self move-dest)) (logior! (-> self status-flags) (spyder-flag sf3)) (nav-enemy-travel-post) 0 @@ -564,7 +568,7 @@ (f30-0 (-> self nav max-rotation-rate)) ) (when gp-0 - (set! (-> self face-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self face-pos) (get-trans (the-as process-focusable gp-0) 0)) (let ((a0-4 self)) (if (logtest? (enemy-flag ef38) (-> a0-4 enemy-flags)) (seek-to-point-toward-point! @@ -607,7 +611,7 @@ (logclear! (-> this status-flags) (spyder-flag sf3)) ) (else - (set! (-> s4-1 quad) (-> s3-0 quad)) + (vector-copy! s4-1 s3-0) ) ) (set! (-> s4-1 y) 0.0) @@ -632,7 +636,7 @@ (defmethod spyder-method-196 ((this spyder) (arg0 vector)) (when (not (logtest? (-> this status-flags) (spyder-flag sf0))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *up-vector* quad)) + (vector-copy! s4-0 *up-vector*) (let ((s3-0 (new 'stack-no-clear 'quaternion))) (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this root gspot-normal) 4551.1113) (vector-orient-by-quat! s4-0 s4-0 s3-0) @@ -650,12 +654,13 @@ ) (defmethod enemy-common-post ((this spyder)) + "Common implementation of post. Runs ja-post." (spyder-method-197 this) (spyder-method-196 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (when (< 1 (the-as int (-> this focus aware))) (let ((s5-1 (handle->process (-> this focus handle)))) (when s5-1 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-1) 1) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s5-1) 1)) (los-control-method-9 (-> this los) (the-as process-focusable s5-1) @@ -762,7 +767,7 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (let ((v1-15 (new 'stack-no-clear 'vector))) - (set! (-> v1-15 quad) (-> *y-vector* quad)) + (vector-copy! v1-15 *y-vector*) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((a1-3 s3-0)) @@ -780,7 +785,7 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a1-3 quad) vf6) ) - (set! (-> s2-0 quad) (-> s3-0 quad)) + (vector-copy! s2-0 s3-0) (set! (-> s2-0 y) (-> this root trans y)) (let ((a2-10 (-> s5-0 start-pos))) (let ((a0-12 s2-0)) @@ -877,7 +882,7 @@ (let ((a0-1 (handle->process (-> self focus handle)))) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-1) 0)) (let* ((s5-0 (-> self root trans)) (f30-0 (vector-vector-distance s5-0 gp-0)) (f0-0 (vector-vector-xz-distance s5-0 (-> self move-dest))) @@ -904,7 +909,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (spyder-travel-post) @@ -958,7 +963,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> v1-0 quad)) + (vector-copy! (-> gp-0 pos) v1-0) (set! (-> gp-0 notify-handle) (process->handle this)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -996,7 +1001,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + (vector-copy! (-> v1-1 target-pos) a0-1) ) 0 (let ((v1-4 self)) @@ -1025,11 +1030,11 @@ ) ) :code (behavior () - (when (not (enemy-method-105 self 2730.6667 #t)) + (when (not (pointing-toward-focus? self 2730.6667 #t)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! spyder-patrol0-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 910.2222 #t) + (until (pointing-toward-focus? self 910.2222 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -1052,9 +1057,9 @@ (let ((a0-14 (handle->process (-> self focus handle)))) (when a0-14 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-14) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-14) 0)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> gp-0 quad)) + (vector-copy! s5-0 gp-0) (let ((f28-0 0.0)) (dotimes (s4-0 8) (let* ((f26-0 (fmin (-> self root trans y) (-> gp-0 y))) @@ -1066,7 +1071,7 @@ (vector+! s2-1 gp-0 s2-1) (set! (-> s2-1 y) f26-0) (set! (-> self fire-info 0 quad) (-> s3-0 quad)) - (set! (-> self fire-info 1 quad) (-> s2-1 quad)) + (vector-copy! (-> self fire-info 1) s2-1) ) (suspend-for (seconds 0.2) (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) @@ -1074,10 +1079,10 @@ (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) ) (let ((f28-1 (+ 12288.0 f28-0))) - (set! (-> gp-0 quad) (-> s5-0 quad)) + (vector-copy! gp-0 s5-0) (let ((a0-31 (handle->process (-> self focus handle)))) (if a0-31 - (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-31) 0) quad)) + (vector-copy! s5-0 (get-trans (the-as process-focusable a0-31) 0)) ) ) (set! f28-0 (fmax 0.0 (- f28-1 (vector-vector-distance gp-0 s5-0)))) @@ -1113,6 +1118,7 @@ ) (defmethod go-hostile ((this spyder)) + "Go to the hostile state, actively trying to attack the target." (if (and (not (logtest? (-> this status-flags) (spyder-flag sf1))) (-> this next-state) (let ((v1-5 (-> this next-state name))) @@ -1167,7 +1173,7 @@ (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-0 heading quad)) + (vector-copy! a1-1 (-> a2-0 heading)) (t9-0 this a1-1) ) 0 @@ -1175,10 +1181,12 @@ ) (defmethod coin-flip? ((this spyder)) + "Return #t half the time, #f the other." #f ) (defmethod init-enemy-collision! ((this spyder)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1287,12 +1295,13 @@ ) (defmethod init-enemy! ((this spyder)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-spyder" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *spyder-nav-enemy-info*) + (setup-enemy! this *spyder-nav-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -1306,12 +1315,12 @@ 0 (set-gravity-length (-> this root dynam) 573440.0) (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) - (set! (-> this my-up-vector quad) (-> *up-vector* quad)) + (vector-copy! (-> this my-up-vector) *up-vector*) (set! (-> this status-flags) (spyder-flag sf2)) (if (rand-vu-percent? 0.5) (logior! (-> this status-flags) (spyder-flag sf4)) ) - (set! (-> this start-pos quad) (-> this root trans quad)) + (vector-copy! (-> this start-pos) (-> this root trans)) (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "spyder-talk" :group 0 :fo-max 70) (-> this root trans) 0.0) ) diff --git a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc index 55f846aaa4b..71f71f2f5f7 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid-orig.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid-orig.gc @@ -645,34 +645,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -711,6 +711,7 @@ (set! (-> *spydroid-orig-nav-enemy-info* fact-defaults) *fact-info-spydroid-orig-defaults*) (defmethod enemy-common-post ((this spydroid-orig)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -749,7 +750,7 @@ (let ((a0-13 (-> this lightning s3-0)) (v1-28 s4-0) ) - (set! (-> a0-13 state meet data (+ (-> a0-13 state points-to-draw) -1) quad) (-> v1-28 quad)) + (vector-copy! (-> a0-13 state meet data (+ (-> a0-13 state points-to-draw) -1)) v1-28) ) (when (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) (or (= v1-33 'die-falling) (= v1-33 'explode)) @@ -812,6 +813,7 @@ ) (defmethod event-handler ((this spydroid-orig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v1-8 structure) (sv-144 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -979,7 +981,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1049,14 +1051,14 @@ ) ) (let ((v1-25 (new 'stack-no-clear 'vector))) - (set! (-> v1-25 quad) (-> self root trans quad)) + (vector-copy! v1-25 (-> self root trans)) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-25) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-25) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -1158,7 +1160,7 @@ ) 0 (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-14 *game-info*) (a0-11 (+ (-> v1-14 attack-id) 1)) ) @@ -1184,7 +1186,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) nav-state (if (logtest? (-> self enemy-flags) (enemy-flag victory)) (logior! (-> self flags) (spydroid-orig-flag sof2)) @@ -1272,7 +1274,7 @@ (t9-0) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1511,6 +1513,7 @@ ) (defmethod init-enemy-collision! ((this spydroid-orig)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1572,6 +1575,7 @@ ) (defmethod coin-flip? ((this spydroid-orig)) + "Return #t half the time, #f the other." #f ) @@ -1604,12 +1608,13 @@ ) (defmethod init-enemy! ((this spydroid-orig)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid-orig" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *spydroid-orig-nav-enemy-info*) + (setup-enemy! this *spydroid-orig-nav-enemy-info*) (dotimes (s5-1 4) (set! (-> this lightning s5-1) (new diff --git a/goal_src/jak3/levels/common/enemy/spydroid.gc b/goal_src/jak3/levels/common/enemy/spydroid.gc index 9f2f66ae212..140bb0774fb 100644 --- a/goal_src/jak3/levels/common/enemy/spydroid.gc +++ b/goal_src/jak3/levels/common/enemy/spydroid.gc @@ -281,34 +281,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -347,6 +347,7 @@ (set! (-> *spydroid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod enemy-common-post ((this spydroid)) + "Common implementation of post. Runs ja-post." (spydroid-method-236 this) ((method-of-type kg-squad-member enemy-common-post) this) 0 @@ -354,6 +355,7 @@ ) (defmethod event-handler ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('jump) (set! (-> this floor) (-> (the-as enemy-jump-info (-> arg3 param 1)) anim-speed)) @@ -371,15 +373,17 @@ (sound-play "droid-explode") (cond ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) + ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 221)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) + ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 221)) ) ) @@ -410,11 +414,11 @@ (when (not (time-elapsed? (-> self state-time) (seconds 2))) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 219)) ) ) @@ -433,7 +437,7 @@ (let ((s4-0 (handle->process (-> this focus handle))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> (the-as process-focusable s4-0) root root-prim prim-core world-sphere quad)) + (vector-copy! s3-0 (-> (the-as process-focusable s4-0) root root-prim prim-core world-sphere)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> this root trans)))) 0.0 (set! (-> s5-1 y) 0.0) @@ -496,7 +500,7 @@ (let ((v1-26 (-> self nav state))) (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-26 target-pos quad) (-> s4-2 quad)) + (vector-copy! (-> v1-26 target-pos) s4-2) ) ) ) @@ -677,7 +681,7 @@ (let ((a0-2 (the-as process-focusable (handle->process (-> self focus handle))))) (when a0-2 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (get-trans a0-2 3) quad)) + (vector-copy! gp-0 (get-trans a0-2 3)) (set! f0-0 (spydroid-method-234 self gp-0)) ) (set! f28-0 (/ f0-0 METER_LENGTH)) @@ -722,7 +726,7 @@ :event enemy-event-handler :enter (behavior () (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (logior! (-> self focus-status) (focus-status dangerous)) (nav-enemy-method-182 self) (let* ((v1-7 *game-info*) @@ -740,7 +744,7 @@ (let ((a0-2 (the-as process-focusable (handle->process (-> self focus handle))))) (when a0-2 (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (get-trans a0-2 3) quad)) + (vector-copy! s5-0 (get-trans a0-2 3)) (vector-! gp-0 s5-0 (-> self root trans)) ) ) @@ -756,12 +760,12 @@ (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> s5-2 quad)) + (vector-copy! s3-0 s5-2) (when s1-0 (set! (-> s3-0 y) 0.0) (clamp-vector-to-mesh-no-gaps (-> self nav) s4-0 s1-0 s3-0 s2-0) (if (-> s2-0 found-boundary) - (set! (-> s5-2 quad) (-> s3-0 quad)) + (vector-copy! s5-2 s3-0) ) ) ) @@ -846,7 +850,7 @@ (let ((v1-28 (-> this alert-level))) (cond ((zero? v1-28) - (enemy-method-70 this (get-target-focus (-> this squad)) (the-as enemy-aware #f)) + (set-focus! this (get-target-focus (-> this squad)) (the-as enemy-aware #f)) ) ((= v1-28 3) (if (and (zero? (get-alert-level1 (-> this squad))) (= (-> this faction-mode) 0)) @@ -880,7 +884,7 @@ (let ((a0-10 (the-as process-focusable (handle->process (-> this focus handle)))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> (get-trans a0-10 3) quad)) + (vector-copy! s5-0 (get-trans a0-10 3)) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> this root trans)))) 0.0 0.0 @@ -900,7 +904,7 @@ (let ((f30-1 (vector-dot s4-1 s3-0))) (when (or (< 0.707 f30-1) (and (< -0.7 f30-1) (< f28-0 18432.0)) (< f28-0 16384.0)) (let ((a1-6 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-6 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> a1-6 start-pos) (-> this root trans)) (+! (-> a1-6 start-pos y) 4096.0) (vector-! (-> a1-6 move-dist) s5-0 (-> a1-6 start-pos)) (let ((v1-45 a1-6)) @@ -946,13 +950,13 @@ (('panic) (let ((gp-0 (the-as traffic-danger-info (-> block param 0)))) (when (spydroid-method-237 self gp-0) - (set! (-> self move-dest quad) (-> gp-0 sphere quad)) + (vector-copy! (-> self move-dest) (-> gp-0 sphere)) (let ((a0-4 (-> self nav state)) (v1-5 (-> self move-dest)) ) (logclear! (-> a0-4 flags) (nav-state-flag directional-mode)) (logior! (-> a0-4 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-4 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> a0-4 target-pos) v1-5) ) 0 ) @@ -969,7 +973,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (set-time! (-> self state-time)) @@ -991,7 +995,7 @@ ) (when (> (get-alert-level1 (-> self squad)) 0) (spydroid-method-231 self (the-as uint 3)) - (enemy-method-70 self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) + (set-focus! self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) (go-virtual hostile) ) ) @@ -1113,6 +1117,7 @@ ) (defmethod init-enemy-collision! ((this spydroid)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1176,6 +1181,7 @@ ) (defmethod coin-flip? ((this spydroid)) + "Return #t half the time, #f the other." #f ) @@ -1270,21 +1276,10 @@ ) (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> this node-list data (-> s3-0 joint)))) - (let* ((v1-13 s4-0) - (t0-0 (-> a1-1 bone transform)) - (a0-5 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-13 rvec quad) a0-5) - (set! (-> v1-13 uvec quad) a2-0) - (set! (-> v1-13 fvec quad) a3-0) - (set! (-> v1-13 trans quad) t0-1) - ) + (matrix-copy! s4-0 (-> a1-1 bone transform)) (vector<-cspace! (-> s4-0 trans) a1-1) ) - (set! (-> s2-0 quad) (-> s3-0 offset quad)) + (vector-copy! s2-0 (-> s3-0 offset)) (set! (-> s2-0 w) 1.0) (vector-matrix*! (-> s4-0 trans) s2-0 s4-0) ) @@ -1295,12 +1290,13 @@ ) (defmethod init-enemy! ((this spydroid)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *spydroid-nav-enemy-info*) + (setup-enemy! this *spydroid-nav-enemy-info*) (call-parent-method this) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) @@ -1412,7 +1408,7 @@ (('panic) (let ((gp-0 (the-as traffic-danger-info (-> block param 0)))) (when (spydroid-method-237 self gp-0) - (set! (-> self move-dest quad) (-> gp-0 sphere quad)) + (vector-copy! (-> self move-dest) (-> gp-0 sphere)) (go-virtual search) ) ) @@ -1441,7 +1437,7 @@ ) (when (> (get-alert-level1 (-> self squad)) 0) (spydroid-method-231 self (the-as uint 3)) - (enemy-method-70 self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) + (set-focus! self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) (go-virtual hostile) ) ) @@ -1475,7 +1471,7 @@ (not (logtest? (-> (the-as process-focusable a0-18) focus-status) (focus-status disable dead inactive))) ) (let* ((s5-1 this) - (s4-0 (method-of-object s5-1 enemy-method-70)) + (s4-0 (method-of-object s5-1 set-focus!)) (s3-0 (handle->process (-> this current-enemy))) ) (s4-0 @@ -1545,7 +1541,7 @@ (defmethod go-from-behavior ((this spydroid) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else diff --git a/goal_src/jak3/levels/common/external-player-control.gc b/goal_src/jak3/levels/common/external-player-control.gc index 2a67108fcb7..9c6d82be512 100644 --- a/goal_src/jak3/levels/common/external-player-control.gc +++ b/goal_src/jak3/levels/common/external-player-control.gc @@ -32,7 +32,7 @@ (defun set-pad-world-dir ((arg0 cpad-info) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (let ((s3-0 (matrix-transpose! (new 'stack-no-clear 'matrix) (-> *target* control cam-R-w)))) (let ((s2-0 (matrix-from-two-vectors! (new 'stack-no-clear 'matrix) @@ -182,14 +182,14 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self root trans) (target-pos 0)) (set-params self arg0) (go-virtual idle) ) (defmethod set-params ((this player-controller) (arg0 player-controller-init-params)) (mem-copy! (the-as pointer (-> this params)) (the-as pointer arg0) 40) - (set! (-> this targ-pos quad) (-> arg0 targ-pos quad)) + (vector-copy! (-> this targ-pos) (-> arg0 targ-pos)) (case (-> arg0 mode) (('active) (if (not (and (-> this next-state) (= (-> this next-state name) 'active))) @@ -276,7 +276,7 @@ ) ) ) - (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self root trans) (target-pos 0)) ) :code sleep-code ) @@ -375,24 +375,24 @@ (move-to-point! (-> *target* control) gp-0) ) ) - (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self root trans) (target-pos 0)) (set-virtual-cur-pos! (-> self nav state) (target-pos 0)) (let ((a0-9 (-> self nav state)) (v1-33 (-> self targ-pos)) ) (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-pos quad) (-> v1-33 quad)) + (vector-copy! (-> a0-9 target-pos) v1-33) ) 0 (let ((gp-3 *target-controller-pad*)) (let ((a1-7 (-> self nav state))) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> a1-7 velocity quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> a1-7 velocity)) ) (let ((a0-12 (-> self nav state)) (s5-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-2 quad) (-> a0-12 heading quad)) + (vector-copy! s5-2 (-> a0-12 heading)) (let ((f30-0 (vector-vector-xz-distance (-> self root trans) (-> self targ-pos)))) (let ((f28-0 1.0)) (setup-control-pad gp-3) diff --git a/goal_src/jak3/levels/common/hvehicle/squad-control.gc b/goal_src/jak3/levels/common/hvehicle/squad-control.gc index a5dcb846239..987ec83976f 100644 --- a/goal_src/jak3/levels/common/hvehicle/squad-control.gc +++ b/goal_src/jak3/levels/common/hvehicle/squad-control.gc @@ -150,7 +150,7 @@ (defmethod probe-backgnd-collision ((this squad-control) (arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 start-pos) arg0) (vector-! (-> v1-0 move-dist) arg1 arg0) (let ((a0-4 v1-0)) (set! (-> a0-4 radius) 2048.0) @@ -180,8 +180,8 @@ ) (logior! (-> s5-1 0 flags) (squad-target-flag visible-now visible-recently visible-ever)) (set-time! (-> s5-1 0 last-seen-time)) - (set! (-> s5-1 0 position quad) (-> s4-0 1 position quad)) - (set! (-> s5-1 0 velocity quad) (-> s4-0 0 velocity quad)) + (vector-copy! (-> s5-1 0 position) (-> s4-0 1 position)) + (vector-copy! (-> s5-1 0 velocity) (-> s4-0 0 velocity)) ) (else (logclear! (-> s5-1 0 flags) (squad-target-flag visible-now)) @@ -198,8 +198,8 @@ (else (logior! (-> arg2 flags) (squad-target-flag visible-now visible-recently visible-ever)) (set-time! (-> arg2 last-seen-time)) - (set! (-> arg2 position quad) (-> (get-trans arg1 3) quad)) - (set! (-> arg2 velocity quad) (-> (get-transv arg1) quad)) + (vector-copy! (-> arg2 position) (get-trans arg1 3)) + (vector-copy! (-> arg2 velocity) (get-transv arg1)) ) ) 0 @@ -233,8 +233,8 @@ (when (logtest? (-> s4-1 0 flags) (squad-target-flag visible-recently)) (let ((s3-0 (new 'stack-no-clear 'primary-target-pos-vel))) (set-pos-vel this (the-as primary-target-pos-vel (-> s3-0 position))) - (set! (-> s4-1 0 position quad) (-> s3-0 position quad)) - (set! (-> s4-1 0 velocity quad) (-> s3-0 velocity quad)) + (vector-copy! (-> s4-1 0 position) (-> s3-0 position)) + (vector-copy! (-> s4-1 0 velocity) (-> s3-0 velocity)) ) ) (mem-copy! (the-as pointer arg2) (the-as pointer s4-1) 68) @@ -258,8 +258,8 @@ ) (when s4-0 (let ((s5-1 (new 'stack-no-clear 'primary-target-pos-vel))) - (set! (-> s5-1 position quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) - (set! (-> s5-1 velocity quad) (-> (get-transv (the-as process-focusable s4-0)) quad)) + (vector-copy! (-> s5-1 position) (get-trans (the-as process-focusable s4-0) 3)) + (vector-copy! (-> s5-1 velocity) (get-transv (the-as process-focusable s4-0))) (set! (-> s5-1 time) (the-as uint (current-time))) (if (>= (- (-> s5-1 time) (-> this primary-target-history 1 time)) (the-as uint 30)) (qmem-copy->! @@ -324,8 +324,8 @@ ) ) (when s5-0 - (set! (-> arg0 position quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) - (set! (-> arg0 velocity quad) (-> (get-transv (the-as process-focusable s5-0)) quad)) + (vector-copy! (-> arg0 position) (get-trans (the-as process-focusable s5-0) 3)) + (vector-copy! (-> arg0 velocity) (get-transv (the-as process-focusable s5-0))) ) ) arg0 @@ -461,8 +461,8 @@ #f (the-as clamp-travel-vector-to-mesh-return-info #f) ) - (set! (-> s2-0 cquery start-pos quad) (-> s5-0 quad)) - (set! (-> s2-0 cquery move-dist quad) (-> s2-0 vec0 quad)) + (vector-copy! (-> s2-0 cquery start-pos) s5-0) + (vector-copy! (-> s2-0 cquery move-dist) (-> s2-0 vec0)) (let ((v1-34 (-> s2-0 cquery))) (set! (-> v1-34 radius) 2048.0) (set! (-> v1-34 collide-with) (collide-spec backgnd)) @@ -502,7 +502,7 @@ ) ) (label cfg-19) - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) ) (none) ) @@ -517,7 +517,7 @@ ) (new 'stack-no-clear 'vector) (if a0-5 - (set! (-> arg1 quad) (-> (get-trans (the-as process-focusable a0-5) 0) quad)) + (vector-copy! arg1 (get-trans (the-as process-focusable a0-5) 0)) ) ) arg1 diff --git a/goal_src/jak3/levels/common/hvehicle/turret-control.gc b/goal_src/jak3/levels/common/hvehicle/turret-control.gc index aa16363a997..634efbf26b9 100644 --- a/goal_src/jak3/levels/common/hvehicle/turret-control.gc +++ b/goal_src/jak3/levels/common/hvehicle/turret-control.gc @@ -159,7 +159,7 @@ (defun vehicle-los-clear? ((arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 start-pos) arg0) (vector-! (-> v1-0 move-dist) arg1 arg0) (let ((a0-1 v1-0)) (set! (-> a0-1 radius) 2048.0) @@ -214,7 +214,7 @@ (a1-9 arg0) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> s5-0 quad)) + (vector-copy! (-> a2-3 trans) s5-0) (t9-5 a0-8 a1-9 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -243,7 +243,7 @@ (defun vehicle-draw-laser ((arg0 vector) (arg1 vector)) (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (camera-pos) arg0) 1.0) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> arg0 quad)) + (vector-copy! (new 'stack-no-clear 'vector) arg0) (let ((s5-1 (-> *part-id-table* 916))) (get-field-spec-by-id s5-1 (sp-field-id spt-timer)) (let* ((s4-3 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) @@ -278,18 +278,7 @@ (defmethod turret-control-method-9 ((this turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) (let ((gp-0 (new 'stack-no-clear 'turret-control-stack-var1))) (set! (-> gp-0 vec-12 x) (seconds-per-frame)) - (let* ((v1-1 (-> gp-0 mat-1)) - (a3-1 (-> arg0 node-list data (-> this info joint-index) bone transform)) - (a0-4 (-> a3-1 rvec quad)) - (a1-4 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-1 rvec quad) a0-4) - (set! (-> v1-1 uvec quad) a1-4) - (set! (-> v1-1 fvec quad) a2-1) - (set! (-> v1-1 trans quad) a3-2) - ) + (matrix-copy! (-> gp-0 mat-1) (-> arg0 node-list data (-> this info joint-index) bone transform)) (set! (-> this target-dist) (vector-vector-distance (-> gp-0 mat-1 trans) arg1)) (let ((f0-3 (/ (-> this target-dist) (-> this info shot-speed)))) (vector+float*! (-> gp-0 vec-1) arg1 arg2 f0-3) @@ -300,18 +289,7 @@ ) (vector-matrix*! (-> gp-0 vec-6) (-> this info local-pos) (-> gp-0 mat-1)) (vector-! (-> gp-0 vec-5) (-> gp-0 vec-1) (-> gp-0 vec-6)) - (let* ((v1-14 (-> gp-0 mat-1)) - (a3-3 (-> arg0 node-list data 0 bone transform)) - (a0-11 (-> a3-3 rvec quad)) - (a1-9 (-> a3-3 uvec quad)) - (a2-3 (-> a3-3 fvec quad)) - (a3-4 (-> a3-3 trans quad)) - ) - (set! (-> v1-14 rvec quad) a0-11) - (set! (-> v1-14 uvec quad) a1-9) - (set! (-> v1-14 fvec quad) a2-3) - (set! (-> v1-14 trans quad) a3-4) - ) + (matrix-copy! (-> gp-0 mat-1) (-> arg0 node-list data 0 bone transform)) (matrix-transpose! (the-as matrix (-> gp-0 vec-8)) (-> gp-0 mat-1)) (vector-rotate*! (-> gp-0 vec-3) (-> gp-0 vec-5) (the-as matrix (-> gp-0 vec-8))) (set! (-> gp-0 vec-4 y) (atan (-> gp-0 vec-3 x) (-> gp-0 vec-3 z))) @@ -359,21 +337,10 @@ ) (logior! (-> this flags) (turret-flag should-shoot)) (when (logtest? (-> this flags) (turret-flag targetting-laser)) - (let* ((v1-88 (-> gp-0 mat-1)) - (a3-5 (-> arg0 node-list data (-> this info joint-index) bone transform)) - (a0-29 (-> a3-5 rvec quad)) - (a1-20 (-> a3-5 uvec quad)) - (a2-5 (-> a3-5 fvec quad)) - (a3-6 (-> a3-5 trans quad)) - ) - (set! (-> v1-88 rvec quad) a0-29) - (set! (-> v1-88 uvec quad) a1-20) - (set! (-> v1-88 fvec quad) a2-5) - (set! (-> v1-88 trans quad) a3-6) - ) - (set! (-> gp-0 vec-7 quad) (-> gp-0 mat-1 fvec quad)) + (matrix-copy! (-> gp-0 mat-1) (-> arg0 node-list data (-> this info joint-index) bone transform)) + (vector-copy! (-> gp-0 vec-7) (-> gp-0 mat-1 fvec)) (let ((s3-2 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-2 start-pos quad) (-> gp-0 vec-6 quad)) + (vector-copy! (-> s3-2 start-pos) (-> gp-0 vec-6)) (vector-float*! (-> s3-2 move-dist) (-> gp-0 vec-7) (-> this info attack-range)) (let ((v1-93 s3-2)) (set! (-> v1-93 radius) 409.6) @@ -511,21 +478,10 @@ (logior! (-> s4-0 params options) (projectile-options po15)) (set! (-> s4-0 params vehicle-impulse-factor) (-> this info vehicle-impulse-factor)) (logior! (-> s4-0 params options) (projectile-options po16)) - (let* ((v1-31 (-> s4-0 mat0)) - (a3-0 (-> arg0 node-list data (-> this info joint-index) bone transform)) - (a0-24 (-> a3-0 rvec quad)) - (a1-8 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-31 rvec quad) a0-24) - (set! (-> v1-31 uvec quad) a1-8) - (set! (-> v1-31 fvec quad) a2-0) - (set! (-> v1-31 trans quad) a3-1) - ) + (matrix-copy! (-> s4-0 mat0) (-> arg0 node-list data (-> this info joint-index) bone transform)) (dotimes (s3-0 (-> this info barrel-count)) (vector-matrix*! (-> s4-0 vec2) (the-as vector (-> this info barrel-array s3-0)) (-> s4-0 mat0)) - (set! (-> s4-0 vec3 quad) (-> s4-0 mat0 fvec quad)) + (vector-copy! (-> s4-0 vec3) (-> s4-0 mat0 fvec)) (set! (-> s4-0 params pos quad) (-> s4-0 vec2 quad)) (vector-float*! (-> s4-0 params vel) (-> s4-0 vec3) (-> this info shot-speed)) (spawn-projectile (-> this info shot-type) (-> s4-0 params) arg0 *default-dead-pool*) diff --git a/goal_src/jak3/levels/common/hvehicle/vehicle-manager.gc b/goal_src/jak3/levels/common/hvehicle/vehicle-manager.gc index 18b0d5ff3ad..59069233899 100644 --- a/goal_src/jak3/levels/common/hvehicle/vehicle-manager.gc +++ b/goal_src/jak3/levels/common/hvehicle/vehicle-manager.gc @@ -186,9 +186,9 @@ (stack-size-set! (-> self main-thread) 16) (logior! (-> self mask) (process-mask vehicle)) (init-collision! self) - (set! (-> self root trans quad) (-> arg1 position quad)) + (vector-copy! (-> self root trans) (-> arg1 position)) (quaternion-copy! (-> self root quat) (-> arg1 rotation)) - (set! (-> self root transv quad) (-> arg1 velocity quad)) + (vector-copy! (-> self root transv) (-> arg1 velocity)) (if (logtest? (-> arg1 flags) (traffic-spawn-flags tsf6)) (vehicle-method-149 self) ) diff --git a/goal_src/jak3/levels/common/race/race-manager.gc b/goal_src/jak3/levels/common/race/race-manager.gc index 4ac5e05945f..f4721aa93ac 100644 --- a/goal_src/jak3/levels/common/race/race-manager.gc +++ b/goal_src/jak3/levels/common/race/race-manager.gc @@ -38,7 +38,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 start-pos) arg1) (vector-reset! (-> s5-0 move-dist)) (set! (-> s5-0 move-dist y) -409600.0) (let ((v1-3 s5-0)) @@ -107,7 +107,7 @@ ) (when (< f0-16 (* f1-1 f1-1)) (logior! (-> s5-0 flags) (race-mesh-flag rmf0)) - (set! (-> this finish-dir quad) (-> this start-dir quad)) + (vector-copy! (-> this finish-dir) (-> this start-dir)) (set! (-> this finish-sphere quad) (-> this start-sphere quad)) ) ) @@ -308,7 +308,7 @@ ) (set! (-> this pos) (+ (-> this lap-distance) (the float (-> this lap-count)))) ) - (set! (-> this position quad) (-> s5-0 vector 0 quad)) + (vector-copy! (-> this position) (-> s5-0 vector 0)) ) (else (logior! (-> this flags) (racer-state-flags rsf2)) @@ -348,7 +348,7 @@ (defmethod init-racer! ((this racer-state) (arg0 process-drawable)) (set! (-> this racer) (process->handle arg0)) - (set! (-> this position quad) (-> arg0 root trans quad)) + (vector-copy! (-> this position) (-> arg0 root trans)) (set! (-> this flags) (racer-state-flags rsf7)) (set! (-> this lap-count) 0) (set! (-> this lap-distance) 0.0) @@ -580,10 +580,10 @@ (let ((a0-17 (-> this racer-array (-> this i-player)))) (let ((a3-1 (handle->process (-> a0-17 racer)))) (if a3-1 - (set! (-> v1-14 rvec quad) (-> (the-as process-drawable a3-1) root trans quad)) + (vector-copy! (-> v1-14 rvec) (-> (the-as process-drawable a3-1) root trans)) ) ) - (set! (-> v1-14 uvec quad) (-> a0-17 start-position quad)) + (vector-copy! (-> v1-14 uvec) (-> a0-17 start-position)) ) (cubic-curve-method-9 (-> this player-intro-curve) @@ -783,7 +783,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (when (= (status-of-level-and-borrows *level* 'lracelit #f) 'active) + (when (= (level-status? *level* 'lracelit #f) 'active) (let ((gp-1 (-> this info))) (handle->process (-> this manager)) (let ((s5-1 (new 'stack-no-clear 'matrix))) @@ -870,7 +870,7 @@ (set! (-> v1-8 vec1 x) (/ (-> v1-8 vec1 z) (the float (max 1 (+ (-> v1-8 word) -1))))) (set! (-> v1-8 vec1 y) -40960.0) (set! (-> v1-8 mat rvec quad) (-> arg1 start-sphere quad)) - (set! (-> v1-8 mat uvec quad) (-> arg1 start-dir quad)) + (vector-copy! (-> v1-8 mat uvec) (-> arg1 start-dir)) (set-vector! (-> v1-8 mat fvec) (-> v1-8 mat uvec z) 0.0 (- (-> v1-8 mat uvec x)) 1.0) (dotimes (a0-22 (-> arg1 racer-count)) (cond @@ -893,7 +893,7 @@ ) (let ((a1-20 (-> this racer-array a0-22))) (-> arg1 racer-array a0-22) - (set! (-> v1-8 mat trans quad) (-> v1-8 mat rvec quad)) + (vector-copy! (-> v1-8 mat trans) (-> v1-8 mat rvec)) (let ((t0-0 (-> v1-8 mat trans))) (let ((a2-9 (-> v1-8 mat trans))) (let ((a3-3 (-> v1-8 mat uvec))) @@ -924,7 +924,7 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> t0-1 quad) vf6) ) - (set! (-> a1-20 start-position quad) (-> v1-8 mat trans quad)) + (vector-copy! (-> a1-20 start-position) (-> v1-8 mat trans)) (set! (-> a1-20 rank) a0-22) (set! (-> a1-20 speed-factor) 1.0) (set! (-> a1-20 racer) (the-as handle #f)) @@ -985,8 +985,8 @@ ) (let ((v1-22 (new 'stack-no-clear 'inline-array 'vector 5))) (let ((a0-7 (-> this race-state info))) - (set! (-> v1-22 0 quad) (-> a0-7 start-sphere quad)) - (set! (-> v1-22 1 quad) (-> a0-7 start-dir quad)) + (vector-copy! (-> v1-22 0) (-> a0-7 start-sphere)) + (vector-copy! (-> v1-22 1) (-> a0-7 start-dir)) ) (set! (-> v1-22 2 y) 0.0) (set! (-> v1-22 2 x) (- (-> v1-22 1 z))) @@ -1035,8 +1035,8 @@ (logior! (-> gp-0 flags) (race-flag rf2)) ) (let ((s4-0 (new 'stack-no-clear 'race-manager-stack-var1))) - (set! (-> s4-0 vec0 quad) (-> gp-0 info start-sphere quad)) - (set! (-> s4-0 vec1 quad) (-> gp-0 info start-dir quad)) + (vector-copy! (-> s4-0 vec0) (-> gp-0 info start-sphere)) + (vector-copy! (-> s4-0 vec1) (-> gp-0 info start-dir)) (set-vector! (-> s4-0 vec2) (-> s4-0 vec1 z) 0.0 (- (-> s4-0 vec1 x)) 1.0) (set! (-> s4-0 params object-type) (traffic-type vehicle-task)) (set! (-> s4-0 params behavior) (the-as uint 10)) @@ -1060,7 +1060,7 @@ (let ((v1-23 (-> gp-0 racer-array s3-0)) (s2-0 (-> s5-0 racer-array s3-0)) ) - (set! (-> s4-0 params position quad) (-> v1-23 start-position quad)) + (vector-copy! (-> s4-0 params position) (-> v1-23 start-position)) (set! (-> s4-0 params id) (the-as uint s3-0)) (set! (-> s4-0 params user-data) (-> s2-0 rider)) (logior! (-> s4-0 params flags) (traffic-spawn-flags tsf1)) diff --git a/goal_src/jak3/levels/common/race/race-mesh.gc b/goal_src/jak3/levels/common/race/race-mesh.gc index 0bf9c04783b..d793a6a9f73 100644 --- a/goal_src/jak3/levels/common/race/race-mesh.gc +++ b/goal_src/jak3/levels/common/race/race-mesh.gc @@ -141,8 +141,8 @@ (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 4)) (a3-1 (the int arg1)) ) - (set! (-> v1-0 0 quad) (-> this samples a3-1 pos quad)) - (set! (-> v1-0 1 quad) (-> this samples (+ a3-1 1) pos quad)) + (vector-copy! (-> v1-0 0) (-> this samples a3-1 pos)) + (vector-copy! (-> v1-0 1) (-> this samples (+ a3-1 1) pos)) (let ((f0-3 (- arg1 (the float a3-1)))) (vector-lerp! arg0 (-> v1-0 0) (-> v1-0 1) f0-3) ) @@ -455,9 +455,9 @@ (v1-5 (-> this edges (-> v1-2 end-edge))) ) (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) - (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) - (set! (-> arg1 slice-corners 2 quad) (-> v1-5 right quad)) - (set! (-> arg1 slice-corners 3 quad) (-> v1-5 left quad)) + (vector-copy! (-> arg1 slice-corners 1) (-> a1-3 right)) + (vector-copy! (-> arg1 slice-corners 2) (-> v1-5 right)) + (vector-copy! (-> arg1 slice-corners 3) (-> v1-5 left)) ) (let ((v1-8 (new 'stack-no-clear 'vector)) (a0-6 (new 'stack-no-clear 'vector)) @@ -553,9 +553,9 @@ (v1-4 (-> this edges (-> v1-1 end-edge))) ) (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) - (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) - (set! (-> arg1 slice-corners 2 quad) (-> v1-4 right quad)) - (set! (-> arg1 slice-corners 3 quad) (-> v1-4 left quad)) + (vector-copy! (-> arg1 slice-corners 1) (-> a1-3 right)) + (vector-copy! (-> arg1 slice-corners 2) (-> v1-4 right)) + (vector-copy! (-> arg1 slice-corners 3) (-> v1-4 left)) ) (let ((v1-7 (new 'stack-no-clear 'vector)) (a0-6 (new 'stack-no-clear 'vector)) @@ -615,7 +615,7 @@ ) (when (or (< f30-0 0.0) (< f0-11 f30-0)) (set! f30-0 f0-11) - (set! (-> arg1 pt-on-slice quad) (-> s5-1 quad)) + (vector-copy! (-> arg1 pt-on-slice) s5-1) ) ) ) diff --git a/goal_src/jak3/levels/desert/artifact-race/artifact-race.gc b/goal_src/jak3/levels/desert/artifact-race/artifact-race.gc index ff7d007ca36..e3054a7812d 100644 --- a/goal_src/jak3/levels/desert/artifact-race/artifact-race.gc +++ b/goal_src/jak3/levels/desert/artifact-race/artifact-race.gc @@ -77,8 +77,8 @@ (defmethod find-ground ((this was-artifact)) (let ((s4-0 #f)) (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> gp-0 vec0 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> gp-0 vec0) (-> this root trans)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec0)) (+! (-> gp-0 cquery start-pos y) 40960.0) (vector-reset! (-> gp-0 vec1)) (set! (-> gp-0 vec1 y) 1.0) @@ -96,12 +96,12 @@ (let ((f0-8 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) (when (>= f0-8 0.0) (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f0-8) - (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (vector-copy! (-> gp-0 vec1) (-> gp-0 cquery best-other-tri normal)) (set! s4-0 #t) (format #t "was-artifact::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) ) ) - (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec0)) (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) ) s4-0 @@ -113,13 +113,14 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (when v1-0 - (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (vector-copy! s5-0 (-> v1-0 control trans)) (set! (-> s5-0 w) 4096.0) (when (focus-test? v1-0 pilot) (let ((a1-4 (handle->process (-> v1-0 pilot vehicle)))) - (set! (-> s5-0 quad) - (-> (the-as collide-shape (-> (the-as process-drawable a1-4) root)) root-prim prim-core world-sphere quad) - ) + (vector-copy! + s5-0 + (-> (the-as collide-shape (-> (the-as process-drawable a1-4) root)) root-prim prim-core world-sphere) + ) ) ) (let ((f0-1 (vector-vector-xz-distance-squared (-> this root trans) s5-0)) @@ -183,8 +184,8 @@ :code (behavior () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> self root trans quad)) - (set! (-> gp-0 pos quad) (-> v1-0 quad)) + (vector-copy! v1-0 (-> self root trans)) + (vector-copy! (-> gp-0 pos) v1-0) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) @@ -214,11 +215,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 333 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 333)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 333)) ) ) @@ -267,11 +268,11 @@ (set! (-> v1-13 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 3.0 3.0 3.0 1.0) (find-ground self) - (set! (-> self pos quad) (-> self root trans quad)) + (vector-copy! (-> self pos) (-> self root trans)) (let* ((v1-23 (-> arg0 artifact-type)) (a1-6 (cond ((= v1-23 (artifact-type artifact-a)) @@ -371,7 +372,7 @@ (new 'static 'talker-speech-class :name "dax163" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :text-duration (seconds 1) :neg #x1 @@ -381,7 +382,7 @@ (new 'static 'talker-speech-class :name "dax164" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :text-duration (seconds 1) :neg #x1 @@ -391,7 +392,7 @@ (new 'static 'talker-speech-class :name "dax165" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :text-duration (seconds 1) :neg #x1 @@ -401,7 +402,7 @@ (new 'static 'talker-speech-class :name "dax166" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5 :text-duration (seconds 1) :neg #x1 @@ -411,7 +412,7 @@ (new 'static 'talker-speech-class :name "dax167" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x6 :text-duration (seconds 1) :neg #x1 @@ -421,7 +422,7 @@ (new 'static 'talker-speech-class :name "dax168" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x7 :text-duration (seconds 1) :neg #x1 @@ -431,7 +432,7 @@ (new 'static 'talker-speech-class :name "dax169" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x8 :text-duration (seconds 1) :neg #x1 @@ -441,7 +442,7 @@ (new 'static 'talker-speech-class :name "dax170" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x9 :text-duration (seconds 1) :neg #x1 @@ -451,7 +452,7 @@ (new 'static 'talker-speech-class :name "dax171" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xa :text-duration (seconds 1) :neg #x1 @@ -461,7 +462,7 @@ (new 'static 'talker-speech-class :name "dax172" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xb :text-duration (seconds 1) :neg #x1 @@ -471,7 +472,7 @@ (new 'static 'talker-speech-class :name "dax173" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xc :text-duration (seconds 1) :neg #x1 @@ -481,7 +482,7 @@ (new 'static 'talker-speech-class :name "dax174" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xd :text-duration (seconds 1) :neg #x1 @@ -491,7 +492,7 @@ (new 'static 'talker-speech-class :name "dax175" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xe :text-duration (seconds 1) :neg #x1 @@ -501,7 +502,7 @@ (new 'static 'talker-speech-class :name "dax176" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xf :text-duration (seconds 1) :neg #x1 @@ -511,7 +512,7 @@ (new 'static 'talker-speech-class :name "dax177" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x10 :text-duration (seconds 1) :neg #x1 @@ -521,7 +522,7 @@ (new 'static 'talker-speech-class :name "dax178" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x11 :text-duration (seconds 1) :neg #x1 @@ -531,7 +532,7 @@ (new 'static 'talker-speech-class :name "dax179" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x12 :text-duration (seconds 1) :neg #x1 @@ -541,7 +542,7 @@ (new 'static 'talker-speech-class :name "dax180" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x13 :text-duration (seconds 1) :neg #x1 @@ -551,7 +552,7 @@ (new 'static 'talker-speech-class :name "dax181" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x14 :text-duration (seconds 1) :neg #x1 @@ -561,7 +562,7 @@ (new 'static 'talker-speech-class :name "dax182" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15 :text-duration (seconds 1) :neg #x1 @@ -571,7 +572,7 @@ (new 'static 'talker-speech-class :name "dax183" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16 :text-duration (seconds 1) :neg #x1 @@ -581,7 +582,7 @@ (new 'static 'talker-speech-class :name "dax184" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x17 :text-duration (seconds 1) :neg #x1 @@ -591,7 +592,7 @@ (new 'static 'talker-speech-class :name "dax185" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x18 :text-duration (seconds 1) :neg #x1 @@ -601,7 +602,7 @@ (new 'static 'talker-speech-class :name "dax186" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x19 :text-duration (seconds 1) :neg #x1 @@ -611,7 +612,7 @@ (new 'static 'talker-speech-class :name "dax187" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1a :text-duration (seconds 1) :neg #x1 @@ -621,7 +622,7 @@ (new 'static 'talker-speech-class :name "dax188" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1b :text-duration (seconds 1) :neg #x1 @@ -631,7 +632,7 @@ (new 'static 'talker-speech-class :name "dax189" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1c :text-duration (seconds 1) :neg #x1 @@ -641,7 +642,7 @@ (new 'static 'talker-speech-class :name "dax190" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1d :text-duration (seconds 1) :neg #x1 @@ -651,7 +652,7 @@ (new 'static 'talker-speech-class :name "dax191" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1e :text-duration (seconds 1) :neg #x1 @@ -661,7 +662,7 @@ (new 'static 'talker-speech-class :name "dax192" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1f :text-duration (seconds 1) :neg #x1 @@ -800,9 +801,9 @@ (format #t "artifact-race::initialize death-count ~d, suck-factor ~f~%" a2-4 (-> this suck-factor)) ) (set! (-> this extra-suck-time) (* 16.0 (-> this suck-factor))) - (set! (-> this begin-pos quad) (-> (new 'static 'vector :x 9263923.0 :y 129024.0 :z 1077248.0 :w 1.0) quad)) - (set! (-> this end-pos quad) (-> (new 'static 'vector :x 9277440.0 :y 127795.2 :z 890880.0 :w 1.0) quad)) - (set! (-> this door-plane quad) (-> (new 'static 'vector :z 1.0 :w 1.0) quad)) + (vector-copy! (-> this begin-pos) (new 'static 'vector :x 9263923.0 :y 129024.0 :z 1077248.0 :w 1.0)) + (vector-copy! (-> this end-pos) (new 'static 'vector :x 9277440.0 :y 127795.2 :z 890880.0 :w 1.0)) + (vector-copy! (-> this door-plane) (new 'static 'vector :z 1.0 :w 1.0)) (set! (-> this door-plane w) (- (vector-dot (-> this door-plane) (new 'static 'vector :x 9277440.0 :y 125747.2 :z 957235.2 :w 1.0))) ) @@ -834,7 +835,7 @@ (let ((s3-0 (-> s5-0 0 data s4-0 actor)) (s2-0 (-> this objs s4-0)) ) - (set! (-> s2-0 pos quad) (-> s3-0 extra trans quad)) + (vector-copy! (-> s2-0 pos) (-> s3-0 extra trans)) (set! (-> s2-0 time) (the-as uint (the int (* 300.0 (+ (res-lump-float s3-0 'timeout :default 60.0) (-> this extra-suck-time))))) ) @@ -881,7 +882,7 @@ (set-fog-interp self (-> self dust-begin)) (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity (-> self dust-begin)) (set-setting! 'fog-special-interp-rate #f 0.01 0) - (while (!= (status-of-level-and-borrows *level* 'desert #f) 'active) + (while (!= (level-status? *level* 'desert #f) 'active) (suspend) ) (while (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status pilot-riding)))) @@ -965,7 +966,7 @@ (open! (-> self node-info) 'event) (remove-setting! 'airlock) (let ((gp-3 (new 'stack-no-clear 'inline-array 'task-arrow-params 1))) - (set! (-> gp-3 0 pos quad) (-> self end-pos quad)) + (vector-copy! (-> gp-3 0 pos) (-> self end-pos)) (quaternion-identity! (-> gp-3 0 quat)) (set! (-> gp-3 0 flags) (task-arrow-flags)) (set! (-> gp-3 0 map-icon) (the-as uint 13)) @@ -994,8 +995,8 @@ (when (and (< 2048000.0 (-> gp-4 trans x)) (time-elapsed? (-> self speech-time) (seconds 4))) (vector-! (-> gp-4 uvec) (-> self end-pos) (-> (the-as process-drawable s5-2) root trans)) (vector-normalize! (-> gp-4 uvec) 1.0) - (set! (-> gp-4 rvec quad) (-> (the-as process-drawable s5-2) node-list data 0 bone transform fvec quad)) - (set! (-> gp-4 fvec quad) (-> (the-as process-drawable s5-2) root transv quad)) + (vector-copy! (-> gp-4 rvec) (-> (the-as process-drawable s5-2) node-list data 0 bone transform fvec)) + (vector-copy! (-> gp-4 fvec) (-> (the-as process-drawable s5-2) root transv)) (when (and (< (vector-dot (-> gp-4 uvec) (-> gp-4 rvec)) (cos 10922.667)) (< (vector-dot (-> gp-4 uvec) (-> (the-as process-drawable s5-2) root transv)) 0.0) (< 81920.0 (vector-length (-> gp-4 fvec))) @@ -1064,9 +1065,11 @@ 0 (when (= (-> self node-info task) (game-task desert-artifact-race-1)) (send-event *target* 'end-mode 'pilot) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) + ) + (suspend-for (seconds 0.5) ) - (suspend-for (seconds 0.5)) (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/desert/boss/deswalk-obs.gc b/goal_src/jak3/levels/desert/boss/deswalk-obs.gc index 77f914e6bb2..0aec6048ffb 100644 --- a/goal_src/jak3/levels/desert/boss/deswalk-obs.gc +++ b/goal_src/jak3/levels/desert/boss/deswalk-obs.gc @@ -204,6 +204,7 @@ ) (defmethod init-from-entity! ((this dm-urchin) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) @@ -424,6 +425,7 @@ ) (defmethod init-from-entity! ((this desw-eco-tank) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -513,9 +515,9 @@ (deactivate self) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-0 (target-pos 0)) (if *target* - (set! (-> gp-0 quad) (-> (get-trans *target* 3) quad)) + (vector-copy! gp-0 (get-trans *target* 3)) ) (vector-! gp-0 gp-0 (-> self root trans)) (let ((f0-0 (vector-normalize-ret-len! gp-0 1.0))) @@ -547,7 +549,7 @@ (set! (-> s5-0 event-self) 'touched) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 444) self)) (go-virtual idle) ) @@ -701,13 +703,13 @@ ) (else (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this gravity quad)) + (vector-copy! s5-0 (-> this gravity)) (let ((s2-0 (-> this ragdoll-joints arg1))) (let ((f0-1 5.0)) (case (-> this mode) ((1) (set! f30-0 2.0) - (set! (-> this gravity quad) (-> arg3 uvec quad)) + (vector-copy! (-> this gravity) (-> arg3 uvec)) ) ((2) (set! f30-0 0.0) @@ -771,7 +773,7 @@ ) ) ) - (set! (-> this gravity quad) (-> s5-0 quad)) + (vector-copy! (-> this gravity) s5-0) ) ) ) @@ -834,9 +836,10 @@ :virtual #t :trans (behavior () (if (and (-> self ragdoll) (nonzero? (-> self ragdoll))) - (set! (-> self ragdoll ragdoll-joints 0 position quad) - (-> (ppointer->process (-> self parent)) root trans quad) - ) + (vector-copy! + (-> self ragdoll ragdoll-joints 0 position) + (-> (ppointer->process (-> self parent)) root trans) + ) ) (cond ((or (not (-> self ragdoll)) (zero? (-> self ragdoll))) @@ -914,7 +917,8 @@ ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this dm-tentacle)) +(defmethod get-search-info-flag ((this dm-tentacle)) + "Get search-info-flag for this process." (the-as search-info-flag (if (and (-> this next-state) (= (-> this next-state name) 'die)) 1 16 @@ -1538,7 +1542,7 @@ (sound-play "snake-spawn" :position (-> self initial-position)) (let ((gp-1 (new 'stack-no-clear 'matrix))) (matrix-identity! gp-1) - (set! (-> gp-1 trans quad) (-> self initial-position quad)) + (vector-copy! (-> gp-1 trans) (-> self initial-position)) (if (logtest? (-> *part-group-id-table* 446 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1581,7 +1585,7 @@ (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (matrix-identity! gp-0) - (set! (-> gp-0 trans quad) (-> self initial-position quad)) + (vector-copy! (-> gp-0 trans) (-> self initial-position)) (if (logtest? (-> *part-group-id-table* 445 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1710,6 +1714,7 @@ ) (defmethod init-from-entity! ((this dm-tentacle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s4-0 total-prims) (the-as uint 10)) @@ -1796,7 +1801,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-dm-tentacle" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> this initial-position quad) (-> this root trans quad)) + (vector-copy! (-> this initial-position) (-> this root trans)) (logior! (-> this mask) (process-mask enemy)) (set! (-> this hit-points) 10.0) (set! (-> this incoming-attack-id) (the-as uint 0)) @@ -2131,6 +2136,7 @@ ) (defmethod init-from-entity! ((this desw-snake-stump) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak3/levels/desert/boss/terraformer-drone.gc b/goal_src/jak3/levels/desert/boss/terraformer-drone.gc index 732ef72ff61..7f568ccacd5 100644 --- a/goal_src/jak3/levels/desert/boss/terraformer-drone.gc +++ b/goal_src/jak3/levels/desert/boss/terraformer-drone.gc @@ -614,34 +614,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 65536.0 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -680,6 +680,7 @@ (set! (-> *terraformer-drone-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod enemy-common-post ((this terraformer-drone)) + "Common implementation of post. Runs ja-post." (with-pp (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) @@ -728,6 +729,7 @@ ) (defmethod event-handler ((this terraformer-drone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('explode) (go (method-of-object this explode)) @@ -745,7 +747,8 @@ ) ) -(defmethod setup-jump! ((this terraformer-drone) (arg0 enemy-jump-info)) +(defmethod setup-jump-trajectory! ((this terraformer-drone) (arg0 enemy-jump-info)) + "Compute jump trajectory." (if (< (-> this root scale x) 1.0) (setup-from-to-duration-and-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) 120.0 61440.0) (setup-from-to-duration-and-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) 120.0 40960.0) @@ -774,7 +777,7 @@ (activate! *camera-smush-control* 819.2 60 300 0.995 0.9 (-> *display* camera-clock)) (sound-play "drone-blow" :position (-> self root trans)) (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 40960.0) (set! (-> gp-1 scale) 1.0) @@ -799,9 +802,10 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod in-jump-handler ((this terraformer-drone) (arg0 int) (arg1 enemy-jump-info)) +(defmethod move-along-ballistic-trajectory-for-jump ((this terraformer-drone) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Adjust trans, transv for the jump, if we're airborne." (case arg0 - ((2 3) + (((jump-stage takeoff) (jump-stage in-air)) (let ((f30-0 (fmin (the float (-> arg1 hang-time)) (-> arg1 traj time)))) (let ((a1-3 (compute-trans-at-time (-> arg1 traj) f30-0 (new 'stack-no-clear 'vector)))) (move-to-point! (-> this root) a1-3) @@ -816,12 +820,14 @@ (none) ) -(defmethod on-ground? ((this terraformer-drone) (arg0 enemy-jump-info)) +(defmethod landed-jump-yet? ((this terraformer-drone) (arg0 enemy-jump-info)) + "Is this on, or close to, the ground?" (>= (the float (-> arg0 hang-time)) (-> arg0 traj time)) ) ;; WARN: Return type mismatch vector vs float. (defmethod move-to-gspot! ((this terraformer-drone)) + "Snap the enemy down onto the cached ground spot (gspot)." (the-as float (vector-reset! (-> this root transv))) ) @@ -910,7 +916,7 @@ (let ((gp-0 (new 'stack-no-clear 'matrix))) (format 0 "spawning impact part~%") (matrix-identity! gp-0) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 431 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -959,7 +965,7 @@ (t9-0) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1015,7 +1021,7 @@ (let ((a0-1 (handle->process (-> self focus handle)))) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-1) 0)) (let ((s5-0 3)) (if (< (-> self root scale x) 1.0) (set! s5-0 6) @@ -1025,7 +1031,7 @@ (let ((v1-14 (-> self nav state))) (logclear! (-> v1-14 flags) (nav-state-flag directional-mode)) (logior! (-> v1-14 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-14 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-14 target-pos) gp-0) ) 0 ) @@ -1065,7 +1071,7 @@ ) (logclear! (-> a0-26 flags) (nav-state-flag directional-mode)) (logior! (-> a0-26 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-26 target-pos quad) (-> v1-48 quad)) + (vector-copy! (-> a0-26 target-pos) v1-48) ) 0 ) @@ -1100,6 +1106,7 @@ ) (defmethod init-enemy-collision! ((this terraformer-drone)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1145,6 +1152,7 @@ ) (defmethod coin-flip? ((this terraformer-drone)) + "Return #t half the time, #f the other." #f ) @@ -1170,13 +1178,14 @@ ) (defmethod init-enemy! ((this terraformer-drone)) + "Typical place for shared init code. Runs from entity or process style init." (with-pp (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-terraformer-drone" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *terraformer-drone-nav-enemy-info*) + (setup-enemy! this *terraformer-drone-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -1212,6 +1221,7 @@ ;; WARN: Return type mismatch vector vs none. (defmethod init-enemy! ((this terraformer-drone-small)) + "Typical place for shared init code. Runs from entity or process style init." (let ((t9-0 (method-of-type terraformer-drone init-enemy!))) (t9-0 this) ) diff --git a/goal_src/jak3/levels/desert/boss/terraformer-head.gc b/goal_src/jak3/levels/desert/boss/terraformer-head.gc index 887f1f66ccc..e702f12377b 100644 --- a/goal_src/jak3/levels/desert/boss/terraformer-head.gc +++ b/goal_src/jak3/levels/desert/boss/terraformer-head.gc @@ -344,7 +344,7 @@ ) (defmethod set-target! ((this joint-mod-disc-look-at) (arg0 vector)) - (set! (-> this target quad) (-> arg0 quad)) + (vector-copy! (-> this target) arg0) 0 (none) ) @@ -455,7 +455,7 @@ (let ((s4-1 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) (set-vector! (-> arg0 bone transform trans) 0.0 0.0 0.0 1.0) (matrix*! (-> arg0 bone transform) (-> arg0 bone transform) s5-1) - (set! (-> arg0 bone transform trans quad) (-> s4-1 quad)) + (vector-copy! (-> arg0 bone transform trans) s4-1) ) ) ) @@ -475,7 +475,8 @@ ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this terraformer-head-target)) +(defmethod get-search-info-flag ((this terraformer-head-target)) + "Get search-info-flag for this process." (the-as search-info-flag 16) ) @@ -592,8 +593,8 @@ (case message (('move) (let ((v1-1 (-> self root))) - (set! (-> self starting-pos quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self root trans quad) (-> self starting-pos quad)) + (vector-copy! (-> self starting-pos) (the-as vector (-> block param 0))) + (vector-copy! (-> self root trans) (-> self starting-pos)) (vector-! (-> self root transv) (the-as vector (-> block param 1)) (-> self starting-pos)) (let ((a0-7 (-> self root transv))) (.lvf vf1 (&-> (-> self root transv) quad)) @@ -605,7 +606,7 @@ (.mul.x.vf.xyz vf1 vf1 vf2) (.svf (&-> a0-7 quad) vf1) ) - (set! (-> self pre-move-transv quad) (-> v1-1 transv quad)) + (vector-copy! (-> self pre-move-transv) (-> v1-1 transv)) ) (vector-normalize-copy! (-> self starting-dir) (-> self root transv) 1.0) (set! (-> self hits) 0) @@ -808,7 +809,8 @@ ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this terraformer-head)) +(defmethod get-search-info-flag ((this terraformer-head)) + "Get search-info-flag for this process." (the-as search-info-flag 1) ) @@ -875,8 +877,8 @@ (set! (-> a1-2 charge) 1.0) (set! (-> a1-2 options) (projectile-options)) (logclear! (-> a1-2 options) (projectile-options po14 po15 po16)) - (set! (-> a1-2 pos quad) (-> self root trans quad)) - (set! (-> a1-2 vel quad) (-> (new 'static 'vector :x 1.0) quad)) + (vector-copy! (-> a1-2 pos) (-> self root trans)) + (vector-copy! (-> a1-2 vel) (new 'static 'vector :x 1.0)) (set! (-> a1-2 notify-handle) (the-as handle #f)) (set! (-> a1-2 owner-handle) (the-as handle #f)) (set! (-> a1-2 target-handle) (the-as handle #f)) @@ -961,7 +963,7 @@ (set! (-> a0-29 pickup-type) (pickup-type ammo-random)) (set! (-> a0-29 pickup-amount) 10.0) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> self root trans quad)) + (vector-copy! s3-1 (-> self root trans)) (set! (-> self root trans quad) (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 s4-1)))) ) @@ -969,7 +971,7 @@ (set! (-> self ammo s4-1 handle) (ppointer->handle (drop-pickup a0-29 #t *entity-pool* (the-as fact-info #f) 0 #t)) ) - (set! (-> self root trans quad) (-> s3-1 quad)) + (vector-copy! (-> self root trans) s3-1) ) ) ) @@ -1084,7 +1086,7 @@ ) ) (update! (-> self position-seeker) (the-as vector #f)) - (set! (-> self root trans quad) (-> self position-seeker value quad)) + (vector-copy! (-> self root trans) (-> self position-seeker value)) (dotimes (gp-2 8) (let* ((s5-3 (-> self critter gp-2)) (s4-3 (handle->process (-> s5-3 handle))) @@ -1856,9 +1858,9 @@ (defbehavior terraformer-head-point-occupied? terraformer-head ((arg0 vector)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> arg0 quad)) + (vector-copy! a1-0 arg0) (set! (-> a1-0 w) 16384.0) - (add-root-sphere-to-hash! (-> self nav) a1-0 255) + (check-sphere-blocked! (-> self nav) a1-0 255) ) ) @@ -1893,7 +1895,7 @@ ) (when (terraformer-head-get-spawn-point gp-0 (-> s5-0 dest)) (set! (-> s5-0 flags) (terraformer-head-critter-tracker-flag)) - (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-0 trans) gp-0) (quaternion-copy! (-> s4-0 quat) (-> self root quat)) (set! (-> s4-0 entity) (-> self entity)) (set! (-> s4-0 directed?) #f) @@ -1993,7 +1995,7 @@ (set-vector! (-> s4-4 fvec) 0.0 1.0 0.0 0.0) (vector-cross! (-> s4-4 rvec) (-> s4-4 uvec) (-> s4-4 fvec)) (set! (-> s4-4 rvec w) 0.0) - (set! (-> s4-4 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-4 trans) gp-0) (+! (-> s4-4 trans y) 8192.0) (set! (-> s4-4 trans w) 1.0) ) @@ -2145,7 +2147,7 @@ :enter (behavior () (terraformer-head-send-group-event 0 'retract) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> self initial-position quad)) + (vector-copy! v1-0 (-> self initial-position)) (+! (-> v1-0 x) 204800.0) (+! (-> v1-0 y) -102400.0) (set! (-> self position-seeker target quad) (-> v1-0 quad)) @@ -2204,11 +2206,11 @@ (let ((gp-0 (get-trans self 3))) (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) ) ) @@ -2295,7 +2297,7 @@ (logior! (-> self skel status) (joint-control-status sync-math)) (set-time! (-> self state-time)) (let ((v1-7 (new 'stack-no-clear 'vector))) - (set! (-> v1-7 quad) (-> self initial-position quad)) + (vector-copy! v1-7 (-> self initial-position)) (+! (-> v1-7 x) 204800.0) (+! (-> v1-7 y) -223232.0) (set! (-> self position-seeker target quad) (-> v1-7 quad)) @@ -2679,6 +2681,7 @@ ) (defmethod init-from-entity! ((this terraformer-head) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 38) 0))) @@ -2964,7 +2967,7 @@ (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set! (-> this initial-position quad) (-> this root trans quad)) + (vector-copy! (-> this initial-position) (-> this root trans)) (+! (-> this root trans x) 204800.0) (+! (-> this root trans y) -57344.0) (init (-> this position-seeker) (-> this root trans) 40.96 4096.0 0.3) @@ -2989,7 +2992,7 @@ (set! (-> this neck-aim-jm up) 1) (set! (-> this neck-aim-jm nose) 2) (logior! (-> this neck-aim-jm flags) (jmod-disc-lookat-flag jdl1)) - (set! (-> this target-position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this target-position) (target-pos 0)) (tracking-spline-method-10 (-> this target-spline) (-> this target-position)) (set! (-> this beam-projectile) (the-as handle #f)) (set! (-> this hit-points) 1.0) diff --git a/goal_src/jak3/levels/desert/boss/terraformer-setup.gc b/goal_src/jak3/levels/desert/boss/terraformer-setup.gc index d568eb817bc..22a8135f1cd 100644 --- a/goal_src/jak3/levels/desert/boss/terraformer-setup.gc +++ b/goal_src/jak3/levels/desert/boss/terraformer-setup.gc @@ -43,7 +43,7 @@ (defmethod init! ((this terraformer-foot-mark-pt-array) (arg0 vector) (arg1 float)) - (set! (-> this origin quad) (-> arg0 quad)) + (vector-copy! (-> this origin) arg0) (set! (-> this radius) arg1) (set! (-> this current-point) 0) 0 @@ -116,7 +116,7 @@ ) (vector-cross! s3-1 (-> s5-0 normal) (vector-get-unique! (new 'stack-no-clear 'vector) (-> s5-0 normal))) (vector-normalize! s3-1 10240.0) - (set! (-> s4-1 0 quad) (-> s3-1 quad)) + (vector-copy! (-> s4-1 0) s3-1) (vector-cross! (-> s4-1 1) s3-1 (-> s5-0 normal)) (vector-negate! (-> s4-1 2) s3-1) (vector-cross! (-> s4-1 3) (-> s5-0 normal) s3-1) @@ -151,7 +151,7 @@ (fill-using-bounding-box *collide-cache* s3-2) ) (dotimes (s3-3 4) - (set! (-> gp-0 start-pos quad) (-> s4-1 s3-3 quad)) + (vector-copy! (-> gp-0 start-pos) (-> s4-1 s3-3)) (when (< (probe-using-line-sphere *collide-cache* gp-0) 0.0) (set! (-> s5-0 found?) #f) (return 0) @@ -179,7 +179,7 @@ ) (let ((s1-0 (-> this points (-> this current-point)))) (when (-> s1-0 found?) - (set! (-> s3-0 uvec quad) (-> s1-0 normal quad)) + (vector-copy! (-> s3-0 uvec) (-> s1-0 normal)) (vector-cross! (-> s3-0 rvec) (-> s3-0 uvec) @@ -591,7 +591,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this terraformer-mine)) +(defmethod get-search-info-flag ((this terraformer-mine)) + "Get search-info-flag for this process." (the-as search-info-flag 24) ) @@ -630,8 +631,8 @@ (set! (-> self draw light-index) (-> (ppointer->process (-> self parent)) draw light-index)) (logior! (-> self mask) (process-mask enemy)) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self src-pos quad) (-> arg0 quad)) - (set! (-> self dest-pos quad) (-> arg1 quad)) + (vector-copy! (-> self src-pos) arg0) + (vector-copy! (-> self dest-pos) arg1) (set! (-> self which-trajectory) 0) self (set! (-> self trail-part) @@ -651,7 +652,7 @@ (defbehavior terraformer-mine-explode terraformer-mine () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) (sound-play "mine-explode" :position (-> self root trans)) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 24576.0) (set! (-> gp-0 scale) 1.0) @@ -728,7 +729,7 @@ (set! (-> self which-trajectory) 0) (set! (-> self x-rotate) (* 65536.0 (rand-vu))) (set! (-> self y-rotate) (* 65536.0 (rand-vu))) - (set! (-> self root trans quad) (-> self src-pos quad)) + (vector-copy! (-> self root trans) (-> self src-pos)) ) :trans (behavior () (rlet ((acc :class vf) @@ -774,7 +775,7 @@ ) (let ((gp-1 (new 'stack-no-clear 'matrix))) (matrix-identity! gp-1) - (set! (-> gp-1 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 432 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -799,7 +800,7 @@ (vector+! gp-3 gp-3 (-> self root trans)) (let ((s5-3 (new 'stack-no-clear 'collide-query))) (set-vector! (-> s5-3 move-dist) 0.0 -122880.0 0.0 1.0) - (set! (-> s5-3 start-pos quad) (-> gp-3 quad)) + (vector-copy! (-> s5-3 start-pos) gp-3) (+! (-> s5-3 start-pos y) 61440.0) (let ((v1-69 s5-3)) (set! (-> v1-69 radius) 4096.0) @@ -881,7 +882,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this terraformer-target)) +(defmethod get-search-info-flag ((this terraformer-target)) + "Get search-info-flag for this process." (the-as search-info-flag 24) ) @@ -933,7 +935,7 @@ (('attack) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) (sound-play "blow-target" :position (-> self root trans)) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 8192.0) (set! (-> gp-0 scale) 1.0) @@ -1253,7 +1255,7 @@ ) ) (set! (-> self root event-self) 'touched) - (set! (-> self root trans quad) (-> (ppointer->process (-> self parent)) root trans quad)) + (vector-copy! (-> self root trans) (-> (ppointer->process (-> self parent)) root trans)) (set! (-> self draw light-index) (-> (ppointer->process (-> self parent)) draw light-index)) (logior! (-> self mask) (process-mask enemy)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1281,7 +1283,7 @@ (activate! *camera-smush-control* f0-4 75 600 1.1 1.07 (-> *display* camera-clock)) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self foot-lock old-position quad)) + (vector-copy! gp-1 (-> self foot-lock old-position)) (let ((s5-1 (new 'stack-no-clear 'quaternion)) (s4-1 (new 'stack-no-clear 'matrix)) (s3-1 #f) @@ -1289,7 +1291,7 @@ (+! (-> gp-1 y) 4096.0) (quaternion-from-two-vectors! s5-1 (new 'static 'vector :y 1.0) (-> self foot-lock old-normal)) (quaternion->matrix s4-1 s5-1) - (set! (-> s4-1 trans quad) (-> gp-1 quad)) + (vector-copy! (-> s4-1 trans) gp-1) (when (nonzero? (-> self splash-list)) (let ((f0-7 (ja-aframe-num 0)) (v1-12 (-> self splash-list-index)) @@ -1317,7 +1319,7 @@ (set! (-> self stepped-in-water) #t) (let ((s5-2 (new 'stack-no-clear 'matrix))) (matrix-identity! s5-2) - (set! (-> s5-2 trans quad) (-> gp-1 quad)) + (vector-copy! (-> s5-2 trans) gp-1) (set! (-> s5-2 trans y) 37273.6) (if (logtest? (-> *part-group-id-table* 437 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -1601,7 +1603,7 @@ (set! (-> self foot-lock lock target) 0.0) (let ((s5-3 (new 'stack-no-clear 'matrix))) (matrix-from-two-vectors! s5-3 (new 'static 'vector :y 1.0) (-> self foot-lock old-normal)) - (set! (-> s5-3 trans quad) (-> self foot-lock old-position quad)) + (vector-copy! (-> s5-3 trans) (-> self foot-lock old-position)) (cond ((-> self stepped-in-water) (set! (-> s5-3 trans y) 37273.6) @@ -1652,9 +1654,10 @@ (else (let ((s5-4 (new 'stack-no-clear 'collide-query))) (let ((v1-92 (new 'stack-no-clear 'vector))) - (set! (-> v1-92 quad) - (-> self node-list data (+ (-> *terraformer-ik-setup* elbow-index) 1) bone transform trans quad) - ) + (vector-copy! + v1-92 + (-> self node-list data (+ (-> *terraformer-ik-setup* elbow-index) 1) bone transform trans) + ) (let ((a2-30 (-> s5-4 bbox)) (a0-30 v1-92) (a1-26 (new 'stack-no-clear 'vector)) @@ -1682,7 +1685,7 @@ (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) ) (fill-using-bounding-box *collide-cache* s5-4) - (set! (-> s5-4 start-pos quad) (-> gp-0 quad)) + (vector-copy! (-> s5-4 start-pos) gp-0) (+! (-> s5-4 start-pos y) 163840.0) (set-vector! (-> s5-4 move-dist) 0.0 -327680.0 0.0 1.0) (let ((v1-99 s5-4)) @@ -1699,7 +1702,7 @@ (when (>= f0-27 0.0) (set! (-> self foot-lock lock target) 1.0) (vector+float*! (-> self foot-lock old-position) (-> s5-4 start-pos) (-> s5-4 move-dist) f0-27) - (set! (-> self foot-lock old-normal quad) (-> s5-4 best-other-tri normal quad)) + (vector-copy! (-> self foot-lock old-normal) (-> s5-4 best-other-tri normal)) (foot-impact) (if (nonzero? (-> self foot-marks)) (init! (-> self foot-marks) (-> self foot-lock old-position) 32768.0) @@ -1867,7 +1870,7 @@ (let* ((a0-20 (-> self nav)) (f0-0 (-> a0-20 extra-nav-sphere w)) ) - (set! (-> a0-20 extra-nav-sphere quad) (-> v1-25 quad)) + (vector-copy! (-> a0-20 extra-nav-sphere) v1-25) (set! (-> a0-20 extra-nav-sphere w) f0-0) ) 0 @@ -1884,18 +1887,7 @@ (let ((f0-2 (terraformer-leg-frames-till-down))) (when (and (< f0-2 32.0) (< 20.0 f0-2)) (let ((gp-1 (new 'stack-no-clear 'matrix))) - (let* ((v1-38 gp-1) - (a3-0 (-> self node-list data 6 bone transform)) - (a0-28 (-> a3-0 rvec quad)) - (a1-4 (-> a3-0 uvec quad)) - (a2-3 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-38 rvec quad) a0-28) - (set! (-> v1-38 uvec quad) a1-4) - (set! (-> v1-38 fvec quad) a2-3) - (set! (-> v1-38 trans quad) a3-1) - ) + (matrix-copy! gp-1 (-> self node-list data 6 bone transform)) (vector<-cspace+vector! (-> gp-1 trans) (-> self node-list data 6) (new 'static 'vector :y 122880.0 :w 1.0)) (if (-> self stepped-in-water) (spawn-from-mat (-> self water-drop-part) gp-1) @@ -2006,7 +1998,7 @@ ) (cond ((-> self launch-drones) - (set! (-> arg0 quad) (-> self target-rot fvec quad)) + (vector-copy! arg0 (-> self target-rot fvec)) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 819200.0) (vector+! arg0 arg0 (-> self old-target-pos)) @@ -2027,7 +2019,7 @@ ) (let ((s5-1 (new 'stack-no-clear 'collide-query))) (set-vector! (-> s5-1 move-dist) 0.0 -245760.0 0.0 1.0) - (set! (-> s5-1 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-1 start-pos) arg0) (+! (-> s5-1 start-pos y) 122880.0) (let ((v1-19 s5-1)) (set! (-> v1-19 radius) 4096.0) @@ -2083,13 +2075,13 @@ (cond ((-> self launch-drones) (let ((s4-0 (new 'stack-no-clear 'enemy-init-by-other-params))) - (set! (-> s4-0 trans quad) (-> s5-0 quad)) + (vector-copy! (-> s4-0 trans) s5-0) (quaternion-copy! (-> s4-0 quat) (-> self root quat)) (set! (-> s4-0 entity) (-> self entity)) (set! (-> s4-0 directed?) #t) (set! (-> s4-0 no-initial-move-to-ground?) #t) (set! (-> s4-0 art-level) #f) - (set! (-> self jump-dest quad) (-> gp-0 quad)) + (vector-copy! (-> self jump-dest) gp-0) (let ((gp-1 (get-process *default-dead-pool* terraformer-drone #x4000 1))) (set! hand (ppointer->handle (when gp-1 @@ -2177,54 +2169,21 @@ ) (when (< (-> self old-target-time) (current-time)) (set! (-> self older-target-time) (-> self old-target-time)) - (set! (-> self older-target-pos quad) (-> self old-target-pos quad)) + (vector-copy! (-> self older-target-pos) (-> self old-target-pos)) (set-time! (-> self old-target-time)) - (set! (-> self old-target-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self old-target-pos) (target-pos 0)) (cond (*target* (quaternion->matrix (-> self target-rot) (get-quat *target* 0)) ) (*camera-combiner* - (let* ((v1-71 (-> self target-rot)) - (a3-0 (-> *camera-combiner* inv-camera-rot)) - (a0-33 (-> a3-0 rvec quad)) - (a1-13 (-> a3-0 uvec quad)) - (a2-2 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-71 rvec quad) a0-33) - (set! (-> v1-71 uvec quad) a1-13) - (set! (-> v1-71 fvec quad) a2-2) - (set! (-> v1-71 trans quad) a3-1) - ) + (matrix-copy! (-> self target-rot) (-> *camera-combiner* inv-camera-rot)) ) (*math-camera* - (let* ((v1-73 (-> self target-rot)) - (a3-2 (-> *math-camera* inv-camera-rot)) - (a0-35 (-> a3-2 rvec quad)) - (a1-14 (-> a3-2 uvec quad)) - (a2-3 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> v1-73 rvec quad) a0-35) - (set! (-> v1-73 uvec quad) a1-14) - (set! (-> v1-73 fvec quad) a2-3) - (set! (-> v1-73 trans quad) a3-3) - ) + (matrix-copy! (-> self target-rot) (-> *math-camera* inv-camera-rot)) ) (else - (let* ((v1-74 (-> self target-rot)) - (a3-4 *identity-matrix*) - (a0-36 (-> a3-4 rvec quad)) - (a1-15 (-> a3-4 uvec quad)) - (a2-4 (-> a3-4 fvec quad)) - (a3-5 (-> a3-4 trans quad)) - ) - (set! (-> v1-74 rvec quad) a0-36) - (set! (-> v1-74 uvec quad) a1-15) - (set! (-> v1-74 fvec quad) a2-4) - (set! (-> v1-74 trans quad) a3-5) - ) + (matrix-copy! (-> self target-rot) *identity-matrix*) ) ) ) @@ -2546,6 +2505,7 @@ ;; ERROR: Function may read a register that is not set: t1 (defmethod init-from-entity! ((this terraformer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (t1-0 int)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -2578,7 +2538,7 @@ (set! (-> this current-node) (the-as uint 0)) (set! (-> this graph) *terraformer-walk-graph*) (if (-> this graph) - (set! (-> this root trans quad) (-> this graph node (-> this current-node) position quad)) + (vector-copy! (-> this root trans) (-> this graph node (-> this current-node) position)) ) (dotimes (v1-25 6) (set! (-> this legs v1-25) (the-as handle #f)) diff --git a/goal_src/jak3/levels/desert/chase/desert-chase.gc b/goal_src/jak3/levels/desert/chase/desert-chase.gc index 228039e857c..bb9795a38da 100644 --- a/goal_src/jak3/levels/desert/chase/desert-chase.gc +++ b/goal_src/jak3/levels/desert/chase/desert-chase.gc @@ -122,13 +122,14 @@ ) :code (behavior () (suspend) - (suspend-for (seconds 3) (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) - (set! (-> a1-0 options) (overlaps-others-options)) - (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) - (set! (-> a1-0 tlist) *touching-list*) - (find-overlapping-shapes (-> self root) a1-0) - ) - ) + (suspend-for (seconds 3) + (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-0 options) (overlaps-others-options)) + (set! (-> a1-0 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-0 tlist) *touching-list*) + (find-overlapping-shapes (-> self root) a1-0) + ) + ) (let ((v1-10 (-> self root root-prim))) (set! (-> v1-10 prim-core collide-as) (collide-spec)) (set! (-> v1-10 prim-core collide-with) (collide-spec)) @@ -154,7 +155,7 @@ (process->handle (-> (cond ((logtest? (-> *part-group-id-table* 454 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this @@ -163,7 +164,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 454) :duration (seconds 3)) ) ) @@ -291,11 +292,11 @@ (activate! *camera-smush-control* 2048.0 30 150 1.0 0.8 (-> *display* camera-clock)) (cond ((logtest? (-> *part-group-id-table* 456 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 456)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 456)) ) ) @@ -315,9 +316,10 @@ (set! (-> s2-1 charge) 1.0) (set! (-> s2-1 options) (projectile-options)) (logclear! (-> s2-1 options) (projectile-options po14 po15 po16)) - (set! (-> s2-1 pos quad) - (-> (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) quad) - ) + (vector-copy! + (-> s2-1 pos) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) + ) (set! (-> s2-1 notify-handle) (the-as handle #f)) (set! (-> s2-1 owner-handle) (the-as handle #f)) (set! (-> s2-1 target-handle) (the-as handle #f)) @@ -363,7 +365,7 @@ (defbehavior catapult-target-init-by-other catapult-target ((arg0 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 455) self)) (go-virtual idle) ) @@ -503,9 +505,11 @@ (let ((v1-137 (-> self vehicle 3 handle process))) (set-setting! 'sound-ear v1-137 0.0 (-> v1-137 0 pid)) ) - (suspend-for (seconds 1.5)) + (suspend-for (seconds 1.5) + ) (desert-chase-ambush-manager-method-35 self 3) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) (set! (-> *display* force-sync) (the-as uint 240)) (sound-play "camera-pan-3" :position #f) @@ -513,9 +517,11 @@ (set-setting! 'sound-ear v1-157 0.0 (-> v1-157 0 pid)) ) (set-setting! 'entity-name "camera-400" 0.0 0) - (suspend-for (seconds 1.5)) + (suspend-for (seconds 1.5) + ) (desert-chase-ambush-manager-method-35 self 2) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (desert-chase-ambush-manager-method-35 self 1) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) (set! (-> *display* force-sync) (the-as uint 240)) @@ -524,9 +530,11 @@ (set-setting! 'sound-ear v1-181 0.0 (-> v1-181 0 pid)) ) (set-setting! 'entity-name "camera-402" 0.0 0) - (suspend-for (seconds 1.5)) + (suspend-for (seconds 1.5) + ) (desert-chase-ambush-manager-method-35 self 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (remove-setting! 'sound-ear) (persist-with-delay *setting-control* 'blur-a (seconds 1.5) 'blur-a 'abs 0.5 0) (set! (-> *display* force-sync) (the-as uint 240)) @@ -565,7 +573,8 @@ (if *target* (logclear! (-> *target* focus-status) (focus-status teleporting)) ) - (suspend-for (seconds 2.5)) + (suspend-for (seconds 2.5) + ) (remove-setting! 'entity-name) (dotimes (gp-20 4) (let ((s5-7 (-> self vehicle gp-20)) @@ -641,7 +650,7 @@ (set! (-> gp-1 0 guard-type) (the-as uint 11)) (set! (-> gp-1 0 entity) #f) (vector-reset! (-> gp-1 0 velocity)) - (set! (-> gp-1 0 position quad) (-> *stronghold-vehicle-stop-point* quad)) + (vector-copy! (-> gp-1 0 position) *stronghold-vehicle-stop-point*) (quaternion-copy! (-> gp-1 0 rotation) (new 'static 'quaternion :x -0.0297 :y -0.879 :z -0.019 :w -0.4753)) (let ((gp-2 (vehicle-spawn (vehicle-type v-toad) (-> gp-1 0)))) (when gp-2 @@ -672,7 +681,8 @@ (ppointer->handle (process-spawn hud-marauder :init hud-init-by-other :name "hud-marauder" :to self)) ) (set! (-> *game-info* counter) (the float (- (+ (-> self marauder-count) 60) (-> self total-spawned)))) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (until (and (>= (-> self total-spawned) (the-as uint 60)) (zero? (-> self marauder-count))) (when (>= (+ (current-time) (seconds -0.5)) (-> self check-timer)) (let* ((gp-5 (length *stronghold-marauder-start*)) @@ -693,7 +703,7 @@ (let ((s4-1 (new 'stack-no-clear 'vector)) (s3-0 (-> self target-point gp-6)) ) - (set! (-> s3-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s3-0 (target-pos 0)) (cond ((rand-vu-percent? 0.2) (+! (-> s3-0 x) (rand-vu-float-range -20480.0 20480.0)) @@ -752,7 +762,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 pos) arg0) (set! (-> gp-0 notify-handle) (process->handle this)) (set! (-> gp-0 owner-handle) (process->handle this)) ;; og:preserve-this @@ -815,7 +825,7 @@ ) (when s4-0 (let ((s3-1 (-> this target-point arg0))) - (set! (-> s3-1 quad) (-> *stronghold-inside-point* quad)) + (vector-copy! s3-1 *stronghold-inside-point*) (+! (-> s3-1 x) (rand-vu-float-range -122880.0 122880.0)) (+! (-> s3-1 z) (rand-vu-float-range -122880.0 122880.0)) (send-event s4-0 'launch s3-1 this) @@ -843,7 +853,7 @@ (set! f30-0 2.0) ) (let ((s1-0 (new 'stack-no-clear 'marauder-init-by-other-params))) - (set! (-> s1-0 trans quad) (-> arg0 pos quad)) + (vector-copy! (-> s1-0 trans) (-> arg0 pos)) (quaternion-copy! (-> s1-0 quat) (-> arg0 quat)) (set! (-> s1-0 entity) (-> this marauder-entity)) (set! (-> s1-0 directed?) #f) @@ -898,8 +908,8 @@ (set! (-> s2-0 params flags) (traffic-spawn-flags tsf6)) (set! (-> s2-0 params guard-type) (the-as uint 11)) (set! (-> s2-0 params entity) #f) - (set! (-> s2-0 params velocity quad) (-> s2-0 vec quad)) - (set! (-> s2-0 params position quad) (-> s3-1 pos quad)) + (vector-copy! (-> s2-0 params velocity) (-> s2-0 vec)) + (vector-copy! (-> s2-0 params position) (-> s3-1 pos)) (quaternion-copy! (-> s2-0 params rotation) (-> s3-1 quat)) (let ((a0-12 (vehicle-spawn (vehicle-type v-catapult) (-> s2-0 params)))) (when a0-12 @@ -991,7 +1001,7 @@ (defbehavior deschase-artifact-init-by-other deschase-artifact ((arg0 vector)) (set! (-> self level) (level-get *level* 'deschase)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self pos quad) (-> arg0 quad)) + (vector-copy! (-> self pos) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-deschase-artifact" (the-as (pointer level) #f))) @@ -1011,7 +1021,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-1 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-1 pos) arg0) (quaternion-identity! (-> s5-1 quat)) (set! (-> s5-1 flags) (task-arrow-flags taf3)) (set! (-> s5-1 map-icon) (the-as uint 13)) @@ -1040,11 +1050,11 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (when v1-0 - (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (vector-copy! s5-0 (-> v1-0 control trans)) (set! (-> s5-0 w) 4096.0) (when (focus-test? v1-0 pilot) (let ((a1-4 (the-as process-focusable (handle->process (-> v1-0 pilot vehicle))))) - (set! (-> s5-0 quad) (-> a1-4 root root-prim prim-core world-sphere quad)) + (vector-copy! s5-0 (-> a1-4 root root-prim prim-core world-sphere)) ) ) (let ((f0-1 (vector-vector-distance-squared (-> this root trans) s5-0)) @@ -1093,6 +1103,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this deschase-artifact) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1281,7 +1292,7 @@ (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead))) ) (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 uvec quad) (-> (the-as process-focusable gp-0) root trans quad)) + (vector-copy! (-> s4-0 uvec) (-> (the-as process-focusable gp-0) root trans)) (vector-float*! (-> s4-0 rvec) (-> (the-as process-focusable gp-0) root transv) 0.1) (set! (-> s4-0 fvec x) 24576.0) (let ((s5-1 (the-as (array collide-shape) ((method-of-type array new) @@ -1456,7 +1467,7 @@ (set! (-> s5-0 guard-type) (the-as uint 11)) (set! (-> s5-0 entity) #f) (vector-reset! (-> s5-0 velocity)) - (set! (-> s5-0 position quad) (-> arg1 pos quad)) + (vector-copy! (-> s5-0 position) (-> arg1 pos)) (quaternion-copy! (-> s5-0 rotation) (-> arg1 quat)) (let ((s5-1 (vehicle-spawn (vehicle-type v-marauder-b) (the-as traffic-object-spawn-params (&-> s5-0 object-type)))) ) @@ -1535,7 +1546,7 @@ (let ((gp-0 (new 'stack-no-clear 'player-controller-init-params))) (set! (-> gp-0 mode) 'active) (set! (-> gp-0 flags) (player-controller-flag pc1 lock-features letterbox pc4)) - (set! (-> gp-0 targ-pos quad) (-> *stronghold-player-goto-point* quad)) + (vector-copy! (-> gp-0 targ-pos) *stronghold-player-goto-point*) (set! (-> gp-0 notify-proc) (process->handle self)) (set! (-> self h-player-controller) (ppointer->handle (process-spawn player-controller gp-0 :name "player-controller" :to *target*)) @@ -1614,7 +1625,8 @@ 0 ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((gp-7 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-7 from) (process->ppointer self)) (set! (-> gp-7 num-params) 0) @@ -1637,7 +1649,8 @@ (set! (-> gp-8 i-node) 48) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((gp-10 (-> self control-array 2))) (when (not (handle->process (-> gp-10 vehicle))) (spawn-chase-vehicle self (the-as deschase-vehicle gp-10) (-> *stronghold-vehicle-start* 0)) @@ -1646,7 +1659,8 @@ 0 ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((gp-12 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-12 from) (process->ppointer self)) (set! (-> gp-12 num-params) 0) @@ -1669,7 +1683,8 @@ (set! (-> gp-13 i-node) 48) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((gp-15 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-15 from) (process->ppointer self)) (set! (-> gp-15 num-params) 0) @@ -1685,8 +1700,10 @@ ) ) ) - (suspend-for (seconds 1)) - (suspend-for (seconds 4)) + (suspend-for (seconds 1) + ) + (suspend-for (seconds 4) + ) (send-event (handle->process (-> self h-player-controller)) 'change-mode 'idle) (dotimes (gp-18 4) (let ((s5-7 (-> self control-array gp-18))) @@ -1779,7 +1796,8 @@ ) ) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (was-squad-manager-start self) (let ((v1-66 *was-squad-control*)) (set! (-> v1-66 target-count) 2) @@ -1918,7 +1936,8 @@ (if (-> self minimap) (logior! (-> self minimap flags) (minimap-flag fade-out)) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (+! gp-6 -1) (if (= gp-6 -1) (goto cfg-176) @@ -1961,7 +1980,8 @@ (defstate complete (desert-chase-chase-manager) :virtual #t :code (behavior () - (suspend-for (seconds 4)) + (suspend-for (seconds 4) + ) (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/desert/chase/desert-jump.gc b/goal_src/jak3/levels/desert/chase/desert-jump.gc index 8ad1389c657..e5077ae430c 100644 --- a/goal_src/jak3/levels/desert/chase/desert-jump.gc +++ b/goal_src/jak3/levels/desert/chase/desert-jump.gc @@ -172,7 +172,7 @@ (toggle-status gp-0 (entity-perm-status dead) #t) (toggle-status s5-0 (entity-perm-status dead) #t) (kill-by-type wascity-airlock *active-pool*) - (set! (-> self root trans quad) (-> gp-0 extra trans quad)) + (vector-copy! (-> self root trans) (-> gp-0 extra trans)) (spawn-exploder self) ) ) @@ -193,7 +193,7 @@ (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) (let ((v1-2 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) 327680.0))) (vector+! v1-2 v1-2 (-> this root trans)) - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> v1-2 quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) v1-2) ) (set! (-> gp-0 fountain-rand-transv-hi x) 81920.0) (set! (-> gp-0 fountain-rand-transv-hi y) 327680.0) @@ -218,6 +218,7 @@ ) (defmethod init-from-entity! ((this wascity-airlock-debris) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (go (method-of-object this idle)) @@ -248,7 +249,7 @@ (defbehavior beam-generator-init-by-other beam-generator ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self pos quad) (-> arg0 quad)) + (vector-copy! (-> self pos) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-beam-generator" (the-as (pointer level) #f))) @@ -268,7 +269,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-1 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-1 pos) arg0) (quaternion-identity! (-> s5-1 quat)) (set! (-> s5-1 flags) (task-arrow-flags taf3)) (set! (-> s5-1 map-icon) (the-as uint 13)) @@ -309,11 +310,11 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (when v1-0 - (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (vector-copy! s5-0 (-> v1-0 control trans)) (set! (-> s5-0 w) 4096.0) (when (focus-test? v1-0 pilot) (let ((a1-4 (the-as process-focusable (handle->process (-> v1-0 pilot vehicle))))) - (set! (-> s5-0 quad) (-> a1-4 root root-prim prim-core world-sphere quad)) + (vector-copy! s5-0 (-> a1-4 root root-prim prim-core world-sphere)) ) ) (let ((f0-1 (vector-vector-distance-squared (-> this root trans) s5-0)) @@ -363,6 +364,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this beam-generator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -870,7 +872,8 @@ ) ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (send-event self 'complete) ) :post (behavior () @@ -920,7 +923,7 @@ ) (cond ((and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status dead)))) - (set! (-> this last-catapult-pos quad) (-> s3-0 root trans quad)) + (vector-copy! (-> this last-catapult-pos) (-> s3-0 root trans)) (let ((s1-0 (-> *desjump-vehicle-path* (-> s4-1 path-type) (-> s4-1 path-pos))) (s2-1 (= (+ (length (-> *desjump-vehicle-path* (-> s4-1 path-type))) -1) (-> s4-1 path-pos))) ) @@ -1085,7 +1088,7 @@ (defmethod spawn-beam-generator ((this desert-jump-manager) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (+! (-> s5-0 y) 8192.0) (set! (-> this generator) (ppointer->handle (process-spawn beam-generator s5-0 (-> this entity) :name "beam-generator" :to this)) @@ -1134,8 +1137,8 @@ (set! (-> s0-0 params flags) (traffic-spawn-flags)) (set! (-> s0-0 params guard-type) (the-as uint 11)) (set! (-> s0-0 params entity) #f) - (set! (-> s0-0 params velocity quad) (-> s0-0 vec quad)) - (set! (-> s0-0 params position quad) (-> s2-0 pos quad)) + (vector-copy! (-> s0-0 params velocity) (-> s0-0 vec)) + (vector-copy! (-> s0-0 params position) (-> s2-0 pos)) (quaternion-copy! (-> s0-0 params rotation) (-> s2-0 quat)) (let ((s2-1 (vehicle-spawn arg1 (-> s0-0 params)))) (when s2-1 diff --git a/goal_src/jak3/levels/desert/chase/marauder.gc b/goal_src/jak3/levels/desert/chase/marauder.gc index 0455fb55dab..7ae59532465 100644 --- a/goal_src/jak3/levels/desert/chase/marauder.gc +++ b/goal_src/jak3/levels/desert/chase/marauder.gc @@ -177,34 +177,34 @@ :jump-height-min (meters 1) :jump-height-factor 0.2 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 49152.0 - :knocked-soft-vxz-hi 73728.0 - :knocked-soft-vy-lo 32768.0 - :knocked-soft-vy-hi 49152.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 32768.0 - :knocked-medium-vy-hi 49152.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 32768.0 - :knocked-hard-vy-hi 49152.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 49152.0 - :knocked-yellow-vxz-hi 65536.0 - :knocked-yellow-vy-lo 32768.0 - :knocked-yellow-vy-hi 49152.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 32768.0 - :knocked-red-vy-hi 49152.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 + :knocked-soft-vxz-lo (meters 12) + :knocked-soft-vxz-hi (meters 18) + :knocked-soft-vy-lo (meters 8) + :knocked-soft-vy-hi (meters 12) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 8) + :knocked-medium-vy-hi (meters 12) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 8) + :knocked-hard-vy-hi (meters 12) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 12) + :knocked-yellow-vxz-hi (meters 16) + :knocked-yellow-vy-lo (meters 8) + :knocked-yellow-vy-hi (meters 12) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 8) + :knocked-red-vy-hi (meters 12) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 8) + :knocked-blue-vy-hi (meters 12) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) @@ -515,17 +515,18 @@ (set! (-> *marauder-nav-enemy-info* fact-defaults) *fact-info-marauder-defaults*) (defmethod init-jump-info! ((this marauder) (arg0 enemy-jump-info)) + "Populate an enemy-jump-info for jumping to this enemy's event-param-point" (set! (-> arg0 flags) (enemy-jump-flags ejf0)) (set! (-> arg0 anim-speed) (rnd-float-range this 0.9 1.1)) (set! (-> arg0 hang-time) 0) - (set! (-> arg0 dest-pos quad) (-> this event-param-point quad)) - (set! (-> arg0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> arg0 dest-pos) (-> this event-param-point)) + (vector-copy! (-> arg0 start-pos) (-> this root trans)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (if (enemy-above-ground? this s4-0 (-> arg0 dest-pos) (-> this gnd-collide-with) 20480.0 81920.0 1024.0) (set! (-> arg0 dest-pos y) (-> s4-0 best-other-tri intersect y)) ) ) - (setup-jump! this arg0) + (setup-jump-trajectory! this arg0) (none) ) @@ -568,6 +569,7 @@ ) (defmethod event-handler ((this marauder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-1 object)) (case arg2 (('nav-mesh-moved) @@ -609,7 +611,7 @@ ) (('save) (let ((a0-23 (the-as object (-> arg3 param 0)))) - (set! (-> this save-pos quad) (-> (the-as vector a0-23) quad)) + (vector-copy! (-> this save-pos) (the-as vector a0-23)) ) (set! v0-1 #t) (set! (-> this save) (the-as symbol v0-1)) @@ -633,7 +635,7 @@ (let ((s4-1 (the-as vector (-> arg3 param 0))) (s5-1 (the-as vector (-> arg3 param 1))) ) - (set! (-> this root trans quad) (-> s4-1 quad)) + (vector-copy! (-> this root trans) s4-1) (quaternion<-rotate-y-vector (-> this root quat) (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1)) (set-vector! (-> this root scale) 0.6 0.6 0.6 1.0) (setup-from-to-height! (-> this traj) s4-1 s5-1 12288.0 -4.551111) @@ -649,7 +651,8 @@ ) ) -(defmethod send-attack-on-jump-or-knocked ((this marauder) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this marauder) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (when (!= (-> arg0 type) target) (let* ((s3-0 (-> arg1 param 0)) (s2-0 arg0) @@ -682,7 +685,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -694,6 +697,7 @@ ) (defmethod enemy-common-post ((this marauder)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -724,19 +728,23 @@ (none) ) -(defmethod enemy-method-123 ((this marauder)) +(defmethod allow-ragdoll? ((this marauder)) + "Can this enemy ragdoll now?" (= (-> this hit-points) 0.0) ) (defmethod ragdoll-spawn! ((this marauder) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." ((method-of-type nav-enemy ragdoll-spawn!) this arg0 arg1) ) (defmethod ragdoll-settled? ((this marauder)) + "Has the ragdoll stopped moving?" ((method-of-type nav-enemy ragdoll-settled?) this) ) (defmethod knocked-anim ((this marauder) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (cond ((not (focus-test? this dead)) @@ -792,6 +800,7 @@ ) (defmethod knocked-land-anim ((this marauder) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((not (focus-test? this dead)) (cond @@ -846,6 +855,7 @@ ) (defmethod jump-wind-up-anim ((this marauder) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 0.0) (set! (-> a0-1 param 1) 1.0) @@ -881,6 +891,7 @@ ) (defmethod jump-in-air-anim ((this marauder) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (let ((v1-2 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) @@ -927,6 +938,7 @@ ) (defmethod jump-land-anim ((this marauder) (arg0 enemy-jump-info)) + "Play the landing anim" (ja-channel-push! 1 0) (cond ((-> this jump-attack) @@ -996,7 +1008,7 @@ (suspend) (ja :num! (loop! f30-0)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! gp-0 (ja-linear-vel 0)) (let ((v1-21 (-> self nav))) (set! (-> v1-21 target-speed) (-> gp-0 z)) ) @@ -1012,7 +1024,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-method-187 self) @@ -1094,7 +1106,7 @@ (let ((a0-0 (-> self nav state)) (v1-8 *null-vector*) ) - (set! (-> a0-0 velocity quad) (-> v1-8 quad)) + (vector-copy! (-> a0-0 velocity) v1-8) ) 0 ) @@ -1133,14 +1145,14 @@ (let* ((v1-21 (get-trans (the-as process-focusable gp-0) 0)) (f30-0 (vector-length (vector-! (new 'stack-no-clear 'vector) v1-21 (-> self root trans)))) ) - (when (enemy-method-105 self 8192.0 #t) + (when (pointing-toward-focus? self 8192.0 #t) (should-check-los? (-> self los) 0) (cond ((< f30-0 32768.0) (cond ((rand-vu-percent? 0.5) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (let ((a0-16 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (a1-10 gp-1) ) @@ -1206,7 +1218,7 @@ (suspend) (ja :num! (loop! f30-0)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! gp-0 (ja-linear-vel 0)) (let ((v1-21 (-> self nav))) (set! (-> v1-21 target-speed) (-> gp-0 z)) ) @@ -1311,7 +1323,7 @@ (let ((a0-4 (handle->process (-> self focus handle)))) (set! gp-0 (when a0-4 (set! gp-0 (-> self target-pos)) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-4) 3) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-4) 3)) gp-0 ) ) @@ -1486,7 +1498,8 @@ ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod check-victory ((this marauder)) +(defmethod clear-stale-victory ((this marauder)) + "Remove victory flag if needed." (if (or (time-elapsed? (-> this hit-focus-time) (seconds 4)) (and (handle->process (-> this focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) @@ -1526,12 +1539,14 @@ (call-parent-method this offset) ) -(defmethod penetrate->next-state ((this marauder) (arg0 process) (arg1 event-message-block) (arg2 float)) - ((method-of-type nav-enemy penetrate->next-state) this arg0 arg1 arg2) +(defmethod msg-for-incoming-attack ((this marauder) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." + ((method-of-type nav-enemy msg-for-incoming-attack) this arg0 arg1 arg2) ) ;; WARN: Return type mismatch number vs float. (defmethod get-damage-from-attack ((this marauder) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let ((v0-1 (the-as number (call-parent-method this arg0 arg1)))) (if (logtest? (-> (the-as attack-info (-> arg1 param 1)) penetrate-using) (penetrate punch spin)) (set! v0-1 #x40000000) @@ -1546,13 +1561,14 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-2 quad)) + (vector-copy! (-> v1-1 target-pos) a0-2) ) 0 (none) ) -(defmethod go-directed2 ((this marauder)) +(defmethod go-next-state-auto ((this marauder)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (cond ((-> this ambush?) (set! (-> this ambush?) #f) @@ -1613,7 +1629,7 @@ ; (suspend) (when (and (-> self skip-jump) (not (sphere-in-view-frustum? gp-0))) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (let ((a0-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (a1-1 gp-1) ) @@ -1644,7 +1660,7 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a1-2 quad) vf6) ) - (set! (-> self root trans quad) (-> gp-1 quad)) + (vector-copy! (-> self root trans) gp-1) ) (go-virtual hostile) ) @@ -1690,7 +1706,7 @@ (set! (-> v1-58 prim-core collide-with) (-> self root backup-collide-with)) ) (let ((gp-3 (new 'stack-no-clear 'vector))) - (set! (-> gp-3 quad) (-> self root trans quad)) + (vector-copy! gp-3 (-> self root trans)) (let ((a0-22 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (a1-8 gp-3) ) @@ -1821,12 +1837,12 @@ (let ((gp-0 (-> self root))) (cond ((focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) ) (else (when (!= (-> self incoming knocked-type) (knocked-type yellow-shot)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! s5-0 (ja-linear-vel 0)) (vector-orient-by-quat! s5-0 s5-0 (-> gp-0 quat)) ) ) @@ -1849,11 +1865,13 @@ ) ) -(defmethod go-idle2 ((this marauder)) +(defmethod go-fallback-init ((this marauder)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this ambush)) ) (defmethod on-attack ((this marauder) (arg0 process-focusable)) + "Handler after this enemy attacks something. By default focuses on the attacked, but could be overriden." (if (and (= (-> arg0 type) target) (-> this next-state) (let ((v1-4 (-> this next-state name))) (or (= v1-4 'attack-run) (= v1-4 'jump)) ) @@ -1865,9 +1883,9 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod init-enemy-defaults! ((this marauder) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this marauder) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1876,6 +1894,7 @@ ) (defmethod init-enemy-collision! ((this marauder)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1988,12 +2007,13 @@ ;; WARN: Return type mismatch symbol vs none. (defmethod init-enemy! ((this marauder)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-marauder" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *marauder-nav-enemy-info*) + (setup-enemy! this *marauder-nav-enemy-info*) (if (logtest? (enemy-flag multi-focus) (-> this enemy-flags)) (logior! (-> this fact enemy-options) (enemy-option multi-focus)) ) diff --git a/goal_src/jak3/levels/desert/chase/wcar-catapult.gc b/goal_src/jak3/levels/desert/chase/wcar-catapult.gc index 3a29d45e4b8..aaff744530a 100644 --- a/goal_src/jak3/levels/desert/chase/wcar-catapult.gc +++ b/goal_src/jak3/levels/desert/chase/wcar-catapult.gc @@ -1290,7 +1290,7 @@ ) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (go-virtual active) ) @@ -1302,18 +1302,7 @@ (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) ) :trans (behavior () - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (math-camera-matrix)) - (v1-0 (-> a2-0 rvec quad)) - (a0-0 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-0) - (set! (-> gp-0 uvec quad) a0-0) - (set! (-> gp-0 fvec quad) a1-0) - (set! (-> gp-0 trans quad) a2-1) - ) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) (-> gp-0 fvec) (-> gp-0 rvec) (matrix->quat gp-0 (-> self root quat)) @@ -1398,11 +1387,11 @@ (defmethod projectile-method-26 ((this v-catapult-shot)) (cond ((logtest? (-> *part-group-id-table* 452 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 452)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 452)) ) ) @@ -1572,7 +1561,7 @@ (vector+! v1-79 (-> s5-2 transform trans) v1-79) (cond ((logtest? (-> *part-group-id-table* 448 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-79 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-79) (part-tracker-spawn part-tracker-subsampler :to this @@ -1581,7 +1570,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-79 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-79) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 448) :duration (seconds 4)) ) ) @@ -1632,11 +1621,11 @@ (set! (-> s1-0 charge) 1.0) (set! (-> s1-0 options) (projectile-options)) (logclear! (-> s1-0 options) (projectile-options po14 po15 po16)) - (set! (-> s1-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s1-0 pos) arg0) (set! (-> s1-0 notify-handle) (process->handle (handle->process (-> this notify-handle)))) (set! (-> s1-0 owner-handle) (process->handle this)) (set! (-> s1-0 target-handle) (the-as handle #f)) - (set! (-> s1-0 target-pos quad) (-> arg1 quad)) + (vector-copy! (-> s1-0 target-pos) arg1) (set! (-> s1-0 ignore-handle) (process->handle this)) (let* ((v1-29 *game-info*) (a0-22 (+ (-> v1-29 attack-id) 1)) @@ -1813,11 +1802,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 452 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 452)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 452)) ) ) @@ -1852,7 +1841,7 @@ (s4-1 (< (vector-vector-angle-safe s4-0 a1-4) 5461.3335)) (a1-6 (new 'stack 'debris-tuning (the-as uint 1))) ) - (set! (-> a1-6 fountain-rand-transv-lo quad) (-> this root trans quad)) + (vector-copy! (-> a1-6 fountain-rand-transv-lo) (-> this root trans)) (set! (-> a1-6 hit-xz-reaction) 0.95) (set! (-> a1-6 hit-y-reaction) 0.6) (set! (-> a1-6 scale-rand-lo) 1.0) @@ -2066,7 +2055,7 @@ ) (when (and a0-2 v1-1) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this targ-pos quad) (-> a0-2 quad)) + (vector-copy! (-> this targ-pos) a0-2) (set! (-> this notify-handle) (process->handle v1-1)) (let ((v0-0 (the-as object #t))) (set! (-> this launch-projectile?) (the-as symbol v0-0)) diff --git a/goal_src/jak3/levels/desert/des-bbush-tasks.gc b/goal_src/jak3/levels/desert/des-bbush-tasks.gc index 5ce1efb5597..6b264c80c48 100644 --- a/goal_src/jak3/levels/desert/des-bbush-tasks.gc +++ b/goal_src/jak3/levels/desert/des-bbush-tasks.gc @@ -345,7 +345,7 @@ ) (when v1-10 (set! (-> this player-vehicle) (-> *target* pilot vehicle)) - (set! (-> this ground-pos quad) (-> (the-as process-focusable v1-10) root trans quad)) + (vector-copy! (-> this ground-pos) (-> (the-as process-focusable v1-10) root trans)) (set-time! (-> this ground-time)) (dotimes (s5-1 3) (send-event (handle->process (-> this player-vehicle)) 'turbo-pickup) @@ -373,7 +373,7 @@ ) (set! (-> this max-distance) (fmax (-> this max-distance) (-> this distance))) (set! (-> this max-air-time) (fmax (-> this max-air-time) (-> this air-time))) - (set! (-> this ground-pos quad) (-> v1-26 root trans quad)) + (vector-copy! (-> this ground-pos) (-> v1-26 root trans)) (set-time! (-> this ground-time)) (set! (-> this distance) 0.0) (set! (-> this air-time) 0.0) @@ -538,7 +538,8 @@ (script-eval gp-0) ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (while (not (-> *setting-control* user-current speech-control)) (suspend) ) diff --git a/goal_src/jak3/levels/desert/des-burning-bush.gc b/goal_src/jak3/levels/desert/des-burning-bush.gc index 6cf2eb5ee1c..656d73e3a99 100644 --- a/goal_src/jak3/levels/desert/des-burning-bush.gc +++ b/goal_src/jak3/levels/desert/des-burning-bush.gc @@ -232,18 +232,7 @@ (let ((gp-0 (get-current-task-event (-> self task))) (s5-0 #f) ) - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-1 (-> self node-list data 3 bone transform)) - (v1-5 (-> a2-1 rvec quad)) - (a0-2 (-> a2-1 uvec quad)) - (a1-1 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> s4-0 rvec quad) v1-5) - (set! (-> s4-0 uvec quad) a0-2) - (set! (-> s4-0 fvec quad) a1-1) - (set! (-> s4-0 trans quad) a2-2) - ) + (let ((s4-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform)))) (when (< (vector-dot (-> s4-0 fvec) (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans s4-0 (new 'stack-no-clear 'vector))) @@ -460,7 +449,7 @@ ) (vector-orient-by-quat! (-> gp-0 vec2) (new 'static 'vector :y 16384.0 :z 40960.0 :w 1.0) (-> gp-0 quat)) (vector+! (-> gp-0 vec1) (-> self root trans) (-> gp-0 vec2)) - (set! (-> *camera* slave 0 trans quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> *camera* slave 0 trans) (-> gp-0 vec1)) (let ((v1-10 (-> gp-0 vec2))) (let ((a0-9 (-> self root trans))) (let ((a1-4 *up-vector*)) @@ -483,18 +472,7 @@ (-> *camera* local-down) ) ) - (let* ((v1-17 (-> gp-0 mat)) - (a3-1 (-> self node-list data 3 bone transform)) - (a0-14 (-> a3-1 rvec quad)) - (a1-8 (-> a3-1 uvec quad)) - (a2-6 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-17 rvec quad) a0-14) - (set! (-> v1-17 uvec quad) a1-8) - (set! (-> v1-17 fvec quad) a2-6) - (set! (-> v1-17 trans quad) a3-2) - ) + (matrix-copy! (-> gp-0 mat) (-> self node-list data 3 bone transform)) (matrix->trans (-> gp-0 mat) (-> gp-0 vec2)) (vector-! (-> gp-0 vec2) (camera-pos) (-> gp-0 vec2)) (when (< (vector-dot (-> gp-0 mat fvec) (-> gp-0 vec2)) 0.0) @@ -876,7 +854,7 @@ (-> self root quat) ) ) - (set! (-> *camera* slave 0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> *camera* slave 0 trans) gp-0) (let ((t9-3 forward-down->inv-matrix) (a0-7 (-> *camera* slave 0 tracking)) (a1-1 (new 'stack-no-clear 'vector)) @@ -1126,6 +1104,7 @@ ) (defmethod init-from-entity! ((this des-burning-bush) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (des-burning-bush-method-32 this) (process-drawable-from-entity! this arg0) (des-burning-bush-method-33 this) @@ -1375,7 +1354,7 @@ (defmethod task-manager-desert-bbush-get-to-method-32 ((this task-manager-desert-bbush-get-to)) - (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (if (= (level-status? *level* 'waswide #f) 'active) (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) ) @@ -1431,7 +1410,7 @@ (set! (-> t1-1 fade-time) (the-as time-frame (the int (-> *burning-bush-get-on-info* (-> self info index) time))) ) - (set! (-> a0-3 quad) (-> *burning-bush-get-on-info* (-> self info index) trans quad)) + (vector-copy! a0-3 (-> *burning-bush-get-on-info* (-> self info index) trans)) (+! (-> a0-3 y) 4096.0) (set! (-> self skill) (ppointer->handle @@ -1451,24 +1430,13 @@ (suspend) (let ((f30-0 (-> *camera* settings fov))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *camera-combiner* trans quad)) - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-7 (-> *camera-combiner* inv-camera-rot)) - (v1-46 (-> a2-7 rvec quad)) - (a0-15 (-> a2-7 uvec quad)) - (a1-15 (-> a2-7 fvec quad)) - (a2-8 (-> a2-7 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-46) - (set! (-> gp-0 uvec quad) a0-15) - (set! (-> gp-0 fvec quad) a1-15) - (set! (-> gp-0 trans quad) a2-8) - ) + (vector-copy! s5-0 (-> *camera-combiner* trans)) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> *camera-combiner* inv-camera-rot)))) (let ((s4-0 (new 'stack 'transformq))) (let ((v1-52 (-> *burning-bush-get-on-info* (-> self info index))) (a1-17 (new 'stack-no-clear 'matrix)) ) - (set! (-> s4-0 trans quad) (-> v1-52 camera-trans quad)) + (vector-copy! (-> s4-0 trans) (-> v1-52 camera-trans)) (set-vector! (-> s4-0 scale) 1.0 1.0 1.0 1.0) (set! (-> a1-17 rvec x) (-> v1-52 camera-rot 0)) (set! (-> a1-17 rvec y) (-> v1-52 camera-rot 1)) @@ -1495,18 +1463,8 @@ (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) ) (set! (-> self update-fov?) #f) - (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) - (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) - (v1-75 (-> gp-0 rvec quad)) - (a0-24 (-> gp-0 uvec quad)) - (a1-19 (-> gp-0 fvec quad)) - (a3-5 (-> gp-0 trans quad)) - ) - (set! (-> a2-15 rvec quad) v1-75) - (set! (-> a2-15 uvec quad) a0-24) - (set! (-> a2-15 fvec quad) a1-19) - (set! (-> a2-15 trans quad) a3-5) - ) + (vector-copy! (-> *camera-combiner* trans) s5-0) + (matrix-copy! (-> *camera-combiner* inv-camera-rot) gp-0) ) ) (set! (-> *camera* settings fov) f30-0) @@ -1555,6 +1513,7 @@ ) (defmethod init-from-entity! ((this wascity-burning-bush) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (des-burning-bush-method-32 this) (process-drawable-from-entity! this arg0) (des-burning-bush-method-33 this) diff --git a/goal_src/jak3/levels/desert/des-bush.gc b/goal_src/jak3/levels/desert/des-bush.gc index 9c768db94ef..122512fcae2 100644 --- a/goal_src/jak3/levels/desert/des-bush.gc +++ b/goal_src/jak3/levels/desert/des-bush.gc @@ -572,7 +572,7 @@ (defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring)) (cond - ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + ((= (level-status? *level* 'waswide #f) 'active) (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) (set-setting! 'music 'wasring 0.0 0) ) @@ -629,10 +629,7 @@ (defmethod hud-timer-handler ((this task-manager-desert-bbush-ring)) (with-pp (cond - ((and *target* - (= (status-of-level-and-borrows *level* 'desert #f) 'active) - (focus-test? *target* pilot-riding) - ) + ((and *target* (= (level-status? *level* 'desert #f) 'active) (focus-test? *target* pilot-riding)) (when (nonzero? (-> this start-time)) (let ((v1-8 (handle->process (-> this hud-timer)))) (if (and *target* (not v1-8)) @@ -1035,11 +1032,11 @@ (cond ((focus-test? v1-0 pilot) (let ((a2-1 (handle->process (-> v1-0 pilot vehicle)))) - (set! (-> a1-0 quad) (-> (the-as vehicle a2-1) root root-prim prim-core world-sphere quad)) + (vector-copy! a1-0 (-> (the-as vehicle a2-1) root root-prim prim-core world-sphere)) ) ) (else - (set! (-> a1-0 quad) (-> v1-0 control trans quad)) + (vector-copy! a1-0 (-> v1-0 control trans)) (+! (-> a1-0 y) 12288.0) ) ) @@ -1143,12 +1140,13 @@ ) (defmethod init-from-entity! ((this desert-chase-ring) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set-ring-particle-texture) (alloc-trsqv! this) (process-drawable-from-entity! this arg0) (set! (-> this ring-radius) (res-lump-float arg0 'ring-radius :default 24576.0)) (quaternion->matrix (-> this mat) (-> this root quat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1547) this)) (set! (-> this part-final) (create-launch-control (-> *part-group-id-table* 1548) this)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1178,11 +1176,11 @@ :enter (behavior () (cond ((logtest? (-> *part-group-id-table* 1546 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1546)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1546)) ) ) @@ -1280,7 +1278,7 @@ (defbehavior spirit-init-by-other spirit ((arg0 vector)) (set! (-> self play-pixie?) #f) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self sound-id) (new-sound-id)) (set! (-> self sound-id-2) (new-sound-id)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1541) self)) @@ -1645,7 +1643,7 @@ (defmethod set-sbanks ((this task-manager-bbush-spirit-chase)) (cond - ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + ((= (level-status? *level* 'waswide #f) 'active) (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) (set-setting! 'music 'waspirit 0.0 0) ) @@ -1960,8 +1958,8 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('trigger) - (set! (-> self src quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self dst quad) (-> self root trans quad)) + (vector-copy! (-> self src) (the-as vector (-> block param 0))) + (vector-copy! (-> self dst) (-> self root trans)) (setup-from-to-duration! (-> self traj) (-> self src) (-> self dst) 300.0 -4.551111) (go-virtual idle) ) @@ -2037,6 +2035,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this score-drop) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) diff --git a/goal_src/jak3/levels/desert/des-cactus.gc b/goal_src/jak3/levels/desert/des-cactus.gc index e920226aa48..96825f1adfd 100644 --- a/goal_src/jak3/levels/desert/des-cactus.gc +++ b/goal_src/jak3/levels/desert/des-cactus.gc @@ -213,7 +213,7 @@ ) (defmethod des-plant-method-35 ((this des-plant) (arg0 vector)) - (set! (-> this attack-vel quad) (-> arg0 quad)) + (vector-copy! (-> this attack-vel) arg0) (if (< 81920.0 (vector-length (-> this attack-vel))) (vector-normalize! (-> this attack-vel) 81920.0) ) @@ -419,6 +419,7 @@ ) (defmethod init-from-entity! ((this des-cactus-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -527,6 +528,7 @@ ) (defmethod init-from-entity! ((this des-cactus-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) diff --git a/goal_src/jak3/levels/desert/desert-dust-storm.gc b/goal_src/jak3/levels/desert/desert-dust-storm.gc index 9ab3df11406..5023d1aef75 100644 --- a/goal_src/jak3/levels/desert/desert-dust-storm.gc +++ b/goal_src/jak3/levels/desert/desert-dust-storm.gc @@ -58,7 +58,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self level) arg0) (set! (-> self enabled-screen-filter?) #f) - (set! (-> self origin quad) (-> arg2 quad)) + (vector-copy! (-> self origin) arg2) (set-time! (-> self state-time)) (set! (-> self current-wind-angle-speed) 0.0) (set! (-> self current-wind-angle) 0.0) @@ -136,7 +136,7 @@ (go-virtual die) ) (('hold-pos) - (set! (-> self origin quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self origin) (the-as vector (-> block param 0))) (set! (-> self dest-wind-angle) (the-as float (-> block param 1))) (go-virtual hold-pos) ) @@ -145,7 +145,7 @@ :trans (behavior () (desert-dust-storm-method-20 self) (set! *duststorm-stationary?* #f) - (set! (-> self origin quad) (-> (math-camera-pos) quad)) + (vector-copy! (-> self origin) (math-camera-pos)) (desert-dust-storm-method-18 self) (desert-dust-storm-method-17 self) ) @@ -182,7 +182,7 @@ (-> self intensity) ) (('hold-pos) - (set! (-> self origin quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self origin) (the-as vector (-> block param 0))) (set! (-> self dest-wind-angle) (the-as float (-> block param 1))) (set! v0-0 (current-time)) (set! (-> self last-hold-time) (the-as time-frame v0-0)) @@ -360,7 +360,7 @@ ((>= (/ (the float (- (current-time) (-> this state-time))) (the float (-> this new-generate-time))) 1.0) (set-time! (-> this state-time)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! s5-0 (-> (math-camera-matrix) fvec)) 0.0 (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) @@ -399,7 +399,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! s5-1 (-> (math-camera-matrix) fvec)) 0.0 (let ((f28-3 1.0)) (set! (-> s5-1 y) 0.0) @@ -474,7 +474,7 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (dotimes (s2-0 15) - (set! (-> s3-0 quad) (-> this origin quad)) + (vector-copy! s3-0 (-> this origin)) (let ((s1-0 s3-0) (s0-0 s3-0) ) @@ -655,7 +655,7 @@ (f30-2 (* f30-1 (+ f28-1 (* f26-0 (+ -1.0 (the-as float v1-34)))))) (s5-3 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-3 quad) (-> *duststorm-wind-vec* quad)) + (vector-copy! s5-3 *duststorm-wind-vec*) (let* ((f28-2 -0.3) (f26-1 0.6) (v1-41 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -665,7 +665,7 @@ ) (vector-float*! s5-3 s5-3 f30-2) (let ((t1-0 (new 'static 'vector))) - (set! (-> t1-0 quad) (-> s5-3 quad)) + (vector-copy! t1-0 s5-3) (set-setting! 'global-wind #f 0.0 t1-0) ) ) @@ -715,7 +715,7 @@ (let ((f0-48 (+ -1.0 (-> this intensity)))) 0.0 (let ((a2-8 (new 'stack-no-clear 'vector))) - (set! (-> a2-8 quad) (-> *time-of-day-context* current-fog fog-color quad)) + (vector-copy! a2-8 (-> *time-of-day-context* current-fog fog-color)) (set! (-> a2-8 w) (* 128.0 f0-48)) (set! (-> this enabled-screen-filter?) #t) (setup *screen-filter* a2-8 a2-8 10000.0 diff --git a/goal_src/jak3/levels/desert/desert-part.gc b/goal_src/jak3/levels/desert/desert-part.gc index a7a21d35cc0..fa789d45724 100644 --- a/goal_src/jak3/levels/desert/desert-part.gc +++ b/goal_src/jak3/levels/desert/desert-part.gc @@ -1248,7 +1248,7 @@ ;; WARN: Return type mismatch vector vs none. (defun birth-func-desert-beacon-set-accel ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (math-camera-matrix) rvec quad)) + (vector-copy! s5-0 (-> (math-camera-matrix) rvec)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 6.826667) (set! (-> s5-0 y) (-> arg1 acc y)) diff --git a/goal_src/jak3/levels/desert/desert-scenes.gc b/goal_src/jak3/levels/desert/desert-scenes.gc index 69d47778eae..ecae7821e57 100644 --- a/goal_src/jak3/levels/desert/desert-scenes.gc +++ b/goal_src/jak3/levels/desert/desert-scenes.gc @@ -6240,7 +6240,7 @@ () (when (not (-> self aborted?)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> *time-of-day-context* current-fog fog-color quad)) + (vector-copy! gp-0 (-> *time-of-day-context* current-fog fog-color)) (set! (-> gp-0 w) 128.0) (disable *screen-filter*) (setup *screen-filter* gp-0 gp-0 1.0 (bucket-id tex-hud-pris2) #x3fffff #x33001 #t) @@ -6258,8 +6258,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> *time-of-day-context* current-fog fog-color quad)) - (set! (-> s5-0 quad) (-> *time-of-day-context* current-fog fog-color quad)) + (vector-copy! gp-0 (-> *time-of-day-context* current-fog fog-color)) + (vector-copy! s5-0 (-> *time-of-day-context* current-fog fog-color)) (set! (-> gp-0 w) 128.0) (set! (-> s5-0 w) 0.0) (disable *screen-filter*) diff --git a/goal_src/jak3/levels/desert/desertf-obs.gc b/goal_src/jak3/levels/desert/desertf-obs.gc index 5135a838bc1..28f65d4b541 100644 --- a/goal_src/jak3/levels/desert/desertf-obs.gc +++ b/goal_src/jak3/levels/desert/desertf-obs.gc @@ -79,6 +79,7 @@ ) (defmethod init-from-entity! ((this des-jump-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -191,8 +192,8 @@ (vector-normalize! (vector-z-quaternion! s2-0 (-> self root quat)) 102400.0) (vector-x-quaternion! s4-0 (-> self root quat)) (vector+! s2-0 s2-0 (-> self root trans)) - (set! (-> s3-0 quad) (-> s2-0 quad)) - (set! (-> gp-3 quad) (-> s2-0 quad)) + (vector-copy! s3-0 s2-0) + (vector-copy! gp-3 s2-0) (vector+! s3-0 s3-0 (vector-normalize! s4-0 143360.0)) (vector+! gp-3 gp-3 (vector-normalize! s4-0 -102400.0)) ) @@ -335,6 +336,7 @@ ) (defmethod init-from-entity! ((this des-draw-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -484,6 +486,7 @@ ) (defmethod init-from-entity! ((this des-garage-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) diff --git a/goal_src/jak3/levels/desert/desertg-obs.gc b/goal_src/jak3/levels/desert/desertg-obs.gc index 567d5d4f39e..3ed6c6fa792 100644 --- a/goal_src/jak3/levels/desert/desertg-obs.gc +++ b/goal_src/jak3/levels/desert/desertg-obs.gc @@ -147,6 +147,7 @@ ) (defmethod init-from-entity! ((this desert-eggwall) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this task-node) (game-task-node nest-eggs-wall)) (cond ((task-node-closed? (-> this task-node)) @@ -264,7 +265,7 @@ (when s5-1 (setup-masks (-> self draw) 0 (the-as int (-> s5-1 prim-id))) (set! (-> s5-1 prim-core collide-as) (collide-spec)) - (set! (-> gp-1 quad) (-> s5-1 prim-core world-sphere quad)) + (vector-copy! gp-1 (-> s5-1 prim-core world-sphere)) ) ) ) @@ -274,16 +275,16 @@ (-> self root) (lambda ((arg0 collide-shape-prim)) (set! (-> arg0 prim-core collide-as) (collide-spec)) 0 (none)) ) - (set! (-> gp-1 quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! gp-1 (-> self root root-prim prim-core world-sphere)) ) ) (cond ((logtest? (-> *part-group-id-table* 1232 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1232)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1232)) ) ) @@ -329,6 +330,7 @@ ) (defmethod init-from-entity! ((this des-cactus-obstacle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate diff --git a/goal_src/jak3/levels/desert/hover/des-beast-2.gc b/goal_src/jak3/levels/desert/hover/des-beast-2.gc index 058eb13b373..f1bc9d3eb30 100644 --- a/goal_src/jak3/levels/desert/hover/des-beast-2.gc +++ b/goal_src/jak3/levels/desert/hover/des-beast-2.gc @@ -36,7 +36,7 @@ (set! (-> a0-4 user-int16 1) (the int (/ (-> (the-as vector v1-1) y) METER_LENGTH))) (set! (-> a0-4 user-int16 2) (the int (/ (-> (the-as vector v1-1) z) METER_LENGTH))) ) - (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + (vector-copy! (-> self root trans) (the-as vector v1-1)) ) (logclear! (-> self mask) (process-mask actor-pause)) (send-event *camera* 'change-target self) @@ -68,7 +68,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set-vector! (-> gp-0 move-dist) 0.0 -204800.0 0.0 1.0) - (set! (-> gp-0 start-pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> self root trans)) (+! (-> gp-0 start-pos y) 102400.0) (let ((v1-15 gp-0)) (set! (-> v1-15 radius) 409.6) @@ -108,7 +108,7 @@ ) (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-1 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 pos) (-> self root trans)) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags taf3 taf5)) (set! (-> gp-1 map-icon) (the-as uint 12)) @@ -170,6 +170,7 @@ ) (defmethod init-from-entity! ((this quantum-reflector) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (the-as penetrate -1)) (let ((v1-3 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -273,7 +274,7 @@ (set! (-> self minimap) #f) ) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) (-> self blast-radius)) (set! (-> gp-0 scale) 1.0) @@ -510,7 +511,7 @@ ) :trans (behavior () (if (and (!= (-> self s-clock) 1.0) *camera*) - (set! (-> *camera* slave 0 trans quad) (-> *beast-camera-slow-motion* quad)) + (vector-copy! (-> *camera* slave 0 trans) *beast-camera-slow-motion*) ) (let ((gp-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (the int (the float (the int (-> self path-pos))))) @@ -629,8 +630,8 @@ (v1-9 (-> self root trans)) (s5-1 (new 'stack-no-clear 'inline-array 'vector 16)) ) - (set! (-> s5-1 0 quad) (-> self focus-pos quad)) - (set! (-> s5-1 1 quad) (-> self focus-vel quad)) + (vector-copy! (-> s5-1 0) (-> self focus-pos)) + (vector-copy! (-> s5-1 1) (-> self focus-vel)) (vector-! (-> s5-1 5) (-> s5-1 0) v1-9) (set! (-> s5-1 2 x) (vector-length (-> s5-1 5))) (vector-normalize! (-> s5-1 5) 1.0) @@ -690,7 +691,7 @@ (set! sv-336 (the-as float 122880.0)) (setup-from-to-height! gp-2 s5-2 s4-3 32768.0 -36864.0) ) - (set! (-> self shot-velocity quad) (-> gp-2 initial-velocity quad)) + (vector-copy! (-> self shot-velocity) (-> gp-2 initial-velocity)) ) (vector-length-max! (-> self shot-velocity) 122880.0) ) @@ -728,7 +729,7 @@ (set! sv-504 -1) (set! sv-512 (-> self des-path node)) (let ((s5-5 (new 'stack-no-clear 'vector))) - (set! (-> s5-5 quad) (-> (get-trans gp-7 0) quad)) + (vector-copy! s5-5 (get-trans gp-7 0)) (set! sv-516 s5-5) ) (vector+float*! @@ -746,7 +747,7 @@ (when (or (= sv-504 -1) (< f0-47 sv-500)) (set! sv-500 f0-47) (set! sv-504 gp-8) - (set! (-> sv-496 quad) (-> s5-8 quad)) + (vector-copy! sv-496 s5-8) ) ) ) @@ -868,9 +869,9 @@ (cond ((and (-> this next-state) (= (-> this next-state name) 'hostile)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! s4-0 (ja-linear-vel 0)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> (ja-linear-vel 1) quad)) + (vector-copy! s3-0 (ja-linear-vel 1)) (vector-lerp! arg0 s4-0 s3-0 (-> this anim-interp)) ) ) @@ -893,12 +894,12 @@ (set! (-> a1-3 charge) 1.0) (set! (-> a1-3 options) (projectile-options)) (logclear! (-> a1-3 options) (projectile-options po14 po15 po16)) - (set! (-> a1-3 pos quad) (-> a0-2 quad)) - (set! (-> a1-3 vel quad) (-> v1-1 quad)) + (vector-copy! (-> a1-3 pos) a0-2) + (vector-copy! (-> a1-3 vel) v1-1) (set! (-> a1-3 notify-handle) (the-as handle #f)) (set! (-> a1-3 owner-handle) (process->handle this)) (set! (-> a1-3 target-handle) (the-as handle #f)) - (set! (-> a1-3 target-pos quad) (-> this target-gun-pos quad)) + (vector-copy! (-> a1-3 target-pos) (-> this target-gun-pos)) (set! (-> a1-3 ignore-handle) (process->handle this)) (let* ((v1-10 *game-info*) (a0-16 (+ (-> v1-10 attack-id) 1)) @@ -915,6 +916,7 @@ ) (defmethod find-best-focus ((this des-beast-2)) + "Search for the best thing to focus on." (if (not (-> this vehicle-handle)) (set! (-> this vehicle-handle) (-> *vehicle-info* handle-by-vehicle-type 14)) ) @@ -925,7 +927,7 @@ ) ) (when s5-0 - (enemy-method-70 this (the-as process-focusable s5-0) (get-enemy-aware this (enemy-aware ea3))) + (set-focus! this (the-as process-focusable s5-0) (modify-awareness this (enemy-aware hostile))) s5-0 ) ) @@ -933,14 +935,15 @@ ;; WARN: Return type mismatch int vs process. (defmethod update-focus ((this des-beast-2)) + "Potentially update the focus, if there is something better to focus on." (call-parent-method this) (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s4-0) 3)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> (get-transv (the-as process-focusable s4-0)) quad)) + (vector-copy! s5-1 (get-transv (the-as process-focusable s4-0))) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> this focus-vel quad)) + (vector-copy! s4-1 (-> this focus-vel)) (let* ((f28-0 (vector-length s4-1)) (f30-0 (lerp f28-0 (vector-length s5-1) (* 0.75 (seconds-per-frame)))) ) @@ -952,7 +955,7 @@ (vector-float*! (-> this focus-vel) s4-1 f30-0) ) (else - (set! (-> this focus-vel quad) (-> s5-1 quad)) + (vector-copy! (-> this focus-vel) s5-1) ) ) ) @@ -964,6 +967,7 @@ ) (defmethod enemy-common-post ((this des-beast-2)) + "Common implementation of post. Runs ja-post." (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this last-draw-time)) ) @@ -973,6 +977,7 @@ ) (defmethod event-handler ((this des-beast-2) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('event-foot) (sound-play "desbeast-step") @@ -998,12 +1003,14 @@ ) ) -(defmethod go-idle2 ((this des-beast-2)) +(defmethod go-fallback-init ((this des-beast-2)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this hostile)) ) ;; WARN: Return type mismatch cspace vs none. (defmethod init-enemy! ((this des-beast-2)) + "Typical place for shared init code. Runs from entity or process style init." (let ((t9-0 (method-of-type des-beast init-enemy!))) (t9-0 this) ) @@ -1034,7 +1041,7 @@ (-> (the-as des-beast-2 s4-0) angle-turret) ) (quaternion->matrix (-> arg0 bone transform) (the-as quaternion (-> gp-0 rvec))) - (set! (-> arg0 bone transform trans quad) (-> gp-0 trans quad)) + (vector-copy! (-> arg0 bone transform trans) (-> gp-0 trans)) ) 0 (none) @@ -1074,7 +1081,7 @@ (the-as quaternion (-> gp-0 uvec)) ) (quaternion->matrix (-> arg0 bone transform) (the-as quaternion (-> gp-0 uvec))) - (set! (-> arg0 bone transform trans quad) (-> gp-0 trans quad)) + (vector-copy! (-> arg0 bone transform trans) (-> gp-0 trans)) ) 0 (none) diff --git a/goal_src/jak3/levels/desert/hover/des-beast.gc b/goal_src/jak3/levels/desert/hover/des-beast.gc index 69f540c320d..ee728be9542 100644 --- a/goal_src/jak3/levels/desert/hover/des-beast.gc +++ b/goal_src/jak3/levels/desert/hover/des-beast.gc @@ -107,7 +107,7 @@ (set! (-> *beast-grenade-trail* zbuffer?) #f) -(set! (-> *beast-grenade-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *beast-grenade-trail* lie-vector) *up-vector*) (set! (-> *beast-grenade-trail* use-tape-mode?) #f) @@ -963,7 +963,7 @@ (set! (-> v1-26 y) 8.0) (set! (-> v1-26 z) 8.0) (set! (-> v1-26 w) 1.0) - (set! (-> this root scale quad) (-> v1-26 quad)) + (vector-copy! (-> this root scale) v1-26) ) 0 (none) @@ -1030,7 +1030,7 @@ ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) (-> self blast-radius)) (set! (-> gp-0 scale) 1.0) @@ -1114,34 +1114,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -1205,34 +1205,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 10) @@ -1471,7 +1471,7 @@ ) :trans (behavior () (if (and (!= (-> self s-clock) 1.0) *camera*) - (set! (-> *camera* slave 0 trans quad) (-> *beast-camera-slow-motion* quad)) + (vector-copy! (-> *camera* slave 0 trans) *beast-camera-slow-motion*) ) (let ((gp-0 (new 'stack-no-clear 'vector))) (let* ((a1-0 (the int (the float (the int (-> self path-pos))))) @@ -1575,7 +1575,7 @@ ) (else (let ((a1-6 (new 'stack-no-clear 'vector))) - (set! (-> a1-6 quad) (-> self root trans quad)) + (vector-copy! a1-6 (-> self root trans)) (set! (-> a1-6 w) 409600.0) (if (or (des-beast-method-167 self a1-6) (and (-> self can-turn?) (time-elapsed? (-> self state-time) (seconds 6)) @@ -1777,6 +1777,7 @@ ) (defmethod event-handler ((this des-beast) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('touch) #f @@ -1791,7 +1792,7 @@ #f ) (('touched) - (send-attack-on-jump-or-knocked this arg0 arg3) + (enemy-touched-handler this arg0 arg3) ) (('attack) (let ((s5-0 (the-as attack-info (-> arg3 param 1)))) @@ -1881,7 +1882,8 @@ #f ) -(defmethod send-attack-on-jump-or-knocked ((this des-beast) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this des-beast) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond ((= (-> arg0 type) target) (let ((s4-0 (-> arg1 param 0))) @@ -1924,7 +1926,7 @@ (not (logtest? (-> this entity extra perm status) (entity-perm-status dead))) ) (let ((s2-1 (new 'stack-no-clear 'vector))) - (set! (-> s2-1 quad) (-> this root transv quad)) + (vector-copy! s2-1 (-> this root transv)) (if (< (vector-length s2-1) 40960.0) (vector-normalize! s2-1 40960.0) ) @@ -1968,7 +1970,7 @@ (persist-with-delay *setting-control* 'interp-time (seconds 4) 'interp-time 'abs 300.0 0) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (let ((s5-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-1 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s5-1 start-pos) (-> this root trans)) (vector-float*! (-> s5-1 move-dist) s3-4 f30-2) (let ((v1-64 s5-1)) (set! (-> v1-64 radius) 12288.0) @@ -1987,7 +1989,7 @@ ) (vector+! *beast-camera-slow-motion* (-> s5-1 start-pos) (-> s5-1 move-dist)) ) - (set! (-> *camera* slave 0 trans quad) (-> *beast-camera-slow-motion* quad)) + (vector-copy! (-> *camera* slave 0 trans) *beast-camera-slow-motion*) (set! (-> this s-clock) 0.25) ) ) @@ -2047,7 +2049,7 @@ ) (defmethod get-linear-vel! ((this des-beast) (arg0 vector)) - (set! (-> arg0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! arg0 (ja-linear-vel 0)) arg0 ) @@ -2064,7 +2066,7 @@ (let ((s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> this root gspot-normal quad)) + (vector-copy! s4-0 (-> this root gspot-normal)) (vector-cross! (new 'stack-no-clear 'vector) s5-1 s4-0) (let ((f0-2 (vector-vector-angle-safe s5-1 s4-0))) (when (< 1.8204443 f0-2) @@ -2084,7 +2086,7 @@ (let ((a1-11 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (v1-25 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-25 quad) (-> *up-vector* quad)) + (vector-copy! v1-25 *up-vector*) (seek! (-> this speed-factor) (- 1.0 (* 0.25 (vector-dot a1-11 v1-25))) (seconds-per-frame)) ) (seek! (-> this main-speed-factor) (-> this main-speed-factor-dest) (seconds-per-frame)) @@ -2096,7 +2098,7 @@ (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 21))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> this node-list data 21 bone transform fvec quad)) + (vector-copy! s5-0 (-> this node-list data 21 bone transform fvec)) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (vector-normalize! s5-0 81920.0) @@ -2105,8 +2107,8 @@ (set! (-> a1-2 charge) 1.0) (set! (-> a1-2 options) (projectile-options)) (logclear! (-> a1-2 options) (projectile-options po14 po15 po16)) - (set! (-> a1-2 pos quad) (-> s4-0 quad)) - (set! (-> a1-2 vel quad) (-> s5-0 quad)) + (vector-copy! (-> a1-2 pos) s4-0) + (vector-copy! (-> a1-2 vel) s5-0) (set! (-> a1-2 notify-handle) (the-as handle #f)) (set! (-> a1-2 owner-handle) (process->handle this)) (set! (-> a1-2 target-handle) (the-as handle #f)) @@ -2128,6 +2130,7 @@ ;; WARN: Return type mismatch float vs none. (defmethod enemy-common-post ((this des-beast)) + "Common implementation of post. Runs ja-post." (when (>= (+ (current-time) (seconds -2)) (-> this attack-id-time)) (let* ((v1-4 *game-info*) (a0-3 (+ (-> v1-4 attack-id) 1)) @@ -2208,7 +2211,7 @@ ) (quaternion-vector-angle! s4-0 *up-vector* (-> (the-as des-beast s3-0) angle-turret)) (quaternion->matrix (-> arg0 bone transform) s4-0) - (set! (-> arg0 bone transform trans quad) (-> s5-0 quad)) + (vector-copy! (-> arg0 bone transform trans) s5-0) ) ) 0 @@ -2258,7 +2261,8 @@ ) ) -(defmethod go-idle2 ((this des-beast)) +(defmethod go-fallback-init ((this des-beast)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this idle)) ) @@ -2289,6 +2293,7 @@ ) (defmethod init-enemy-collision! ((this des-beast)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2444,12 +2449,13 @@ ;; WARN: Return type mismatch cspace vs none. (defmethod init-enemy! ((this des-beast)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-des-beast" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *des-beast-enemy-info*) + (setup-enemy! this *des-beast-enemy-info*) (set! (-> this event-hook) enemy-event-handler) (logclear! (-> this mask) (process-mask actor-pause)) (logior! (-> this mask) (process-mask enemy)) @@ -2518,14 +2524,15 @@ ) (defmethod init-from-entity! ((this des-beast) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-enemy-collision! this) (process-drawable-from-entity! this arg0) (set! (-> this manager) (the-as handle #f)) (init-enemy! this) - (set! (-> this root trans quad) (-> this des-path node 0 position quad)) + (vector-copy! (-> this root trans) (-> this des-path node 0 position)) (set! (-> this hit-part) (create-launch-control (-> *part-group-id-table* 414) this)) (des-beast-method-166 this) - (go-idle2 this) + (go-fallback-init this) ) (defbehavior des-beast-init-by-other des-beast ((arg0 level) (arg1 entity-actor) (arg2 desbeast-path) (arg3 quaternion) (arg4 handle)) @@ -2533,11 +2540,11 @@ (set! (-> self entity) arg1) (set! (-> self manager) arg4) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg2 node 0 position quad)) + (vector-copy! (-> self root trans) (-> arg2 node 0 position)) (quaternion-copy! (-> self root quat) arg3) (set! (-> self des-path) arg2) (set! (-> self hit-part) (create-launch-control (-> *part-group-id-table* 414) self)) (init-enemy! self) (des-beast-method-166 self) - (go-idle2 self) + (go-fallback-init self) ) diff --git a/goal_src/jak3/levels/desert/hover/mh-flyer.gc b/goal_src/jak3/levels/desert/hover/mh-flyer.gc index 0f0a1d2e718..13b8f8fdbde 100644 --- a/goal_src/jak3/levels/desert/hover/mh-flyer.gc +++ b/goal_src/jak3/levels/desert/hover/mh-flyer.gc @@ -116,7 +116,7 @@ (set! (-> *mh-flyer-missile-trail* zbuffer?) #f) -(set! (-> *mh-flyer-missile-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *mh-flyer-missile-trail* lie-vector) *up-vector*) (set! (-> *mh-flyer-missile-trail* use-tape-mode?) #f) @@ -172,7 +172,7 @@ (set! (-> self minimap) #f) ) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 40960.0) (set! (-> gp-0 scale) 1.0) @@ -249,21 +249,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 102 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 102)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 102)) ) ) ) ((logtest? (-> *part-group-id-table* 101 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 101)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 101)) ) ) @@ -341,7 +341,7 @@ (let ((v1-23 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-12 (-> arg0 hit-pos)) ) - (set! (-> a1-12 quad) (-> s5-0 trans quad)) + (vector-copy! a1-12 (-> s5-0 trans)) (vector+! a1-12 a1-12 v1-23) (move-to-point! (-> arg0 root) a1-12) ) @@ -428,7 +428,7 @@ (the-as pair 0) ) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 327680.0) @@ -667,34 +667,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9952 :y 0.0483 :z -0.0847 :w 19014.305) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -976,7 +976,7 @@ (defbehavior mh-flyer-fly-post mh-flyer () (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set-ground-pat! self a1-0 (collide-spec backgnd) 8192.0 163840.0 4096.0 (the-as process #f)) + (find-ground-and-set-pat! self a1-0 (collide-spec backgnd) 8192.0 163840.0 4096.0 (the-as process #f)) ) (if (!= (-> self root gspot-pos y) -40959590.0) (set! (-> self move-dest y) (+ 81920.0 (fmax (-> self move-dest y) (-> self root gspot-pos y)))) @@ -1025,7 +1025,7 @@ ) (vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) (-> self bank-angle) (-> self rotation-matrix fvec)) (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-1 1 quad) (-> self root transv quad)) + (vector-copy! (-> s5-1 1) (-> self root transv)) (vector-normalize! (-> s5-1 1) 1.0) (forward-up->quaternion (the-as quaternion (-> s5-1 0)) (-> s5-1 1) gp-0) (quaternion-slerp! @@ -1050,7 +1050,7 @@ :enter (behavior () (set! (-> self bank-angle) 0.0) (set! (-> self pitch-angle) 0.0) - (set! (-> self init-pos quad) (-> self root trans quad)) + (vector-copy! (-> self init-pos) (-> self root trans)) (vector-reset! (-> self root transv)) (let ((f0-3 (* 65536.0 (get-interp-mod-time 10.0 -0.2))) (gp-0 (new 'stack-no-clear 'vector)) @@ -1141,9 +1141,7 @@ (set! (-> gp-1 charge) (lerp-scale 0.0 1.0 (the float (-> self missiles-fired)) 0.0 3.0)) (set! (-> gp-1 options) (projectile-options)) (logclear! (-> gp-1 options) (projectile-options po14 po15 po16)) - (set! (-> gp-1 pos quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-flyer-lod0-jg jaw)) quad) - ) + (vector-copy! (-> gp-1 pos) (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-flyer-lod0-jg jaw))) (set! (-> gp-1 notify-handle) (the-as handle #f)) (set! (-> gp-1 owner-handle) (the-as handle #f)) (set! (-> gp-1 target-handle) (the-as handle #f)) @@ -1175,7 +1173,7 @@ (go empty-state) ) (let ((a1-10 (-> self des-path node (-> self path-pos)))) - (set! (-> self move-dest quad) (-> a1-10 position quad)) + (vector-copy! (-> self move-dest) (-> a1-10 position)) (if (< (vector-vector-distance (-> self root trans) (the-as vector a1-10)) 327680.0) (+! (-> self path-pos) 1) ) @@ -1203,7 +1201,7 @@ :code (behavior () (local-vars (v1-14 object)) (let ((gp-0 (-> self root transv))) - (set! (-> gp-0 quad) (-> self target-velocity quad)) + (vector-copy! gp-0 (-> self target-velocity)) (vector-length-max! gp-0 245760.0) (set! (-> gp-0 y) (fmax -163840.0 (fmin 163840.0 (-> gp-0 y)))) (vector-float*! gp-0 gp-0 0.5) @@ -1221,13 +1219,15 @@ (if (-> self skel effect) (do-effect (-> self skel effect) "death-default" 0.0 -1) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (cleanup-for-death self) ) ) ;; WARN: Return type mismatch int vs process. (defmethod update-focus ((this mh-flyer)) + "Potentially update the focus, if there is something better to focus on." (let ((t9-0 (method-of-type enemy update-focus))) (t9-0 this) ) @@ -1238,8 +1238,8 @@ ) ) (when s5-0 - (set! (-> this focus-bullseye-pos quad) (-> (get-trans s5-0 3) quad)) - (set! (-> this focus-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-copy! (-> this focus-bullseye-pos) (get-trans s5-0 3)) + (vector-copy! (-> this focus-pos) (get-trans s5-0 3)) (vector-! (-> this focus-xz-dir) (-> this focus-pos) (-> this root trans)) (set! (-> this focus-xz-dir y) 0.0) (vector-xz-normalize! (-> this focus-xz-dir) 1.0) @@ -1264,7 +1264,7 @@ (set! (-> gp-0 z) 0.0) (set! (-> gp-0 w) 0.0) (let ((f30-0 163840.0)) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-11 s4-0)) (set! (-> v1-11 radius) 3276.8) @@ -1321,6 +1321,7 @@ ) (defmethod enemy-common-post ((this mh-flyer)) + "Common implementation of post. Runs ja-post." (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) (mh-flyer-method-157 this) ((method-of-type enemy enemy-common-post) this) @@ -1328,6 +1329,7 @@ ) (defmethod event-handler ((this mh-flyer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (-> arg3 param 1) @@ -1340,7 +1342,8 @@ ) ) -(defmethod go-idle2 ((this mh-flyer)) +(defmethod go-fallback-init ((this mh-flyer)) + "If there's no specific settings for initial state, go to this state after spawning." (let ((v1-1 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))) (cond ((zero? v1-1) @@ -1360,6 +1363,7 @@ ) (defmethod init-enemy-collision! ((this mh-flyer)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1431,12 +1435,13 @@ ) (defmethod init-enemy! ((this mh-flyer)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-flyer" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *mh-flyer-enemy-info*) + (setup-enemy! this *mh-flyer-enemy-info*) (set! (-> this root pause-adjust-distance) 368640.0) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) @@ -1459,7 +1464,7 @@ (set! (-> self entity) arg1) (set! (-> self manager) arg4) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg2 node 0 position quad)) + (vector-copy! (-> self root trans) (-> arg2 node 0 position)) (quaternion-copy! (-> self root quat) arg3) (set! (-> self des-path) arg2) (init-enemy! self) diff --git a/goal_src/jak3/levels/desert/hover/scorpion-gun.gc b/goal_src/jak3/levels/desert/hover/scorpion-gun.gc index e97e00c74b8..8bf0ef7972f 100644 --- a/goal_src/jak3/levels/desert/hover/scorpion-gun.gc +++ b/goal_src/jak3/levels/desert/hover/scorpion-gun.gc @@ -19,7 +19,7 @@ (new 'static 'talker-speech-class :name "sig175" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1 :neg #x1 :on-close #f @@ -28,7 +28,7 @@ (new 'static 'talker-speech-class :name "sig176" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -37,7 +37,7 @@ (new 'static 'talker-speech-class :name "sig177" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :neg #x1 :on-close #f @@ -46,7 +46,7 @@ (new 'static 'talker-speech-class :name "sig178" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :neg #x1 :on-close #f @@ -55,7 +55,7 @@ (new 'static 'talker-speech-class :name "sig197" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5 :neg #x1 :on-close #f @@ -627,7 +627,7 @@ (case message (('draw) (set! (-> self draw?) #t) - (set! (-> self screen-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self screen-pos) (the-as vector (-> block param 0))) (let ((v0-0 (the-as object (-> block param 1)))) (set! (-> self color) (the-as rgba v0-0)) v0-0 @@ -713,7 +713,7 @@ ) (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) - (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (vector-copy! (-> a1-7 fvec) s2-0) (matrix->eul (the-as euler-angles s1-0) a1-7 21) (vector-negate! s3-2 s1-0) (let ((a0-14 s3-2)) @@ -735,11 +735,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 228 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 228)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 228)) ) ) @@ -831,8 +831,8 @@ (defmethod init-proj-settings! ((this scorpion-gun-shot)) (with-pp - (set! (-> this init-pos quad) (-> this root trans quad)) - (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) + (vector-copy! (-> this init-dir) (-> this starting-dir)) (vector-normalize-copy! (-> this root transv) (-> this init-dir) @@ -906,7 +906,7 @@ (vector+float*! sv-32 sv-32 (-> s5-0 bone transform fvec) -24576.0) (set! (-> sv-32 y) (fmax (-> sv-32 y) (-> s5-0 bone transform trans y))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 x) 0.0) (set! (-> s3-0 y) 0.0) @@ -1081,7 +1081,7 @@ ) ) (let ((gp-1 (-> self node-list data 7 bone transform))) - (set! (-> self aim-dir quad) (-> gp-1 fvec quad)) + (vector-copy! (-> self aim-dir) (-> gp-1 fvec)) (when (-> self target-handle) (let* ((s5-1 (handle->process (-> self target-handle))) (s4-2 (if (type? s5-1 process-drawable) @@ -1117,7 +1117,7 @@ (set! sv-1304 (-> self aim-dir)) (set! sv-1308 (new 'stack-no-clear 'vector)) (set! sv-1312 (the-as rgba (new 'stack-no-clear 'array 'rgba 1))) - (set! (-> sv-1300 start-pos quad) (-> sv-1296 bone transform trans quad)) + (vector-copy! (-> sv-1300 start-pos) (-> sv-1296 bone transform trans)) (vector-float*! (-> sv-1300 move-dist) sv-1304 1024000.0) (let ((v1-73 sv-1300)) (set! (-> v1-73 radius) 819.2) @@ -1258,7 +1258,7 @@ (set! (-> s5-0 params options) (projectile-options)) (logclear! (-> s5-0 params options) (projectile-options po14 po15 po16)) (set! (-> s5-0 params pos quad) (-> gp-0 bone transform trans quad)) - (set! (-> s5-0 params vel quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 params vel) (-> s5-0 vec0)) (set! (-> s5-0 params notify-handle) (the-as handle #f)) (set! (-> s5-0 params owner-handle) (process->handle s4-0)) (set! (-> s5-0 params target-handle) (the-as handle #f)) @@ -1279,18 +1279,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'matrix))) - (let* ((v1-37 s5-1) - (a3-1 (-> gp-0 bone transform)) - (a0-30 (-> a3-1 rvec quad)) - (a1-6 (-> a3-1 uvec quad)) - (a2-4 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-37 rvec quad) a0-30) - (set! (-> v1-37 uvec quad) a1-6) - (set! (-> v1-37 fvec quad) a2-4) - (set! (-> v1-37 trans quad) a3-2) - ) + (matrix-copy! s5-1 (-> gp-0 bone transform)) (matrix->trans (-> gp-0 bone transform) (-> s5-1 trans)) (if (logtest? (-> *part-group-id-table* 227 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -1333,7 +1322,7 @@ (s5-0 (-> this root)) ) (when gp-0 - (set! (-> s5-0 transv quad) (-> (the-as process-drawable gp-0) root transv quad)) + (vector-copy! (-> s5-0 transv) (-> (the-as process-drawable gp-0) root transv)) (quaternion-copy! (-> this scorp-quat) (-> (the-as process-drawable gp-0) root quat)) (vector-matrix*! (-> s5-0 trans) @@ -1515,7 +1504,7 @@ ) (('trans 'player-pos) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> self trans quad)) + (vector-copy! v1-1 (-> self trans)) (+! (-> v1-1 y) -12288.0) (set! v0-0 (-> arg3 param 0)) (set! (-> (the-as vector v0-0) quad) (-> v1-1 quad)) @@ -1690,7 +1679,7 @@ (set! (-> gp-0 guard-type) (the-as uint 11)) (set! (-> gp-0 entity) #f) (vector-reset! (-> gp-0 velocity)) - (set! (-> gp-0 position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> gp-0 position) (target-pos 0)) (quaternion-copy! (-> gp-0 rotation) (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 0.0) @@ -1939,9 +1928,11 @@ (send-event self 'use-camera #f) (send-event (handle->process (-> self gun)) 'shutdown) (send-event *camera* 'change-target (handle->process (-> self last-beast))) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (send-event (handle->process (-> self scorp)) 'set-control-hook-player) - (suspend-for (seconds 4)) + (suspend-for (seconds 4) + ) (until (process-release? *target*) (suspend) ) @@ -1980,7 +1971,8 @@ (send-event *camera* 'change-target (handle->process (-> self scorp))) ) :code (behavior () - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (let* ((v1-7 (-> *game-info* sub-task-list (game-task-node desert-beast-battle-kill-last-beast))) (v1-9 (if (-> v1-7 manager) (-> v1-7 manager manager) @@ -2045,7 +2037,7 @@ (defmethod scorpion-gun-manager-method-21 ((this scorpion-gun-manager)) (let ((v1-1 (handle->process (-> this scorp)))) (when v1-1 - (set! (-> this trans quad) (-> (the-as process-drawable v1-1) root trans quad)) + (vector-copy! (-> this trans) (-> (the-as process-drawable v1-1) root trans)) (quaternion-copy! (-> this quat) (-> (the-as process-drawable v1-1) root quat)) ) ) @@ -2058,7 +2050,7 @@ (dotimes (gp-0 (-> *desbeast-battle-path-table* length)) (let ((s5-0 (-> *desbeast-battle-path-table* gp-0))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> s5-0 node 0 position quad)) + (vector-copy! s4-0 (-> s5-0 node 0 position)) (+! (-> s4-0 y) 12288.0) (let ((s3-0 add-debug-text-3d) (s2-0 #t) @@ -2191,7 +2183,7 @@ :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 diff --git a/goal_src/jak3/levels/desert/lizard/desert-lizard-h.gc b/goal_src/jak3/levels/desert/lizard/desert-lizard-h.gc index 965fb8b8ef8..6c8a51c5391 100644 --- a/goal_src/jak3/levels/desert/lizard/desert-lizard-h.gc +++ b/goal_src/jak3/levels/desert/lizard/desert-lizard-h.gc @@ -132,7 +132,7 @@ (new 'static 'talker-speech-class :name "dax208" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x10 :neg #x1 :on-close #f @@ -141,7 +141,7 @@ (new 'static 'talker-speech-class :name "dax209" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x11 :neg #x1 :on-close #f @@ -150,7 +150,7 @@ (new 'static 'talker-speech-class :name "dax210" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x12 :neg #x1 :on-close #f @@ -159,7 +159,7 @@ (new 'static 'talker-speech-class :name "dax211" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x13 :neg #x1 :on-close #f @@ -168,7 +168,7 @@ (new 'static 'talker-speech-class :name "dax212" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x14 :neg #x1 :on-close #f @@ -177,7 +177,7 @@ (new 'static 'talker-speech-class :name "dax213" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15 :neg #x1 :on-close #f @@ -186,7 +186,7 @@ (new 'static 'talker-speech-class :name "dax214" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16 :neg #x1 :on-close #f @@ -195,7 +195,7 @@ (new 'static 'talker-speech-class :name "dax215" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x17 :neg #x1 :on-close #f @@ -204,7 +204,7 @@ (new 'static 'talker-speech-class :name "dax216" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x18 :neg #x1 :on-close #f @@ -213,7 +213,7 @@ (new 'static 'talker-speech-class :name "dax217" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x19 :neg #x1 :on-close #f @@ -222,7 +222,7 @@ (new 'static 'talker-speech-class :name "dax218" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1a :neg #x1 :on-close #f @@ -231,7 +231,7 @@ (new 'static 'talker-speech-class :name "dax219" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1b :neg #x1 :on-close #f @@ -240,7 +240,7 @@ (new 'static 'talker-speech-class :name "dax220" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1c :neg #x1 :on-close #f @@ -249,7 +249,7 @@ (new 'static 'talker-speech-class :name "dax221" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1d :neg #x1 :on-close #f @@ -258,7 +258,7 @@ (new 'static 'talker-speech-class :name "dax222" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1e :neg #x1 :on-close #f @@ -267,7 +267,7 @@ (new 'static 'talker-speech-class :name "dax223" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1f :neg #x1 :on-close #f @@ -276,7 +276,7 @@ (new 'static 'talker-speech-class :name "dax224" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x20 :neg #x1 :on-close #f @@ -285,7 +285,7 @@ (new 'static 'talker-speech-class :name "dax225" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x21 :neg #x1 :on-close #f @@ -294,7 +294,7 @@ (new 'static 'talker-speech-class :name "dax226" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x22 :neg #x1 :on-close #f @@ -303,7 +303,7 @@ (new 'static 'talker-speech-class :name "dax227" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x23 :neg #x1 :on-close #f @@ -312,7 +312,7 @@ (new 'static 'talker-speech-class :name "dax228" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x24 :neg #x1 :on-close #f @@ -321,7 +321,7 @@ (new 'static 'talker-speech-class :name "dax229" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x25 :neg #x1 :on-close #f @@ -330,7 +330,7 @@ (new 'static 'talker-speech-class :name "dax230" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x26 :neg #x1 :on-close #f @@ -339,7 +339,7 @@ (new 'static 'talker-speech-class :name "dax231" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x27 :neg #x1 :on-close #f @@ -356,7 +356,7 @@ (new 'static 'talker-speech-class :name "dax233" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x29 :neg #x1 :on-close #f @@ -365,7 +365,7 @@ (new 'static 'talker-speech-class :name "dax235" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2a :neg #x1 :on-close #f @@ -374,7 +374,7 @@ (new 'static 'talker-speech-class :name "dax236" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2b :neg #x1 :on-close #f @@ -383,7 +383,7 @@ (new 'static 'talker-speech-class :name "dax237" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2c :neg #x1 :on-close #f @@ -392,7 +392,7 @@ (new 'static 'talker-speech-class :name "dax238" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2d :neg #x1 :on-close #f @@ -401,7 +401,7 @@ (new 'static 'talker-speech-class :name "dax239" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2e :neg #x1 :on-close #f @@ -410,7 +410,7 @@ (new 'static 'talker-speech-class :name "dax240" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2f :neg #x1 :on-close #f @@ -419,7 +419,7 @@ (new 'static 'talker-speech-class :name "dax241" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x30 :neg #x1 :on-close #f @@ -428,7 +428,7 @@ (new 'static 'talker-speech-class :name "dax242" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x31 :neg #x1 :on-close #f diff --git a/goal_src/jak3/levels/desert/lizard/desert-lizard-task.gc b/goal_src/jak3/levels/desert/lizard/desert-lizard-task.gc index 26815951f26..d2497e5e06d 100644 --- a/goal_src/jak3/levels/desert/lizard/desert-lizard-task.gc +++ b/goal_src/jak3/levels/desert/lizard/desert-lizard-task.gc @@ -234,8 +234,7 @@ ) ) (when (time-elapsed? (-> self state-time) (seconds 5)) - (suspend-for - (seconds 1) + (suspend-for (seconds 1) (set! (-> self sound-id) (add-process *gui-control* self (gui-channel background) (gui-action queue) "hudchime" -99.0 0) ) @@ -283,7 +282,7 @@ ((and *target* (focus-test? *target* flut)) (when (not (-> self arrow-handle)) (let ((gp-4 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-4 pos quad) (-> *minimap-class-list* 121 default-position quad)) + (vector-copy! (-> gp-4 pos) (-> *minimap-class-list* 121 default-position)) (quaternion-identity! (-> gp-4 quat)) (set! (-> gp-4 flags) (task-arrow-flags taf8)) (set! (-> gp-4 map-icon) (the-as uint 12)) @@ -750,7 +749,7 @@ ) (s5-2 0) ) - (set! (-> s3-0 quad) (-> this corral-pos quad)) + (vector-copy! s3-0 (-> this corral-pos)) (set! (-> s4-3 length) (fill-actor-list-for-box *actor-hash* s3-0 (-> s4-3 data) (-> s4-3 allocated-length))) (dotimes (s3-1 (-> s4-3 length)) (if (type? (-> s4-3 s3-1 process) flut) @@ -900,6 +899,7 @@ ) (defmethod init-from-entity! ((this kleever-catch-lizards) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) diff --git a/goal_src/jak3/levels/desert/lizard/desert-lizard.gc b/goal_src/jak3/levels/desert/lizard/desert-lizard.gc index 93b13639b03..36cc6345e56 100644 --- a/goal_src/jak3/levels/desert/lizard/desert-lizard.gc +++ b/goal_src/jak3/levels/desert/lizard/desert-lizard.gc @@ -92,34 +92,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x -1.0 :w 1194.157) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -563,7 +563,7 @@ (when s4-0 (let ((gp-0 (-> self move-dest))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (get-trans s4-0 0) quad)) + (vector-copy! s5-0 (get-trans s4-0 0)) (let ((a1-3 (get-quat s4-0 0))) (when (focus-test? s4-0 pilot-riding) (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-3)) @@ -600,12 +600,12 @@ (let ((a0-15 (-> self nav state)) (a1-8 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-8 quad) (-> a0-15 target-pos quad)) + (vector-copy! a1-8 (-> a0-15 target-pos)) (when (< 2048.0 (vector-vector-xz-distance gp-0 a1-8)) (let ((v1-38 (-> self nav state))) (logclear! (-> v1-38 flags) (nav-state-flag directional-mode)) (logior! (-> v1-38 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-38 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-38 target-pos) gp-0) ) 0 ) @@ -671,7 +671,7 @@ ) ) (set! (-> self catch-timer) (the-as uint (current-time))) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -905,7 +905,7 @@ (let ((f0-2 (vector-vector-xz-distance arg1 arg0))) (when (< f28-0 f0-2) (set! f28-0 f0-2) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) ) ) (set! f30-0 (cond @@ -921,7 +921,7 @@ (+! f24-0 f26-0) ) (when (and (!= f28-0 0.0) (< 4096.0 (vector-vector-xz-distance (-> this root trans) s3-0))) - (set! (-> arg0 quad) (-> s3-0 quad)) + (vector-copy! arg0 s3-0) arg0 ) ) @@ -932,7 +932,7 @@ (local-vars (sv-160 vector) (sv-176 int) (sv-192 vector)) (with-pp (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (cond ((-> this graph) (let ((s2-0 (-> this graph point)) @@ -953,7 +953,7 @@ (when (or (< f0-0 f30-0) (= s1-0 -1)) (set! f30-0 f0-0) (set! s1-0 sv-176) - (set! (-> s0-0 quad) (-> sv-192 quad)) + (vector-copy! s0-0 sv-192) ) ) ) @@ -962,7 +962,7 @@ (when (!= s1-0 -1) (cond ((< 24576.0 f30-0) - (set! (-> s5-0 quad) (-> s0-0 quad)) + (vector-copy! s5-0 s0-0) ) (else (let ((s0-1 (new 'stack-no-clear 'inline-array 'vector 1))) @@ -972,7 +972,7 @@ (-> s2-0 (-> this graph edge s1-0 index 1)) (-> s0-1 0) ) - (set! (-> s5-0 quad) (-> s0-1 0 quad)) + (vector-copy! s5-0 (-> s0-1 0)) ) ) ) @@ -1012,10 +1012,11 @@ ) (defmethod knocked-handler ((this desert-lizard) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (case (-> this incoming knocked-type) (((knocked-type vehicle)) - (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + (vector-copy! arg0 (-> this incoming attack-direction)) arg0 ) (else @@ -1031,14 +1032,17 @@ ) (defmethod jump-wind-up-anim ((this desert-lizard) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" #f ) (defmethod jump-land-anim ((this desert-lizard) (arg0 enemy-jump-info)) + "Play the landing anim" #f ) -(defmethod enemy-method-108 ((this desert-lizard) (arg0 process-focusable)) +(defmethod should-flee-from? ((this desert-lizard) (arg0 process-focusable)) + "Return if this enemy should flee from the process." #t ) @@ -1056,6 +1060,7 @@ ) (defmethod event-handler ((this desert-lizard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1067,7 +1072,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1093,7 +1098,8 @@ ) ) -(defmethod go-idle2 ((this desert-lizard)) +(defmethod go-fallback-init ((this desert-lizard)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) (go (method-of-object this disappear)) (go (method-of-object this idle)) @@ -1102,6 +1108,7 @@ ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod init-enemy-collision! ((this desert-lizard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1155,12 +1162,13 @@ ) (defmethod init-enemy! ((this desert-lizard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-desert-lizard" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *desert-lizard-enemy-info*) + (setup-enemy! this *desert-lizard-enemy-info*) (set! (-> this root pause-adjust-distance) 819200.0) (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) @@ -1241,7 +1249,7 @@ ) (let ((gp-3 (new 'stack-no-clear 'enemy-init-by-other-params))) (let ((s5-2 (-> self entity))) - (set! (-> gp-3 trans quad) (-> s5-2 extra trans quad)) + (vector-copy! (-> gp-3 trans) (-> s5-2 extra trans)) (quaternion-copy! (-> gp-3 quat) (-> s5-2 quat)) (set! (-> gp-3 entity) s5-2) ) @@ -1267,6 +1275,7 @@ ) (defmethod init-from-entity! ((this desert-lizard-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this suppress-spawn-time) 0) (go (method-of-object this idle)) diff --git a/goal_src/jak3/levels/desert/oasis/ash-oasis-course.gc b/goal_src/jak3/levels/desert/oasis/ash-oasis-course.gc index aafced74bd6..9956dc2702d 100644 --- a/goal_src/jak3/levels/desert/oasis/ash-oasis-course.gc +++ b/goal_src/jak3/levels/desert/oasis/ash-oasis-course.gc @@ -22,7 +22,8 @@ ) -(defmethod go-idle2 ((this ashelin-oasis)) +(defmethod go-fallback-init ((this ashelin-oasis)) + "If there's no specific settings for initial state, go to this state after spawning." (go-idle this) ) @@ -117,12 +118,12 @@ (s3-2 (new 'stack-no-clear 'vector)) ) (if (< f30-0 122880.0) - (set! (-> s3-2 quad) (-> v1-7 quad)) - (set! (-> s3-2 quad) (-> s4-1 quad)) + (vector-copy! s3-2 v1-7) + (vector-copy! s3-2 s4-1) ) (vector+! s3-2 s3-2 (math-camera-pos)) (if arg0 - (set! (-> this last-sound-trans quad) (-> s3-2 quad)) + (vector-copy! (-> this last-sound-trans) s3-2) (vector-seek-3d-smooth! (-> this last-sound-trans) s3-2 (* 102400.0 (seconds-per-frame)) 1.0) ) ) @@ -153,6 +154,7 @@ ) (defmethod enemy-common-post ((this ashelin-oasis)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type ashelin enemy-common-post))) (t9-0 this) ) @@ -165,6 +167,7 @@ ) (defmethod event-handler ((this ashelin-oasis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('impact-impulse) (let ((v1-1 (the-as object (-> arg3 param 0)))) diff --git a/goal_src/jak3/levels/desert/oasis/oasis-defense.gc b/goal_src/jak3/levels/desert/oasis/oasis-defense.gc index 2ccd890a923..8a1a255835e 100644 --- a/goal_src/jak3/levels/desert/oasis/oasis-defense.gc +++ b/goal_src/jak3/levels/desert/oasis/oasis-defense.gc @@ -233,7 +233,7 @@ ) (loop (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self ash-entity extra trans quad)) + (vector-copy! gp-0 (-> self ash-entity extra trans)) (let ((f30-0 (vector-vector-distance gp-0 (target-pos 0)))) (when (and *was-squad-manager* (< f30-0 3276800.0)) (set! (-> *was-squad-control* target-count) 0) @@ -308,8 +308,8 @@ (set! (-> s4-0 params flags) (traffic-spawn-flags)) (set! (-> s4-0 params guard-type) (the-as uint 11)) (set! (-> s4-0 params entity) #f) - (set! (-> s4-0 params velocity quad) (-> s4-0 vec quad)) - (set! (-> s4-0 params position quad) (-> s5-1 pos quad)) + (vector-copy! (-> s4-0 params velocity) (-> s4-0 vec)) + (vector-copy! (-> s4-0 params position) (-> s5-1 pos)) (quaternion-copy! (-> s4-0 params rotation) (-> s5-1 quat)) (let ((s5-2 (vehicle-spawn (vehicle-type v-marauder) (-> s4-0 params)))) (when s5-2 @@ -467,7 +467,7 @@ (when a1-10 (let ((v1-83 (new 'stack-no-clear 'wvehicle-ai-drop-off-params))) (set! (-> v1-83 proc) a1-10) - (set! (-> v1-83 dest quad) (-> s2-0 pos quad)) + (vector-copy! (-> v1-83 dest) (-> s2-0 pos)) (send-event s3-0 'ai-drop-off v1-83) ) (set! (-> s4-0 spawned-marauder?) #t) @@ -603,7 +603,7 @@ ) ) (let ((s0-0 (new 'stack-no-clear 'marauder-init-by-other-params))) - (set! (-> s0-0 trans quad) (-> arg0 pos quad)) + (vector-copy! (-> s0-0 trans) (-> arg0 pos)) (quaternion-copy! (-> s0-0 quat) (-> arg0 quat)) (set! (-> s0-0 entity) (-> this marauder-entity)) (set! (-> s0-0 directed?) #f) @@ -678,8 +678,8 @@ (set! (-> sv-240 params flags) (traffic-spawn-flags)) (set! (-> sv-240 params guard-type) (the-as uint 11)) (set! (-> sv-240 params entity) #f) - (set! (-> sv-240 params velocity quad) (-> sv-240 vec quad)) - (set! (-> sv-240 params position quad) (-> s0-0 pos quad)) + (vector-copy! (-> sv-240 params velocity) (-> sv-240 vec)) + (vector-copy! (-> sv-240 params position) (-> s0-0 pos)) (quaternion-copy! (-> sv-240 params rotation) (-> s0-0 quat)) ) (let ((s0-1 (vehicle-spawn (vehicle-type v-marauder) (-> sv-240 params)))) @@ -785,6 +785,7 @@ ) (defmethod init-from-entity! ((this desoasis-hellcat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/goal_src/jak3/levels/desert/race/course-race.gc b/goal_src/jak3/levels/desert/race/course-race.gc index 11111548e44..ea9cd1edfd4 100644 --- a/goal_src/jak3/levels/desert/race/course-race.gc +++ b/goal_src/jak3/levels/desert/race/course-race.gc @@ -133,8 +133,8 @@ (s4-0 (-> s5-0 info)) (s3-0 (new 'stack-no-clear 'course-race-stack-var0)) ) - (set! (-> s3-0 vec1 quad) (-> s5-0 info start-sphere quad)) - (set! (-> s3-0 vec2 quad) (-> s5-0 info start-dir quad)) + (vector-copy! (-> s3-0 vec1) (-> s5-0 info start-sphere)) + (vector-copy! (-> s3-0 vec2) (-> s5-0 info start-dir)) (set! (-> s3-0 params object-type) (traffic-type vehicle-task)) (set! (-> s3-0 params behavior) (the-as uint 10)) (set! (-> s3-0 params id) (the-as uint 0)) @@ -152,7 +152,7 @@ (let ((v1-10 (-> s5-0 racer-array s2-0)) (s1-0 (-> s4-0 racer-array s2-0)) ) - (set! (-> s3-0 params position quad) (-> v1-10 start-position quad)) + (vector-copy! (-> s3-0 params position) (-> v1-10 start-position)) (set! (-> s3-0 params id) (the-as uint s2-0)) (set! (-> s3-0 params user-data) (-> s1-0 rider)) (logior! (-> s3-0 params flags) (traffic-spawn-flags tsf1)) @@ -160,7 +160,7 @@ (vector-reset! (-> s3-0 params velocity)) (let ((a0-16 (-> s1-0 rider))) (when (or (zero? a0-16) (= a0-16 1)) - (set! (-> this start-pos quad) (-> v1-10 start-position quad)) + (vector-copy! (-> this start-pos) (-> v1-10 start-position)) (logclear! (-> s3-0 params flags) (traffic-spawn-flags tsf1)) (logior! (-> s3-0 params flags) (traffic-spawn-flags tsf5)) ) @@ -266,12 +266,14 @@ ) (suspend) (speech-control-method-12 *speech-control* *target* (speech-type race-errol-start)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (set! (-> self race-started?) #t) (task-manager-race-method-38 self) (remove-setting! 'allow-progress) (send-event (ppointer->process *race-manager*) 'force-start) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (send-event (handle->process (-> self player-vehicle)) 'set-control-hook-player) (call-parent-state-handler code) ) @@ -313,8 +315,8 @@ (let ((t9-0 (method-of-type task-manager-race set-time-limit))) (t9-0 this) ) - (set! (-> this start-pos quad) (-> (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0) quad)) - (set! (-> this fail-plane quad) (-> (new 'static 'vector :x -0.9241 :z -0.3819 :w 1.0) quad)) + (vector-copy! (-> this start-pos) (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0)) + (vector-copy! (-> this fail-plane) (new 'static 'vector :x -0.9241 :z -0.3819 :w 1.0)) (set! (-> this fail-plane w) (- (vector-dot (-> this fail-plane) (new 'static 'vector :x 10571776.0 :z 1187840.0 :w 1.0))) ) @@ -497,7 +499,7 @@ ;; WARN: new jak 2 until loop case, check carefully (defbehavior task-manager-desert-course-race-pre-race-sequence task-manager-desert-course-race () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self start-pos quad)) + (vector-copy! (-> gp-0 pos) (-> self start-pos)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf3 taf5)) (set! (-> gp-0 map-icon) (the-as uint 12)) @@ -591,7 +593,8 @@ ) #f (label cfg-123) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (send-event (handle->process (-> self player-vehicle)) 'go-die) (remove-setting! 'entity-name) (send-event *target* 'continue (get-continue-by-name *game-info* "desertb-race-start")) @@ -665,7 +668,8 @@ ) (task-node-close! (game-task-node desert-course-race-win) 'event) (send-event (ppointer->process *race-manager*) 'kill-npc-racers) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (while (handle->process (-> self scene-player)) (suspend) ) @@ -834,6 +838,7 @@ ) (defmethod init-from-entity! ((this des-rally-bollard) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) diff --git a/goal_src/jak3/levels/desert/race/kleever-rider.gc b/goal_src/jak3/levels/desert/race/kleever-rider.gc index 0ac0f5b87cb..2688c7334c0 100644 --- a/goal_src/jak3/levels/desert/race/kleever-rider.gc +++ b/goal_src/jak3/levels/desert/race/kleever-rider.gc @@ -42,19 +42,8 @@ (let ((gp-0 (new 'stack-no-clear 'kleever-rider-stack-var0))) (let ((a0-1 (handle->process (-> self vehicle)))) (when a0-1 - (set! (-> gp-0 vec1 quad) (-> (the-as wvehicle a0-1) lin-acceleration quad)) - (let* ((v1-5 (-> gp-0 mat0)) - (a3-0 (-> (the-as wvehicle a0-1) rbody matrix)) - (a0-5 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-5 rvec quad) a0-5) - (set! (-> v1-5 uvec quad) a1-3) - (set! (-> v1-5 fvec quad) a2-0) - (set! (-> v1-5 trans quad) a3-1) - ) + (vector-copy! (-> gp-0 vec1) (-> (the-as wvehicle a0-1) lin-acceleration)) + (matrix-copy! (-> gp-0 mat0) (-> (the-as wvehicle a0-1) rbody matrix)) ) ) (set! (-> gp-0 time) (the-as uint (current-time))) @@ -173,7 +162,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (set! (-> self level) (level-get *level* 'destrack)) (initialize-skeleton @@ -235,19 +224,8 @@ (let ((gp-0 (new 'stack-no-clear 'kleever-rider-stack-var0))) (let ((a0-1 (handle->process (-> self vehicle)))) (when a0-1 - (set! (-> gp-0 vec1 quad) (-> (the-as wvehicle a0-1) lin-acceleration quad)) - (let* ((v1-5 (-> gp-0 mat0)) - (a3-0 (-> (the-as wvehicle a0-1) rbody matrix)) - (a0-5 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-5 rvec quad) a0-5) - (set! (-> v1-5 uvec quad) a1-3) - (set! (-> v1-5 fvec quad) a2-0) - (set! (-> v1-5 trans quad) a3-1) - ) + (vector-copy! (-> gp-0 vec1) (-> (the-as wvehicle a0-1) lin-acceleration)) + (matrix-copy! (-> gp-0 mat0) (-> (the-as wvehicle a0-1) rbody matrix)) ) ) (set! (-> gp-0 time) (the-as uint (current-time))) @@ -352,7 +330,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (set! (-> self level) (level-get *level* 'destrack)) (if (not (-> self level)) diff --git a/goal_src/jak3/levels/desert/race/turtle-training.gc b/goal_src/jak3/levels/desert/race/turtle-training.gc index f1ce4952844..609a44bcccc 100644 --- a/goal_src/jak3/levels/desert/race/turtle-training.gc +++ b/goal_src/jak3/levels/desert/race/turtle-training.gc @@ -37,6 +37,7 @@ ) (defmethod init-from-entity! ((this des-train-bollard) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -92,6 +93,7 @@ ) (defmethod init-from-entity! ((this des-train-barrier) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -146,6 +148,7 @@ ) (defmethod init-from-entity! ((this des-train-stones) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -185,8 +188,8 @@ (let ((t9-0 (method-of-type task-manager set-time-limit))) (t9-0 this) ) - (set! (-> this start-pos quad) (-> (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0) quad)) - (set! (-> this door-plane quad) (-> (new 'static 'vector :z 1.0 :w 1.0) quad)) + (vector-copy! (-> this start-pos) (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0)) + (vector-copy! (-> this door-plane) (new 'static 'vector :z 1.0 :w 1.0)) (set! (-> this door-plane w) (- (vector-dot (-> this door-plane) (new 'static 'vector :x 9277440.0 :y 125747.2 :z 957235.2 :w 1.0))) ) @@ -200,7 +203,7 @@ (set! (-> this max-count) (-> v1-7 0 length)) (dotimes (a0-13 (-> this max-count)) (let ((a1-7 (-> v1-7 0 data a0-13 actor))) - (set! (-> this goal-array a0-13 pos quad) (-> a1-7 extra trans quad)) + (vector-copy! (-> this goal-array a0-13 pos) (-> a1-7 extra trans)) ) ) ) @@ -254,8 +257,8 @@ ) ) (when a0-3 - (set! (-> this player-pos quad) (-> (the-as process-drawable a0-3) root trans quad)) - (set! (-> this player-vel quad) (-> (the-as process-drawable a0-3) root transv quad)) + (vector-copy! (-> this player-pos) (-> (the-as process-drawable a0-3) root trans)) + (vector-copy! (-> this player-vel) (-> (the-as process-drawable a0-3) root transv)) (copy-vehicle-controls! (the-as wvehicle a0-3) (-> this player-controls)) 0 ) @@ -281,9 +284,9 @@ (suspend) (send-event (handle->process (-> self player-vehicle)) 'ignore-damage #t) (set-time! (-> self test-time)) - (set! (-> self goal-pos quad) (-> self goal-array 0 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 0 pos)) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-0 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 12)) @@ -321,9 +324,9 @@ (suspend-for (seconds 0.25) ) (set! (-> self show-message?) #f) - (set! (-> self goal-pos quad) (-> self goal-array 1 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 1 pos)) (let ((gp-5 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-5 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-5 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-5 quat)) (set! (-> gp-5 flags) (task-arrow-flags)) (set! (-> gp-5 map-icon) (the-as uint 12)) @@ -373,9 +376,9 @@ (suspend-for (seconds 0.25) ) (set! (-> self show-message?) #f) - (set! (-> self goal-pos quad) (-> self goal-array 2 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 2 pos)) (let ((gp-10 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-10 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-10 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-10 quat)) (set! (-> gp-10 flags) (task-arrow-flags)) (set! (-> gp-10 map-icon) (the-as uint 12)) @@ -421,9 +424,9 @@ (set! (-> self start-time) 0) (suspend-for (seconds 0.25) ) - (set! (-> self goal-pos quad) (-> self goal-array 3 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 3 pos)) (let ((gp-13 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-13 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-13 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-13 quat)) (set! (-> gp-13 flags) (task-arrow-flags)) (set! (-> gp-13 map-icon) (the-as uint 12)) @@ -451,9 +454,9 @@ (set! (-> self start-time) 0) (suspend-for (seconds 0.25) ) - (set! (-> self goal-pos quad) (-> self goal-array 4 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 4 pos)) (let ((gp-16 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-16 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-16 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-16 quat)) (set! (-> gp-16 flags) (task-arrow-flags)) (set! (-> gp-16 map-icon) (the-as uint 12)) @@ -485,9 +488,9 @@ (set! (-> self start-time) 0) (suspend-for (seconds 0.25) ) - (set! (-> self goal-pos quad) (-> self goal-array 5 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 5 pos)) (let ((gp-19 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-19 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-19 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-19 quat)) (set! (-> gp-19 flags) (task-arrow-flags)) (set! (-> gp-19 map-icon) (the-as uint 12)) diff --git a/goal_src/jak3/levels/desert/rescue/desert-rescue-bbush.gc b/goal_src/jak3/levels/desert/rescue/desert-rescue-bbush.gc index 4b96f157318..b97921514eb 100644 --- a/goal_src/jak3/levels/desert/rescue/desert-rescue-bbush.gc +++ b/goal_src/jak3/levels/desert/rescue/desert-rescue-bbush.gc @@ -80,14 +80,14 @@ ) (dotimes (v1-10 (-> *desresc-transport-path-1* length)) - (set! (-> *__bbush-transport-path__* v1-10 quad) (-> *desresc-transport-path-1* v1-10 pos quad)) + (vector-copy! (-> *__bbush-transport-path__* v1-10) (-> *desresc-transport-path-1* v1-10 pos)) ) ;; WARN: Return type mismatch quaternion vs none. (defmethod init-transport-params! ((this task-manager-desert-rescue-bbush) (arg0 desert-rescue-transport-init-params)) (set! (-> arg0 path-pts) *__bbush-transport-path__*) (set! (-> arg0 num-pts) (-> this desresc-path allocated-length)) - (set! (-> arg0 pos quad) (-> this desresc-path 0 pos quad)) + (vector-copy! (-> arg0 pos) (-> this desresc-path 0 pos)) (set! (-> arg0 desresc-path) (-> this desresc-path)) (quaternion-identity! (-> arg0 quat)) (none) @@ -123,12 +123,11 @@ (set! (-> this passenger-pos length) (-> *passenger-pos* length)) (when (-> this actor-group) (dotimes (s5-2 (-> this actor-group 0 length)) - (set! (-> *bbush-passenger-pos* s5-2 passenger-pos quad) - (-> this actor-group 0 data s5-2 actor extra trans quad) - ) - (set! (-> *bbush-passenger-pos* s5-2 beacon-pos quad) - (-> this actor-group 1 data s5-2 actor extra trans quad) - ) + (vector-copy! + (-> *bbush-passenger-pos* s5-2 passenger-pos) + (-> this actor-group 0 data s5-2 actor extra trans) + ) + (vector-copy! (-> *bbush-passenger-pos* s5-2 beacon-pos) (-> this actor-group 1 data s5-2 actor extra trans)) (set! (-> *bbush-passenger-pos* s5-2 is-final?) #f) (let ((s4-0 (res-lump-value @@ -186,7 +185,7 @@ :trans (behavior () ((-> (method-of-type task-manager active) trans)) (task-manager-desert-rescue-method-49 self) - (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (when (= (level-status? *level* 'desert #f) 'active) (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x3e4ccccd) (when (and *target* (focus-test? *target* pilot-riding)) (set! (-> self jak-vehicle) (process->handle (the-as process (send-event *target* 'get-vehicle)))) @@ -228,7 +227,7 @@ (let ((a0-1 (entity-by-name "des-burning-bush-40"))) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> a0-1 extra trans quad)) + (vector-copy! (-> gp-0 pos) (-> a0-1 extra trans)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 13)) diff --git a/goal_src/jak3/levels/desert/rescue/desert-rescue.gc b/goal_src/jak3/levels/desert/rescue/desert-rescue.gc index 80cbede6606..e35c58f4f66 100644 --- a/goal_src/jak3/levels/desert/rescue/desert-rescue.gc +++ b/goal_src/jak3/levels/desert/rescue/desert-rescue.gc @@ -1027,7 +1027,7 @@ ) (dotimes (v1-20 (-> *desresc-transport-path-0* length)) - (set! (-> *__transport-path__* v1-20 quad) (-> *desresc-transport-path-0* v1-20 pos quad)) + (vector-copy! (-> *__transport-path__* v1-20) (-> *desresc-transport-path-0* v1-20 pos)) ) (defmethod new transport-path-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 (inline-array vector)) (arg2 int)) @@ -1090,7 +1090,7 @@ (set! (-> *transport-tread-settings* zbuffer?) #f) -(set! (-> *transport-tread-settings* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *transport-tread-settings* lie-vector) *up-vector*) (set! (-> *transport-tread-settings* use-tape-mode?) #f) @@ -1158,7 +1158,7 @@ (defmethod desert-rescue-transport-method-43 ((this desert-rescue-transport)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> this root trans quad)) + (vector-copy! s2-0 (-> this root trans)) (let ((v1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -1209,7 +1209,7 @@ ) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) - (set! (-> arg1 quad) (-> gp-0 best-other-tri normal quad)) + (vector-copy! arg1 (-> gp-0 best-other-tri normal)) (-> gp-0 best-other-tri intersect y) ) (else @@ -1359,7 +1359,7 @@ (ja :group! (-> self draw art-group data 3) :num! (identity 1.0)) (set! (-> self desresc-path) (-> arg0 desresc-path)) (set! (-> self path) (new 'process 'transport-path-control self (-> arg0 path-pts) (-> arg0 num-pts))) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (set! (-> self target-pitch) 0.0) (set! (-> self pitch) 0.0) @@ -1505,7 +1505,7 @@ (let ((f0-4 (vector-dot s3-1 s5-0))) (cond ((>= f0-4 0.9999) - (set! (-> s5-0 quad) (-> s3-1 quad)) + (vector-copy! s5-0 s3-1) ) (else (vector-cross! s4-0 s5-0 s3-1) @@ -1544,7 +1544,7 @@ (defmethod desert-rescue-transport-method-44 ((this desert-rescue-transport)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> this root trans quad)) + (vector-copy! gp-0 (-> this root trans)) (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (f30-0 43008.0) ) @@ -1557,7 +1557,7 @@ (defmethod desert-rescue-transport-method-45 ((this desert-rescue-transport)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> this root trans quad)) + (vector-copy! gp-0 (-> this root trans)) (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (f30-0 43008.0) ) @@ -1783,7 +1783,7 @@ :virtual #t :event task-manager-event-handler :code (behavior () - (while (or (not *target*) (not *spawn-actors*) (!= (status-of-level-and-borrows *level* 'desrescg #f) 'active)) + (while (or (not *target*) (not *spawn-actors*) (!= (level-status? *level* 'desrescg #f) 'active)) (suspend) ) (set-time-limit self) @@ -1836,7 +1836,7 @@ (set! (-> gp-0 guard-type) (the-as uint 11)) (set! (-> gp-0 entity) #f) (vector-reset! (-> gp-0 velocity)) - (set! (-> gp-0 position quad) (-> *snake-start-pos* quad)) + (vector-copy! (-> gp-0 position) *snake-start-pos*) (quaternion-identity! (-> gp-0 rotation)) (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *snake-start-angle*) (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-0))) @@ -1865,7 +1865,7 @@ (set! (-> gp-2 guard-type) (the-as uint 11)) (set! (-> gp-2 entity) #f) (vector-reset! (-> gp-2 velocity)) - (set! (-> gp-2 position quad) (-> *snake-start-pos* quad)) + (vector-copy! (-> gp-2 position) *snake-start-pos*) (quaternion-identity! (-> gp-2 rotation)) (quaternion-rotate-y! (-> gp-2 rotation) (-> gp-2 rotation) *snake-start-angle*) (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-2))) @@ -1882,7 +1882,7 @@ ) (else (task-manager-desert-rescue-method-49 self) - (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (when (= (level-status? *level* 'desert #f) 'active) (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x3e4ccccd) (when (and *target* (focus-test? *target* pilot-riding)) (set! (-> self jak-vehicle) (process->handle (the-as process (send-event *target* 'get-vehicle)))) @@ -1907,7 +1907,7 @@ (defmethod init-transport-params! ((this task-manager-desert-rescue) (arg0 desert-rescue-transport-init-params)) (set! (-> arg0 path-pts) *__transport-path__*) (set! (-> arg0 num-pts) (-> this desresc-path allocated-length)) - (set! (-> arg0 pos quad) (-> this desresc-path 0 pos quad)) + (vector-copy! (-> arg0 pos) (-> this desresc-path 0 pos)) (set! (-> arg0 desresc-path) (-> this desresc-path)) (quaternion-identity! (-> arg0 quat)) (none) @@ -1960,7 +1960,7 @@ (set-setting! 'dust-storm-sound-scalar #f 1.0 0) (remove-setting! 'vehicles) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> *home-pos* quad)) + (vector-copy! (-> gp-0 pos) *home-pos*) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 12)) @@ -2115,16 +2115,14 @@ (let ((s5-0 (-> gp-0 pos)) (s4-0 (handle->process (-> self jak-vehicle))) ) - (set! (-> s5-0 quad) (-> (get-trans - (the-as process-focusable (if (type? s4-0 process-focusable) - (the-as process-focusable s4-0) - ) - ) - 0 - ) - quad - ) - ) + (vector-copy! s5-0 (get-trans + (the-as process-focusable (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + 0 + ) + ) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) @@ -2200,7 +2198,7 @@ (set! (-> gp-0 guard-type) (the-as uint 11)) (set! (-> gp-0 entity) #f) (vector-reset! (-> gp-0 velocity)) - (set! (-> gp-0 position quad) (-> *snake-start-pos* quad)) + (vector-copy! (-> gp-0 position) *snake-start-pos*) (quaternion-identity! (-> gp-0 rotation)) (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *snake-start-angle*) (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-0))) @@ -2394,7 +2392,7 @@ (task-manager-desert-rescue-method-45 self 1) (send-event (handle->process (-> self current-transport)) 'passenger-pickup) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self passenger-pos (-> self current-passenger-index) beacon-pos quad)) + (vector-copy! (-> gp-0 pos) (-> self passenger-pos (-> self current-passenger-index) beacon-pos)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -2529,10 +2527,10 @@ (let ((s5-0 (mod (-> this current-passenger-index) 3))) 0 (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s4-0 (target-pos 0)) (let ((a0-8 (the-as process-focusable (handle->process (-> this current-passenger))))) (if a0-8 - (set! (-> s4-0 quad) (-> (get-trans a0-8 3) quad)) + (vector-copy! s4-0 (get-trans a0-8 3)) ) ) (let ((s4-1 (speech-play (-> *rescue-speech-array* s5-0) arg0 *desert-rescue-speech-list* s4-0))) diff --git a/goal_src/jak3/levels/desert/rescue/neo-satellite.gc b/goal_src/jak3/levels/desert/rescue/neo-satellite.gc index 7a41e60951e..e7a2ca36f35 100644 --- a/goal_src/jak3/levels/desert/rescue/neo-satellite.gc +++ b/goal_src/jak3/levels/desert/rescue/neo-satellite.gc @@ -1268,34 +1268,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -1359,7 +1359,7 @@ (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask enemy)) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (initialize-skeleton self @@ -1374,7 +1374,7 @@ (dotimes (gp-2 3) (set! (-> self snd-whips-loop gp-2) (new-sound-id)) ) - (init-enemy-defaults! self *neo-sat-nav-enemy-info*) + (setup-enemy! self *neo-sat-nav-enemy-info*) (logior! (-> self skel status) (joint-control-status sync-math)) (ja-no-eval :group! neo-satellite-idle-ja :num! zero) (ja-post) @@ -1460,9 +1460,9 @@ ) ;; WARN: Return type mismatch none vs object. -(defmethod init-enemy-defaults! ((this neo-sat) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this neo-sat) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (neo-sat-method-199 this) @@ -1527,12 +1527,13 @@ (none) ) -(defmethod penetrate->next-state ((this neo-sat) (arg0 process) (arg1 event-message-block) (arg2 float)) +(defmethod msg-for-incoming-attack ((this neo-sat) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." (when (< 0.0 arg2) (let* ((a1-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this incoming attack-direction) 1.0)) (s5-0 (matrix-f-u-compose (new 'stack-no-clear 'matrix) a1-2 *up-vector*)) ) - (set! (-> s5-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) (if (logtest? (-> *part-group-id-table* 421 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 421) :mat-joint s5-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 421) :mat-joint s5-0) @@ -1555,6 +1556,7 @@ ) (defmethod init-enemy-collision! ((this neo-sat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1630,6 +1632,7 @@ ;; WARN: Return type mismatch object vs none. (defmethod init-enemy! ((this neo-sat)) + "Typical place for shared init code. Runs from entity or process style init." (let ((v1-0 (-> this nav))) (set! (-> v1-0 speed-scale) 1.0) ) @@ -1651,6 +1654,7 @@ ;; WARN: Return type mismatch object vs none. (defmethod enemy-common-post ((this neo-sat)) + "Common implementation of post. Runs ja-post." (call-parent-method this) (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) (when (-> this should-rise?) @@ -1693,7 +1697,7 @@ ) (let ((a0-19 (handle->process (-> this focus handle)))) (if a0-19 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-19) 0) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-19) 0)) ) ) (let ((f0-18 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) @@ -1832,7 +1836,7 @@ (let ((a0-1 (-> this nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a0-1 target-pos quad)) + (vector-copy! a1-1 (-> a0-1 target-pos)) (let ((f30-0 (vector-vector-xz-distance (-> this root trans) a1-1))) (-> this xz-vel) (let ((s5-0 (new-stack-vector0))) @@ -1851,7 +1855,7 @@ ) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) s3-1 (-> this root transv)))) (vector-lerp! (-> this last-thrust-vec) (-> this last-thrust-vec) s4-2 (* 2.0 (seconds-per-frame))) - (set! (-> s4-2 quad) (-> this last-thrust-vec quad)) + (vector-copy! s4-2 (-> this last-thrust-vec)) (let* ((f1-1 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this root transv) 1.0) (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-2 1.0) @@ -1938,7 +1942,7 @@ (set-setting! 'duststorm-push-player? #f 0.0 0) (set! (-> this last-play-laser-time) 0) (set! (-> this current-height-probe-index) 0) - (set! (-> this shockwave-origin quad) (-> this root trans quad)) + (vector-copy! (-> this shockwave-origin) (-> this root trans)) (let ((v1-8 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> *neo-sat-laser-array* 0 joint))) ) @@ -1976,6 +1980,7 @@ ) (defmethod event-handler ((this neo-sat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (let ((a0-3 (-> arg3 param 1)) @@ -2010,6 +2015,7 @@ ) (defmethod coin-flip? ((this neo-sat)) + "Return #t half the time, #f the other." #f ) @@ -2061,7 +2067,7 @@ ) (logclear! (-> a0-12 flags) (nav-state-flag directional-mode)) (logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-12 target-pos quad) (-> v1-4 quad)) + (vector-copy! (-> a0-12 target-pos) v1-4) ) 0 (set! (-> self last-thrust-vec quad) (the-as uint128 0)) @@ -2181,17 +2187,17 @@ (a1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data gp-0))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> this node-list data gp-0 bone transform fvec quad)) + (vector-copy! s3-0 (-> this node-list data gp-0 bone transform fvec)) (let ((gp-1 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) ;; og:preserve-this made infinite mass slightly less infinite. ;; PS2 does math on this float, and it behaves like an extremely large float rather than ;; IEEE754 inf. (set! (-> gp-1 knots data 0 mass) (the-as float #x7f700000)) (if (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) - (set! (-> gp-1 gravity-dir quad) (-> s3-0 quad)) + (vector-copy! (-> gp-1 gravity-dir) s3-0) ) (set! (-> gp-1 knots data 0 pos quad) (-> a1-3 quad)) - (set! (-> gp-1 knots data 0 prev-pos quad) (-> a1-3 quad)) + (vector-copy! (-> gp-1 knots data 0 prev-pos) a1-3) (set! (-> gp-1 knot-constraints data 0 dir quad) (-> s3-0 quad)) (when (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) (let ((f30-1 (- (-> a1-3 y) (neo-sat-method-218 this a1-3)))) @@ -2285,7 +2291,7 @@ (a1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s4-0))) (v1-5 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-5 quad) (-> this node-list data s4-0 bone transform fvec quad)) + (vector-copy! v1-5 (-> this node-list data s4-0 bone transform fvec)) 368640.0 (let ((a0-15 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) 0.0 @@ -2513,6 +2519,7 @@ ;; WARN: Return type mismatch number vs float. (defmethod get-damage-from-attack ((this neo-sat) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let ((v0-1 (the-as number (call-parent-method this arg0 arg1)))) (if (logtest? (penetrate dark-bomb dark-smack) (-> (the-as attack-info (-> arg1 param 1)) penetrate-using)) (set! v0-1 #x41f00000) @@ -2521,7 +2528,8 @@ ) ) -(defmethod damage-enemy! ((this neo-sat) (arg0 object) (arg1 event-message-block)) +(defmethod damage-enemy-from-attack! ((this neo-sat) (arg0 object) (arg1 event-message-block)) + "Given an attack message, apply damage." (let ((f30-0 (call-parent-method this arg0 arg1))) (let ((f28-0 (-> this hit-points)) (f26-0 (* 30.0 (- 3.0 (the float (+ (-> this current-stage) 1))))) @@ -2703,7 +2711,7 @@ (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (* f26-2 (+ f24-1 (+ -1.0 (the-as float v1-42))))) ) (let ((a2-4 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s0-0 *up-vector*))) - (set! (-> a2-4 trans quad) (-> s1-0 quad)) + (vector-copy! (-> a2-4 trans) s1-0) (launch-particles (-> *part-id-table* 1679) a2-4 :origin-is-matrix #t) ) ) @@ -2722,7 +2730,7 @@ (vector+float*! s2-2 (-> this shockwave-origin) s1-1 f28-1) (set! (-> s2-2 y) (neo-sat-method-218 this s2-2)) (let ((a2-7 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s1-1 *up-vector*))) - (set! (-> a2-7 trans quad) (-> s2-2 quad)) + (vector-copy! (-> a2-7 trans) s2-2) (set! (-> *part-id-table* 1680 init-specs 9 initial-valuef) (the-as float (shl (-> this global-neo-sat-index) 16)) ) @@ -2797,11 +2805,11 @@ (send-event (handle->process (-> self warp-handle)) 'turn-off) (cond ((logtest? (-> *part-group-id-table* 418 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 418)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 418)) ) ) @@ -2869,14 +2877,14 @@ (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root transv quad) (the-as uint128 0)) (set! (-> self desired-float-height) 16384.0) - (set! (-> self start-thrust-pos quad) (-> self root trans quad)) + (vector-copy! (-> self start-thrust-pos) (-> self root trans)) (set-time! (-> self state-time)) ) :trans (behavior () (neo-sat-method-220 self) (let ((f30-0 (neo-sat-probe-ground self (-> self root trans)))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> a2-0 quad) (-> self root trans quad)) + (vector-copy! a2-0 (-> self root trans)) (set! (-> a2-0 y) (+ (-> self start-thrust-pos y) (-> self desired-float-height))) (cond ((< 0.0 (-> self desired-float-height)) @@ -2888,7 +2896,7 @@ (when (>= f28-0 0.95) (set! (-> self desired-float-height) -102400.0) (set-time! (-> self state-time)) - (set! (-> self start-thrust-pos quad) (-> self root trans quad)) + (vector-copy! (-> self start-thrust-pos) (-> self root trans)) ) ) ) @@ -2950,7 +2958,7 @@ (seek! (-> self anim-speed) 3.0 (* 0.15 (seconds-per-frame))) (when (time-elapsed? (-> self wander-generate-time) (seconds 1.5)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *x-vector* quad)) + (vector-copy! s5-0 *x-vector*) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-normalize! s5-0 65536.0) (vector-rotate-y! s5-0 s5-0 (-> self offset-angle)) @@ -2967,7 +2975,7 @@ (let ((v1-26 (-> self nav state))) (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-26 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-26 target-pos) gp-0) ) ) ) @@ -3062,11 +3070,11 @@ (logclear! (-> self focus-status) (focus-status dangerous)) (cond ((logtest? (-> *part-group-id-table* 420 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 420)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 420)) ) ) @@ -3137,11 +3145,11 @@ (process->handle (-> (cond ((logtest? (-> *part-group-id-table* 427 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 427)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 427)) ) ) @@ -3162,11 +3170,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 426 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 426)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 426)) ) ) @@ -3194,11 +3202,11 @@ (send-event (handle->process (-> self warp-handle)) 'turn-on) (cond ((logtest? (-> *part-group-id-table* 420 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 420)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 420)) ) ) @@ -3291,7 +3299,7 @@ :trans (behavior () (sound-play "sat-hover" :id (-> self snd-hover)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *x-vector* quad)) + (vector-copy! s5-0 *x-vector*) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-normalize! s5-0 12288.0) (vector-rotate-y! s5-0 s5-0 (-> self offset-angle)) @@ -3317,7 +3325,7 @@ (let ((v1-34 (-> self nav state))) (logclear! (-> v1-34 flags) (nav-state-flag directional-mode)) (logior! (-> v1-34 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-34 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-34 target-pos) gp-0) ) ) ) @@ -3367,7 +3375,7 @@ (defmethod nav-enemy-method-161 ((this neo-sat) (arg0 nav-control)) (when (logtest? (enemy-flag ef37) (-> this enemy-flags)) (let ((a2-1 (-> arg0 state))) - (set! (-> this nav-vector quad) (-> a2-1 travel quad)) + (vector-copy! (-> this nav-vector) (-> a2-1 travel)) ) (vector-normalize! (-> this nav-vector) 1.0) ) @@ -3377,7 +3385,7 @@ ;; WARN: Return type mismatch (pointer process) vs (pointer neo-sat). (defun spawn-neo-sat ((arg0 vector) (arg1 quaternion) (arg2 process)) (let ((s5-0 (new 'stack-no-clear 'neo-sat-init-params))) - (set! (-> s5-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 pos) arg0) (quaternion-copy! (-> s5-0 quat) arg1) (process-spawn neo-sat s5-0 :name "neo-sat" :to arg2 :stack-size #x14000) ) @@ -3487,7 +3495,7 @@ (a0-8 (-> s5-0 knots data (+ s4-0 1))) (s3-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s3-0 start-pos quad) (-> v1-18 pos quad)) + (vector-copy! (-> s3-0 start-pos) (-> v1-18 pos)) (vector-! (-> s3-0 move-dist) (the-as vector a0-8) (the-as vector v1-18)) (let ((v1-19 s3-0)) (set! (-> v1-19 radius) 40.96) @@ -3578,10 +3586,10 @@ ) ) ) - (set! (-> s4-1 quad) (-> this node-list data arg0 bone transform fvec quad)) + (vector-copy! s4-1 (-> this node-list data arg0 bone transform fvec)) (vector-normalize! s4-1 1.0) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> s5-1 quad)) + (vector-copy! (-> s3-1 start-pos) s5-1) (vector-float*! (-> s3-1 move-dist) s4-1 f30-0) (let ((v1-16 s3-1)) (set! (-> v1-16 radius) 4096.0) @@ -3911,7 +3919,7 @@ ) ) ) - (set! (-> this root trans quad) (-> (the-as process-focusable a0-2) root trans quad)) + (vector-copy! (-> this root trans) (-> (the-as process-focusable a0-2) root trans)) ) (quaternion-identity! (-> this root quat)) (let ((s5-1 (-> (math-camera-matrix) fvec))) @@ -4094,7 +4102,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this neo-sat)) +(defmethod get-search-info-flag ((this neo-sat)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (!= (-> this hit-points) 0.0) (set! v0-0 (logior (logior v0-0 16) 8)) diff --git a/goal_src/jak3/levels/desert/rescue/rope-prim-system.gc b/goal_src/jak3/levels/desert/rescue/rope-prim-system.gc index 691668857eb..5ff3b054c91 100644 --- a/goal_src/jak3/levels/desert/rescue/rope-prim-system.gc +++ b/goal_src/jak3/levels/desert/rescue/rope-prim-system.gc @@ -61,7 +61,7 @@ (set! sv-128 (-> this alpha)) (set! sv-132 (the-as float 0.0)) (set! sv-136 (the-as float 0.0)) - (set! (-> sv-112 quad) (-> this knots data s5-0 pos quad)) + (vector-copy! sv-112 (-> this knots data s5-0 pos)) (cond ((< s5-0 (+ (-> this knots length) -1)) (vector-! sv-116 (the-as vector (-> this knots data (+ s5-0 1))) sv-112) @@ -87,6 +87,7 @@ (set! (-> sv-260 z) 1.0) (set! (-> sv-260 w) sv-128) (set! sv-256 (rgba<-rgbaf (the-as rgba sv-256) sv-260)) + ;; og:preserve-this (add-prim-vert this (-> this strip1) sv-240 (the-as rgba sv-256) 0.0 sv-132) (add-prim-vert this (-> this strip1) sv-244 (the-as rgba sv-256) 1.0 sv-132) (add-prim-vert this (-> this strip2) sv-248 (the-as rgba sv-256) 1.0 sv-132) @@ -101,7 +102,7 @@ (defmethod add-prim-vert ((this rope-prim-system) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) (when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts)) (let ((v1-5 (-> arg0 data (-> arg0 num-verts)))) - (set! (-> v1-5 pos quad) (-> arg1 quad)) + (vector-copy! (-> v1-5 pos) arg1) (set! (-> v1-5 col) arg2) (set! (-> v1-5 stq x) arg3) (set! (-> v1-5 stq y) arg4) @@ -210,7 +211,7 @@ ) ) (let ((v0-3 (-> this knots data 0 prev-pos))) - (set! (-> v0-3 quad) (-> this knots data 0 pos quad)) + (vector-copy! v0-3 (-> this knots data 0 pos)) v0-3 ) ) diff --git a/goal_src/jak3/levels/desert/rescue/rope-system.gc b/goal_src/jak3/levels/desert/rescue/rope-system.gc index d6b04ff2c90..64457619f24 100644 --- a/goal_src/jak3/levels/desert/rescue/rope-system.gc +++ b/goal_src/jak3/levels/desert/rescue/rope-system.gc @@ -74,14 +74,14 @@ (a1-3 (new 'stack-no-clear 'vector)) ) (let ((a3-0 (new 'stack-no-clear 'vector))) - (set! (-> a3-0 quad) (-> this accum-force quad)) + (vector-copy! a3-0 (-> this accum-force)) (vector+! a3-0 a3-0 (-> a2-1 force)) (vector-float*! a1-3 (-> a2-1 pos) (- 2.0 f1-1)) (vector-! a1-3 a1-3 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) (vector+float*! a1-3 a1-3 a3-0 f0-1) ) - (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) - (set! (-> a2-1 pos quad) (-> a1-3 quad)) + (vector-copy! (-> a2-1 prev-pos) (-> a2-1 pos)) + (vector-copy! (-> a2-1 pos) a1-3) ) ) ) @@ -209,7 +209,7 @@ (f26-0 (/ f0-7 f1-5)) ) (let ((s1-1 (new 'stack-no-clear 'vector))) - (set! (-> s1-1 quad) (-> s3-0 pos quad)) + (vector-copy! s1-1 (-> s3-0 pos)) (set! sv-368 (new 'stack-no-clear 'vector)) (let ((v1-35 (-> s2-0 pos quad))) (set! (-> sv-368 quad) v1-35) diff --git a/goal_src/jak3/levels/desert/rescue/wland-passenger.gc b/goal_src/jak3/levels/desert/rescue/wland-passenger.gc index b4f076c6d82..5e349662673 100644 --- a/goal_src/jak3/levels/desert/rescue/wland-passenger.gc +++ b/goal_src/jak3/levels/desert/rescue/wland-passenger.gc @@ -175,7 +175,7 @@ (let ((f30-0 (compute-y-height arg0 (target-pos 0))) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> (target-pos 0) quad)) + (vector-copy! s3-1 (target-pos 0)) (set! (-> s3-1 y) f30-0) ) (vector+float*! arg1 (get-trans arg0 0) s5-0 -57344.0) @@ -184,6 +184,7 @@ ) (defmethod should-move-to-ground? ((this wland-passenger)) + "Should this enemy be moved to the ground while moving?" (not (and (-> this next-state) (= (-> this next-state name) 'entering-transport))) ) @@ -212,7 +213,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-8 quad)) + (vector-copy! (-> gp-0 target-pos) v1-8) ) 0 ) @@ -231,7 +232,7 @@ (a2-0 (-> self nav state)) (a1-3 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-3 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-3 (-> a2-0 target-pos)) (when (< (t9-2 a0-5 a1-3) 14745.6) (send-event (handle->process (-> self transport)) 'leave) (send-event (handle->process (-> self transport)) 'die-when-ready) @@ -346,7 +347,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-7 quad)) + (vector-copy! (-> gp-0 target-pos) v1-7) ) 0 (nav-enemy-method-177 self) @@ -383,7 +384,7 @@ (a2-1 (-> self nav state)) (a1-3 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-3 quad) (-> a2-1 target-pos quad)) + (vector-copy! a1-3 (-> a2-1 target-pos)) (when (< (t9-2 a0-5 a1-3) 2048.0) (let ((v1-8 (-> self nav))) (set! (-> v1-8 sphere-mask) (the-as uint 65)) @@ -421,7 +422,7 @@ ) (logclear! (-> a0-12 flags) (nav-state-flag directional-mode)) (logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-12 target-pos quad) (-> v1-4 quad)) + (vector-copy! (-> a0-12 target-pos) v1-4) ) 0 (nav-enemy-method-176 self) @@ -583,7 +584,7 @@ ) (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-21 target-pos quad) (-> v1-37 quad)) + (vector-copy! (-> a0-21 target-pos) v1-37) ) 0 (if (< (vector-vector-xz-distance gp-2 (-> self root trans)) 6144.0) @@ -607,6 +608,7 @@ ) (defmethod coin-flip? ((this wland-passenger)) + "Return #t half the time, #f the other." #f ) @@ -677,7 +679,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (ja-no-eval :group! wland-passenger-vehicle-jump-to-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((s5-0 (ja-num-frames 0)) @@ -834,7 +836,7 @@ (quaternion-copy! (-> self root quat) (-> gp-2 root quat)) ) (quaternion-rotate-y! (-> self root quat) (-> self root quat) -16384.0) - (set! (-> self original-trans quad) (-> self root trans quad)) + (vector-copy! (-> self original-trans) (-> self root trans)) (quaternion-copy! (-> self original-quat) (-> self root quat)) (let ((s4-1 (the-as vehicle (handle->process (-> self vehicle)))) (s5-1 (new 'stack-no-clear 'vector)) @@ -929,7 +931,7 @@ (set! (-> s5-1 uvec z) (sin (-> s5-1 uvec x))) (set! (-> s5-1 uvec w) (cos (-> s5-1 uvec x))) (set! (-> s5-1 uvec y) (seconds-per-frame)) - (set! (-> s5-1 rvec quad) (-> s4-0 local-accel quad)) + (vector-copy! (-> s5-1 rvec) (-> s4-0 local-accel)) (let ((f1-6 (+ (* 0.03 (-> s5-1 uvec z)) (* -1.0 (-> s5-1 rvec x) (-> s4-0 left-right-accel-factor))))) (+! (-> this left-right-interp) (* (- f1-6 (-> this left-right-interp)) (fmin 1.0 (* 8.0 (-> s5-1 uvec y))))) ) @@ -1196,11 +1198,11 @@ ) (defbehavior wland-passenger-init-by-other wland-passenger ((arg0 wland-passenger-init-by-other-params)) - (set! (-> self start-pos quad) (-> arg0 position quad)) + (vector-copy! (-> self start-pos) (-> arg0 position)) (set! (-> self transport) (the-as handle #f)) (set! (-> self is-dead?) (-> arg0 is-dead?)) (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-0 pos quad) (-> arg0 position quad)) + (vector-copy! (-> s5-0 pos) (-> arg0 position)) (quaternion-identity! (-> s5-0 quat)) (set! (-> s5-0 flags) (task-arrow-flags)) (set! (-> s5-0 map-icon) (the-as uint 13)) @@ -1330,34 +1332,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 61440.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 15) + :knocked-soft-vy-hi (meters 15) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 24) + :knocked-hard-vy-hi (meters 26) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 15) + :knocked-red-vy-hi (meters 15) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -1395,6 +1397,7 @@ (set! (-> *wland-passenger-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod init-enemy-collision! ((this wland-passenger)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1452,12 +1455,13 @@ ) (defmethod init-enemy! ((this wland-passenger)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wland-passenger" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *wland-passenger-nav-enemy-info*) + (setup-enemy! this *wland-passenger-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -1476,7 +1480,7 @@ ;; WARN: Return type mismatch (pointer process) vs (pointer wland-passenger). (defun spawn-wlander ((arg0 desert-passenger-info) (arg1 process)) (let ((s5-0 (new 'stack-no-clear 'wland-passenger-init-by-other-params))) - (set! (-> s5-0 position quad) (-> arg0 passenger-pos quad)) + (vector-copy! (-> s5-0 position) (-> arg0 passenger-pos)) (quaternion-identity! (-> s5-0 rotation)) (set! (-> s5-0 velocity quad) (the-as uint128 0)) (set! (-> s5-0 behavior) (the-as uint 0)) @@ -1489,6 +1493,7 @@ ;; WARN: disable def twice: 20. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this wland-passenger) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('impact-impulse) (when (= arg0 (send-event *target* 'get-vehicle)) @@ -1515,7 +1520,7 @@ 0 (citizen-method-195 this) (citizen-method-194 this) - (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) (go (method-of-object this active)) ) ) @@ -1544,6 +1549,7 @@ ) (defmethod go-die ((this wland-passenger)) + "Go to the die state." (send-event (handle->process (-> this task-man)) 'fail-delay) (call-parent-method this) ) @@ -1555,6 +1561,7 @@ ) (defmethod get-penetrated-by ((this wland-passenger)) + "Figure out the penetrated-by mask for this process." ((method-of-type enemy get-penetrated-by) this) ) @@ -1582,6 +1589,7 @@ ) (defmethod go-hostile ((this wland-passenger)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this active)) ) @@ -1589,6 +1597,7 @@ 0.5 ) -(defmethod lerp-damage ((this wland-passenger) (arg0 float)) +(defmethod impact-velocity-to-hit-points ((this wland-passenger) (arg0 float)) + "Given an impact velocity, compute hit points." (lerp-scale 0.0 (* 0.3 (-> this enemy-info default-hit-points)) arg0 20480.0 122880.0) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc b/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc index e062438ebd9..afcf361c603 100644 --- a/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc +++ b/goal_src/jak3/levels/desert/wvehicle/w-parking-spot.gc @@ -33,7 +33,7 @@ (defmethod w-parking-spot-method-24 ((this w-parking-spot)) (let ((gp-0 (new 'stack-no-clear 'cquery-with-5vec))) (set! (-> gp-0 vec 0 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec 0 quad)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec 0)) (vector-reset! (-> gp-0 vec 1)) (set! (-> gp-0 vec 1 y) 1.0) (vector-z-quaternion! (-> gp-0 vec 2) (-> this root quat)) @@ -53,19 +53,19 @@ (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) (when (>= f30-0 0.0) (vector+float*! (the-as vector (-> gp-0 vec)) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) - (set! (-> gp-0 vec 1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (vector-copy! (-> gp-0 vec 1) (-> gp-0 cquery best-other-tri normal)) (when (< (-> gp-0 vec 1 y) (cos 3640.889)) (vector-reset! (-> gp-0 vec 1)) (set! (-> gp-0 vec 1 y) 1.0) ) - (set! (-> this root trans quad) (-> gp-0 vec 0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec 0)) (format #t "w-parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec 0 y)) ) (if (< f30-0 0.0) (format #t "w-parking-spot::find-ground: could not find ground~%") ) ) - (set! (-> this root trans quad) (-> gp-0 vec 0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec 0)) (forward-up-nopitch->quaternion (-> this root quat) (-> gp-0 vec 2) (-> gp-0 vec 1)) ) 0 @@ -106,7 +106,7 @@ ) (when (not (handle->process (-> this arrow))) (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-1 pos quad) (-> this root trans quad)) + (vector-copy! (-> s5-1 pos) (-> this root trans)) (quaternion-identity! (-> s5-1 quat)) (set! (-> s5-1 flags) (task-arrow-flags taf8)) (set! (-> s5-1 map-icon) (the-as uint 12)) @@ -163,7 +163,7 @@ (set! (-> s4-0 guard-type) (the-as uint 11)) (set! (-> s4-0 entity) #f) (vector-reset! (-> s4-0 velocity)) - (set! (-> s4-0 position quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 position) (-> this root trans)) (quaternion-copy! (-> s4-0 rotation) (-> this root quat)) (let ((a0-22 (vehicle-spawn (the-as vehicle-type s5-0) s4-0))) (when a0-22 @@ -194,6 +194,7 @@ ) (defmethod init-from-entity! ((this w-parking-spot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause movie)) @@ -206,7 +207,7 @@ (let ((v1-9 (res-lump-struct arg0 'spawn-trans vector))) (cond (v1-9 - (set! (-> this root trans quad) (-> v1-9 quad)) + (vector-copy! (-> this root trans) v1-9) (let ((a1-5 (res-lump-struct arg0 'spawn-quat structure))) (when a1-5 (quaternion-copy! (-> this root quat) (the-as quaternion a1-5)) @@ -244,7 +245,8 @@ (w-parking-spot-method-23 self) ) (until #f - (suspend-for (seconds 0.25)) + (suspend-for (seconds 0.25) + ) (w-parking-spot-method-21 self) (when (-> self should-spawn?) (let ((f0-0 (vector-vector-distance-squared (camera-pos) (-> self test-sphere))) diff --git a/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc b/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc index bf455760eeb..2e17a4c0af7 100644 --- a/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc +++ b/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc @@ -117,9 +117,9 @@ (a1-2 (the-as uint #xa01013fd)) (a1-3 (logand -2 a1-2)) ) - (set! (-> a0-2 vec0 quad) (-> arg0 quad)) + (vector-copy! (-> a0-2 vec0) arg0) (set! (-> a0-2 vec0 w) 20480.0) - (set! (-> v1-0 0 quad) (-> a0-2 vec0 quad)) + (vector-copy! (-> v1-0 0) (-> a0-2 vec0)) (let ((a0-3 (-> a0-2 cquery))) (set! (-> a0-3 best-dist) (the-as float v1-0)) (set! (-> a0-3 best-other-prim) (the-as collide-shape-prim 1)) @@ -149,8 +149,8 @@ (set! (-> s3-0 params flags) (traffic-spawn-flags)) (set! (-> s3-0 params guard-type) (the-as uint 11)) (set! (-> s3-0 params entity) #f) - (set! (-> s3-0 params velocity quad) (-> s3-0 vec quad)) - (set! (-> s3-0 params position quad) (-> arg0 quad)) + (vector-copy! (-> s3-0 params velocity) (-> s3-0 vec)) + (vector-copy! (-> s3-0 params position) arg0) (quaternion-copy! (-> s3-0 params rotation) arg1) (let ((s5-1 (vehicle-spawn (vehicle-type v-marauder) (-> s3-0 params)))) (when s5-1 @@ -184,27 +184,16 @@ ) (when s4-0 (let ((s5-1 (new 'stack-no-clear 'inline-array 'matrix 4))) - (let* ((s3-0 (-> s5-1 0)) - (a2-0 (camera-matrix)) - (v1-4 (-> a2-0 rvec quad)) - (a0-5 (-> a2-0 uvec quad)) - (a1-2 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s3-0 rvec quad) v1-4) - (set! (-> s3-0 uvec quad) a0-5) - (set! (-> s3-0 fvec quad) a1-2) - (set! (-> s3-0 trans quad) a2-1) - ) - (set! (-> s5-1 1 fvec quad) (-> s5-1 0 trans quad)) - (set! (-> s5-1 1 trans quad) (-> (the-as process-focusable s4-0) root transv quad)) - (set! (-> s5-1 2 uvec quad) (-> s5-1 1 trans quad)) + (matrix-copy! (-> s5-1 0) (camera-matrix)) + (vector-copy! (-> s5-1 1 fvec) (-> s5-1 0 trans)) + (vector-copy! (-> s5-1 1 trans) (-> (the-as process-focusable s4-0) root transv)) + (vector-copy! (-> s5-1 2 uvec) (-> s5-1 1 trans)) (let* ((v1-8 (-> s5-1 1 trans)) (f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) (f1-3 4096.0) ) (if (< f0-3 (* f1-3 f1-3)) - (set! (-> s5-1 2 uvec quad) (-> (the-as process-focusable s4-0) node-list data 0 bone transform fvec quad)) + (vector-copy! (-> s5-1 2 uvec) (-> (the-as process-focusable s4-0) node-list data 0 bone transform fvec)) ) ) (set! (-> s5-1 2 uvec y) 0.0) @@ -256,7 +245,7 @@ (let ((s4-5 (new 'stack-no-clear 'cquery-with-5vec))) (set! (-> s4-5 vec 0 quad) (-> s5-1 1 uvec quad)) (set! (-> s4-5 vec 0 y) 614400.0) - (set! (-> s4-5 cquery start-pos quad) (-> s4-5 vec 0 quad)) + (vector-copy! (-> s4-5 cquery start-pos) (-> s4-5 vec 0)) (vector-reset! (-> s4-5 vec 1)) (set! (-> s4-5 vec 1 y) 1.0) (vector-! (-> s4-5 vec 2) (-> s5-1 2 trans) (the-as vector (-> s4-5 vec))) @@ -282,7 +271,7 @@ (when (or (< (* f0-31 f0-31) (vector-vector-distance-squared (-> s5-1 1 fvec) (the-as vector (-> s4-5 vec)))) (not (sphere-in-view-frustum? (the-as sphere (-> s5-1 3)))) ) - (set! (-> s4-5 vec 1 quad) (-> s4-5 cquery best-other-tri normal quad)) + (vector-copy! (-> s4-5 vec 1) (-> s4-5 cquery best-other-tri normal)) (when (< (-> s4-5 vec 1 y) (cos 3640.889)) (vector-reset! (-> s4-5 vec 1)) (set! (-> s4-5 vec 1 y) 1.0) @@ -328,8 +317,8 @@ ) ) (when v1-8 - (set! (-> s5-1 0 uvec quad) (-> (the-as process-focusable v1-8) root trans quad)) - (set! (-> s5-1 0 fvec quad) (-> (the-as process-focusable v1-8) root transv quad)) + (vector-copy! (-> s5-1 0 uvec) (-> (the-as process-focusable v1-8) root trans)) + (vector-copy! (-> s5-1 0 fvec) (-> (the-as process-focusable v1-8) root transv)) (let ((f0-0 8192.0)) (.lvf vf1 (&-> (-> s5-1 0 fvec) quad)) (.add.w.vf.x vf2 vf0 vf0) @@ -339,8 +328,8 @@ (.add.mul.z.vf.x vf1 vf2 vf1 acc) (.mov a0-14 vf1) (if (< f0-0 a0-14) - (set! (-> s5-1 0 trans quad) (-> s5-1 0 fvec quad)) - (set! (-> s5-1 0 trans quad) (-> (the-as process-focusable v1-8) node-list data 0 bone transform fvec quad)) + (vector-copy! (-> s5-1 0 trans) (-> s5-1 0 fvec)) + (vector-copy! (-> s5-1 0 trans) (-> (the-as process-focusable v1-8) node-list data 0 bone transform fvec)) ) ) (set! (-> s5-1 0 trans y) 0.0) @@ -413,7 +402,7 @@ (cond (a1-20 (let ((v1-71 (new 'stack-no-clear 'matrix))) - (set! (-> v1-71 rvec quad) (-> (the-as process-focusable a1-20) root trans quad)) + (vector-copy! (-> v1-71 rvec) (-> (the-as process-focusable a1-20) root trans)) (cond ((and (< (-> this active-count) (-> this target-count)) (> (-> this reserve-count) 0) @@ -484,7 +473,7 @@ ) (defmethod was-squad-manager-method-15 ((this was-squad-manager)) - (if (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (if (= (level-status? *level* 'desert #f) 'active) (update (-> this squad)) ) 0 diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-fox.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-fox.gc index 80c2d6b1e9d..a234d535e56 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-fox.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-fox.gc @@ -68,7 +68,7 @@ (setup-masks (-> this draw) 2 0) (set! (-> this shoot-delay) (the-as uint 18)) (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) - (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0)) (set! (-> this rider-hand-joint-array 0) 8) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc index 4e462f44a95..a27a25925cb 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-mirage.gc @@ -22,18 +22,7 @@ (set! (-> gp-1 vec10 y) 204800.0) (set! (-> gp-1 vec10 z) 409600.0) (set! (-> gp-1 vec10 w) 163840.0) - (let* ((v1-9 (-> gp-1 mat0)) - (a3-1 (-> this rbody matrix)) - (a0-4 (-> a3-1 rvec quad)) - (a1-1 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-9 rvec quad) a0-4) - (set! (-> v1-9 uvec quad) a1-1) - (set! (-> v1-9 fvec quad) a2-1) - (set! (-> v1-9 trans quad) a3-2) - ) + (matrix-copy! (-> gp-1 mat0) (-> this rbody matrix)) (let ((v1-10 (new 'static 'inline-array vector 2 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) @@ -46,7 +35,7 @@ (vector-reset! (-> gp-1 vec4)) (set! (-> gp-1 vec4 z) (-> gp-1 vec10 y)) (set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y))) - (set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad)) + (vector-copy! (-> gp-1 vec8) (-> gp-1 mat0 fvec)) (vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x))) (vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x))) (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) @@ -73,8 +62,8 @@ ) ) (when s4-2 - (set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad)) - (set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad)) + (vector-copy! (-> gp-1 vec6) (get-trans s4-2 3)) + (vector-copy! (-> gp-1 vec7) (get-transv s4-2)) (vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y)) (vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0)) (set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) @@ -99,7 +88,7 @@ (set! (-> gp-1 params options) (projectile-options)) (logclear! (-> gp-1 params options) (projectile-options po14 po15 po16)) (set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad)) - (set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad)) + (vector-copy! (-> gp-1 params vel) (-> gp-1 vec2)) (set! (-> gp-1 params notify-handle) (the-as handle #f)) (set! (-> gp-1 params owner-handle) (process->handle this)) (set! (-> gp-1 params target-handle) (the-as handle #f)) @@ -173,7 +162,7 @@ (alloc-rbody-control! this *v-mirage-constants*) (set! (-> this shoot-delay) (the-as uint 240)) (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) - (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0)) (set! (-> this rider-hand-joint-array 0) 17) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc index 457990499a1..b40289720c5 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-projectiles.gc @@ -46,7 +46,7 @@ ) (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) - (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (vector-copy! (-> a1-7 fvec) s2-0) (matrix->eul (the-as euler-angles s1-0) a1-7 21) (vector-negate! s3-2 s1-0) (let ((a0-15 s3-2)) @@ -67,11 +67,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 228 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 228)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 228)) ) ) @@ -125,7 +125,7 @@ (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) (move-by-vector! arg0 a1-1) ) - (set! (-> (the-as v-scorp-shot (-> arg0 process)) collide-normal quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! (-> (the-as v-scorp-shot (-> arg0 process)) collide-normal) (-> arg1 best-other-tri normal)) (let* ((s5-1 (-> arg1 best-other-tri collide-ptr)) (v1-7 (if (type? s5-1 collide-shape-prim) s5-1 @@ -195,8 +195,8 @@ (defmethod init-proj-settings! ((this v-scorp-shot)) (with-pp - (set! (-> this init-pos quad) (-> this root trans quad)) - (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) + (vector-copy! (-> this init-dir) (-> this starting-dir)) (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 491520.0 (-> pp clock frames-per-second))) (set! (-> this attack-mode) 'eco-blue) (set! (-> this max-speed) (* 491520.0 (-> pp clock frames-per-second))) @@ -256,7 +256,7 @@ (a1-4 (-> *part-id-table* 855)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -302,7 +302,7 @@ (f28-0 (-> *part-id-table* 982 init-specs 5 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 982 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 982 init-specs 5 initial-valuef) (* f26-0 f28-0)) (launch-particles (-> *part-id-table* 982) s4-1 :origin-is-matrix #t) @@ -320,27 +320,27 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) (v1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-1 quad) (-> s5-0 trans quad)) + (vector-copy! v1-1 (-> s5-0 trans)) (vector+! v1-1 v1-1 a0-3) (cond ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) ) ) ) ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) ) ) @@ -496,7 +496,7 @@ (set! (-> v1-13 y) 2.0) (set! (-> v1-13 z) 2.0) (set! (-> v1-13 w) 1.0) - (set! (-> this root scale quad) (-> v1-13 quad)) + (vector-copy! (-> this root scale) v1-13) ) (let ((s5-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) (set! (-> s5-1 tracked-obj) (process->handle this)) @@ -551,7 +551,7 @@ :virtual #t :code (behavior () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) (-> self blast-radius)) (set! (-> gp-0 scale) 2.0) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc index 690cb94bcd9..d6f314555a4 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-rhino.gc @@ -19,18 +19,7 @@ (set! (-> this shoot-time) (the-as uint (current-time))) (set! (-> this gun-kick) 1638.4) (let ((gp-0 (new 'stack-no-clear 'wcar-rhino-proj-params))) - (let* ((v1-3 (-> gp-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-3 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-3 rvec quad) a0-3) - (set! (-> v1-3 uvec quad) a1-0) - (set! (-> v1-3 fvec quad) a2-0) - (set! (-> v1-3 trans quad) a3-1) - ) + (matrix-copy! (-> gp-0 mat) (-> this node-list data 0 bone transform)) (vector-matrix*! (-> gp-0 gun-local-pos) (-> this gun-local-pos) (-> gp-0 mat)) (vector-rotate*! (-> gp-0 gun-local-dir) (-> this gun-local-dir) (-> gp-0 mat)) (vector-float*! (-> gp-0 gun-dir) (-> gp-0 gun-local-dir) 409600.0) @@ -39,7 +28,7 @@ (set! (-> gp-0 params options) (projectile-options)) (logclear! (-> gp-0 params options) (projectile-options po14 po15 po16)) (set! (-> gp-0 params pos quad) (-> gp-0 gun-local-pos quad)) - (set! (-> gp-0 params vel quad) (-> gp-0 gun-dir quad)) + (vector-copy! (-> gp-0 params vel) (-> gp-0 gun-dir)) (set! (-> gp-0 params notify-handle) (the-as handle #f)) (set! (-> gp-0 params owner-handle) (process->handle this)) (set! (-> gp-0 params target-handle) (the-as handle #f)) @@ -155,7 +144,7 @@ 16 ) ) - (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 6553.6 :z 14745.6 :w 1.0) quad)) + (vector-copy! (-> this turret-local-pos) (new 'static 'vector :y 6553.6 :z 14745.6 :w 1.0)) ((method-of-type wcar-base vehicle-method-62) this) 0 (none) @@ -222,7 +211,7 @@ (set! (-> this rider-hand-joint-array 0) 8) (init (-> this jmod-gun-turn) this (the-as uint 9) (joint-mod-base-flags attached)) (init (-> this jmod-gun-kick) this (the-as uint 10) (joint-mod-base-flags attached trans)) - (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 10485.76 :z 12288.0 :w 1.0) quad)) + (vector-copy! (-> this turret-local-pos) (new 'static 'vector :y 10485.76 :z 12288.0 :w 1.0)) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) this diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc index a232956857e..368c86a6ed1 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-scorpion.gc @@ -135,18 +135,7 @@ (set! (-> this shoot-time) (the-as uint (current-time))) (set! (-> this gun-kick) 1638.4) (let ((gp-0 (new 'stack-no-clear 'wcar-rhino-proj-params))) - (let* ((v1-3 (-> gp-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-3 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-3 rvec quad) a0-3) - (set! (-> v1-3 uvec quad) a1-0) - (set! (-> v1-3 fvec quad) a2-0) - (set! (-> v1-3 trans quad) a3-1) - ) + (matrix-copy! (-> gp-0 mat) (-> this node-list data 0 bone transform)) (vector-matrix*! (-> gp-0 gun-local-pos) (-> this gun-local-pos) (-> gp-0 mat)) (vector-rotate*! (-> gp-0 gun-local-dir) (-> this gun-local-dir) (-> gp-0 mat)) (vector-float*! (-> gp-0 gun-dir) (-> gp-0 gun-local-dir) 409600.0) @@ -155,7 +144,7 @@ (set! (-> gp-0 params options) (projectile-options)) (logclear! (-> gp-0 params options) (projectile-options po14 po15 po16)) (set! (-> gp-0 params pos quad) (-> gp-0 gun-local-pos quad)) - (set! (-> gp-0 params vel quad) (-> gp-0 gun-dir quad)) + (vector-copy! (-> gp-0 params vel) (-> gp-0 gun-dir)) (set! (-> gp-0 params notify-handle) (the-as handle #f)) (set! (-> gp-0 params owner-handle) (process->handle this)) (set! (-> gp-0 params target-handle) (the-as handle #f)) @@ -174,7 +163,7 @@ (set! (-> v1-23 initial-valuef) (+ -20480.0 (-> gp-0 gun-local-pos y))) ) ) - (set! (-> gp-0 mat fvec quad) (-> gp-0 gun-local-dir quad)) + (vector-copy! (-> gp-0 mat fvec) (-> gp-0 gun-local-dir)) (vector-cross! (the-as vector (-> gp-0 mat)) (-> gp-0 mat uvec) (-> gp-0 mat fvec)) (vector+float*! (-> gp-0 mat trans) (-> gp-0 gun-local-pos) (-> gp-0 gun-local-dir) -12288.0) (if (logtest? (-> *part-group-id-table* 227 flags) (sp-group-flag sp13)) @@ -240,33 +229,22 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'wvehicle-physics-work))) - (let* ((v1-20 (-> s5-1 mat)) - (a3-4 (-> this node-list data 0 bone transform)) - (a0-15 (-> a3-4 rvec quad)) - (a1-6 (-> a3-4 uvec quad)) - (a2-6 (-> a3-4 fvec quad)) - (a3-5 (-> a3-4 trans quad)) - ) - (set! (-> v1-20 rvec quad) a0-15) - (set! (-> v1-20 uvec quad) a1-6) - (set! (-> v1-20 fvec quad) a2-6) - (set! (-> v1-20 trans quad) a3-5) - ) - (set! (-> s5-1 force quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0) quad)) - (set! (-> s5-1 velocity quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0) quad)) - (set! (-> s5-1 world-pos quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0) quad)) - (set! (-> s5-1 world-normal quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0) quad)) + (matrix-copy! (-> s5-1 mat) (-> this node-list data 0 bone transform)) + (vector-copy! (-> s5-1 force) (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0)) + (vector-copy! (-> s5-1 velocity) (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0)) + (vector-copy! (-> s5-1 world-pos) (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0)) + (vector-copy! (-> s5-1 world-normal) (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0)) (set-vector! (-> s5-1 local-pos) 27670.756 27670.756 28398.934 28398.934) (dotimes (s4-1 4) (let ((s3-0 (-> this wheel s4-1))) (let ((v1-29 (-> s3-0 info))) (set! (-> s5-1 ground-pos x) (+ -3276.8 (-> v1-29 susp-arm-length))) (set! (-> s5-1 tmp quad) (-> (the-as (pointer uint128) (+ (+ (* s4-1 16) 64) (the-as int s5-1))))) - (set! (-> s5-1 steering-axis quad) (-> v1-29 local-pos quad)) + (vector-copy! (-> s5-1 steering-axis) (-> v1-29 local-pos)) ) (+! (-> s5-1 steering-axis x) (* (-> s5-1 ground-pos x) (-> s3-0 cos-susp-ang))) (+! (-> s5-1 steering-axis y) (* (-> s5-1 ground-pos x) (-> s3-0 sin-susp-ang))) - (set! (-> s5-1 p-body quad) (-> s5-1 steering-axis quad)) + (vector-copy! (-> s5-1 p-body) (-> s5-1 steering-axis)) (set! (-> s5-1 p-body x) (* (-> s5-1 p-body x) (-> s3-0 x-scale))) (set! (-> s5-1 tmp x) (* (-> s5-1 tmp x) (-> s3-0 x-scale))) (vector-! (-> s5-1 axis) (-> s5-1 p-body) (-> s5-1 tmp)) @@ -314,7 +292,7 @@ (init (-> this jmod-axles 1) this (the-as uint 15) (joint-mod-base-flags attached)) (init (-> this jmod-axles 2) this (the-as uint 8) (joint-mod-base-flags attached)) (init (-> this jmod-axles 3) this (the-as uint 16) (joint-mod-base-flags attached)) - (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 10485.76 :z -10240.0 :w 1.0) quad)) + (vector-copy! (-> this turret-local-pos) (new 'static 'vector :y 10485.76 :z -10240.0 :w 1.0)) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) this diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-snake.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-snake.gc index b4087d9f909..7e29340a77a 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-snake.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-snake.gc @@ -68,7 +68,7 @@ (alloc-rbody-control! this *v-snake-constants*) (set! (-> this shoot-delay) (the-as uint 18)) (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) - (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0)) (set! (-> this rider-hand-joint-array 0) 17) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc index 6d9be7dffa0..e98337d06cc 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-toad.gc @@ -47,18 +47,7 @@ (set! (-> gp-1 vec10 y) 204800.0) (set! (-> gp-1 vec10 z) 409600.0) (set! (-> gp-1 vec10 w) 163840.0) - (let* ((v1-9 (-> gp-1 mat0)) - (a3-1 (-> this rbody matrix)) - (a0-4 (-> a3-1 rvec quad)) - (a1-1 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-9 rvec quad) a0-4) - (set! (-> v1-9 uvec quad) a1-1) - (set! (-> v1-9 fvec quad) a2-1) - (set! (-> v1-9 trans quad) a3-2) - ) + (matrix-copy! (-> gp-1 mat0) (-> this rbody matrix)) (let ((v1-10 (new 'static 'inline-array vector 2 (new 'static 'vector :x 2048.0 :y 7372.8 :z 6144.0 :w 1.0) (new 'static 'vector :x -2048.0 :y 7372.8 :z 6144.0 :w 1.0) @@ -71,7 +60,7 @@ (vector-reset! (-> gp-1 vec4)) (set! (-> gp-1 vec4 z) (-> gp-1 vec10 y)) (set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y))) - (set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad)) + (vector-copy! (-> gp-1 vec8) (-> gp-1 mat0 fvec)) (vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x))) (vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x))) (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) @@ -98,8 +87,8 @@ ) ) (when s4-2 - (set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad)) - (set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad)) + (vector-copy! (-> gp-1 vec6) (get-trans s4-2 3)) + (vector-copy! (-> gp-1 vec7) (get-transv s4-2)) (vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y)) (vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0)) (set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) @@ -124,7 +113,7 @@ (set! (-> gp-1 params options) (projectile-options)) (logclear! (-> gp-1 params options) (projectile-options po14 po15 po16)) (set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad)) - (set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad)) + (vector-copy! (-> gp-1 params vel) (-> gp-1 vec2)) (set! (-> gp-1 params notify-handle) (the-as handle #f)) (set! (-> gp-1 params owner-handle) (process->handle this)) (set! (-> gp-1 params target-handle) (the-as handle #f)) @@ -290,25 +279,14 @@ (set-vector! (-> gp-0 p-body) 1.0 0.0 0.0 1.0) (set-vector! (-> gp-0 axis) 0.0 1.0 0.0 1.0) (quaternion-copy! (the-as quaternion (-> gp-0 world-normal)) (-> this root quat)) - (let* ((v1-3 (-> gp-0 mat)) - (a3-0 (-> this rbody matrix)) - (a0-7 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-3 rvec quad) a0-7) - (set! (-> v1-3 uvec quad) a1-2) - (set! (-> v1-3 fvec quad) a2-1) - (set! (-> v1-3 trans quad) a3-1) - ) + (matrix-copy! (-> gp-0 mat) (-> this rbody matrix)) (set! (-> gp-0 wsphere y) (* (-> arg1 radius) (-> arg1 scale))) (set! (-> gp-0 wsphere z) 13590.528) (set! (-> gp-0 wsphere r) 0.0) (set! (-> gp-0 friction-coef) (+ (-> gp-0 wsphere r) (* 2.0 (asin (/ (/ (-> arg1 travel) 2) (-> gp-0 wsphere z))))) ) - (set! (-> gp-0 steering-axis quad) (-> (new 'static 'vector :x 10649.6 :y 2662.4 :z 7618.56 :w 1.0) quad)) + (vector-copy! (-> gp-0 steering-axis) (new 'static 'vector :x 10649.6 :y 2662.4 :z 7618.56 :w 1.0)) (set-vector! (-> gp-0 ground-pos) 0.0 @@ -317,7 +295,7 @@ 1.0 ) (vector-normalize! (-> gp-0 ground-pos) 1.0) - (set! (-> gp-0 tmp quad) (-> gp-0 steering-axis quad)) + (vector-copy! (-> gp-0 tmp) (-> gp-0 steering-axis)) (+! (-> gp-0 tmp z) (* (-> gp-0 wsphere z) (cos (-> gp-0 wsphere r)))) (+! (-> gp-0 tmp y) (* -1.0 (sin (-> gp-0 wsphere r)) (-> gp-0 wsphere z))) (set! (-> gp-0 tmp y) (- (-> gp-0 tmp y) (-> gp-0 wsphere y))) @@ -328,8 +306,8 @@ (-> arg0 local-axis) (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) ) - (set! (-> arg0 probe-local-pos quad) (-> gp-0 tmp quad)) - (set! (-> arg0 probe-local-dir quad) (-> gp-0 ground-pos quad)) + (vector-copy! (-> arg0 probe-local-pos) (-> gp-0 tmp)) + (vector-copy! (-> arg0 probe-local-dir) (-> gp-0 ground-pos)) (vector-matrix*! (-> gp-0 side-dir) (-> gp-0 tmp) (-> gp-0 mat)) (vector-rotate*! (-> gp-0 forward-dir) (-> gp-0 ground-pos) (-> gp-0 mat)) (set! (-> gp-0 wsphere x) @@ -364,7 +342,7 @@ (the-as quaternion (-> gp-0 force)) ) ) - (set! (-> gp-0 dir quad) (-> gp-0 steering-axis quad)) + (vector-copy! (-> gp-0 dir) (-> gp-0 steering-axis)) (+! (-> gp-0 dir z) (* (-> gp-0 wsphere z) (-> arg0 cos-susp-ang))) (+! (-> gp-0 dir y) (* -1.0 (-> arg0 sin-susp-ang) (-> gp-0 wsphere z))) (set! (-> gp-0 dir x) (* (-> gp-0 dir x) (-> arg0 x-scale))) @@ -388,7 +366,7 @@ (the-as quaternion (-> gp-0 velocity)) ) (quaternion*! (-> arg0 quat) (the-as quaternion (-> gp-0 world-normal)) (the-as quaternion (-> gp-0 force))) - (set! (-> arg0 trans quad) (-> gp-0 ground-normal-sum quad)) + (vector-copy! (-> arg0 trans) (-> gp-0 ground-normal-sum)) ) 0 (none) @@ -432,31 +410,20 @@ ) ) (let ((s5-2 (new 'stack-no-clear 'wvehicle-physics-work))) - (let* ((v1-19 (-> s5-2 mat)) - (a3-3 (-> this node-list data 0 bone transform)) - (a0-12 (-> a3-3 rvec quad)) - (a1-5 (-> a3-3 uvec quad)) - (a2-4 (-> a3-3 fvec quad)) - (a3-4 (-> a3-3 trans quad)) - ) - (set! (-> v1-19 rvec quad) a0-12) - (set! (-> v1-19 uvec quad) a1-5) - (set! (-> v1-19 fvec quad) a2-4) - (set! (-> v1-19 trans quad) a3-4) - ) - (set! (-> s5-2 force quad) (-> (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0) quad)) - (set! (-> s5-2 velocity quad) (-> (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0) quad)) + (matrix-copy! (-> s5-2 mat) (-> this node-list data 0 bone transform)) + (vector-copy! (-> s5-2 force) (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0)) + (vector-copy! (-> s5-2 velocity) (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0)) (set-vector! (-> s5-2 local-pos) 32768.0 32768.0 0.0 0.0) (dotimes (s4-2 2) (let ((v1-26 (-> this wheel (+ s4-2 2)))) (let ((a0-20 (-> v1-26 info))) (set! (-> s5-2 ground-pos y) (+ -2048.0 (-> a0-20 susp-arm-length))) (set! (-> s5-2 tmp quad) (-> (the-as (pointer uint128) (+ (+ (* s4-2 16) 64) (the-as int s5-2))))) - (set! (-> s5-2 steering-axis quad) (-> a0-20 local-pos quad)) + (vector-copy! (-> s5-2 steering-axis) (-> a0-20 local-pos)) ) (+! (-> s5-2 steering-axis x) (* (-> s5-2 ground-pos y) (-> v1-26 cos-susp-ang))) (+! (-> s5-2 steering-axis y) (* (-> s5-2 ground-pos y) (-> v1-26 sin-susp-ang))) - (set! (-> s5-2 p-body quad) (-> s5-2 steering-axis quad)) + (vector-copy! (-> s5-2 p-body) (-> s5-2 steering-axis)) (set! (-> s5-2 p-body x) (* (-> s5-2 p-body x) (-> v1-26 x-scale))) (set! (-> s5-2 tmp x) (* (-> s5-2 tmp x) (-> v1-26 x-scale))) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc index 29b9d9eb9e8..f75f6221b6b 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-turtle.gc @@ -146,7 +146,7 @@ (vector-matrix*! (-> s5-1 mat uvec) (new 'static 'vector :y 20480.0 :z -8192.0 :w 1.0) (-> this rbody matrix)) (rigid-body-control-method-23 (-> this rbody) (-> s5-1 mat uvec) (the-as vector (-> s5-1 mat))) (vector-! (-> s5-1 mat fvec) (the-as vector (-> s5-1 mat)) (-> this ant-tip-vel)) - (set! (-> this ant-tip-vel quad) (-> s5-1 mat rvec quad)) + (vector-copy! (-> this ant-tip-vel) (-> s5-1 mat rvec)) (vector-float*! (-> s5-1 mat fvec) (-> s5-1 mat fvec) (/ 1.0 (-> s5-1 mat trans x))) (vector+float*! (-> this spring-vel) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar-x-ride.gc b/goal_src/jak3/levels/desert/wvehicle/wcar-x-ride.gc index 1687bfb2016..84a73964bfe 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar-x-ride.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar-x-ride.gc @@ -68,7 +68,7 @@ (alloc-rbody-control! this *v-x-ride-constants*) (set! (-> this shoot-delay) (the-as uint 18)) (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) - (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0)) (set! (-> this rider-hand-joint-array 0) 8) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wcar.gc b/goal_src/jak3/levels/desert/wvehicle/wcar.gc index 5cc1981bc9e..8e3789593f6 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wcar.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wcar.gc @@ -3828,25 +3828,14 @@ (set! (-> s5-0 vec0 7 w) 0.3419) (set! (-> s5-0 vec0 7 z) -0.1736) ) - (let* ((v1-13 (-> s5-0 mat0)) - (a3-0 (-> this rbody matrix)) - (a0-4 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-13 rvec quad) a0-4) - (set! (-> v1-13 uvec quad) a1-0) - (set! (-> v1-13 fvec quad) a2-0) - (set! (-> v1-13 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat0) (-> this rbody matrix)) (new 'static 'inline-array vector 2 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) ) (vector-matrix*! (the-as vector (-> s5-0 vec0)) (-> this local-gun-pos (-> s5-0 barrel-idx)) (-> s5-0 mat0)) 0 - (set! (-> s5-0 vec0 2 quad) (-> (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0) quad)) + (vector-copy! (-> s5-0 vec0 2) (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0)) (vector-rotate*! (-> s5-0 vec0 3) (-> s5-0 vec0 2) (-> s5-0 mat0)) (vector-float*! (-> s5-0 vec0 4) (-> s5-0 vec0 3) (- (-> s5-0 vec0 7 y) (-> s5-0 vec0 7 x))) (vector+float*! @@ -3879,7 +3868,7 @@ ) ) (when a0-14 - (set! (-> s5-0 vec0 6 quad) (-> (get-trans a0-14 3) quad)) + (vector-copy! (-> s5-0 vec0 6) (get-trans a0-14 3)) (vector-! (-> s5-0 vec0 5) (-> s5-0 vec0 6) (the-as vector (-> s5-0 vec0))) (matrix-transpose! (-> s5-0 mat1) (-> s5-0 mat0)) (vector-matrix*! (-> s5-0 vec0 2) (-> s5-0 vec0 5) (-> s5-0 mat1)) @@ -3915,7 +3904,7 @@ (set! (-> s5-0 params options) (projectile-options)) (logclear! (-> s5-0 params options) (projectile-options po14 po15 po16)) (set! (-> s5-0 params pos quad) (-> s5-0 vec0 0 quad)) - (set! (-> s5-0 params vel quad) (-> s5-0 vec0 4 quad)) + (vector-copy! (-> s5-0 params vel) (-> s5-0 vec0 4)) (set! (-> s5-0 params notify-handle) (the-as handle #f)) (set! (-> s5-0 params owner-handle) (process->handle this)) (set! (-> s5-0 params target-handle) (the-as handle #f)) @@ -4074,21 +4063,21 @@ (set! (-> v1-16 2 quad) a2-3) (set! (-> v1-16 3 quad) a3-3) ) - (set! (-> s5-1 vec0 4 quad) (-> (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0) quad)) - (set! (-> s5-1 vec0 5 quad) (-> (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0) quad)) - (set! (-> s5-1 vec0 6 quad) (-> (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0) quad)) - (set! (-> s5-1 vec0 7 quad) (-> (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0) quad)) + (vector-copy! (-> s5-1 vec0 4) (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0)) + (vector-copy! (-> s5-1 vec0 5) (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0)) + (vector-copy! (-> s5-1 vec0 6) (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0)) + (vector-copy! (-> s5-1 vec0 7) (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0)) (set-vector! (-> s5-1 vec0 8) 25486.223 25486.223 29127.111 29127.111) (dotimes (s4-1 4) (let ((s3-1 (-> this wheel s4-1))) (let ((v1-25 (-> s3-1 info))) (set! (-> s5-1 float0) (+ -2048.0 (-> v1-25 susp-arm-length))) (set! (-> s5-1 vec1 0 quad) (-> (the-as (pointer uint128) (+ (+ (* s4-1 16) 64) (the-as int s5-1))))) - (set! (-> s5-1 vec0 9 quad) (-> v1-25 local-pos quad)) + (vector-copy! (-> s5-1 vec0 9) (-> v1-25 local-pos)) ) (+! (-> s5-1 vec0 9 x) (* (-> s5-1 float0) (-> s3-1 cos-susp-ang))) (+! (-> s5-1 vec0 9 y) (* (-> s5-1 float0) (-> s3-1 sin-susp-ang))) - (set! (-> s5-1 vec1 1 quad) (-> s5-1 vec0 9 quad)) + (vector-copy! (-> s5-1 vec1 1) (-> s5-1 vec0 9)) (set! (-> s5-1 vec1 1 x) (* (-> s5-1 vec1 1 x) (-> s3-1 x-scale))) (set! (-> s5-1 vec1 0 x) (* (-> s5-1 vec1 0 x) (-> s3-1 x-scale))) (vector-! (-> s5-1 vec1 2) (-> s5-1 vec1 1) (the-as vector (-> s5-1 vec1))) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-ai.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-ai.gc index 2a9d778805a..b4a171ff6aa 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-ai.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-ai.gc @@ -20,8 +20,8 @@ ) ) (when s5-2 - (set! (-> this target-status position quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) - (set! (-> this target-status velocity quad) (-> (get-transv (the-as process-focusable s5-2)) quad)) + (vector-copy! (-> this target-status position) (get-trans (the-as process-focusable s5-2) 3)) + (vector-copy! (-> this target-status velocity) (get-transv (the-as process-focusable s5-2))) ) ) ((-> this control-hook) this) @@ -75,9 +75,9 @@ (set! (-> gp-0 friction-coef) (the-as float (current-time))) (vehicle-method-140 this) (set! (-> gp-0 mat rvec quad) (-> this rbody position quad)) - (set! (-> gp-0 mat uvec quad) (-> this rbody lin-velocity quad)) - (set! (-> gp-0 probe-dir quad) (-> this rbody matrix fvec quad)) - (set! (-> gp-0 steering-axis quad) (-> this rbody matrix rvec quad)) + (vector-copy! (-> gp-0 mat uvec) (-> this rbody lin-velocity)) + (vector-copy! (-> gp-0 probe-dir) (-> this rbody matrix fvec)) + (vector-copy! (-> gp-0 steering-axis) (-> this rbody matrix rvec)) (set! (-> gp-0 steering-axis y) 0.0) (set! (-> gp-0 side-dir z) (vector-length (-> gp-0 mat uvec))) (set! (-> gp-0 wheel-axis z) (vector-dot (-> gp-0 mat uvec) (-> gp-0 probe-dir))) @@ -116,10 +116,10 @@ (set! (-> gp-0 side-dir x) 1.0) (b! #t cfg-64 :delay (nop!)) (label cfg-39) - (set! (-> gp-0 force quad) (-> (the-as process-focusable a0-32) node-list data 0 bone transform fvec quad)) + (vector-copy! (-> gp-0 force) (-> (the-as process-focusable a0-32) node-list data 0 bone transform fvec)) ) - (set! (-> gp-0 mat fvec quad) (-> this target-status position quad)) - (set! (-> gp-0 mat trans quad) (-> this target-status velocity quad)) + (vector-copy! (-> gp-0 mat fvec) (-> this target-status position)) + (vector-copy! (-> gp-0 mat trans) (-> this target-status velocity)) (let* ((f0-11 40960.0) (f0-13 (* f0-11 f0-11)) ) @@ -131,7 +131,7 @@ (.add.mul.z.vf.x vf1 vf2 vf1 acc) (.mov v1-50 vf1) (if (< f0-13 v1-50) - (set! (-> gp-0 force quad) (-> gp-0 mat trans quad)) + (vector-copy! (-> gp-0 force) (-> gp-0 mat trans)) ) ) (set! (-> gp-0 wheel-axis x) @@ -141,10 +141,10 @@ (vector+float*! (-> gp-0 velocity) (-> gp-0 mat fvec) (-> gp-0 force) 81920.0) (vector+float*! (-> gp-0 velocity) (-> gp-0 velocity) (-> gp-0 mat trans) 0.5) (when (logtest? (vehicle-flag vf54) (-> this v-flags)) - (set! (-> gp-0 axis quad) (-> gp-0 mat rvec quad)) - (set! (-> gp-0 dir quad) (-> gp-0 mat uvec quad)) - (set! (-> gp-0 ground-normal-sum quad) (-> gp-0 mat fvec quad)) - (set! (-> gp-0 ground-pos quad) (-> gp-0 mat trans quad)) + (vector-copy! (-> gp-0 axis) (-> gp-0 mat rvec)) + (vector-copy! (-> gp-0 dir) (-> gp-0 mat uvec)) + (vector-copy! (-> gp-0 ground-normal-sum) (-> gp-0 mat fvec)) + (vector-copy! (-> gp-0 ground-pos) (-> gp-0 mat trans)) (set! (-> gp-0 axis y) 0.0) (set! (-> gp-0 dir y) 0.0) (set! (-> gp-0 ground-normal-sum y) 0.0) @@ -175,7 +175,7 @@ (label cfg-45) (cond ((= v1-38 2) - (set! (-> gp-0 velocity quad) (-> this ai-target-point quad)) + (vector-copy! (-> gp-0 velocity) (-> this ai-target-point)) (set! (-> gp-0 wheel-axis x) (-> this ai-max-speed)) ) ((zero? v1-38) @@ -200,7 +200,7 @@ ) (logclear! (-> a0-69 flags) (nav-state-flag directional-mode)) (logior! (-> a0-69 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-69 target-pos quad) (-> v1-92 quad)) + (vector-copy! (-> a0-69 target-pos) v1-92) ) 0 (let ((v1-95 (-> this nav))) @@ -208,7 +208,7 @@ ) 0 (let ((a1-22 (-> this nav state))) - (set! (-> gp-0 mat trans quad) (-> a1-22 velocity quad)) + (vector-copy! (-> gp-0 mat trans) (-> a1-22 velocity)) ) ) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-obs.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-obs.gc index 61b491a9cb2..9cec3fd8a09 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-obs.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-obs.gc @@ -309,8 +309,8 @@ (defmethod find-ground ((this turbo-pickup)) (let ((s4-0 #f)) (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> gp-0 vec0 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> gp-0 vec0) (-> this root trans)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec0)) (vector-reset! (-> gp-0 vec1)) (set! (-> gp-0 vec1 y) 1.0) (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) @@ -327,13 +327,13 @@ (let ((f0-6 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) (when (>= f0-6 0.0) (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f0-6) - (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (vector-copy! (-> gp-0 vec1) (-> gp-0 cquery best-other-tri normal)) (+! (-> gp-0 vec0 y) 4915.2) (set! s4-0 #t) (format #t "turbo-pickup::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) ) ) - (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec0)) (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) ) s4-0 @@ -430,7 +430,7 @@ (set! (-> s4-0 event-self) 'touched) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (update-transforms (-> self root)) (set! (-> self available) #t) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-part.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-part.gc index 2c4a94b02f1..477d6aabf78 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-part.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-part.gc @@ -973,7 +973,7 @@ (set! (-> *toad-grenade-trail* zbuffer?) #f) -(set! (-> *toad-grenade-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *toad-grenade-trail* lie-vector) *up-vector*) (set! (-> *toad-grenade-trail* use-tape-mode?) #f) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc index 2db1cc5c083..4e8017f53db 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc @@ -241,7 +241,7 @@ (vector-! (-> arg1 velocity) (-> arg1 velocity) (-> this surface-velocity)) ) (let ((s0-0 (the-as object (+ (+ (* 144 s3-1) 416) (the-as int arg1))))) - (set! (-> arg1 probe-work-array 0 local-normal quad) (-> (the-as wvehicle-physics-work s0-0) force quad)) + (vector-copy! (-> arg1 probe-work-array 0 local-normal) (-> (the-as wvehicle-physics-work s0-0) force)) (vector+float*! (-> (the-as wvehicle-physics-work s0-0) velocity) (-> arg1 probe-work-array 0 local-normal) @@ -255,15 +255,18 @@ (-> s2-1 ground-normal) ) (vector-normalize! (-> (the-as wvehicle-physics-work s0-0) world-pos) 1.0) - (set! (-> (the-as wvehicle-physics-work arg1) forward-dir quad) - (-> (the-as wvehicle-physics-work s0-0) world-pos quad) - ) - (set! (-> (the-as wvehicle-physics-work arg1) side-dir quad) - (-> (the-as wvehicle-physics-work s0-0) velocity quad) - ) - (set! (-> (the-as wvehicle-physics-work s0-0) world-normal quad) - (-> (the-as wvehicle-physics-work arg1) velocity quad) - ) + (vector-copy! + (-> (the-as wvehicle-physics-work arg1) forward-dir) + (-> (the-as wvehicle-physics-work s0-0) world-pos) + ) + (vector-copy! + (-> (the-as wvehicle-physics-work arg1) side-dir) + (-> (the-as wvehicle-physics-work s0-0) velocity) + ) + (vector-copy! + (-> (the-as wvehicle-physics-work s0-0) world-normal) + (-> (the-as wvehicle-physics-work arg1) velocity) + ) ) (set! (-> s2-1 side-vel) (vector-dot @@ -413,11 +416,11 @@ (when (< 0.0 (-> s1-2 up-force)) (set! (-> arg1 probe-work-array 0 world-normal y) (* (-> s2-2 scale) (-> s2-2 radius))) (let ((v1-138 (-> (the-as wvehicle-physics-work arg1) probe-work-array s3-2))) - (set! (-> (the-as wvehicle-physics-work arg1) forward-dir quad) (-> v1-138 forward-dir quad)) - (set! (-> (the-as wvehicle-physics-work arg1) side-dir quad) (-> v1-138 side-dir quad)) - (set! (-> (the-as wvehicle-physics-work arg1) velocity quad) (-> v1-138 velocity quad)) + (vector-copy! (-> (the-as wvehicle-physics-work arg1) forward-dir) (-> v1-138 forward-dir)) + (vector-copy! (-> (the-as wvehicle-physics-work arg1) side-dir) (-> v1-138 side-dir)) + (vector-copy! (-> (the-as wvehicle-physics-work arg1) velocity) (-> v1-138 velocity)) ) - (set! (-> (the-as wvehicle-physics-work arg1) ground-pos quad) (-> s1-2 ground-pos quad)) + (vector-copy! (-> (the-as wvehicle-physics-work arg1) ground-pos) (-> s1-2 ground-pos)) (vector-! (-> (the-as wvehicle-physics-work arg1) p-body) (-> (the-as wvehicle-physics-work arg1) ground-pos) @@ -541,7 +544,7 @@ ) (cond ((< f0-13 (* f1-10 f1-10)) - (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (vector-copy! (-> gp-0 local-pos) (-> s4-0 info cm-offset-joint)) (+! (-> gp-0 local-pos z) 4096.0) (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) (vector-reset! (-> gp-0 force)) @@ -551,7 +554,7 @@ (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) ) (else - (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (vector-copy! (-> gp-0 local-pos) (-> s4-0 info cm-offset-joint)) (+! (-> gp-0 local-pos y) 4096.0) (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) (vector-reset! (-> gp-0 force)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-race.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-race.gc index ad475a9cb1f..cda96d05db0 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-race.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-race.gc @@ -183,22 +183,11 @@ (vector-reset! (-> s4-0 ang-momentum)) (rigid-body-control-method-26 s4-0) (init-velocities! s4-0) - (set! (-> this root transv quad) (-> s4-0 lin-velocity quad)) + (vector-copy! (-> this root transv) (-> s4-0 lin-velocity)) (quaternion-copy! (-> this root quat) (the-as quaternion (-> s4-0 rot))) (rigid-body-control-method-25 s4-0 (-> this root trans)) - (let* ((v1-54 (-> this node-list data 0 bone transform)) - (a3-1 (-> s4-0 matrix)) - (a0-21 (-> a3-1 rvec quad)) - (a1-16 (-> a3-1 uvec quad)) - (a2-5 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-54 rvec quad) a0-21) - (set! (-> v1-54 uvec quad) a1-16) - (set! (-> v1-54 fvec quad) a2-5) - (set! (-> v1-54 trans quad) a3-2) - ) - (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (matrix-copy! (-> this node-list data 0 bone transform) (-> s4-0 matrix)) + (vector-copy! (-> this node-list data 0 bone transform trans) (-> this root trans)) (race-control-method-11 s5-0 (* f30-0 f28-0)) ) ) @@ -235,13 +224,13 @@ ) (mem-set32! (the-as pointer (-> gp-0 vec11)) 6 0) (set! (-> gp-0 time) (the-as uint (current-time))) - (set! (-> gp-0 vec0 quad) (-> this rbody position quad)) - (set! (-> gp-0 vec1 quad) (-> this rbody lin-velocity quad)) + (vector-copy! (-> gp-0 vec0) (-> this rbody position)) + (vector-copy! (-> gp-0 vec1) (-> this rbody lin-velocity)) (set! (-> gp-0 float5) 0.0) - (set! (-> gp-0 vec8 quad) (-> this rbody matrix rvec quad)) + (vector-copy! (-> gp-0 vec8) (-> this rbody matrix rvec)) (set! (-> gp-0 vec8 y) 0.0) (vector-normalize! (-> gp-0 vec8) 1.0) - (set! (-> gp-0 vec9 quad) (-> this rbody matrix fvec quad)) + (vector-copy! (-> gp-0 vec9) (-> this rbody matrix fvec)) (set! (-> gp-0 vec13 x) (* (-> this rbody ang-velocity y) (vector-length (-> this rbody lin-velocity)))) (set! (-> gp-0 float1) (seconds-per-frame)) (set! (-> gp-0 float8) (vector-dot (-> gp-0 vec1) (-> gp-0 vec9))) @@ -285,9 +274,9 @@ (let ((v1-60 (handle->process (-> s3-0 racer-array s2-0 racer)))) (when v1-60 (when (!= v1-60 this) - (set! (-> gp-0 vec2 quad) (-> (the-as process-drawable v1-60) root trans quad)) - (set! (-> gp-0 vec3 quad) (-> (the-as process-drawable v1-60) root transv quad)) - (set! (-> gp-0 vec4 quad) (-> (the-as process-drawable v1-60) rbody matrix fvec quad)) + (vector-copy! (-> gp-0 vec2) (-> (the-as process-drawable v1-60) root trans)) + (vector-copy! (-> gp-0 vec3) (-> (the-as process-drawable v1-60) root transv)) + (vector-copy! (-> gp-0 vec4) (-> (the-as process-drawable v1-60) rbody matrix fvec)) (set! (-> gp-0 float6) (nearest-dist2-between-moving-points (-> gp-0 vec0) (-> gp-0 vec1) (-> gp-0 vec2) (-> gp-0 vec3) 0.5) ) @@ -456,7 +445,7 @@ (defmethod wvehicle-method-182 ((this wvehicle)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) - (set! (-> s5-0 0 quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 0) (-> this rbody position)) (set! (-> this camera-dist2) (vector-vector-distance-squared (-> s5-0 0) (camera-pos))) (let ((s4-1 vector-vector-distance-squared) (s5-1 (-> s5-0 0)) @@ -479,7 +468,7 @@ (defmethod wvehicle-method-185 ((this wvehicle)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) - (set! (-> s5-0 0 quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 0) (-> this rbody position)) (set! (-> this camera-dist2) (vector-vector-distance-squared (-> s5-0 0) (camera-pos))) (let ((s4-1 vector-vector-distance-squared) (s5-1 (-> s5-0 0)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc index e2105d64003..bc5b98acb82 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-states.gc @@ -112,7 +112,7 @@ (init-velocities! gp-1) ) (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) @@ -169,7 +169,7 @@ (set-time! (-> self state-time)) (set! (-> self v-flags) (the-as vehicle-flag (logclear (-> self v-flags) (vehicle-flag rammed-target)))) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 4096.0) (set! (-> gp-0 scale) (/ (-> self draw bounds w) 11264)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-util.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-util.gc index 2e8672fa339..71113b51d8a 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-util.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-util.gc @@ -555,7 +555,7 @@ (defmethod spawn-wheels! ((this wvehicle) (arg0 skeleton-group) (arg1 skeleton-group) (arg2 skeleton-group) (arg3 skeleton-group)) (local-vars (sv-96 vehicle-wheel-state)) (let ((s1-0 (new 'stack-no-clear 'vehicle-wheel-init-params))) - (set! (-> s1-0 position quad) (-> this root trans quad)) + (vector-copy! (-> s1-0 position) (-> this root trans)) (quaternion-identity! (-> s1-0 rotation)) (vector-identity! (-> s1-0 scale)) (set! (-> s1-0 skel) arg0) @@ -638,7 +638,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this wvehicle)) +(defmethod get-search-info-flag ((this wvehicle)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (logtest? (vehicle-flag ai-driving) (-> this v-flags)) (set! v0-0 (logior v0-0 40)) @@ -654,10 +655,10 @@ (let ((gp-0 (new 'stack-no-clear 'wvehicle-stack-type2))) (set! (-> gp-0 float0) 4096.0) (quaternion->matrix (-> gp-0 mat0) (-> this root quat)) - (set! (-> gp-0 mat0 trans quad) (-> this root trans quad)) - (set! (-> gp-0 vec3 quad) (-> gp-0 mat0 fvec quad)) - (set! (-> gp-0 vec1 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> gp-0 mat0 trans) (-> this root trans)) + (vector-copy! (-> gp-0 vec3) (-> gp-0 mat0 fvec)) + (vector-copy! (-> gp-0 vec1) (-> this root trans)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec1)) (+! (-> gp-0 cquery start-pos y) 4096.0) (vector-reset! (-> gp-0 vec2)) (set! (-> gp-0 vec2 y) 1.0) @@ -703,19 +704,19 @@ ) (set! (-> gp-0 vec1 y) (- (-> gp-0 vec1 y) (-> v1-21 depth))) ) - (set! (-> gp-0 vec2 quad) (-> gp-0 cquery best-other-tri normal quad)) + (vector-copy! (-> gp-0 vec2) (-> gp-0 cquery best-other-tri normal)) (when (< (-> gp-0 vec2 y) (cos 3640.889)) (vector-reset! (-> gp-0 vec2)) (set! (-> gp-0 vec2 y) 1.0) ) - (set! (-> this root trans quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec1)) 0 ) (if (< f30-0 0.0) 0 ) ) - (set! (-> this root trans quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec1)) (forward-up-nopitch->quaternion (-> this root quat) (-> gp-0 vec3) (-> gp-0 vec2)) ) 0 @@ -728,19 +729,8 @@ (let ((v1-2 (-> this info setup))) (set! (-> gp-0 ground-pos y) (fmax (fmin (-> this gun-aim-yaw) (-> v1-2 gun-yaw-max)) (-> v1-2 gun-yaw-min))) ) - (let* ((v1-4 (-> gp-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-3 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-4 rvec quad) a0-3) - (set! (-> v1-4 uvec quad) a1-0) - (set! (-> v1-4 fvec quad) a2-0) - (set! (-> v1-4 trans quad) a3-1) - ) - (set! (-> gp-0 tmp quad) (-> this turret-local-pos quad)) + (matrix-copy! (-> gp-0 mat) (-> this node-list data 0 bone transform)) + (vector-copy! (-> gp-0 tmp) (-> this turret-local-pos)) (set-vector! (-> gp-0 probe-dir) (sin (-> gp-0 ground-pos y)) 0.0 (cos (-> gp-0 ground-pos y)) 1.0) (vector+float*! (-> gp-0 steering-axis) (-> gp-0 tmp) (-> gp-0 probe-dir) 204800.0) (vector-matrix*! (-> gp-0 local-pos) (-> gp-0 tmp) (-> gp-0 mat)) @@ -814,8 +804,8 @@ ) (vector+float*! (-> gp-0 steering-axis) (-> gp-0 tmp) (-> gp-0 probe-dir) (-> s4-4 gun-z-offset)) ) - (set! (-> this gun-local-dir quad) (-> gp-0 probe-dir quad)) - (set! (-> this gun-local-pos quad) (-> gp-0 steering-axis quad)) + (vector-copy! (-> this gun-local-dir) (-> gp-0 probe-dir)) + (vector-copy! (-> this gun-local-pos) (-> gp-0 steering-axis)) ) 0 (none) @@ -841,7 +831,7 @@ (else (matrix-transpose! (-> s5-0 mat0) (-> this rbody matrix)) (matrix*! (-> s5-0 mat0) (camera-matrix) (-> s5-0 mat0)) - (set! (-> s5-0 vec0 quad) (-> s5-0 mat0 fvec quad)) + (vector-copy! (-> s5-0 vec0) (-> s5-0 mat0 fvec)) (set! (-> this gun-aim-yaw) (atan (-> s5-0 vec0 x) (-> s5-0 vec0 z))) ) ) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc index 772e1ec771d..7124f934fba 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-wheel.gc @@ -203,7 +203,7 @@ (defmethod rbody-post ((this vehicle-wheel)) (let ((v1-0 (new 'stack-no-clear 'rigid-body-move-work))) - (set! (-> v1-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> v1-0 cquery start-pos) (-> this rbody position)) (vector-float*! (-> v1-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) (let ((a0-4 (-> v1-0 cquery))) (set! (-> a0-4 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) @@ -255,7 +255,7 @@ (let ((a0-4 (-> self draw color-mult))) (vector-float*! (the-as vector a0-4) (the-as vector a0-4) 0.25) ) - (set! (-> self rbody position quad) (-> self root trans quad)) + (vector-copy! (-> self rbody position) (-> self root trans)) (quaternion-copy! (the-as quaternion (-> self rbody rot)) (-> self root quat)) (let ((v1-10 (-> block param 0))) (when v1-10 @@ -402,9 +402,9 @@ (defbehavior vehicle-wheel-init-by-other vehicle-wheel ((arg0 vehicle-wheel-init-params)) (logior! (-> self mask) (process-mask vehicle)) (init-collision! self arg0) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 rotation)) - (set! (-> self root scale quad) (-> arg0 scale quad)) + (vector-copy! (-> self root scale) (-> arg0 scale)) (set! (-> self level) (the-as level (-> arg0 level))) (initialize-skeleton self (-> arg0 skel) (the-as pair 0)) (setup-lods! (-> self normal-look) (-> arg0 skel) (-> self draw art-group) (-> self entity)) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc index 555f3a8866e..5ab2b0bdea5 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle.gc @@ -34,19 +34,8 @@ (set-vector! (-> gp-0 vec0) 1.0 0.0 0.0 1.0) (set-vector! (-> gp-0 vec1) 0.0 1.0 0.0 1.0) (quaternion-copy! (-> gp-0 quat3) (-> this root quat)) - (let* ((v1-3 (-> gp-0 mat0)) - (a3-0 (-> this rbody matrix)) - (a0-7 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-3 rvec quad) a0-7) - (set! (-> v1-3 uvec quad) a1-2) - (set! (-> v1-3 fvec quad) a2-1) - (set! (-> v1-3 trans quad) a3-1) - ) - (set! (-> gp-0 vec2 quad) (-> arg1 local-pos quad)) + (matrix-copy! (-> gp-0 mat0) (-> this rbody matrix)) + (vector-copy! (-> gp-0 vec2) (-> arg1 local-pos)) (+! (-> gp-0 vec2 x) (-> arg1 susp-arm-length)) (set! (-> gp-0 vec2 x) (* (-> gp-0 vec2 x) (-> arg0 x-scale))) (+! (-> gp-0 vec2 y) (-> arg1 probe-y-offset)) @@ -79,7 +68,7 @@ (quaternion-normalize! (-> gp-0 quat0)) (quaternion*! (-> gp-0 quat4) (-> gp-0 quat4) (-> gp-0 quat0)) ) - (set! (-> gp-0 vec2 quad) (-> arg1 local-pos quad)) + (vector-copy! (-> gp-0 vec2) (-> arg1 local-pos)) (+! (-> gp-0 vec2 x) (* (-> arg1 susp-arm-length) (-> arg0 cos-susp-ang))) (set! (-> gp-0 vec2 x) (* (-> gp-0 vec2 x) (-> arg0 x-scale))) (+! (-> gp-0 vec2 y) (-> gp-0 float0)) @@ -95,7 +84,7 @@ (quaternion*! (-> gp-0 quat0) (-> gp-0 quat2) (-> gp-0 quat4)) (quaternion*! (-> gp-0 quat0) (-> gp-0 quat0) (-> gp-0 quat1)) (quaternion*! (-> arg0 quat) (-> gp-0 quat3) (-> gp-0 quat0)) - (set! (-> arg0 trans quad) (-> gp-0 vec3 quad)) + (vector-copy! (-> arg0 trans) (-> gp-0 vec3)) ) 0 (none) @@ -146,10 +135,10 @@ (vector-normalize! (-> s5-1 uvec) 1.0) (mem-copy! (the-as pointer s1-0) (the-as pointer (-> this draw shadow-ctrl settings)) 80) (set! (-> s5-1 uvec w) (-> s1-0 shadow-dir w)) - (set! (-> s1-0 shadow-dir quad) (-> s5-1 uvec quad)) + (vector-copy! (-> s1-0 shadow-dir) (-> s5-1 uvec)) ) (let ((v1-39 (-> (the-as process-focusable s2-0) root))) - (set! (-> v1-39 trans quad) (-> s3-0 trans quad)) + (vector-copy! (-> v1-39 trans) (-> s3-0 trans)) (quaternion-copy! (-> v1-39 quat) (-> s3-0 quat)) ) (logand! (-> s3-0 flags) -9) @@ -329,7 +318,7 @@ ) (let ((v1-8 (new 'stack-no-clear 'matrix))) (set! (-> v1-8 fvec x) (seconds-per-frame)) - (set! (-> v1-8 uvec quad) (-> this draw color-emissive quad)) + (vector-copy! (-> v1-8 uvec) (-> this draw color-emissive)) (set! (-> v1-8 uvec x) (fmax 0.0 (+ (-> v1-8 uvec x) (* -2.0 (-> v1-8 fvec x))))) (set! (-> this draw color-emissive quad) (-> v1-8 uvec quad)) ) @@ -942,8 +931,8 @@ (set! (-> a1-11 tread-tracker) (the-as handle #f)) (set! (-> a1-11 inertia) (-> a2-2 inertia)) ) - (set! (-> a1-11 probe-local-dir quad) (-> (new 'static 'vector :y -1.0 :w 1.0) quad)) - (set! (-> a1-11 local-axis quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + (vector-copy! (-> a1-11 probe-local-dir) (new 'static 'vector :y -1.0 :w 1.0)) + (vector-copy! (-> a1-11 local-axis) (new 'static 'vector :x 1.0 :w 1.0)) ) ) (set! (-> (the-as rigid-body-vehicle-constants arg0) physics-model drive-wheel-count) (-> v1-19 byte0)) @@ -1205,7 +1194,7 @@ ) (('ai-drop-off) (let ((v1-140 (the-as object (-> arg3 param 0)))) - (set! (-> this other-pos quad) (-> (the-as wvehicle-ai-drop-off-params v1-140) dest quad)) + (vector-copy! (-> this other-pos) (-> (the-as wvehicle-ai-drop-off-params v1-140) dest)) (set! (-> this other-proc) (process->handle (-> (the-as wvehicle-ai-drop-off-params v1-140) proc))) ) (set! v0-0 (logior (vehicle-flag vf53) (-> this v-flags))) diff --git a/goal_src/jak3/levels/factory/car/hvehicle-effects.gc b/goal_src/jak3/levels/factory/car/hvehicle-effects.gc index efb51e4da40..501efd28331 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle-effects.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle-effects.gc @@ -21,18 +21,7 @@ (when (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (when (< 0.0 (-> this info particles thruster-flame-length)) (let ((s5-0 (new 'stack-no-clear 'hvehicle-effects-stack-var0))) - (let* ((v1-7 (-> s5-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-4 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-4) - (set! (-> v1-7 uvec quad) a1-0) - (set! (-> v1-7 fvec quad) a2-0) - (set! (-> v1-7 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat) (-> this node-list data 0 bone transform)) (set! (-> s5-0 work vec0 y) (-> this info particles thruster-flame-width)) (set! (-> s5-0 work vec0 z) (-> this info particles thruster-flame-length)) (set! (-> s5-0 work vec0 x) diff --git a/goal_src/jak3/levels/factory/car/hvehicle-physics.gc b/goal_src/jak3/levels/factory/car/hvehicle-physics.gc index 2cfc6d4fec1..4eb0413021e 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle-physics.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle-physics.gc @@ -82,8 +82,8 @@ (s0-0 (-> arg1 probe-work-array s1-0)) ) (vector-reset! (-> s0-0 tire-force)) - (set! (-> s0-0 local-pos quad) (-> v1-29 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-29 rot quad)) + (vector-copy! (-> s0-0 local-pos) (-> v1-29 local-pos)) + (vector-copy! (-> s0-0 local-normal) (-> v1-29 rot)) (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) (let ((a1-9 (-> s0-0 probe-pos))) (let ((v1-32 (-> s0-0 world-pos))) @@ -101,27 +101,25 @@ (.svf (&-> a1-9 quad) vf6) ) (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) - (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) - (-> arg1 steering-axis) - (the-as vector (-> arg1 mat)) - ) - ) - quad - ) - ) - (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s0-0 wheel-axis) (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) + (-> arg1 steering-axis) + (the-as vector (-> arg1 mat)) + ) + ) + ) + (vector-copy! (-> s0-0 ground-pos) (-> s0-0 probe-pos)) (set! (-> s0-0 ground-pos y) 0.0) (vector-reset! (-> s0-0 ground-normal)) (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos)) (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) (cond ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) (logclear! (-> this v-flags) (vehicle-flag in-air)) (logior! (-> this v-flags) (vehicle-flag on-ground)) (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) - (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) + (vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal)) + (vector-copy! (-> arg1 ground-normal) (-> s0-0 ground-normal)) ) (else (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 position y))) @@ -142,8 +140,8 @@ (when (>= 1 (-> this force-level)) (dotimes (s2-1 (-> this info physics-model lift-thruster-count)) (let ((s1-1 (-> arg1 probe-work-array s2-1))) - (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) - (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s1-1 world-pos)) + (vector-copy! (-> arg1 velocity) (-> s1-1 velocity)) (let ((f28-1 (-> s1-1 probe-pos y))) (when (> (-> this flight-level-index) 0) (set! f28-1 (- f28-1 (+ 6144.0 (-> this flight-level)))) @@ -281,8 +279,8 @@ (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) ) (vector-normalize! (-> arg1 normal) 1.0) - (set! (-> arg1 world-pos quad) (-> s3-0 position quad)) - (set! (-> arg1 velocity quad) (-> s3-0 lin-velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s3-0 position)) + (vector-copy! (-> arg1 velocity) (-> s3-0 lin-velocity)) (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 position)) (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 inv-i-world)) @@ -339,7 +337,7 @@ (when (>= 1 (-> this force-level)) (set! sv-944 (* (-> s4-0 info mass) (-> s4-0 extra gravity))) (when (!= (-> s4-0 handling pitch-control-factor) 0.0) - (set! (-> gp-0 axis quad) (-> gp-0 mat rvec quad)) + (vector-copy! (-> gp-0 axis) (-> gp-0 mat rvec)) (set! (-> gp-0 axis y) 0.0) (let ((f30-0 (vector-dot (-> gp-0 axis) (-> s5-0 ang-velocity)))) (dotimes (s1-0 (-> s4-0 physics-model lift-thruster-count)) @@ -378,7 +376,7 @@ (quaternion-vector-angle! (the-as quaternion (-> s1-1 0)) (-> gp-0 mat fvec) f0-12) ) (quaternion->matrix (the-as matrix (-> s1-1 1)) (the-as quaternion (-> s1-1 0))) - (set! (-> gp-0 dir quad) (-> s1-1 2 quad)) + (vector-copy! (-> gp-0 dir) (-> s1-1 2)) ) (let ((f0-14 (vector-dot (the-as vector (-> gp-0 mat)) (-> gp-0 dir)))) (set! sv-1040 (* (-> s4-0 info mass) (-> s4-0 extra gravity))) @@ -427,7 +425,7 @@ (if (< (-> this controls throttle) 0.0) (set! f0-30 (* -1.0 f0-30)) ) - (set! (-> gp-0 axis quad) (-> gp-0 mat uvec quad)) + (vector-copy! (-> gp-0 axis) (-> gp-0 mat uvec)) (let* ((f0-34 (* (-> this power-level) (- (* f0-30 f2-12 (-> s4-0 handling steering-thruster-max-gain)) (vector-dot (-> gp-0 axis) (-> s5-0 ang-velocity)) ) @@ -447,7 +445,7 @@ (seek! (-> this jump-thrust) 0.0 (* 6.0 arg0)) (when (logtest? (vehicle-flag ignition) (-> this v-flags)) (vector-matrix*! (-> gp-0 world-pos) (-> s4-0 physics-model engine-thrust-local-pos) (-> gp-0 mat)) - (set! (-> gp-0 dir quad) (-> gp-0 mat fvec quad)) + (vector-copy! (-> gp-0 dir) (-> gp-0 mat fvec)) (let ((f0-45 (* (-> this engine-thrust) (-> s4-0 handling max-engine-thrust) (-> s4-0 info mass) @@ -557,7 +555,7 @@ ) (when (not (logtest? (vehicle-flag gun-dark-2-zero-g) (-> this v-flags))) (when (logtest? (-> this v-flags) (vehicle-flag riding)) - (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (vector-copy! (-> gp-0 local-pos) (-> s4-0 info cm-offset-joint)) (+! (-> gp-0 local-pos x) (* (-> this controls steering) (-> s4-0 handling player-shift-x))) (+! (-> gp-0 local-pos z) (* (-> this controls lean-z) (-> s4-0 handling player-shift-z))) (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) @@ -570,7 +568,7 @@ ) (vehicle-method-96 this arg0) (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) - (set! (-> gp-0 world-normal quad) (-> s5-0 lin-momentum quad)) + (vector-copy! (-> gp-0 world-normal) (-> s5-0 lin-momentum)) (set! (-> gp-0 world-normal y) 0.0) (vector-normalize! (-> gp-0 world-normal) 1.0) (let* ((v1-161 (-> s5-0 lin-velocity)) diff --git a/goal_src/jak3/levels/factory/car/hvehicle-util.gc b/goal_src/jak3/levels/factory/car/hvehicle-util.gc index 92a67d86da1..bad879e43de 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle-util.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle-util.gc @@ -47,7 +47,7 @@ (set! sv-24 (-> arg2 info info inv-mass)) (let ((gp-0 (new 'stack-no-clear 'vehicle-physics-work))) (set! (-> gp-0 dir x) (+ (-> this target-speed) (-> this target-speed-offset))) - (set! (-> gp-0 mat uvec quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 mat uvec) arg1) (set! (-> gp-0 mat rvec quad) (-> arg2 root trans quad)) (vector-z-quaternion! (-> gp-0 mat trans) (-> arg2 root quat)) (vector-reset! (-> gp-0 mat fvec)) @@ -56,7 +56,7 @@ (vector-! (-> gp-0 world-pos) (-> this turn-enter-point) (the-as vector (-> gp-0 mat))) (let ((f0-5 (vector-dot (-> gp-0 world-pos) (-> this turn-enter-dir)))) (vector+float*! (-> gp-0 force) (-> this turn-enter-point) (-> this turn-enter-dir) (- f0-5)) - (set! (-> gp-0 velocity quad) (-> this turn-enter-dir quad)) + (vector-copy! (-> gp-0 velocity) (-> this turn-enter-dir)) (if (>= 0.0 f0-5) (logclear! (-> this flags) (vehicle-controller-flag on-straightaway)) ) @@ -135,8 +135,8 @@ ) ) (when (and v1-70 (not (logtest? (-> v1-70 v-flags) (vehicle-flag dead))) (nonzero? (-> v1-70 flight-level-index))) - (set! (-> gp-0 lift-dir quad) (-> v1-70 root trans quad)) - (set! (-> gp-0 normal quad) (-> v1-70 root transv quad)) + (vector-copy! (-> gp-0 lift-dir) (-> v1-70 root trans)) + (vector-copy! (-> gp-0 normal) (-> v1-70 root transv)) (vector-! (-> gp-0 tmp) (the-as vector (-> gp-0 mat)) (-> gp-0 lift-dir)) (.lvf vf1 (&-> (-> gp-0 tmp) quad)) (.add.w.vf.x vf2 vf0 vf0) @@ -259,7 +259,7 @@ ) ) (else - (set! (-> gp-0 world-normal quad) (-> this turn-exit-dir quad)) + (vector-copy! (-> gp-0 world-normal) (-> this turn-exit-dir)) ) ) (let ((f0-60 (vector-length (-> gp-0 world-normal)))) @@ -272,7 +272,7 @@ ) ) (vector+! (-> gp-0 mat fvec) (-> gp-0 mat fvec) (-> gp-0 world-pos)) - (set! (-> sv-16 quad) (-> gp-0 mat fvec quad)) + (vector-copy! sv-16 (-> gp-0 mat fvec)) ) (let ((v1-144 (-> *perf-stats* data 21))) (b! (zero? (-> v1-144 ctrl)) cfg-76 :delay (nop!)) @@ -324,8 +324,8 @@ (defmethod hvehicle-method-158 ((this hvehicle)) (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others direct-mode)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-0 0 quad) (-> this root trans quad)) - (set! (-> s5-0 1 quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 0) (-> this root trans)) + (vector-copy! (-> s5-0 1) (-> this root transv)) (set! (-> s5-0 0 w) 40960.0) (let ((s4-0 0)) (label cfg-1) diff --git a/goal_src/jak3/levels/factory/car/hvehicle.gc b/goal_src/jak3/levels/factory/car/hvehicle.gc index e9168f4aa3c..3069486cabf 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle.gc @@ -196,9 +196,9 @@ (logclear! (-> s4-0 status) (collide-status on-ground)) (cond ((above-ground? s4-0 s3-0 (-> s4-0 trans) (collide-spec backgnd) 0.0 102400.0 1024.0) - (set! (-> s4-0 gspot-pos quad) (-> s4-0 trans quad)) + (vector-copy! (-> s4-0 gspot-pos) (-> s4-0 trans)) (set! (-> s4-0 gspot-pos y) (-> s3-0 best-other-tri intersect y)) - (set! (-> s4-0 gspot-normal quad) (-> s3-0 best-other-tri normal quad)) + (vector-copy! (-> s4-0 gspot-normal) (-> s3-0 best-other-tri normal)) (set! (-> s4-0 ground-pat) (-> s3-0 best-other-tri pat)) (when (logtest? (-> gp-0 settings flags) (shadow-flags disable-draw)) (set! (-> gp-0 settings top-plane w) (- (-> this root trans y) (-> this root gspot-pos y))) @@ -291,7 +291,7 @@ (logclear! (-> this v-flags) (vehicle-flag impact)) (let ((s5-0 (new 'stack-no-clear 'rigid-body-move-work))) (set! (-> s5-0 mat trans w) -4096000.0) - (set! (-> s5-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 cquery start-pos) (-> this rbody position)) (vector-float*! (-> s5-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) (let ((v1-6 (-> s5-0 cquery))) (set! (-> v1-6 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) @@ -591,7 +591,7 @@ (let ((v1-31 (math-camera-matrix)) (a0-17 (new 'stack-no-clear 'matrix)) ) - (set! (-> a0-17 uvec quad) (-> *target* alt-cam-pos quad)) + (vector-copy! (-> a0-17 uvec) (-> *target* alt-cam-pos)) (vector-! (-> a0-17 rvec) (-> a0-17 uvec) (-> v1-31 trans)) (let ((f0-7 (/ (vector-dot (-> a0-17 rvec) (-> v1-31 uvec)) (vector-dot (-> a0-17 rvec) (-> v1-31 fvec))))) (cond @@ -728,8 +728,8 @@ (defmethod control-hook-ai ((this hvehicle) (arg0 vehicle-controls)) (let ((s5-0 (new 'stack-no-clear 'vehicle-physics-work))) (mem-set32! (the-as pointer (-> s5-0 mat)) 6 0) - (set! (-> s5-0 mat trans quad) (-> this rbody matrix rvec quad)) - (set! (-> s5-0 force quad) (-> this rbody matrix fvec quad)) + (vector-copy! (-> s5-0 mat trans) (-> this rbody matrix rvec)) + (vector-copy! (-> s5-0 force) (-> this rbody matrix fvec)) (let ((f28-0 (* (-> this rbody ang-velocity y) (vector-length (-> this rbody lin-velocity)))) (f30-0 (seconds-per-frame)) ) @@ -910,7 +910,7 @@ ) (when (logtest? (-> this draw status) (draw-control-status on-screen)) (when #t - (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vector-copy! (-> this node-list data 0 bone transform trans) (-> this root trans)) (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag particles) (-> this v-flags)))) (vehicle-method-78 this) ) @@ -947,7 +947,7 @@ 0 (rigid-body-object-method-30 this) (update-transforms (-> this root)) - (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vector-copy! (-> this node-list data 0 bone transform trans) (-> this root trans)) (vehicle-method-115 this) (let ((v1-98 (-> *perf-stats* data 20))) (b! (zero? (-> v1-98 ctrl)) cfg-25 :delay (nop!)) @@ -1018,10 +1018,10 @@ (init-rbody-impact-from-tshape! this (the-as rigid-body-impact (-> s5-0 mat)) arg1) (if (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (rigid-body-control-method-23 (-> this rbody) (the-as vector (-> s5-0 mat)) (-> s5-0 mat fvec)) - (set! (-> s5-0 mat fvec quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 mat fvec) (-> this root transv)) ) (let ((v1-17 (-> arg0 root))) - (set! (-> s5-0 force quad) (-> v1-17 transv quad)) + (vector-copy! (-> s5-0 force) (-> v1-17 transv)) (vector-! (-> s5-0 mat fvec) (-> v1-17 transv) (-> s5-0 mat fvec)) ) (let ((f0-2 (vector-dot (-> s5-0 mat fvec) (-> s5-0 mat uvec)))) @@ -1122,9 +1122,9 @@ (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) (logior! (-> this v-flags) (vehicle-flag traffic-managed)) (let ((s5-0 (the-as traffic-object-spawn-params (-> arg3 param 0)))) - (set! (-> this root trans quad) (-> s5-0 position quad)) + (vector-copy! (-> this root trans) (-> s5-0 position)) (quaternion-copy! (-> this root quat) (-> s5-0 rotation)) - (set! (-> this root transv quad) (-> s5-0 velocity quad)) + (vector-copy! (-> this root transv) (-> s5-0 velocity)) (hvehicle-method-161 this s5-0) ) ) @@ -1236,7 +1236,7 @@ (vector-float*! (the-as vector a0-8) (the-as vector a0-8) 0.25) ) (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) diff --git a/goal_src/jak3/levels/factory/car/wcar-faccar.gc b/goal_src/jak3/levels/factory/car/wcar-faccar.gc index f30f980cb88..db96204eb39 100644 --- a/goal_src/jak3/levels/factory/car/wcar-faccar.gc +++ b/goal_src/jak3/levels/factory/car/wcar-faccar.gc @@ -159,30 +159,31 @@ (lambda :behavior process ((arg0 handle)) (let ((s5-0 (current-time))) - (suspend-for (seconds 0.65) (when (time-elapsed? s5-0 (seconds 0.06)) - (set! s5-0 (current-time)) - (let ((s3-0 (handle->process arg0))) - (process-drawable-shock-effect - (the-as process-drawable s3-0) - (-> *lightning-spec-id-table* 1) - lightning-probe-callback - (-> *part-id-table* 160) - 0 - 0 - 40960.0 - ) - (process-drawable-shock-effect - (the-as process-drawable s3-0) - (-> *lightning-spec-id-table* 1) - lightning-probe-callback - (-> *part-id-table* 160) - 0 - 0 - 40960.0 - ) - ) - ) - ) + (suspend-for (seconds 0.65) + (when (time-elapsed? s5-0 (seconds 0.06)) + (set! s5-0 (current-time)) + (let ((s3-0 (handle->process arg0))) + (process-drawable-shock-effect + (the-as process-drawable s3-0) + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + (process-drawable-shock-effect + (the-as process-drawable s3-0) + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) + ) ) #f ) @@ -372,7 +373,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this v-faccar)) +(defmethod get-search-info-flag ((this v-faccar)) + "Get search-info-flag for this process." (the-as search-info-flag 0) ) diff --git a/goal_src/jak3/levels/factory/conveyor.gc b/goal_src/jak3/levels/factory/conveyor.gc index 8d7a2852593..0775b289554 100644 --- a/goal_src/jak3/levels/factory/conveyor.gc +++ b/goal_src/jak3/levels/factory/conveyor.gc @@ -106,7 +106,7 @@ (defmethod push-focus ((this conveyor) (arg0 process-focusable)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (get-trans arg0 0) quad)) + (vector-copy! s4-0 (get-trans arg0 0)) (set! (-> s4-0 w) 1.0) (when (>= (vector4-dot s4-0 (the-as vector (-> this leading))) 0.0) (let* ((a1-2 (-> this sections)) @@ -302,7 +302,7 @@ (set! sv-32 (the-as conveyor-section #f)) (dotimes (s0-0 s1-0) (set! sv-48 (-> s2-0 data s0-0)) - (set! (-> sv-48 start quad) (-> s3-0 quad)) + (vector-copy! (-> sv-48 start) s3-0) (get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'exact) (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start)) @@ -369,6 +369,7 @@ ) (defmethod init-from-entity! ((this conveyor) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (alloc-trsqv! this) (process-drawable-from-entity! this arg0) (init-skel! this) diff --git a/goal_src/jak3/levels/factory/fac-gunturret.gc b/goal_src/jak3/levels/factory/fac-gunturret.gc index bb24fdaf1ed..52bac00ed95 100644 --- a/goal_src/jak3/levels/factory/fac-gunturret.gc +++ b/goal_src/jak3/levels/factory/fac-gunturret.gc @@ -368,34 +368,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -414,7 +414,7 @@ ((and arg0 (-> this los-clear)) (let ((a0-2 (the-as process-focusable (handle->process (-> this focus handle))))) (when a0-2 - (set! (-> this aim-pos quad) (-> (get-trans a0-2 3) quad)) + (vector-copy! (-> this aim-pos) (get-trans a0-2 3)) (vector+! (-> this aim-pos) (-> this aim-pos) (-> this aim-offset)) ) ) @@ -478,7 +478,7 @@ (defmethod check-los ((this fac-gunturret)) (let ((a0-2 (the-as process-focusable (handle->process (-> this focus handle))))) (if a0-2 - (set! (-> this aim-pos quad) (-> (get-trans a0-2 3) quad)) + (vector-copy! (-> this aim-pos) (get-trans a0-2 3)) ) ) (let* ((s4-0 @@ -490,8 +490,8 @@ (cos 364.0889) ) (let ((a1-5 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-5 start-pos quad) (-> s4-0 quad)) - (set! (-> a1-5 move-dist quad) (-> s5-3 quad)) + (vector-copy! (-> a1-5 start-pos) s4-0) + (vector-copy! (-> a1-5 move-dist) s5-3) (let ((v1-17 a1-5)) (set! (-> v1-17 radius) 409.6) (set! (-> v1-17 collide-with) @@ -540,7 +540,7 @@ (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) - (set! (-> s4-0 pos quad) (-> s0-0 quad)) + (vector-copy! (-> s4-0 pos) s0-0) (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) (set! (-> s4-0 target-handle) (the-as handle #f)) @@ -566,7 +566,7 @@ (vector+! (-> s4-0 vel) (-> s4-0 vel) s2-0) ) (if (-> this use-alt-barrel) - (set! (-> s4-0 pos quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 pos) s3-0) ) (set! (-> this use-alt-barrel) (not (-> this use-alt-barrel))) (spawn-projectile fturret-shot s4-0 this *default-dead-pool*) @@ -626,10 +626,9 @@ (sound-group) (-> self root trans) ) - (suspend-for - (seconds 0.75) + (suspend-for (seconds 0.75) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> self aim-pos quad)) + (vector-copy! s5-2 (-> self aim-pos)) (track-target self #t) (vector-! s5-2 (-> self aim-pos) s5-2) (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.12)) @@ -694,6 +693,7 @@ ) (defmethod event-handler ((this fac-gunturret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) (set-time! (-> this last-hit-time)) ) @@ -826,11 +826,14 @@ (cleanup-for-death self) (ja-channel-set! 0) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (+! (-> gp-1 y) 12288.0) - (suspend-for (seconds 2) (spawn (-> self part) gp-1)) + (suspend-for (seconds 2) + (spawn (-> self part) gp-1) + ) + ) + (suspend-for (seconds 1) ) - (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) @@ -842,6 +845,7 @@ ) (defmethod init-enemy-collision! ((this fac-gunturret)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -907,7 +911,8 @@ (none) ) -(defmethod is-pfoc-in-mesh? ((this fac-gunturret) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this fac-gunturret) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (= (-> this activate-distance) 0.0) (return #t) (return (< (fabs (vector-dot @@ -939,6 +944,7 @@ ) (defmethod coin-flip? ((this fac-gunturret)) + "Return #t half the time, #f the other." #f ) @@ -989,9 +995,10 @@ ) (defmethod init-enemy! ((this fac-gunturret)) + "Typical place for shared init code. Runs from entity or process style init." (init-turret-params! this) (initialize-skeleton this (-> this params normal-sg) (the-as pair 0)) - (init-enemy-defaults! this (-> this params enemy-info)) + (setup-enemy! this (-> this params enemy-info)) (set! (-> this draw light-index) (the-as uint 10)) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) @@ -1023,7 +1030,8 @@ (none) ) -(defmethod go-idle2 ((this fac-gunturret)) +(defmethod go-fallback-init ((this fac-gunturret)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this idle)) ) diff --git a/goal_src/jak3/levels/factory/fac-robotank-turret.gc b/goal_src/jak3/levels/factory/fac-robotank-turret.gc index b0d0479e837..96da73c689f 100644 --- a/goal_src/jak3/levels/factory/fac-robotank-turret.gc +++ b/goal_src/jak3/levels/factory/fac-robotank-turret.gc @@ -174,7 +174,7 @@ (vector-normalize-copy! (new 'stack-no-clear 'vector) (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0) 1.0) ) ) - (set! (-> self root trans quad) (-> s5-0 quad)) + (vector-copy! (-> self root trans) s5-0) (forward-up->quaternion (-> self root quat) a1-3 *up-vector*) ) (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0))) @@ -270,7 +270,7 @@ (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) - (set! (-> s4-0 pos quad) (-> s5-0 quad)) + (vector-copy! (-> s4-0 pos) s5-0) (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) (set! (-> s4-0 target-handle) (the-as handle #f)) @@ -319,7 +319,7 @@ (s0-0 sv-144 sv-160 a2-1) ) ) - (set! (-> s5-0 0 quad) (-> s3-0 0 quad)) + (vector-copy! (-> s5-0 0) (-> s3-0 0)) (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) (set! (-> this shot-range) (fmin 204800.0 f28-0)) ) @@ -327,7 +327,7 @@ (let ((f28-1 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 1))))))) (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-r s2-0) bone transform fvec) 1.0) (vector-rotate-y! s4-0 s4-0 (- (- 16384.0 (acos (/ f30-0 f28-1))))) - (set! (-> s5-0 0 quad) (-> s3-0 1 quad)) + (vector-copy! (-> s5-0 0) (-> s3-0 1)) (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) (set! (-> this shot-range) (fmin 204800.0 f28-1)) ) @@ -342,7 +342,7 @@ (let ((s5-0 (new 'stack-no-clear 'collide-query)) (f30-0 307200.0) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-float*! (-> s5-0 move-dist) arg1 f30-0) (let ((v1-4 s5-0)) (set! (-> v1-4 radius) 4096.0) @@ -372,7 +372,7 @@ ) (s5-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-2 quad) (-> s4-1 quad)) + (vector-copy! s5-2 s4-1) (vector+float*! s5-2 s5-2 (-> (math-camera-matrix) fvec) -2048.0) (if (and s3-0 (logtest? (process-mask target enemy) (-> (the-as collide-shape-prim s3-0) cshape process mask)) @@ -413,7 +413,7 @@ (look-at! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) 'attacking self) ) (set! (-> self aim-pos 0 quad) (-> self aim-pos 1 quad)) - (set! (-> self aim-pos 1 quad) (-> (get-trans gp-0 0) quad)) + (vector-copy! (-> self aim-pos 1) (get-trans gp-0 0)) (let ((s5-2 (-> self aim-pos 2)) (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self gun-joint-l 0)))) ) @@ -434,8 +434,8 @@ (vector-normalize! gp-2 1.0) (vector-normalize! s3-1 1.0) (if (logtest? (-> self flags) (fac-robotank-turret-flag frt3)) - (set! (-> s5-3 quad) (-> s3-1 quad)) - (set! (-> s5-3 quad) (-> gp-2 quad)) + (vector-copy! s5-3 s3-1) + (vector-copy! s5-3 gp-2) ) (when (logtest? (-> self flags) (fac-robotank-turret-flag frt7)) (let ((f0-6 (lerp-scale 1.0 0.2 f30-0 8192.0 327680.0))) @@ -623,7 +623,7 @@ (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> s4-1 quad)) + (vector-copy! s5-0 s4-1) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (set! (-> s5-0 y) 0.0) @@ -680,8 +680,8 @@ ) (when a0-1 (set! (-> self aim-pos 0 quad) (-> (get-trans a0-1 0) quad)) - (set! (-> self aim-pos 1 quad) (-> self aim-pos 0 quad)) - (set! (-> self aim-pos 2 quad) (-> self aim-pos 0 quad)) + (vector-copy! (-> self aim-pos 1) (-> self aim-pos 0)) + (vector-copy! (-> self aim-pos 2) (-> self aim-pos 0)) ) ) ) @@ -713,7 +713,7 @@ ) ) (logior! (-> self flags) (fac-robotank-turret-flag frt3)) - (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) + (vector-copy! (-> self firing-sight-pos) (-> self sight-pos)) (suspend-for (seconds 0.5) ) (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) @@ -852,9 +852,9 @@ ) (set! (-> self root) s2-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) - (set! (-> self offset quad) (-> arg2 quad)) + (vector-copy! (-> self offset) arg2) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-robotank-turret" (the-as (pointer level) #f))) @@ -873,8 +873,8 @@ (set! (-> self rotate-rate) 0.0) (set! (-> self rotate-mult) arg3) (set! (-> self aim-pos 0 quad) (-> self root trans quad)) - (set! (-> self aim-pos 1 quad) (-> self root trans quad)) - (set! (-> self aim-pos 2 quad) (-> self root trans quad)) + (vector-copy! (-> self aim-pos 1) (-> self root trans)) + (vector-copy! (-> self aim-pos 2) (-> self root trans)) (set-time! (-> self gun-timer)) (set! (-> self flags) (fac-robotank-turret-flag)) (set! (-> self fov-mult) 1.0) @@ -885,7 +885,7 @@ (set! (-> self gun-joint-r 1) 6) (set! (-> self gun-index) 0) (let ((v1-51 (new 'stack-no-clear 'vector))) - (set! (-> v1-51 quad) (-> self root trans quad)) + (vector-copy! v1-51 (-> self root trans)) (+! (-> v1-51 z) 40960.0) (+! (-> v1-51 y) 32768.0) ) diff --git a/goal_src/jak3/levels/factory/fac-robotank.gc b/goal_src/jak3/levels/factory/fac-robotank.gc index 1d221842f28..f7a7fdeb35f 100644 --- a/goal_src/jak3/levels/factory/fac-robotank.gc +++ b/goal_src/jak3/levels/factory/fac-robotank.gc @@ -268,7 +268,7 @@ (set! (-> s1-0 random-rangef) (lerp-scale 0.0 1.0 f30-0 0.0 f28-0)) ) (let ((a1-8 (forward-up-nopitch->inv-matrix (new 'stack-no-clear 'matrix) s2-0 *up-vector*))) - (set! (-> a1-8 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a1-8 trans) s4-0) (+! (-> a1-8 trans y) -2498.56) (spawn-from-mat (-> self part) a1-8) ) @@ -282,7 +282,7 @@ ) ) ) - (set! (-> s5-0 pos quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 pos) s4-0) ) ) (let ((v1-48 (-> self path-info data (-> self path-index)))) @@ -576,11 +576,11 @@ (sound-play "tank-explode") (cond ((logtest? (-> *part-group-id-table* 732 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 732)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 732)) ) ) diff --git a/goal_src/jak3/levels/factory/fac-tower.gc b/goal_src/jak3/levels/factory/fac-tower.gc index ddec45967ea..56b4754fae5 100644 --- a/goal_src/jak3/levels/factory/fac-tower.gc +++ b/goal_src/jak3/levels/factory/fac-tower.gc @@ -136,7 +136,7 @@ ) ) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (vector-identity! (-> self root scale)) (go-virtual idle) @@ -233,7 +233,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gun-tower-break" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (quaternion-copy! (-> self root quat) arg2) (vector-identity! (-> self root scale)) (if s4-2 @@ -321,6 +321,7 @@ (defmethod init-from-entity! ((this fac-gun-tower-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -361,7 +362,7 @@ (set! (-> this draw lod-set lod 2 dist) 14336000.0) (logior! (-> this draw status) (draw-control-status no-draw)) (quaternion-copy! (-> this root quat) (-> arg0 quat)) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (go (method-of-object this idle)) ) @@ -381,10 +382,10 @@ (when (and (type? proc projectile) (not (type? proc warf-projectile))) (let ((s4-0 (the-as projectile proc))) (when (not (vector= *fac-tower-impact-pos* (-> s4-0 root trans))) - (set! (-> *fac-tower-impact-pos* quad) (-> s4-0 root trans quad)) + (vector-copy! *fac-tower-impact-pos* (-> s4-0 root trans)) (cond ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-0 root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s4-0 root trans)) (let ((s4-1 (the-as projectile (get-process *default-dead-pool* part-tracker-subsampler #x4000 0)))) (when s4-1 (let ((t9-4 (method-of-type part-tracker-subsampler activate))) @@ -413,7 +414,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-0 root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s4-0 root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) ) ) @@ -460,6 +461,7 @@ (defmethod init-from-entity! ((this fac-gun-tower) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) @@ -555,7 +557,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this fac-gun-tower)) +(defmethod get-search-info-flag ((this fac-gun-tower)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (and (-> this next-state) (= (-> this next-state name) 'open)) (set! v0-0 (logior v0-0 40)) @@ -599,7 +602,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> (get-trans *target* 3) quad)) + (vector-copy! s4-0 (get-trans *target* 3)) (let ((s2-0 (-> this node-list data 10 bone transform)) (s3-0 (new 'stack-no-clear 'quaternion)) ) @@ -672,7 +675,7 @@ (defmethod fac-gun-tower-method-36 ((this fac-gun-tower)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) 409600.0) (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-0 s4-0 384)) @@ -782,11 +785,11 @@ (start-destroyed-fac-gun-tower (-> self root trans) (-> self root quat) (the-as process *entity-pool*)) (cond ((logtest? (-> *part-group-id-table* 731 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 731)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 731)) ) ) @@ -858,7 +861,7 @@ (let ((s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8))) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 quad) (-> (get-trans *target* 3) quad)) + (vector-copy! s2-0 (get-trans *target* 3)) (vector-! s4-0 s3-0 s2-0) ) (vector-negate! s4-0 s4-0) @@ -909,14 +912,14 @@ (('attack) (when (and (type? proc projectile) (not (type? proc warf-projectile))) (when (not (vector= *fac-tower-impact-pos* (-> (the-as projectile proc) root trans))) - (set! (-> *fac-tower-impact-pos* quad) (-> (the-as projectile proc) root trans quad)) + (vector-copy! *fac-tower-impact-pos* (-> (the-as projectile proc) root trans)) (cond ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (the-as projectile proc) root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as projectile proc) root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (the-as projectile proc) root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as projectile proc) root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) ) ) diff --git a/goal_src/jak3/levels/factory/factory-boss-setup.gc b/goal_src/jak3/levels/factory/factory-boss-setup.gc index 1cca37120df..fd1955d6397 100644 --- a/goal_src/jak3/levels/factory/factory-boss-setup.gc +++ b/goal_src/jak3/levels/factory/factory-boss-setup.gc @@ -358,7 +358,7 @@ (f30-0 0.0) ) (matrix-identity! s5-0) - (set! (-> s5-0 trans quad) (-> sv-160 quad)) + (vector-copy! (-> s5-0 trans) sv-160) (let ((v1-8 s1-0)) (cond ((zero? v1-8) @@ -408,23 +408,12 @@ (let* ((f0-2 (lerp-scale 1.0 0.1 (the float (mod s2-0 90)) 90.0 0.0)) (f30-1 (* 3686.4 f0-2)) ) - (let* ((a2-2 s1-1) - (a3-2 s5-0) - (v1-64 (-> a3-2 rvec quad)) - (a0-9 (-> a3-2 uvec quad)) - (a1-3 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-2 rvec quad) v1-64) - (set! (-> a2-2 uvec quad) a0-9) - (set! (-> a2-2 fvec quad) a1-3) - (set! (-> a2-2 trans quad) a3-3) - ) + (matrix-copy! s1-1 s5-0) (vector+float*! (-> s1-1 trans) (-> s5-0 trans) (-> s5-0 rvec) (- f30-1)) (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 fvec) (- f30-1)) (spawn-from-mat (-> this reticle-corner-0) s1-1) (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 rvec) (* 2.0 f30-1)) - (set! (-> s1-1 rvec quad) (-> s5-0 fvec quad)) + (vector-copy! (-> s1-1 rvec) (-> s5-0 fvec)) (vector-negate! (-> s1-1 fvec) (-> s5-0 rvec)) (spawn-from-mat (-> this reticle-corner-1) s1-1) (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 fvec) (* 2.0 f30-1)) @@ -434,7 +423,7 @@ (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 rvec) (* -2.0 f30-1)) ) (vector-negate! (-> s1-1 rvec) (-> s5-0 fvec)) - (set! (-> s1-1 fvec quad) (-> s5-0 rvec quad)) + (vector-copy! (-> s1-1 fvec) (-> s5-0 rvec)) (spawn-from-mat (-> this reticle-corner-3) s1-1) ) ) @@ -644,7 +633,7 @@ (let ((t9-1 (method-of-type projectile init-proj-settings!))) (t9-1 this) ) - (set! (-> this shot-dest quad) (-> this root transv quad)) + (vector-copy! (-> this shot-dest) (-> this root transv)) (set-time! (-> this traj-time)) (cond ((type? this factory-boss-shockwave-bomb) @@ -669,10 +658,10 @@ ) ) (compute-transv-at-time (-> this traj) 0.0 (-> this root transv)) - (set! (-> this pre-move-transv quad) (-> this root transv quad)) + (vector-copy! (-> this pre-move-transv) (-> this root transv)) (vector-normalize-copy! (-> this starting-dir) (-> this root transv) 1.0) (vector+float*! (-> this base-target-pos) (-> this root trans) (-> this starting-dir) 2048000.0) - (set! (-> this target-pos quad) (-> this base-target-pos quad)) + (vector-copy! (-> this target-pos) (-> this base-target-pos)) (set! (-> this impact-played) #f) (set! (-> this reticle-sound) (new-sound-id)) (sound-play "reticle-lock" :id (-> this reticle-sound) :position (-> this shot-dest)) @@ -734,7 +723,7 @@ (.mul.x.vf.xyz vf1 vf1 vf2) (.svf (&-> v1-22 quad) vf1) ) - (set! (-> self root transv quad) (-> self pre-move-transv quad)) + (vector-copy! (-> self root transv) (-> self pre-move-transv)) (if (< 2191360.0 (-> gp-1 y)) (integrate-and-collide! (-> self root) (-> self root transv)) (projectile-move-fill-line-sphere self) @@ -789,7 +778,7 @@ ) 0 (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -838,7 +827,7 @@ ) 0 (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -856,13 +845,13 @@ (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) (set-time! (-> self state-time)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> self root trans quad)) + (vector-copy! s5-1 (-> self root trans)) (let ((gp-2 (new 'stack-no-clear 'quaternion))) (let ((s4-0 (new 'stack-no-clear 'matrix))) (+! (-> s5-1 y) 409.6) (quaternion-set! gp-2 0.0 0.0 0.0 1.0) (matrix-identity! s4-0) - (set! (-> s4-0 trans quad) (-> s5-1 quad)) + (vector-copy! (-> s4-0 trans) s5-1) ) (let* ((s3-0 (get-process *default-dead-pool* manipy #x20000 1)) (s4-1 (when s3-0 @@ -970,7 +959,7 @@ (f28-1 (* 2048.0 (pow (the float (+ (- (seconds -0.05) (-> self state-time)) (current-time))) 0.85))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self root trans quad)) + (vector-copy! s5-0 (-> self root trans)) (+! (-> s5-0 y) 409.6) (when *target* (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) s5-0)) @@ -1009,7 +998,7 @@ ) 0 (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -1255,6 +1244,7 @@ ) (defmethod init-from-entity! ((this fac-drop-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (with-pp (stack-size-set! (-> this main-thread) 32) @@ -1359,11 +1349,11 @@ (let ((v1-0 (new 'stack-no-clear 'vector)) (a0-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-0 quad) (-> this center quad)) + (vector-copy! v1-0 (-> this center)) (+! (-> v1-0 x) (-> this x-off)) (+! (-> v1-0 z) (-> this z-off)) (+! (-> v1-0 y) 9175.04) - (set! (-> a0-2 quad) (-> this center quad)) + (vector-copy! a0-2 (-> this center)) (set! (-> a0-2 x) (- (-> a0-2 x) (-> this x-off))) (set! (-> a0-2 z) (- (-> a0-2 z) (-> this z-off))) (+! (-> a0-2 y) 9011.2) @@ -1378,7 +1368,7 @@ (let ((a3-5 (-> this lightning a1-5)) (a2-15 a0-2) ) - (set! (-> a3-5 state meet data (+ (-> a3-5 state points-to-draw) -1) quad) (-> a2-15 quad)) + (vector-copy! (-> a3-5 state meet data (+ (-> a3-5 state points-to-draw) -1)) a2-15) ) (let ((a2-19 (-> this lightning a1-5)) (a3-8 1) @@ -1405,10 +1395,10 @@ ) ) (let ((s4-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) - (set! (-> s4-0 0 quad) (-> this center quad)) + (vector-copy! (-> s4-0 0) (-> this center)) (+! (-> s4-0 0 x) (-> this x-off)) (+! (-> s4-0 0 z) (-> this z-off)) - (set! (-> s4-0 1 quad) (-> s4-0 0 quad)) + (vector-copy! (-> s4-0 1) (-> s4-0 0)) (set! (-> s4-0 1 x) (- (-> s4-0 1 x) (* 2.0 (-> this x-off)))) (set! (-> s4-0 1 z) (- (-> s4-0 1 z) (* 2.0 (-> this z-off)))) (when (not (handle->process (-> this blocking-plane))) @@ -1466,7 +1456,7 @@ (defmethod factory-boss-lightning-gate-method-11 ((this factory-boss-lightning-gate) (arg0 vector) (arg1 float) (arg2 float) (arg3 process)) (set-factoryd-light! 0.0) - (set! (-> this center quad) (-> arg0 quad)) + (vector-copy! (-> this center) arg0) (set! (-> this x-off) arg1) (set! (-> this z-off) arg2) (set! (-> this blocking-plane) (the-as handle #f)) @@ -1587,9 +1577,9 @@ (defmethod factory-boss-method-27 ((this factory-boss) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-copy! v1-0 arg0) (set! (-> v1-0 w) 16384.0) - (add-root-sphere-to-hash! (-> this nav) v1-0 255) + (check-sphere-blocked! (-> this nav) v1-0 255) ) ) @@ -1727,6 +1717,7 @@ ) (defmethod init-from-entity! ((this factory-boss) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -1754,7 +1745,7 @@ (logior! (-> this skel status) (joint-control-status eye-anim)) (logior! (-> this mask) (process-mask enemy)) (set-vector! (-> this root scale) 1.6 1.6 1.6 1.0) - (set! (-> this center quad) (-> this root trans quad)) + (vector-copy! (-> this center) (-> this root trans)) (+! (-> this center z) 83992.98) (+! (-> this center y) -65536.0) (+! (-> this center x) -83992.98) @@ -1957,10 +1948,10 @@ (set! (-> this reticle-sound) (new-sound-id)) (set! (-> this reticle-sound-playing) #f) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> this center quad)) + (vector-copy! s5-2 (-> this center)) (+! (-> s5-2 z) 141312.0) (factory-boss-lightning-gate-method-11 (-> this warp-blocker) s5-2 28672.0 0.0 this) - (set! (-> s5-2 quad) (-> this center quad)) + (vector-copy! s5-2 (-> this center)) (+! (-> s5-2 z) -141312.0) (factory-boss-lightning-gate-method-11 (-> this entry-blocker) s5-2 28672.0 0.0 this) ) @@ -2159,6 +2150,7 @@ ) (defmethod init-from-entity! ((this fac-warp-effect) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak3/levels/factory/factory-boss-states.gc b/goal_src/jak3/levels/factory/factory-boss-states.gc index 40c00646f1e..4161989b610 100644 --- a/goal_src/jak3/levels/factory/factory-boss-states.gc +++ b/goal_src/jak3/levels/factory/factory-boss-states.gc @@ -56,7 +56,7 @@ ) (defbehavior factory-boss-target-pos factory-boss ((arg0 vector) (arg1 int) (arg2 int)) - (set! (-> arg0 quad) (-> (target-pos 0) quad)) + (vector-copy! arg0 (target-pos 0)) (set! (-> arg0 y) (-> self center y)) (when (= arg1 1) (let ((a0-3 (- (the-as int (- (current-time) (-> self shot-timer))))) @@ -318,8 +318,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s3-0 quad)) - (set! (-> gp-0 vel quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 pos) s3-0) + (vector-copy! (-> gp-0 vel) s4-0) ) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) @@ -475,7 +475,7 @@ (let ((v1-0 (new 'stack-no-clear 'vector))) (vector+float*! v1-0 arg1 (-> arg0 uvec) 14336.0) (vector+float*! v1-0 v1-0 (-> arg0 fvec) 7168.0) - (set! (-> arg0 trans quad) (-> v1-0 quad)) + (vector-copy! (-> arg0 trans) v1-0) ) (spawn-from-mat (-> arg2 ring-part) arg0) (none) @@ -602,11 +602,11 @@ (vector+float*! s1-0 s1-0 (-> s2-0 uvec) f1-5) ) (vector+float*! s1-0 s1-0 (-> s2-0 fvec) -4096.0) - (set! (-> s2-0 trans quad) (-> s1-0 quad)) + (vector-copy! (-> s2-0 trans) s1-0) (vector+float*! s3-0 s1-0 (-> s2-0 rvec) (* -2.0 f0-6)) ) ) - (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s2-0 trans) s3-0) (if (logtest? (-> s5-0 flags) (facboss-machine-state-flag fms1)) (factory-boss-spawn-ring s2-0 s4-0 s5-0) ) @@ -636,7 +636,7 @@ ) (set! (-> s5-0 lightning state meet data 0 quad) (-> s1-0 quad)) (let ((v1-51 (-> s5-0 lightning))) - (set! (-> v1-51 state meet data (+ (-> v1-51 state points-to-draw) -1) quad) (-> s3-0 quad)) + (vector-copy! (-> v1-51 state meet data (+ (-> v1-51 state points-to-draw) -1)) s3-0) ) ) (else @@ -666,9 +666,9 @@ ) ) ) - (set! (-> s2-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s2-0 trans) s4-0) (spawn-from-mat (-> s5-0 damaged-low-smoke-part) s2-0) - (set! (-> s2-0 trans quad) (-> s0-0 quad)) + (vector-copy! (-> s2-0 trans) s0-0) (spawn-from-mat (-> s5-0 damaged-high-smoke-part) s2-0) (cond ((< (- (current-time) (-> s5-0 ring-timer)) 0) @@ -712,7 +712,7 @@ ) (cond ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms2)) - (set! (-> s2-0 trans quad) (-> s1-0 quad)) + (vector-copy! (-> s2-0 trans) s1-0) (spawn-from-mat (-> s5-0 damaged-left-spark-part) s2-0) (when (>= (- (current-time) (-> s5-0 left-spark-timer)) 0) (let ((s1-1 (current-time)) @@ -754,7 +754,7 @@ ) (cond ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms3)) - (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s2-0 trans) s3-0) (spawn-from-mat (-> s5-0 damaged-right-spark-part) s2-0) (when (>= (- (current-time) (-> s5-0 right-spark-timer)) 0) (let* ((s3-1 (current-time)) @@ -822,7 +822,7 @@ (dotimes (s3-3 10) (when (not (handle->process (-> self ammo s3-3))) (let ((s2-3 (new 'static 'fact-info))) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> (the-as process-drawable s4-1) root trans quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s4-1) root trans)) (set-vector! (new 'stack-no-clear 'vector) 0.0 57001.605 0.0 1.0) (set! (-> s2-3 options) (actor-option fade-out fall no-distance-check-fadeout)) (set! (-> s2-3 fade-time) (seconds 10)) @@ -1140,7 +1140,7 @@ (gp-0 (new 'stack-no-clear 'matrix)) ) (factory-boss-get-particle-spawn-points (-> self chosen-machine) a1-8 s5-0 gp-0) - (set! (-> gp-0 trans quad) (-> s5-0 quad)) + (vector-copy! (-> gp-0 trans) s5-0) (if (logtest? (-> *part-group-id-table* 1367 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1298,7 +1298,7 @@ (the-as symbol (-> self launching-group)) ) (set! (-> s5-0 flags) (facboss-critter-tracker-flag)) - (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-0 trans) gp-0) (quaternion-copy! (-> s4-0 quat) (-> self root quat)) (set! (-> s4-0 entity) (-> self entity)) (set! (-> s4-0 directed?) #t) @@ -1426,7 +1426,7 @@ (set-vector! (-> s4-2 fvec) 0.0 1.0 0.0 0.0) (vector-cross! (-> s4-2 rvec) (-> s4-2 uvec) (-> s4-2 fvec)) (set! (-> s4-2 rvec w) 0.0) - (set! (-> s4-2 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-2 trans) gp-0) (+! (-> s4-2 trans y) 8192.0) (set! (-> s4-2 trans w) 1.0) (if (logtest? (-> *part-group-id-table* 1377 flags) (sp-group-flag sp13)) diff --git a/goal_src/jak3/levels/factory/factory-manager.gc b/goal_src/jak3/levels/factory/factory-manager.gc index 5e8d610d940..599bd06d56f 100644 --- a/goal_src/jak3/levels/factory/factory-manager.gc +++ b/goal_src/jak3/levels/factory/factory-manager.gc @@ -91,7 +91,7 @@ (set! (-> *factory-fighter-trail* zbuffer?) #f) -(set! (-> *factory-fighter-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *factory-fighter-trail* lie-vector) *up-vector*) (set! (-> *factory-fighter-trail* use-tape-mode?) #f) @@ -383,6 +383,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this factory-fighter-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (cleanup-for-death this) ) @@ -393,6 +394,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this factory-tanks-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (cleanup-for-death this) ) @@ -490,7 +492,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) 0.0 0.0 - (set! (-> s5-0 quad) (-> *target* control trans quad)) + (vector-copy! s5-0 (-> *target* control trans)) (dotimes (s4-0 (-> arg0 fpath npath)) (when (logtest? (-> arg0 fpath inout s4-0 flags) (factory-inout-flag fi1)) (get-point-at-percent-along-path! (-> arg0 fpath path s4-0) s5-0 0.0 'interp) @@ -584,7 +586,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> (get-trans *target* 3) quad)) + (vector-copy! s4-0 (get-trans *target* 3)) (let ((v1-4 s5-0)) (let ((a0-3 (-> this root trans))) (let ((a1-1 (-> this forw))) @@ -694,7 +696,7 @@ ) ) ) - (set! (-> this ppos quad) (-> this root trans quad)) + (vector-copy! (-> this ppos) (-> this root trans)) (get-point-at-percent-along-path! (-> s5-0 fpath path (-> this path-idx)) (-> this root trans) @@ -708,10 +710,10 @@ ) (vector-! s2-0 (-> this root trans) (-> this ppos)) (vector-float*! s2-0 s2-0 f28-0) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s2-0) (vector-normalize! s4-0 1.0) (vector-! s3-0 s2-0 (-> this pvel)) - (set! (-> this pvel quad) (-> s2-0 quad)) + (vector-copy! (-> this pvel) s2-0) (vector-float*! s3-0 s3-0 (/ f28-0 (meters 15))) (cond ((< 0.0 (-> this blendpath)) @@ -723,10 +725,10 @@ (set! (-> this blendpath) (fmax 0.0 (- (-> this blendpath) (* 4.0 f30-0)))) ) ((zero? (-> this newpath)) - (set! (-> this pacc quad) (-> s3-0 quad)) + (vector-copy! (-> this pacc) s3-0) ) (else - (set! (-> s3-0 quad) (-> this pacc quad)) + (vector-copy! s3-0 (-> this pacc)) (+! (-> this newpath) -1) (if (zero? (-> this newpath)) (set! (-> this blendpath) 1.0) @@ -748,8 +750,8 @@ (vector+! s5-1 *up-vector* s3-0) (vector-normalize! s5-1 1.0) (forward-up->quaternion (-> this root quat) s4-0 s5-1) - (set! (-> this forw quad) (-> s4-0 quad)) - (set! (-> this upvc quad) (-> s5-1 quad)) + (vector-copy! (-> this forw) s4-0) + (vector-copy! (-> this upvc) s5-1) ) ) ) @@ -771,7 +773,7 @@ (let ((s5-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s4-0 (new 'stack-no-clear 'vector))) (if (-> self disappear) (go-virtual die) @@ -888,11 +890,11 @@ 0 (cond ((logtest? (-> *part-group-id-table* 730 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 730)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 730)) ) ) @@ -950,11 +952,11 @@ (set! (-> self root root-prim local-sphere w) 491520.0) (cond ((logtest? (-> *part-group-id-table* 730 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 730)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 730)) ) ) @@ -1232,6 +1234,7 @@ ) (defmethod init-from-entity! ((this fac-target) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -1470,11 +1473,11 @@ (set! (-> gp-0 rot-speed) 16.0) (cond ((logtest? (-> *part-group-id-table* 733 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 733)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 733)) ) ) @@ -1560,7 +1563,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this fac-target)) +(defmethod get-search-info-flag ((this fac-target)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (set! v0-0 (logior v0-0 40)) diff --git a/goal_src/jak3/levels/factory/factoryb-init.gc b/goal_src/jak3/levels/factory/factoryb-init.gc index 9caca3e7574..2836618bf2c 100644 --- a/goal_src/jak3/levels/factory/factoryb-init.gc +++ b/goal_src/jak3/levels/factory/factoryb-init.gc @@ -11,7 +11,7 @@ (defun factoryb-activate ((arg0 level)) (cond - ((= (status-of-level-and-borrows *level* 'lfactory #f) 'active) + ((= (level-status? *level* 'lfactory #f) 'active) (format 0 "factoryb-activate~%") (factory-manager-start arg0) ) diff --git a/goal_src/jak3/levels/factory/factoryc-obs.gc b/goal_src/jak3/levels/factory/factoryc-obs.gc index e7f618dcc65..d89bcd6e5d9 100644 --- a/goal_src/jak3/levels/factory/factoryc-obs.gc +++ b/goal_src/jak3/levels/factory/factoryc-obs.gc @@ -82,21 +82,21 @@ ;; WARN: Return type mismatch vector vs none. (defmethod set-jmod-inner-scale! ((this generic-spot-shadow-effect) (arg0 vector)) - (set! (-> this jmod-inner transform scale quad) (-> arg0 quad)) + (vector-copy! (-> this jmod-inner transform scale) arg0) (none) ) ;; WARN: Return type mismatch vector vs none. (defmethod set-jmod-outer-scale! ((this generic-spot-shadow-effect) (arg0 vector)) - (set! (-> this jmod-outer transform scale quad) (-> arg0 quad)) + (vector-copy! (-> this jmod-outer transform scale) arg0) (none) ) (defbehavior generic-spot-shadow-effect-init-by-other generic-spot-shadow-effect ((arg0 vector) (arg1 quaternion)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) - (set! (-> self pre-flicker-pos quad) (-> self root trans quad)) + (vector-copy! (-> self pre-flicker-pos) (-> self root trans)) (set! (-> self level) (-> *level* level-default)) (initialize-skeleton self @@ -282,7 +282,7 @@ (let ((a0-5 (-> self lightning)) (v1-4 s5-0) ) - (set! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1) quad) (-> v1-4 quad)) + (vector-copy! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1)) v1-4) ) (until #f (let ((v1-9 (mod (+ (current-time) (-> self phase-offset)) (+ (-> self on-duration) (-> self off-duration))))) @@ -491,31 +491,10 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'matrix))) - (let* ((v1-9 gp-1) - (a3-0 (-> self node-list data 4 bone transform)) - (a0-5 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-2 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-9 rvec quad) a0-5) - (set! (-> v1-9 uvec quad) a1-2) - (set! (-> v1-9 fvec quad) a2-2) - (set! (-> v1-9 trans quad) a3-1) - ) + (matrix-copy! gp-1 (-> self node-list data 4 bone transform)) (vector-negate-in-place! (-> gp-1 uvec)) (vector-negate-in-place! (-> gp-1 fvec)) - (let ((a2-3 (-> self particle-hack)) - (v1-10 (-> gp-1 rvec quad)) - (a0-8 (-> gp-1 uvec quad)) - (a1-3 (-> gp-1 fvec quad)) - (a3-2 (-> gp-1 trans quad)) - ) - (set! (-> a2-3 rvec quad) v1-10) - (set! (-> a2-3 uvec quad) a0-8) - (set! (-> a2-3 fvec quad) a1-3) - (set! (-> a2-3 trans quad) a3-2) - ) + (matrix-copy! (-> self particle-hack) gp-1) ) (add-debug-rot-matrix #t (bucket-id debug-no-zbuf1) (-> self particle-hack) (-> self root trans)) (spawn-from-mat (-> self part) (-> self particle-hack)) @@ -544,6 +523,7 @@ ) (defmethod init-from-entity! ((this fac-fire-torch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -680,7 +660,7 @@ (s5-0 (new 'stack-no-clear 'enemy-init-by-other-params)) ) (vector+! v1-5 (-> arg0 root trans) (new 'static 'vector :w 1.0)) - (set! (-> s5-0 trans quad) (-> v1-5 quad)) + (vector-copy! (-> s5-0 trans) v1-5) (quaternion-copy! (-> s5-0 quat) (-> arg0 root quat)) (set! (-> s5-0 entity) (-> arg0 entity)) (set! (-> s5-0 directed?) #f) @@ -878,11 +858,11 @@ (sound-play "fac-hatch-explo") (cond ((logtest? (-> *part-group-id-table* 752 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 752)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 752)) ) ) @@ -904,11 +884,11 @@ (set! (-> self root root-prim prim-core action) (collide-action)) (cond ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 218)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 218)) ) ) @@ -943,6 +923,7 @@ ) (defmethod init-from-entity! ((this fac-robopod) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1019,7 +1000,7 @@ ) (set! (-> self beams gp-0 state meet data 0 quad) (-> s4-0 quad)) (let ((a0-9 (-> self beams gp-0))) - (set! (-> a0-9 state meet data (+ (-> a0-9 state points-to-draw) -1) quad) (-> v1-2 quad)) + (vector-copy! (-> a0-9 state meet data (+ (-> a0-9 state points-to-draw) -1)) v1-2) ) ) (set! (-> self beams-on gp-0) #t) @@ -1062,8 +1043,7 @@ (defstate flickering (factory-elec-gate) :virtual #t :code (behavior () - (suspend-for - (seconds 3) + (suspend-for (seconds 3) (let ((s5-0 (the-as int (rand-uint31-gen *random-generator*)))) (let ((s4-0 0) (s3-0 3) @@ -1123,8 +1103,7 @@ (+! s4-0 1) ) ) - (suspend-for - (seconds 0.1) + (suspend-for (seconds 0.1) (if (logand s5-0 1) (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) ) @@ -1175,6 +1154,7 @@ ) (defmethod init-from-entity! ((this factory-elec-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (when (task-node-closed? (game-task-node factory-assault-get-vehicle)) (process-entity-status! this (entity-perm-status dead) #t) diff --git a/goal_src/jak3/levels/factory/factoryc-obs2.gc b/goal_src/jak3/levels/factory/factoryc-obs2.gc index b6ae4593fbf..17d69d06c73 100644 --- a/goal_src/jak3/levels/factory/factoryc-obs2.gc +++ b/goal_src/jak3/levels/factory/factoryc-obs2.gc @@ -104,11 +104,11 @@ () (cond ((logtest? (-> *part-group-id-table* 750 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 750)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 750)) ) ) @@ -120,7 +120,7 @@ ) ) (when a0-14 - (set! (-> gp-2 fountain-rand-transv-lo quad) (-> (get-trans a0-14 0) quad)) + (vector-copy! (-> gp-2 fountain-rand-transv-lo) (get-trans a0-14 0)) (+! (-> gp-2 fountain-rand-transv-lo y) 16384.0) ) ) @@ -152,6 +152,7 @@ ) (defmethod init-from-entity! ((this fac-break-floor) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -331,11 +332,11 @@ (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) (cond ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) ) ) @@ -357,6 +358,7 @@ ) (defmethod init-from-entity! ((this fac-break-fence-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -483,11 +485,11 @@ (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) (cond ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) ) ) @@ -509,6 +511,7 @@ ) (defmethod init-from-entity! ((this fac-break-fence-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -583,6 +586,7 @@ ) (defmethod init-from-entity! ((this fac-break-fence-c) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -681,11 +685,11 @@ (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) (cond ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) ) ) @@ -836,8 +840,7 @@ (process-entity-status! self (entity-perm-status subtask-complete) #t) (cond ((not arg0) - (suspend-for - (seconds 0.3) + (suspend-for (seconds 0.3) (let* ((f28-0 (lerp-clamp 0.0 3640.889 (* 0.011111111 (the float (- (current-time) (-> self state-time)))))) (f30-0 (cos f28-0)) (f0-2 (sin f28-0)) @@ -851,7 +854,9 @@ (suspend) ) (set-setting! 'entity-name gp-2 0.0 0) - (suspend-for (seconds 3) '()) + (suspend-for (seconds 3) + '() + ) (remove-setting! 'entity-name) (while (not (process-release? *target*)) (suspend) @@ -869,6 +874,7 @@ ) (defmethod init-from-entity! ((this fac-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1079,8 +1085,7 @@ :trans plat-trans :code (behavior () (let ((f30-0 (-> self dead-set-time))) - (suspend-for - (seconds 3) + (suspend-for (seconds 3) (set! (-> self path-pos) (lerp-clamp (get-norm! (-> self sync) 0) f30-0 (* 0.0011111111 (the float (- (current-time) time)))) ) @@ -1467,6 +1472,7 @@ ) (defmethod init-from-entity! ((this fac-rotfan) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1546,6 +1552,7 @@ ) (defmethod init-from-entity! ((this fac-robot-ass-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-set! this arg0) (go (method-of-object this idle)) ) @@ -1706,6 +1713,7 @@ ) (defmethod init-from-entity! ((this fac-punch-wall) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) diff --git a/goal_src/jak3/levels/factory/ffight-projectile.gc b/goal_src/jak3/levels/factory/ffight-projectile.gc index 49812f20391..1c5262c2643 100644 --- a/goal_src/jak3/levels/factory/ffight-projectile.gc +++ b/goal_src/jak3/levels/factory/ffight-projectile.gc @@ -316,7 +316,7 @@ (a1-4 (-> *part-id-table* 2856)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -366,7 +366,7 @@ ) (-> *part-id-table* 2854 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 2854 init-specs 3 initial-valuef) (* f28-1 f30-1)) (launch-particles (-> *part-id-table* 2854) s4-1 :origin-is-matrix #t) (set! (-> *part-id-table* 2854 init-specs 3 initial-valuef) f30-1) @@ -587,7 +587,7 @@ (defmethod init-proj-settings! ((this ffight-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'ffight-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) ffight-shot-move) @@ -620,7 +620,7 @@ (set! (-> gp-0 attack-id) a2-12) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) (the-as projectile (spawn-projectile ffight-shot gp-0 arg0 *default-dead-pool*)) diff --git a/goal_src/jak3/levels/factory/ftank-projectile.gc b/goal_src/jak3/levels/factory/ftank-projectile.gc index f382c9e0f86..36517ee6b19 100644 --- a/goal_src/jak3/levels/factory/ftank-projectile.gc +++ b/goal_src/jak3/levels/factory/ftank-projectile.gc @@ -246,7 +246,7 @@ (a1-4 (-> *part-id-table* 2871)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -296,7 +296,7 @@ ) (-> *part-id-table* 2869 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 2869 init-specs 3 initial-valuef) (* f28-1 f30-1)) (launch-particles (-> *part-id-table* 2869) s4-1 :origin-is-matrix #t) (set! (-> *part-id-table* 2869 init-specs 3 initial-valuef) f30-1) @@ -381,7 +381,7 @@ (let ((v1-5 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-5 sphere quad) (-> self root trans quad)) (set! (-> v1-5 sphere r) 40960.0) - (set! (-> v1-5 velocity quad) (-> self root transv quad)) + (vector-copy! (-> v1-5 velocity) (-> self root transv)) (set! (-> v1-5 notify-radius) 122880.0) (set! (-> v1-5 danger-level) 1.0) (set! (-> v1-5 decay-rate) 0.0) @@ -490,7 +490,7 @@ (defmethod init-proj-settings! ((this ftank-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'fac-robotank-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) ftank-shot-move) @@ -525,8 +525,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) diff --git a/goal_src/jak3/levels/factory/fturret-projectile.gc b/goal_src/jak3/levels/factory/fturret-projectile.gc index 62521b8bf0c..1f68245cf48 100644 --- a/goal_src/jak3/levels/factory/fturret-projectile.gc +++ b/goal_src/jak3/levels/factory/fturret-projectile.gc @@ -352,7 +352,7 @@ (a1-4 (-> *part-id-table* 2883)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -402,7 +402,7 @@ (f28-1 (-> *part-id-table* 2881 init-specs 4 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 2881 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 2881 init-specs 4 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 2881) s4-1 :origin-is-matrix #t) @@ -573,7 +573,7 @@ (defmethod init-proj-settings! ((this fturret-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'fac-robotank-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) fturret-shot-move) @@ -608,8 +608,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) diff --git a/goal_src/jak3/levels/factory/h-warf.gc b/goal_src/jak3/levels/factory/h-warf.gc index ae312a375ba..c45549baac0 100644 --- a/goal_src/jak3/levels/factory/h-warf.gc +++ b/goal_src/jak3/levels/factory/h-warf.gc @@ -614,7 +614,7 @@ (set! (-> s5-1 charge) 1.0) (set! (-> s5-1 options) (projectile-options po13)) (logclear! (-> s5-1 options) (projectile-options po14 po15 po16)) - (set! (-> s5-1 pos quad) (-> s4-0 quad)) + (vector-copy! (-> s5-1 pos) s4-0) (set! (-> s5-1 notify-handle) (the-as handle #f)) (set! (-> s5-1 owner-handle) (process->handle *target*)) (set! (-> s5-1 target-handle) (the-as handle #f)) @@ -691,7 +691,7 @@ (set! (-> s5-2 charge) 1.0) (set! (-> s5-2 options) (projectile-options)) (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) - (set! (-> s5-2 pos quad) (-> s2-1 quad)) + (vector-copy! (-> s5-2 pos) s2-1) (set! (-> s5-2 notify-handle) (the-as handle #f)) (set! (-> s5-2 owner-handle) (the-as handle #f)) (set! (-> s5-2 target-handle) (the-as handle #f)) @@ -782,7 +782,7 @@ ) 0.0 (let ((v1-11 (new 'stack-no-clear 'vector))) - (set! (-> v1-11 quad) (-> this rbody ang-velocity quad)) + (vector-copy! v1-11 (-> this rbody ang-velocity)) (let ((f0-10 (* 0.25 (fabs (-> v1-11 y))))) (set! (-> v1-11 y) 0.0) (let* ((f0-11 (+ f0-10 (vector-length v1-11))) @@ -1001,8 +1001,8 @@ (s0-0 (-> arg1 probe-work-array s1-0)) ) (vector-reset! (-> s0-0 tire-force)) - (set! (-> s0-0 local-pos quad) (-> v1-29 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-29 rot quad)) + (vector-copy! (-> s0-0 local-pos) (-> v1-29 local-pos)) + (vector-copy! (-> s0-0 local-normal) (-> v1-29 rot)) (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) (let ((a1-9 (-> s0-0 probe-pos))) (let ((v1-32 (-> s0-0 world-pos))) @@ -1017,30 +1017,29 @@ (.add.x.vf.w vf6 vf0 vf0) (.mul.x.vf.xyz acc vf5 vf7) (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) + (.add.x.vf.w vf6 vf0 vf0) (.svf (&-> a1-9 quad) vf6) ) (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) - (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) - (-> arg1 steering-axis) - (the-as vector (-> arg1 mat)) - ) - ) - quad - ) - ) - (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s0-0 wheel-axis) (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) + (-> arg1 steering-axis) + (the-as vector (-> arg1 mat)) + ) + ) + ) + (vector-copy! (-> s0-0 ground-pos) (-> s0-0 probe-pos)) (set! (-> s0-0 ground-pos y) 0.0) (vector-reset! (-> s0-0 ground-normal)) (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos)) (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) (cond ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) (logclear! (-> this v-flags) (vehicle-flag in-air)) (logior! (-> this v-flags) (vehicle-flag on-ground)) (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) - (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) + (vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal)) + (vector-copy! (-> arg1 ground-normal) (-> s0-0 ground-normal)) ) (else (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 position y))) @@ -1061,8 +1060,8 @@ (when (>= 1 (-> this force-level)) (dotimes (s2-1 (-> this info physics-model lift-thruster-count)) (let ((s1-1 (-> arg1 probe-work-array s2-1))) - (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) - (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s1-1 world-pos)) + (vector-copy! (-> arg1 velocity) (-> s1-1 velocity)) (let* ((f1-12 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) (f28-1 (- 1.0 (/ (+ -4096.0 f1-12) (+ -4096.0 f30-1)))) ) @@ -1129,8 +1128,8 @@ (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) ) (vector-normalize! (-> arg1 normal) 1.0) - (set! (-> arg1 world-pos quad) (-> s3-0 position quad)) - (set! (-> arg1 velocity quad) (-> s3-0 lin-velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s3-0 position)) + (vector-copy! (-> arg1 velocity) (-> s3-0 lin-velocity)) (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 position)) (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 inv-i-world)) @@ -1184,7 +1183,7 @@ 0.0 (forward-up->inv-matrix s1-0 arg0 *up-vector*) (matrix-transpose! s1-0 s1-0) - (set! (-> s2-0 quad) (-> this rbody matrix fvec quad)) + (vector-copy! s2-0 (-> this rbody matrix fvec)) (set! (-> s2-0 y) 0.0) (vector-normalize! s2-0 1.0) (vector-rotate*! s2-0 s2-0 s1-0) @@ -1239,7 +1238,7 @@ (disable-physics! this) ) (when (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) (not (time-elapsed? (-> this birth) (seconds 1)))) - (set! (-> this rbody lin-momentum quad) (-> this rbody matrix fvec quad)) + (vector-copy! (-> this rbody lin-momentum) (-> this rbody matrix fvec)) (vector-normalize! (-> this rbody lin-momentum) 204800.0) (vector-float*! (-> this rbody lin-momentum) (-> this rbody lin-momentum) (-> this rbody info mass)) ) @@ -1270,7 +1269,7 @@ (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) (+! (-> s3-0 z) 4096.0) - (set! (-> s2-2 velocity quad) (-> *x-vector* quad)) + (vector-copy! (-> s2-2 velocity) *x-vector*) (let ((f0-19 (* 0.00024414062 (vector-length (-> this rbody lin-velocity))))) (set! (-> s2-2 world-pos z) (/ 1.0 f0-19)) ) @@ -1283,7 +1282,7 @@ (let ((s0-0 (new 'stack-no-clear 'vector)) (s1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s0-0 quad) (-> this rbody matrix rvec quad)) + (vector-copy! s0-0 (-> this rbody matrix rvec)) (set! (-> s0-0 y) 0.0000000001) (vector-normalize! s0-0 1.0) (set! (-> s2-2 world-pos x) (* 0.00024414062 (vector-dot (-> this rbody lin-velocity) s0-0))) @@ -1462,7 +1461,7 @@ (let ((s3-1 (new 'stack-no-clear 'vector))) 0.0 (let ((f30-3 (impact-reduction (the-as int (-> this impact-time))))) - (set! (-> s3-1 quad) (-> this rbody matrix rvec quad)) + (vector-copy! s3-1 (-> this rbody matrix rvec)) (set! (-> s3-1 y) 0.0000000001) (vector-normalize! s3-1 1.0) (vector-float*! @@ -1509,7 +1508,7 @@ ) 0.0 (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) - (set! (-> s3-2 quad) (-> this rbody lin-velocity quad)) + (vector-copy! s3-2 (-> this rbody lin-velocity)) (vector-normalize! s3-2 1.0) (let ((f0-156 (vector-dot s3-2 s4-0))) (vector-float*! s2-3 s3-2 f0-156) @@ -1567,10 +1566,10 @@ (init-rbody-impact-from-tshape! this s5-0 arg1) (if (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (rigid-body-control-method-23 (-> this rbody) (-> s5-0 point) (-> s5-0 velocity)) - (set! (-> s5-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 velocity) (-> this root transv)) ) (let ((v1-17 (-> arg0 root))) - (set! (-> s2-0 quad) (-> v1-17 transv quad)) + (vector-copy! s2-0 (-> v1-17 transv)) (vector-! (-> s5-0 velocity) (-> v1-17 transv) (-> s5-0 velocity)) ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) @@ -1656,7 +1655,7 @@ (init-vf0-vector) (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg2 quad)) + (vector-copy! s5-0 arg2) (let ((s4-0 (new 'stack-no-clear 'matrix))) (quaternion->matrix s4-0 (-> this root quat)) (let ((a2-1 (matrix-transpose! (new 'stack-no-clear 'matrix) s4-0))) @@ -1674,10 +1673,10 @@ ) ) (else - (set! (-> s5-0 quad) (-> arg2 quad)) + (vector-copy! s5-0 arg2) ) ) - (set! (-> s4-0 trans quad) (-> arg1 quad)) + (vector-copy! (-> s4-0 trans) arg1) (dotimes (s3-1 15) (let* ((f28-0 (* 0.06666667 (- 15.0 (the float s3-1)))) (f26-0 (* f28-0 (rand-vu-float-range 8192.0 9011.2))) @@ -1743,7 +1742,7 @@ (when (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (let ((s5-0 (new 'stack-no-clear 'h-warf-stack-var0))) (quaternion->matrix (-> s5-0 mat) (-> this root quat)) - (set! (-> s5-0 mat trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 mat trans) (-> this root trans)) (set-vector! (-> s5-0 vec1) 0.0 0.0 -1.0 1.0) (vector-rotate*! (-> s5-0 vec1) (-> s5-0 vec1) (-> s5-0 mat)) (when (< 0.0 (-> this info particles thruster-flame-length)) @@ -1783,19 +1782,8 @@ (let ((a0-3 (the-as process-focusable (handle->process (-> this track-obj))))) (when a0-3 (let ((s5-0 (new 'stack-no-clear 'vehicle-physics-work))) - (let* ((v1-7 (-> s5-0 mat)) - (a3-0 (-> a0-3 node-list data (-> this track-joint) bone transform)) - (a0-9 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-9) - (set! (-> v1-7 uvec quad) a1-3) - (set! (-> v1-7 fvec quad) a2-0) - (set! (-> v1-7 trans quad) a3-1) - ) - (set! (-> s5-0 velocity quad) (-> s5-0 mat trans quad)) + (matrix-copy! (-> s5-0 mat) (-> a0-3 node-list data (-> this track-joint) bone transform)) + (vector-copy! (-> s5-0 velocity) (-> s5-0 mat trans)) (matrix->quaternion (the-as quaternion (-> s5-0 force)) (-> s5-0 mat)) (rigid-body-control-method-28 (-> this rbody) (-> s5-0 velocity) (the-as quaternion (-> s5-0 force))) ) diff --git a/goal_src/jak3/levels/factory/lfaccity-mood.gc b/goal_src/jak3/levels/factory/lfaccity-mood.gc index 5d8e2dfbd97..5028ff96b99 100644 --- a/goal_src/jak3/levels/factory/lfaccity-mood.gc +++ b/goal_src/jak3/levels/factory/lfaccity-mood.gc @@ -112,6 +112,7 @@ (defmethod init-from-entity! ((this lfaccity-pparticle-mover) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -179,7 +180,7 @@ (when a1-4 (let ((a1-5 (-> a1-4 extra process))) (when a1-5 - (set! (-> (the-as process-drawable a1-5) root trans quad) (-> v1-6 quad)) + (vector-copy! (-> (the-as process-drawable a1-5) root trans) v1-6) (vector+! (-> (the-as process-drawable a1-5) root trans) (-> (the-as process-drawable a1-5) root trans) diff --git a/goal_src/jak3/levels/factory/lfacrm1-mood.gc b/goal_src/jak3/levels/factory/lfacrm1-mood.gc index 9a14c1ff946..4dae169bb41 100644 --- a/goal_src/jak3/levels/factory/lfacrm1-mood.gc +++ b/goal_src/jak3/levels/factory/lfacrm1-mood.gc @@ -145,6 +145,7 @@ ) (defmethod init-from-entity! ((this lfac-hanger-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -158,7 +159,7 @@ (defbehavior lfac-hanger-door-init-by-other lfac-hanger-door ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-lfac-hanger-door" (the-as (pointer level) #f))) diff --git a/goal_src/jak3/levels/factory/missile-bot.gc b/goal_src/jak3/levels/factory/missile-bot.gc index d3bc0f593c4..14c88f11278 100644 --- a/goal_src/jak3/levels/factory/missile-bot.gc +++ b/goal_src/jak3/levels/factory/missile-bot.gc @@ -177,34 +177,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 20480.0 - :knocked-soft-vxz-hi 28672.0 - :knocked-soft-vy-lo 36864.0 - :knocked-soft-vy-hi 45056.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 49152.0 - :knocked-hard-vxz-hi 57344.0 - :knocked-hard-vy-lo 49152.0 - :knocked-hard-vy-hi 57344.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 28672.0 - :knocked-yellow-vy-lo 36864.0 - :knocked-yellow-vy-hi 4096.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 114688.0 - :knocked-red-vy-lo 53248.0 - :knocked-red-vy-hi 69632.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 20480.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 5) + :knocked-soft-vxz-hi (meters 7) + :knocked-soft-vy-lo (meters 9) + :knocked-soft-vy-hi (meters 11) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 12) + :knocked-hard-vxz-hi (meters 14) + :knocked-hard-vy-lo (meters 12) + :knocked-hard-vy-hi (meters 14) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 7) + :knocked-yellow-vy-lo (meters 9) + :knocked-yellow-vy-hi (meters 1) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 28) + :knocked-red-vy-lo (meters 13) + :knocked-red-vy-hi (meters 17) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 5) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -250,6 +250,7 @@ ) (defmethod event-handler ((this missile-bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('lift-off) (go (method-of-object this lift-off)) @@ -260,7 +261,10 @@ ) ) -(defmethod enemy-method-63 ((this missile-bot) (arg0 float)) +(defmethod apply-incoming-hitpoint-mods ((this missile-bot) (arg0 float)) + "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (fmax 0.0 (fmin arg0 (-> this hit-points))) ) @@ -304,7 +308,7 @@ ) (init-vf0-vector) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node missile-bot-lod0-jg main)))) - (set! (-> arg0 quad) (-> s4-0 quad)) + (vector-copy! arg0 s4-0) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (target-pos 0))) (s2-0 (ppointer->process (-> self parent))) (s3-1 (if (type? s2-0 factory-boss) @@ -448,7 +452,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -471,7 +475,7 @@ ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) (go-stare self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -566,7 +570,7 @@ (set! (-> self root penetrate-using) (the-as penetrate (logclear (-> self root penetrate-using) (penetrate knocked))) ) - (enemy-method-50 self 2) + (update-collision-action self 2) (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -712,17 +716,17 @@ (f30-0 (rand-vu-float-range 1228.8 2048.0)) (f28-0 (rand-vu-float-range 30.0 120.0)) ) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (+! (-> gp-0 y) (rand-vu-float-range 6144.0 10240.0)) (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-0 f28-0 f30-0) ) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -781,11 +785,11 @@ (set! (-> self root root-prim local-sphere w) 491520.0) (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) ) ) @@ -805,6 +809,7 @@ ;; WARN: Return type mismatch symbol vs none. (defmethod enemy-common-post ((this missile-bot)) + "Common implementation of post. Runs ja-post." (local-vars (sv-272 vector) (sv-288 vector) (sv-304 vector)) (with-pp (cond @@ -841,7 +846,7 @@ (update-with-delay! (-> this main-wobble-rand)) (when (not (stunned?)) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> this main-wobble-rand value quad)) + (vector-copy! a1-4 (-> this main-wobble-rand value)) (vector+! a1-4 a1-4 (new 'static 'vector :y 1.0)) (update! (-> this main-wobble) a1-4) ) @@ -979,7 +984,7 @@ (let ((a0-67 (-> this lightning s0-0)) (v1-116 s4-0) ) - (set! (-> a0-67 state meet data (+ (-> a0-67 state points-to-draw) -1) quad) (-> v1-116 quad)) + (vector-copy! (-> a0-67 state meet data (+ (-> a0-67 state points-to-draw) -1)) v1-116) ) (cond ((or (= (-> this lightning-mode) 2) (and (= (-> this lightning-mode) 1) (< s0-0 2))) @@ -1095,6 +1100,7 @@ ) (defmethod coin-flip? ((this missile-bot)) + "Return #t half the time, #f the other." #f ) @@ -1140,7 +1146,8 @@ (none) ) -(defmethod enemy-method-50 ((this missile-bot) (arg0 int)) +(defmethod update-collision-action ((this missile-bot) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0)) (a0-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1)) ) @@ -1170,6 +1177,7 @@ ) (defmethod init-enemy-collision! ((this missile-bot)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1219,6 +1227,7 @@ ) (defmethod init-enemy! ((this missile-bot)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-missile-bot" (the-as (pointer level) #f))) @@ -1227,7 +1236,7 @@ (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) ) - (init-enemy-defaults! this *missile-bot-nav-enemy-info*) + (setup-enemy! this *missile-bot-nav-enemy-info*) (set! (-> this top-angle) 0.0) (set! (-> this top-spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) (set! (-> this top-spin-jm track-mode) (track-mode no-trans no-scale)) diff --git a/goal_src/jak3/levels/factory/warf-projectile.gc b/goal_src/jak3/levels/factory/warf-projectile.gc index e037e5c4b79..b80c7c0afc9 100644 --- a/goal_src/jak3/levels/factory/warf-projectile.gc +++ b/goal_src/jak3/levels/factory/warf-projectile.gc @@ -216,7 +216,7 @@ ) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (set! (-> self draw lod-set lod 0 dist) 14336000.0) (set! (-> self expanding?) #t) @@ -241,18 +241,7 @@ (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) ) :trans (behavior () - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (math-camera-matrix)) - (v1-0 (-> a2-0 rvec quad)) - (a0-0 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-0) - (set! (-> gp-0 uvec quad) a0-0) - (set! (-> gp-0 fvec quad) a1-0) - (set! (-> gp-0 trans quad) a2-1) - ) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) (let ((a1-1 (-> gp-0 fvec)) (v1-1 (-> gp-0 rvec)) ) @@ -323,7 +312,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (set! (-> gp-0 notify-handle) (process->handle arg0)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -357,7 +346,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (set! (-> gp-0 notify-handle) (process->handle arg0)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -410,7 +399,7 @@ (fmin 1.0 (/ f30-0 (meters 40))) (-> *part-id-table* 2895 init-specs 3 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) ) ) 0 @@ -472,7 +461,7 @@ (defmethod warf-projectile-method-45 ((this warf-projectile)) (when (time-elapsed? (-> this spawn-time) (seconds 0.5)) - (set! (-> this hit-pos quad) (-> this root trans quad)) + (vector-copy! (-> this hit-pos) (-> this root trans)) (go (method-of-object this impact)) ) 0 @@ -501,7 +490,7 @@ (let ((v1-19 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-6 (-> arg0 hit-pos)) ) - (set! (-> a1-6 quad) (-> s5-0 trans quad)) + (vector-copy! a1-6 (-> s5-0 trans)) (vector+! a1-6 a1-6 v1-19) (move-to-point! (-> arg0 root) a1-6) ) @@ -612,7 +601,7 @@ (set! (-> self hit-pos w) 0.0) (kill-particles (-> self part)) (let ((gp-0 (new 'stack-no-clear 'warf-explosion-sphere-init-params))) - (set! (-> gp-0 pos quad) (-> self hit-pos quad)) + (vector-copy! (-> gp-0 pos) (-> self hit-pos)) (let ((s5-0 sound-play-by-name) (sname (static-sound-name "impact-trigger2")) (s3-0 (new-sound-id)) @@ -747,7 +736,7 @@ (defmethod init-proj-settings! ((this warf-projectile)) (set! (-> this hit-actor?) #f) (set! (-> this hit-pos quad) (the-as uint128 0)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'guard-shot) (set! (-> this max-speed) 327680.0) (set! (-> this move) warf-projectile-move) @@ -1007,7 +996,7 @@ (f28-0 (-> *part-id-table* 2895 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 s4-1 *up-vector*) - (set! (-> s3-1 trans quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 trans) s5-0) (gun-warf-shot-method-42 this f30-1 f28-0 s3-1) ) ) @@ -1249,7 +1238,7 @@ (defmethod init-proj-settings! ((this fac-gun-tower-projectile)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) #t) (set! (-> this max-speed) 327680.0) (set! (-> this move) fac-gun-tower-projectile-move) @@ -1274,21 +1263,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) ) ) ) ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) ) ) @@ -1362,7 +1351,7 @@ (let ((v1-14 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-5 (-> arg0 hit-pos)) ) - (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector-copy! a1-5 (-> s5-0 trans)) (vector+! a1-5 a1-5 v1-14) (move-to-point! (-> arg0 root) a1-5) ) @@ -1426,7 +1415,7 @@ (defmethod init-proj-settings! ((this gun-warf-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 1638400.0) diff --git a/goal_src/jak3/levels/forest/eco-green-collider.gc b/goal_src/jak3/levels/forest/eco-green-collider.gc index 547a2339871..313eec490d3 100644 --- a/goal_src/jak3/levels/forest/eco-green-collider.gc +++ b/goal_src/jak3/levels/forest/eco-green-collider.gc @@ -64,7 +64,7 @@ (defbehavior eco-green-collider-init-by-other eco-green-collider ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (init-collision! self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 125) self)) (go-virtual idle) ) diff --git a/goal_src/jak3/levels/forest/for-turret-shot.gc b/goal_src/jak3/levels/forest/for-turret-shot.gc index 29c99cca900..357aedaa5e7 100644 --- a/goal_src/jak3/levels/forest/for-turret-shot.gc +++ b/goal_src/jak3/levels/forest/for-turret-shot.gc @@ -330,7 +330,7 @@ (a1-4 (-> *part-id-table* 1069)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -379,7 +379,7 @@ (f28-1 (-> *part-id-table* 1067 init-specs 5 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 1067 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 1067 init-specs 5 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 1067) s4-1 :origin-is-matrix #t) @@ -397,15 +397,15 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector-copy! v1-2 (-> gp-0 trans)) (vector+! v1-2 v1-2 a0-3) (cond ((logtest? (-> *part-group-id-table* 239 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 239)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 239)) ) ) @@ -553,7 +553,7 @@ ) (defmethod init-proj-settings! ((this for-turret-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'for-turret-shot) (set! (-> this max-speed) 737280.0) (set! (-> this move) for-turret-shot-move) @@ -581,7 +581,7 @@ (set! (-> gp-0 attack-id) a0-11) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) arg2 arg3) (the-as (pointer for-turret-shot) (spawn-projectile for-turret-shot gp-0 arg0 *default-dead-pool*)) ) diff --git a/goal_src/jak3/levels/forest/for-turret.gc b/goal_src/jak3/levels/forest/for-turret.gc index 28fafd5f13d..c9bc1d12c53 100644 --- a/goal_src/jak3/levels/forest/for-turret.gc +++ b/goal_src/jak3/levels/forest/for-turret.gc @@ -324,8 +324,8 @@ (set! (-> this values 1 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) ) (('set-aim-vector) - (set! (-> this aim-vector-source quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> this aim-vector quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! (-> this aim-vector-source) (the-as vector (-> arg3 param 0))) + (vector-copy! (-> this aim-vector) (the-as vector (-> arg3 param 1))) ) (('set-hud-pos) (set-hud-piece-position! @@ -520,7 +520,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (ja-post) (update-transforms (-> self root)) (go-virtual idle) @@ -850,11 +850,11 @@ ) (when gp-0 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! s5-1 (get-trans (the-as process-focusable gp-0) 0)) (+! (-> s5-1 y) 6144.0) (when (>= 327680.0 (vector-vector-xz-distance s5-1 (-> self root trans))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (get-transv (the-as process-focusable gp-0)) quad)) + (vector-copy! s4-0 (get-transv (the-as process-focusable gp-0))) (vector+float*! (-> self aim-pos) s5-1 s4-0 -0.3) ) (when (and (time-elapsed? (-> self fire-timer) (-> self params fire-interval)) @@ -865,7 +865,7 @@ (f30-1 (vector-length s5-3)) (gp-1 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-1 quad) (-> self node-list data 7 bone transform fvec quad)) + (vector-copy! gp-1 (-> self node-list data 7 bone transform fvec)) (vector-normalize! s5-3 1.0) (vector-normalize! gp-1 1.0) (if (and (< (acos (vector-dot s5-3 gp-1)) 1820.4445) @@ -1030,9 +1030,9 @@ (vector+float*! sv-120 (-> this root trans) s4-1 (* 4096.0 (rand-vu-float-range 1.5 2.5))) ) (let ((s4-2 (new 'stack-no-clear 'vector))) - (set! (-> s4-2 quad) (-> *y-vector* quad)) + (vector-copy! s4-2 *y-vector*) (let ((s3-2 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-2 start-pos quad) (-> sv-120 quad)) + (vector-copy! (-> s3-2 start-pos) sv-120) (+! (-> s3-2 start-pos y) 12288.0) (set-vector! (-> s3-2 move-dist) 0.0 -12288.0 0.0 0.0) (let ((v1-13 s3-2)) @@ -1056,7 +1056,7 @@ (matrix-u-f-compose sv-112 s4-2 sv-116) ) (+! (-> sv-120 y) 819.2) - (set! (-> sv-112 trans quad) (-> sv-120 quad)) + (vector-copy! (-> sv-112 trans) sv-120) (let ((v1-32 (if (logtest? (-> *part-group-id-table* 241 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -1173,7 +1173,7 @@ (f0-3 6144.0) (s3-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s3-0 start-pos quad) (-> s1-1 quad)) + (vector-copy! (-> s3-0 start-pos) s1-1) (+! (-> s3-0 start-pos y) 12288.0) (set-vector! (-> s3-0 move-dist) 0.0 -12288.0 0.0 0.0) (let ((v1-10 s3-0)) @@ -1198,7 +1198,7 @@ (set! (-> v1-10 action-mask) (collide-action solid)) ) (when (< (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) - (set! (-> arg0 quad) (-> s1-1 quad)) + (vector-copy! arg0 s1-1) (let ((v1-15 s3-0)) (set! (-> v1-15 radius) 819.2) (set! (-> v1-15 collide-with) (collide-spec backgnd)) @@ -1237,9 +1237,9 @@ (s3-0 (-> this node-list data (-> v1-3 (-> this current-barrel)))) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) s3-0)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> s5-0 quad)) + (vector-copy! (new 'stack-no-clear 'vector) s5-0) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> s3-0 bone transform fvec quad)) + (vector-copy! s4-0 (-> s3-0 bone transform fvec)) (new 'stack-no-clear 'vector) (vector-normalize! s4-0 1.0) (vector+float*! s5-0 s5-0 s4-0 10240.0) @@ -1346,7 +1346,7 @@ (gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) s3-0)) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> s3-0 bone transform fvec quad)) + (vector-copy! s4-1 (-> s3-0 bone transform fvec)) (vector-normalize! s4-1 1.0) (vector+float*! gp-1 gp-1 s4-1 10240.0) ) diff --git a/goal_src/jak3/levels/forest/forest-bridges.gc b/goal_src/jak3/levels/forest/forest-bridges.gc index b2038021690..79fd56e3336 100644 --- a/goal_src/jak3/levels/forest/forest-bridges.gc +++ b/goal_src/jak3/levels/forest/forest-bridges.gc @@ -133,14 +133,14 @@ (process-entity-status! self (entity-perm-status subtask-complete) #t) (sound-play "bridge-break") (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> gp-1 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 fountain-rand-transv-lo) (-> self root trans)) (set! (-> gp-1 fountain-rand-transv-hi x) 4096.0) (set! (-> gp-1 fountain-rand-transv-hi y) 40960.0) (set! (-> gp-1 fountain-rand-transv-hi z) 4096.0) (set! (-> gp-1 fountain-rand-transv-hi w) 102400.0) (cond ((logtest? (-> *part-group-id-table* 577 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -149,7 +149,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -181,6 +181,7 @@ ) (defmethod init-from-entity! ((this for-break-bridge-board) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 64) (when (task-node-closed? (game-task-node forest-kill-plants-resolution)) (cleanup-for-death this) diff --git a/goal_src/jak3/levels/forest/forest-kill-plants.gc b/goal_src/jak3/levels/forest/forest-kill-plants.gc index d67bd31061e..06201b15c94 100644 --- a/goal_src/jak3/levels/forest/forest-kill-plants.gc +++ b/goal_src/jak3/levels/forest/forest-kill-plants.gc @@ -215,7 +215,7 @@ (set! (-> *eco-green-trail* zbuffer?) #f) -(set! (-> *eco-green-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *eco-green-trail* lie-vector) *up-vector*) (set! (-> *eco-green-trail* use-tape-mode?) #f) @@ -429,10 +429,7 @@ :virtual #t :code (behavior () (when (not (task-node-closed? (game-task-node forest-kill-plants-armor))) - (let ((gp-0 (current-time))) - (until (time-elapsed? gp-0 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (when (not (task-node-closed? (game-task-node forest-kill-plants-pillars))) (dotimes (gp-1 (length (-> self actor-group 1))) @@ -458,9 +455,9 @@ ) (when (not (handle->process (-> self arrow))) (let ((gp-5 (new 'stack-no-clear 'vector))) - (set! (-> gp-5 quad) (-> (entity-by-name "ecovent-20") extra trans quad)) + (vector-copy! gp-5 (-> (entity-by-name "ecovent-20") extra trans)) (let ((s5-3 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-3 pos quad) (-> gp-5 quad)) + (vector-copy! (-> s5-3 pos) gp-5) (quaternion-identity! (-> s5-3 quat)) (set! (-> s5-3 flags) (task-arrow-flags)) (set! (-> s5-3 map-icon) (the-as uint 13)) @@ -529,11 +526,9 @@ ) (when (-> self actor-group) (let ((gp-7 (new 'stack-no-clear 'vector))) - (set! (-> gp-7 quad) - (-> self actor-group 0 data (+ (length (-> self actor-group 0)) -1) actor extra trans quad) - ) + (vector-copy! gp-7 (-> self actor-group 0 data (+ (length (-> self actor-group 0)) -1) actor extra trans)) (let ((s5-7 (new 'stack-no-clear 'vector))) - (set! (-> s5-7 quad) (-> gp-7 quad)) + (vector-copy! s5-7 gp-7) (+! (-> gp-7 y) 65536.0) (+! (-> s5-7 y) 73728.0) (let ((s4-4 (-> self actor-group 1))) @@ -574,15 +569,12 @@ ) ) ) - (let ((s3-1 (current-time))) - (until (time-elapsed? s3-1 (seconds 0.5)) - (suspend) - ) + (suspend-for (seconds 0.5) ) ) (when (not (handle->process (-> self arrow))) (let ((s4-6 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s4-6 pos quad) (-> gp-7 quad)) + (vector-copy! (-> s4-6 pos) gp-7) (quaternion-identity! (-> s4-6 quat)) (set! (-> s4-6 flags) (task-arrow-flags)) (set! (-> s4-6 map-icon) (the-as uint 13)) @@ -603,10 +595,7 @@ ) (let ((s4-9 (talker-spawn-func (-> *talker-speech* 104) *entity-pool* (target-pos 0) (the-as region #f)))) (when (not (task-node-closed? (game-task-node forest-kill-plants-pillars))) - (let ((s3-3 (current-time))) - (until (time-elapsed? s3-3 (seconds 2)) - (suspend) - ) + (suspend-for (seconds 2) ) (set-setting! 'interp-time 'abs 0.0 0) (remove-setting! 'entity-name) @@ -664,7 +653,7 @@ (when (-> self actor-group) (let ((gp-11 (-> self actor-group 0 data (+ (length (-> self actor-group 0)) -1) actor))) (let ((s5-10 (new 'stack-no-clear 'vector))) - (set! (-> s5-10 quad) (-> gp-11 extra trans quad)) + (vector-copy! s5-10 (-> gp-11 extra trans)) (+! (-> s5-10 y) 65536.0) (while (let ((f0-11 102400.0)) (>= (* f0-11 f0-11) (vector-vector-distance-squared s5-10 (target-pos 0))) @@ -685,10 +674,7 @@ 'trigger ) ) - (let ((gp-12 (current-time))) - (until (time-elapsed? gp-12 (seconds 5)) - (suspend) - ) + (suspend-for (seconds 5) ) (set-setting! 'interp-time 'abs 0.0 0) (remove-setting! 'entity-name) diff --git a/goal_src/jak3/levels/forest/forest-part.gc b/goal_src/jak3/levels/forest/forest-part.gc index 1af52c512a8..3fb9ab57d09 100644 --- a/goal_src/jak3/levels/forest/forest-part.gc +++ b/goal_src/jak3/levels/forest/forest-part.gc @@ -726,7 +726,7 @@ (set! (-> a0-9 y) (-> arg2 launchrot y)) (set! (-> a0-9 z) (-> arg2 launchrot z)) (set! (-> a0-9 w) 1.0) - (set! (-> v1-18 quad) (-> a0-9 quad)) + (vector-copy! v1-18 a0-9) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 570)) ) @@ -738,7 +738,7 @@ (set! (-> a0-14 y) (-> arg2 launchrot y)) (set! (-> a0-14 z) (-> arg2 launchrot z)) (set! (-> a0-14 w) 1.0) - (set! (-> v1-33 quad) (-> a0-14 quad)) + (vector-copy! v1-33 a0-14) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 570)) ) @@ -1039,7 +1039,7 @@ (set! (-> a0-1 y) (-> arg2 launchrot y)) (set! (-> a0-1 z) (-> arg2 launchrot z)) (set! (-> a0-1 w) 1.0) - (set! (-> v1-6 quad) (-> a0-1 quad)) + (vector-copy! v1-6 a0-1) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 573)) ) @@ -1051,7 +1051,7 @@ (set! (-> a0-6 y) (-> arg2 launchrot y)) (set! (-> a0-6 z) (-> arg2 launchrot z)) (set! (-> a0-6 w) 1.0) - (set! (-> v1-19 quad) (-> a0-6 quad)) + (vector-copy! v1-19 a0-6) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 573)) ) diff --git a/goal_src/jak3/levels/forest/forest-ring-chase.gc b/goal_src/jak3/levels/forest/forest-ring-chase.gc index 5d8856fdacc..3a1ff351edc 100644 --- a/goal_src/jak3/levels/forest/forest-ring-chase.gc +++ b/goal_src/jak3/levels/forest/forest-ring-chase.gc @@ -438,11 +438,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 579 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 579)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 579)) ) ) @@ -464,7 +464,7 @@ (let ((f0-18 (vector-dot s3-0 s4-3))) (cond ((< 0.9999 f0-18) - (set! (-> s4-3 quad) (-> s3-0 quad)) + (vector-copy! s4-3 s3-0) ) (else (let ((s5-2 (new 'stack-no-clear 'vector)) @@ -482,7 +482,7 @@ ) (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this root trans) s4-3 (meters 1) *color-yellow*) (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this root trans) s3-0 (meters 1) *color-dark-yellow*) - (set! (-> this root transv quad) (-> s4-3 quad)) + (vector-copy! (-> this root transv) s4-3) ) (vector-normalize! (-> this root transv) f30-1) ) @@ -525,7 +525,8 @@ (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) - (suspend-for (seconds 8)) + (suspend-for (seconds 8) + ) ) ) @@ -545,6 +546,7 @@ ;; WARN: Return type mismatch float vs object. (defmethod init-from-entity! ((this for-race-ring-finder) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) (set! (-> this ring-finder-speed) 163840.0) ) @@ -552,7 +554,7 @@ (defbehavior for-race-ring-finder-init-by-other for-race-ring-finder ((arg0 vector) (arg1 entity)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self path-pos) 0.0) (set! (-> self ring-finder-speed) 163840.0) @@ -677,13 +679,14 @@ (cond ((focus-test? v1-3 pilot) (let ((a2-1 (handle->process (-> v1-3 pilot vehicle)))) - (set! (-> a1-1 quad) - (-> (the-as collide-shape (-> (the-as process-drawable a2-1) root)) root-prim prim-core world-sphere quad) - ) + (vector-copy! + a1-1 + (-> (the-as collide-shape (-> (the-as process-drawable a2-1) root)) root-prim prim-core world-sphere) + ) ) ) (else - (set! (-> a1-1 quad) (-> v1-3 control trans quad)) + (vector-copy! a1-1 (-> v1-3 control trans)) (+! (-> a1-1 y) 8192.0) ) ) @@ -787,10 +790,11 @@ ) (defmethod init-from-entity! ((this for-race-ring) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (for-race-ring-method-23 this) (process-drawable-from-entity! this arg0) (quaternion->matrix (-> this mat) (-> this root quat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 589) this)) (set! (-> this part-final) (create-launch-control (-> *part-group-id-table* 590) this)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1020,7 +1024,7 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 584 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to self @@ -1029,20 +1033,21 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 584) :duration (seconds 1)) ) ) - (suspend-for (seconds 1) (if (nonzero? (-> self sound-id)) - (sound-play "statue-expl-bu" :id (-> self sound-id)) - ) - ) + (suspend-for (seconds 1) + (if (nonzero? (-> self sound-id)) + (sound-play "statue-expl-bu" :id (-> self sound-id)) + ) + ) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) ) (cond ((logtest? (-> *part-group-id-table* 585 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -1051,7 +1056,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1071,7 +1076,8 @@ (transform-post) (sound-play "statue-explode") (for-statue-method-28 self) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (cleanup-for-death self) (let ((a1-15 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-15 from) (process->ppointer self)) @@ -1169,6 +1175,7 @@ ) (defmethod init-from-entity! ((this for-statue) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (with-pp (for-statue-method-27 this) (process-drawable-from-entity! this arg0) @@ -2187,11 +2194,10 @@ (not (logtest? (-> s5-1 extra perm status) (entity-perm-status subtask-complete))) ) (let ((s2-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s2-0 pos quad) - (-> (vector+! (new 'stack-no-clear 'vector) (-> s5-1 extra trans) (new 'static 'vector :y -4096.0 :w 1.0)) - quad - ) - ) + (vector-copy! + (-> s2-0 pos) + (vector+! (new 'stack-no-clear 'vector) (-> s5-1 extra trans) (new 'static 'vector :y -4096.0 :w 1.0)) + ) (quaternion-identity! (-> s2-0 quat)) (set! (-> s2-0 flags) (task-arrow-flags taf8)) (set! (-> s2-0 map-icon) (the-as uint 13)) @@ -2292,7 +2298,9 @@ ) (suspend) ) - (suspend-for (seconds 3) (format *stdebug* "task-manager-forest-ring-chase: done!~%")) + (suspend-for (seconds 3) + (format *stdebug* "task-manager-forest-ring-chase: done!~%") + ) (while (-> self use-camera?) (suspend) ) @@ -2431,7 +2439,7 @@ ) (set-setting! 'airlock #f 0.0 0) (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-0 pos quad) (-> (new 'static 'vector :x -2937746.8 :y 249443.12 :z 4155934.0 :w 1.0) quad)) + (vector-copy! (-> s5-0 pos) (new 'static 'vector :x -2937746.8 :y 249443.12 :z 4155934.0 :w 1.0)) (quaternion-identity! (-> s5-0 quat)) (set! (-> s5-0 flags) (task-arrow-flags)) (set! (-> s5-0 map-icon) (the-as uint 12)) diff --git a/goal_src/jak3/levels/forest/forest-tasks.gc b/goal_src/jak3/levels/forest/forest-tasks.gc index 726e4be2c66..b4ae5b95704 100644 --- a/goal_src/jak3/levels/forest/forest-tasks.gc +++ b/goal_src/jak3/levels/forest/forest-tasks.gc @@ -67,7 +67,8 @@ :virtual #t :code (behavior () (local-vars (a1-12 event-message-block) (gp-3 symbol)) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (until (and (-> self manager-entity) (= (-> *game-info* counter) 0.0)) (suspend) (if (not (-> self manager-entity)) @@ -143,7 +144,8 @@ (until (process-grab? *target* #f) (suspend) ) - (suspend-for (seconds 0.1)) + (suspend-for (seconds 0.1) + ) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-14 from) (process->ppointer self)) (set! (-> a1-14 num-params) 0) @@ -273,7 +275,8 @@ (suspend) (set! (-> self manager-entity) (entity-by-name "for-machine-manager-1")) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((gp-1 (-> self entity extra perm))) (logior! (-> gp-1 status) (entity-perm-status bit-5)) (when (zero? (-> gp-1 user-object 0)) @@ -291,7 +294,8 @@ ) (set! (-> gp-1 user-object 0) (+ (the-as int (-> gp-1 user-object 0)) 1)) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (set! sv-16 (new 'static 'res-tag)) (let ((v1-33 (res-lump-data (-> self manager-entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond @@ -328,7 +332,7 @@ ) ) (let ((gp-4 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-4 pos quad) (-> (new 'static 'vector :x -2937746.8 :y 249443.12 :z 4155934.0 :w 1.0) quad)) + (vector-copy! (-> gp-4 pos) (new 'static 'vector :x -2937746.8 :y 249443.12 :z 4155934.0 :w 1.0)) (quaternion-identity! (-> gp-4 quat)) (set! (-> gp-4 flags) (task-arrow-flags)) (set! (-> gp-4 map-icon) (the-as uint 12)) diff --git a/goal_src/jak3/levels/forest/foresta-obs.gc b/goal_src/jak3/levels/forest/foresta-obs.gc index dfb30043ee1..46058ac954b 100644 --- a/goal_src/jak3/levels/forest/foresta-obs.gc +++ b/goal_src/jak3/levels/forest/foresta-obs.gc @@ -203,7 +203,7 @@ (set! (-> a0-21 param2) (the-as basic 0)) ) (let ((v1-18 (-> this shakers 1))) - (set! (-> v1-18 axis quad) (-> s5-0 quad)) + (vector-copy! (-> v1-18 axis) s5-0) (set! (-> v1-18 start-time) (+ (current-time) (seconds -0.06))) (set! (-> v1-18 decay-time) 600.0) (set! (-> v1-18 freq) 150.0) @@ -219,7 +219,7 @@ (set! (-> v1-20 param2) (the-as basic 1)) ) (let ((v1-21 (-> this shakers 2))) - (set! (-> v1-21 axis quad) (-> s5-0 quad)) + (vector-copy! (-> v1-21 axis) s5-0) (set! (-> v1-21 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-21 decay-time) 600.0) (set! (-> v1-21 freq) 150.0) @@ -234,7 +234,7 @@ (set! (-> v1-23 param2) (the-as basic 2)) ) (let ((v1-24 (-> this shakers 3))) - (set! (-> v1-24 axis quad) (-> s5-0 quad)) + (vector-copy! (-> v1-24 axis) s5-0) (set! (-> v1-24 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-24 decay-time) 600.0) (set! (-> v1-24 freq) 150.0) @@ -309,6 +309,7 @@ ) (defmethod init-from-entity! ((this for-log) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -501,7 +502,7 @@ ) ) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self entity extra trans quad)) + (vector-copy! a1-1 (-> self entity extra trans)) (set! (-> a1-1 y) 90112.0) (spawn (-> self part) a1-1) ) @@ -578,6 +579,7 @@ ) (defmethod init-from-entity! ((this for-pillar) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 64) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -798,13 +800,14 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this for-telescope) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) (defbehavior for-telescope-init-by-other for-telescope ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (for-telescope-method-21 self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) 11832.889) (initialize-skeleton self @@ -888,6 +891,7 @@ ) (defmethod init-from-entity! ((this for-tower) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 64) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -911,7 +915,7 @@ (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> this root trans quad)) + (vector-copy! s4-1 (-> this root trans)) (set! (-> s4-1 y) (+ 65536.0 (-> this extend-height) (-> s4-1 y))) (set! (-> this telescope) (ppointer->handle (process-spawn for-telescope s4-1 arg0 :name "for-telescope" :to this)) @@ -941,7 +945,7 @@ (set! (-> self level) arg2) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-shoulder-plates" (the-as (pointer level) #f))) @@ -961,5 +965,6 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this shoulder-plates) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) diff --git a/goal_src/jak3/levels/forest/mh-plant.gc b/goal_src/jak3/levels/forest/mh-plant.gc index 93408150399..160868a4fa5 100644 --- a/goal_src/jak3/levels/forest/mh-plant.gc +++ b/goal_src/jak3/levels/forest/mh-plant.gc @@ -144,11 +144,11 @@ (sound-play "plant-sprout") (cond ((logtest? (-> *part-group-id-table* 571 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 571)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 571)) ) ) @@ -230,11 +230,11 @@ (sound-play "plant-pop") (cond ((logtest? (-> *part-group-id-table* 576 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 576)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 576)) ) ) @@ -263,11 +263,11 @@ ((time-elapsed? (-> self sub-state-time) (seconds 4)) (cond ((logtest? (-> *part-group-id-table* 575 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 575)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 575)) ) ) @@ -319,11 +319,11 @@ :enter (behavior () (cond ((logtest? (-> *part-group-id-table* 574 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 574)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 574)) ) ) @@ -510,6 +510,7 @@ ) (defmethod init-from-entity! ((this mh-plant) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 16) (init! this arg0) (cond diff --git a/goal_src/jak3/levels/forest/neo-spawner.gc b/goal_src/jak3/levels/forest/neo-spawner.gc index 8937b932e63..6d2dd8bde5b 100644 --- a/goal_src/jak3/levels/forest/neo-spawner.gc +++ b/goal_src/jak3/levels/forest/neo-spawner.gc @@ -162,6 +162,7 @@ ) (defmethod init-from-entity! ((this neo-spawner-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this total-spawned) 0) (set! (-> this max-spawned) 0) @@ -338,7 +339,7 @@ (gp-0 (new 'stack-no-clear 'vector4w)) ) (set! (-> gp-0 quad) (the-as uint128 0)) - (set! (-> s5-0 quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! s5-0 (-> self node-list data 3 bone transform trans)) (+! (-> s5-0 y) -6144.0) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (camera-pos) s5-0))) (vector-normalize! s4-1 9420.8) @@ -516,7 +517,7 @@ ) ) (when s4-0 - (set! (-> s5-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) (quaternion-copy! (-> s5-0 quat) (-> this root quat)) (set! (-> s5-0 entity) (-> this entity)) (set! (-> s5-0 directed?) #f) @@ -605,7 +606,7 @@ (let ((a1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) (matrix-f-compose gp-0 a1-5) ) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 566 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 566) :mat-joint gp-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 566) :mat-joint gp-0) @@ -679,7 +680,7 @@ (new 'stack-no-clear 'vector) (set! (-> a1-7 hit-xz-reaction) 0.95) (set! (-> a1-7 hit-y-reaction) 0.6) - (set! (-> a1-7 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> a1-7 fountain-rand-transv-lo) (-> self root trans)) (set! (-> a1-7 fountain-rand-transv-hi x) 24576.0) (set! (-> a1-7 fountain-rand-transv-hi y) 163840.0) (set! (-> a1-7 fountain-rand-transv-hi z) 24576.0) @@ -689,11 +690,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 565 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 565)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 565)) ) ) @@ -717,18 +718,7 @@ :code sleep-code :post (behavior () (let ((a1-0 (new 'stack-no-clear 'matrix))) - (let* ((v1-0 a1-0) - (t0-0 (-> self node-list data 3 bone transform)) - (a0-2 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-2) - (set! (-> v1-0 uvec quad) a2-0) - (set! (-> v1-0 fvec quad) a3-0) - (set! (-> v1-0 trans quad) t0-1) - ) + (matrix-copy! a1-0 (-> self node-list data 3 bone transform)) (vector+float*! (-> a1-0 trans) (-> a1-0 trans) (-> a1-0 fvec) 8192.0) (spawn-from-mat (-> self dead-part) a1-0) ) @@ -736,7 +726,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this neo-spawner)) +(defmethod get-search-info-flag ((this neo-spawner)) + "Get search-info-flag for this process." (the-as search-info-flag 1) ) @@ -758,6 +749,7 @@ ) (defmethod init-from-entity! ((this neo-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak3/levels/glider/glider-manager.gc b/goal_src/jak3/levels/glider/glider-manager.gc index 4135a9afb7e..0246548a6d4 100644 --- a/goal_src/jak3/levels/glider/glider-manager.gc +++ b/goal_src/jak3/levels/glider/glider-manager.gc @@ -46,7 +46,7 @@ (defun pre-populate-clouds ((arg0 vector) (arg1 process)) (let ((s4-0 (new 'stack-no-clear 'vector))) (dotimes (s3-0 57) - (set! (-> s4-0 quad) (-> arg0 quad)) + (vector-copy! s4-0 arg0) (let* ((f30-0 -1228800.0) (f28-0 2457600.0) (v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -916,7 +916,7 @@ (if (= (-> this max-count) -1) (set! (-> this max-count) (-> s4-0 length)) ) - (set! (-> s5-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s5-0 (target-pos 0)) (while (< (-> this count) (-> this max-count)) (let ((s3-1 (-> s4-0 (-> this count)))) (let ((f0-0 8192000.0)) @@ -1009,8 +1009,8 @@ ) ) (b! (not s4-0) cfg-86 :delay (nop!)) - (set! (-> s5-0 pos quad) (-> s4-0 rbody matrix trans quad)) - (set! (-> s5-0 forw quad) (-> s4-0 rbody matrix fvec quad)) + (vector-copy! (-> s5-0 pos) (-> s4-0 rbody matrix trans)) + (vector-copy! (-> s5-0 forw) (-> s4-0 rbody matrix fvec)) (set! (-> s5-0 shootable) #f) (set! (-> s5-0 speedmod) 1.0) (cond @@ -1052,7 +1052,7 @@ ) ) (b! (not v1-85) cfg-86 :delay (nop!)) - (set! (-> s5-1 pos quad) (-> v1-85 rbody matrix trans quad)) + (vector-copy! (-> s5-1 pos) (-> v1-85 rbody matrix trans)) (set! (-> s5-1 pos w) 40960.0) (set! (-> s5-1 thermal-time) 0) (let ((a0-42 (new 'stack-no-clear 'vector))) @@ -1072,7 +1072,7 @@ (.svf (&-> a2-2 quad) vf6) ) (set! (-> a0-42 w) (-> s5-1 pos w)) - (set! (-> s5-1 pos quad) (-> a0-42 quad)) + (vector-copy! (-> s5-1 pos) a0-42) ) ) (set! (-> s5-1 hheight) 409600.0) @@ -1420,7 +1420,7 @@ ) (let ((s5-2 (new 'stack-no-clear 'vector))) (let ((s4-4 (camera-matrix))) - (set! (-> s5-2 quad) (-> (camera-pos) quad)) + (vector-copy! s5-2 (camera-pos)) (let ((a0-29 s5-2)) (let ((v1-73 s5-2)) (let ((a1-15 (-> s4-4 fvec))) @@ -1437,7 +1437,7 @@ (.svf (&-> a0-29 quad) vf6) ) ) - (set! (-> *cloud-cube* quad) (-> s5-2 quad)) + (vector-copy! *cloud-cube* s5-2) ) (set! (-> *cloud-cube* w) 2457600.0) (task-manager-desert-glide-method-34 this) @@ -1590,6 +1590,7 @@ ) (defmethod init-from-entity! ((this tpl-glider) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak3/levels/glider/glider-ring-part.gc b/goal_src/jak3/levels/glider/glider-ring-part.gc index 785f41e242e..3846692e007 100644 --- a/goal_src/jak3/levels/glider/glider-ring-part.gc +++ b/goal_src/jak3/levels/glider/glider-ring-part.gc @@ -816,7 +816,7 @@ (let ((s3-0 (new 'stack-no-clear 'collide-query)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s3-0 start-pos) arg0) (set! (-> s3-0 move-dist quad) (the-as uint128 0)) (set! (-> s3-0 move-dist y) -2048000.0) (let ((v1-3 s3-0)) @@ -831,18 +831,18 @@ ) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) - (set! (-> s4-0 quad) (-> s3-0 best-other-tri normal quad)) + (vector-copy! s4-0 (-> s3-0 best-other-tri normal)) (set! (-> arg0 y) (-> s3-0 best-other-tri intersect y)) ) (else - (set! (-> s4-0 quad) (-> *up-vector* quad)) + (vector-copy! s4-0 *up-vector*) (set! (-> arg0 y) (get-base-height *ocean-map*)) ) ) (matrix-u-compose arg1 s4-0 arg2 arg3) ) (+! (-> arg0 y) 8192.0) - (set! (-> arg1 trans quad) (-> arg0 quad)) + (vector-copy! (-> arg1 trans) arg0) (set! (-> arg1 rvec w) 0.0) (set! (-> arg1 uvec w) 0.0) (set! (-> arg1 fvec w) 0.0) diff --git a/goal_src/jak3/levels/glider/glider-ring.gc b/goal_src/jak3/levels/glider/glider-ring.gc index 3fd9d427ecf..8dd83d53f12 100644 --- a/goal_src/jak3/levels/glider/glider-ring.gc +++ b/goal_src/jak3/levels/glider/glider-ring.gc @@ -93,7 +93,7 @@ (set! (-> *glider-ring-trail* zbuffer?) #f) -(set! (-> *glider-ring-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *glider-ring-trail* lie-vector) *up-vector*) (set! (-> *glider-ring-trail* use-tape-mode?) #f) @@ -274,8 +274,8 @@ ) (when gp-2 (let ((s4-1 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s4-1 0 quad) (-> gp-2 trans quad)) - (set! (-> s4-1 1 quad) (-> gp-2 trans-old-old quad)) + (vector-copy! (-> s4-1 0) (-> gp-2 trans)) + (vector-copy! (-> s4-1 1) (-> gp-2 trans-old-old)) (set! (-> s4-1 0 w) 1.0) (set! (-> s4-1 1 w) 1.0) (let ((f30-0 (vector4-dot (-> self plane) (-> s4-1 0))) @@ -379,7 +379,7 @@ (set-far self #f) (set-far self #t) ) - (set! (-> self root trans quad) (-> self save-pos quad)) + (vector-copy! (-> self root trans) (-> self save-pos)) (when (< 0.0 (-> self speedmod)) (when (!= (-> self xdist) 0.0) (let ((gp-1 (-> self root trans))) @@ -419,7 +419,7 @@ (if (and (-> self shootable) (not (-> self shot))) (quaternion-rotate-local-z! (-> self root quat) (-> self root quat) (* 32768.0 (seconds-per-frame))) ) - (set! (-> self mat trans quad) (-> self root trans quad)) + (vector-copy! (-> self mat trans) (-> self root trans)) (when (and (nonzero? (-> self distant-part)) (not (-> self shootable))) ) (when (logtest? (-> self draw status) (draw-control-status on-screen)) @@ -490,7 +490,7 @@ ) (let ((v1-151 (the-as glider-prim (handle->process (-> self ring-prim))))) (when v1-151 - (set! (-> v1-151 root trans quad) (-> self root trans quad)) + (vector-copy! (-> v1-151 root trans) (-> self root trans)) (quaternion-copy! (-> v1-151 root quat) (-> self root quat)) ) ) @@ -575,9 +575,9 @@ (vector-normalize! (-> this right) 1.0) (vector-cross! (-> this up) (-> this right) (-> s5-0 fvec)) (vector-normalize! (-> this up) 1.0) - (set! (-> s5-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) (matrix->quaternion (-> this root quat) s5-0) - (set! (-> this plane quad) (-> s5-0 fvec quad)) + (vector-copy! (-> this plane) (-> s5-0 fvec)) ) (set! (-> this plane w) (- (vector-dot (-> this plane) (-> this root trans)))) (update-transforms (-> this root)) @@ -643,7 +643,7 @@ ) ) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-from-two-vectors! (-> self root quat) *z-vector* (-> arg0 forw)) (let ((v1-37 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (a0-17 (-> self root trans)) @@ -660,7 +660,7 @@ (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> a0-17 quad) vf6) ) - (set! (-> self save-pos quad) (-> self root trans quad)) + (vector-copy! (-> self save-pos) (-> self root trans)) (set! (-> self boost) (-> arg0 boost)) (set! (-> self id) arg1) (set! (-> self persistent) arg2) @@ -755,14 +755,14 @@ (defmethod init-part-and-mat! ((this glider-thermal)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 656) this)) (matrix-identity! (-> this mat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) 0 (none) ) (defbehavior glider-thermal-init-by-other glider-thermal ((arg0 glider-thermal-info) (arg1 int)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (set! (-> self id) arg1) (init-part-and-mat! self) (go-virtual idle) @@ -819,11 +819,11 @@ (defun glider-launch-mist-particle ((arg0 vector) (arg1 process)) (cond ((logtest? (-> *part-group-id-table* 657 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> arg0 quad)) + (vector-copy! (-> *launch-matrix* trans) arg0) (part-tracker-spawn part-tracker-subsampler :to arg1 :group (-> *part-group-id-table* 657) :duration -1) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg0 quad)) + (vector-copy! (-> *launch-matrix* trans) arg0) (part-tracker-spawn part-tracker :to arg1 :group (-> *part-group-id-table* 657) :duration -1) ) ) diff --git a/goal_src/jak3/levels/glider/h-glider.gc b/goal_src/jak3/levels/glider/h-glider.gc index a03c418f77d..c5c41f5c0d8 100644 --- a/goal_src/jak3/levels/glider/h-glider.gc +++ b/goal_src/jak3/levels/glider/h-glider.gc @@ -451,10 +451,10 @@ ) (('ring-pos) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! v1-1 (the-as vector (-> arg3 param 1))) (when (< 0.0 (vector-dot v1-1 (-> this rbody matrix fvec))) - (set! (-> this last-ring-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> this progression-plane quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! (-> this last-ring-pos) (the-as vector (-> arg3 param 0))) + (vector-copy! (-> this progression-plane) (the-as vector (-> arg3 param 1))) (set! (-> this progression-plane w) (vector-dot (-> this root trans) (-> this progression-plane))) ) ) @@ -686,8 +686,8 @@ (s0-0 (-> arg1 probe-work-array s1-0)) ) (vector-reset! (-> s0-0 tire-force)) - (set! (-> s0-0 local-pos quad) (-> v1-29 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-29 rot quad)) + (vector-copy! (-> s0-0 local-pos) (-> v1-29 local-pos)) + (vector-copy! (-> s0-0 local-normal) (-> v1-29 rot)) (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) (let ((a1-9 (-> s0-0 probe-pos))) (let ((v1-32 (-> s0-0 world-pos))) @@ -705,27 +705,25 @@ (.svf (&-> a1-9 quad) vf6) ) (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) - (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) - (-> arg1 steering-axis) - (the-as vector (-> arg1 mat)) - ) - ) - quad - ) - ) - (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s0-0 wheel-axis) (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) + (-> arg1 steering-axis) + (the-as vector (-> arg1 mat)) + ) + ) + ) + (vector-copy! (-> s0-0 ground-pos) (-> s0-0 probe-pos)) (set! (-> s0-0 ground-pos y) 0.0) (vector-reset! (-> s0-0 ground-normal)) (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos)) (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) (cond ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) (logclear! (-> this v-flags) (vehicle-flag in-air)) (logior! (-> this v-flags) (vehicle-flag on-ground)) (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) - (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) + (vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal)) + (vector-copy! (-> arg1 ground-normal) (-> s0-0 ground-normal)) ) (else (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 position y))) @@ -746,8 +744,8 @@ (when (>= 1 (-> this force-level)) (dotimes (s2-1 (-> this info physics-model lift-thruster-count)) (let ((s1-1 (-> arg1 probe-work-array s2-1))) - (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) - (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s1-1 world-pos)) + (vector-copy! (-> arg1 velocity) (-> s1-1 velocity)) (let* ((f1-12 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) (f28-1 (- 1.0 (/ (+ -4096.0 f1-12) (+ -4096.0 f30-1)))) ) @@ -814,8 +812,8 @@ (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) ) (vector-normalize! (-> arg1 normal) 1.0) - (set! (-> arg1 world-pos quad) (-> s3-0 position quad)) - (set! (-> arg1 velocity quad) (-> s3-0 lin-velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s3-0 position)) + (vector-copy! (-> arg1 velocity) (-> s3-0 lin-velocity)) (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 position)) (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 inv-i-world)) @@ -911,7 +909,7 @@ (= v1-15 0.0) ) ) - (set! (-> this rbody lin-momentum quad) (-> this rbody matrix fvec quad)) + (vector-copy! (-> this rbody lin-momentum) (-> this rbody matrix fvec)) (vector-normalize! (-> this rbody lin-momentum) (if (task-node-closed? (game-task-node desert-glide-templetop)) @@ -940,7 +938,7 @@ (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) (+! (-> s3-0 z) 4096.0) - (set! (-> s2-3 force quad) (-> *x-vector* quad)) + (vector-copy! (-> s2-3 force) *x-vector*) (let ((f0-20 (* 0.00024414062 (vector-length (-> this rbody lin-velocity))))) (set! (-> s2-3 velocity z) (/ 1.0 f0-20)) ) @@ -1124,7 +1122,7 @@ (let ((s3-1 (new 'stack-no-clear 'vector))) 0.0 (let ((f30-4 (glider-impact-reduction (the-as time-frame (-> this impact-time))))) - (set! (-> s3-1 quad) (-> this rbody matrix rvec quad)) + (vector-copy! s3-1 (-> this rbody matrix rvec)) (set! (-> s3-1 y) 0.0000000001) (vector-normalize! s3-1 1.0) (vector-float*! @@ -1239,21 +1237,21 @@ ) ) (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) - (set! (-> s3-5 quad) (-> this rbody lin-velocity quad)) + (vector-copy! s3-5 (-> this rbody lin-velocity)) (vector-normalize! s3-5 1.0) (let ((f0-152 (vector-dot s3-5 s4-0))) (vector-float*! s2-6 s3-5 f0-152) ) (vector-! s4-0 s4-0 s2-6) (add-force! (-> this rbody) s4-0) - (set! (-> s3-5 quad) (-> this rbody matrix fvec quad)) + (vector-copy! s3-5 (-> this rbody matrix fvec)) (vector-normalize! s3-5 1.0) (vector-float*! s4-0 *up-vector* (* -1.0 (-> this info info mass) f30-7)) (let ((f0-157 (vector-dot s3-5 s4-0))) (vector-float*! s4-0 s3-5 f0-157) ) (add-force! (-> this rbody) s4-0) - (set! (-> s3-5 quad) (-> this rbody matrix uvec quad)) + (vector-copy! s3-5 (-> this rbody matrix uvec)) (vector-normalize! s3-5 1.0) (vector-float*! s4-0 *up-vector* (* -0.12 (-> this info info mass) f30-7)) (let ((f0-162 (vector-dot s3-5 s4-0))) diff --git a/goal_src/jak3/levels/gungame/gun-dummy.gc b/goal_src/jak3/levels/gungame/gun-dummy.gc index 4b847804e27..67bc5964137 100644 --- a/goal_src/jak3/levels/gungame/gun-dummy.gc +++ b/goal_src/jak3/levels/gungame/gun-dummy.gc @@ -149,7 +149,7 @@ (return 0) ) (let ((s5-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> s5-0 fountain-rand-transv-lo quad) (-> this impact quad)) + (vector-copy! (-> s5-0 fountain-rand-transv-lo) (-> this impact)) (set! (-> s5-0 fountain-rand-transv-hi x) 4096.0) (set! (-> s5-0 fountain-rand-transv-hi y) 122880.0) (if (-> this explode-part-group) @@ -346,7 +346,7 @@ (forward-up-nopitch->quaternion (-> this quat-ground) s4-6 *up-vector*) ) (quaternion-normalize! (-> this quat-ground)) - (set! (-> this root trans quad) (-> s3-3 quad)) + (vector-copy! (-> this root trans) s3-3) ) (set! (-> this inout-percent) (lerp-scale 0.0 1.0 f30-0 0.0 (-> s5-0 0 time))) (set! (-> this first-time-command) #f) @@ -384,7 +384,7 @@ (get-point-in-path! s4-0 s2-4 (-> this path-pos) 'interp) (get-point-in-path! s4-0 s3-4 (* 0.007843138 (the float (-> s5-0 0 path-pos))) 'interp) (let ((v1-102 (new 'stack-no-clear 'vector))) - (set! (-> v1-102 quad) (-> this root trans quad)) + (vector-copy! v1-102 (-> this root trans)) (vector-float*! (-> this root trans) s2-4 (- 1.0 f28-2)) (let ((a0-63 (-> this root trans))) (let ((a1-23 (-> this root trans))) @@ -470,7 +470,7 @@ (case arg0 ((3 2) (let ((v0-0 (new 'static 'vector :w 1.0))) - (set! (-> v0-0 quad) (-> v1-0 trans quad)) + (vector-copy! v0-0 (-> v1-0 trans)) (+! (-> v0-0 y) 8192.0) v0-0 ) @@ -538,13 +538,13 @@ (let ((s5-3 (new 'stack-no-clear 'matrix))) (let ((s4-3 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)))) (let ((a0-40 s4-3)) - (set! (-> a0-40 quad) (-> s4-3 quad)) + (vector-copy! a0-40 s4-3) (set! (-> a0-40 y) 0.0) (vector-normalize! a0-40 1.0) ) (matrix-fu-compose s5-3 s4-3 *up-vector*) ) - (set! (-> s5-3 trans quad) (-> self root trans quad)) + (vector-copy! (-> s5-3 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 1425 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -683,6 +683,7 @@ ) (defmethod init-from-entity! ((this gun-dummy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -702,15 +703,16 @@ (quaternion-copy! (-> arg1 quat) (-> s4-0 gun-info quat)) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> arg0 bone transform trans quad)) + (vector-copy! s4-1 (-> arg0 bone transform trans)) (matrix<-no-trans-transformq! (-> arg0 bone transform) arg1) - (set! (-> arg0 bone transform trans quad) (-> s4-1 quad)) + (vector-copy! (-> arg0 bone transform trans) s4-1) ) (none) ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this gun-dummy)) +(defmethod get-search-info-flag ((this gun-dummy)) + "Get search-info-flag for this process." (let ((v1-1 (-> this current 0 command))) (the-as search-info-flag (if (or (= v1-1 (tpath-cmd cmd1)) (= v1-1 (tpath-cmd cmd5))) 0 @@ -1080,7 +1082,7 @@ (set-time! (-> this arm-start-time)) (sound-play "gtarget-explode") (let ((s5-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-1 spawn-point quad) (-> this root trans quad)) + (vector-copy! (-> s5-1 spawn-point) (-> this root trans)) (quaternion-identity! (-> s5-1 spawn-quat)) (set! (-> s5-1 radius) 24576.0) (set! (-> s5-1 scale) 1.0) @@ -1245,8 +1247,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -1299,7 +1301,7 @@ ((3) (let ((s5-0 (new 'stack-no-clear 'primary-target-pos-vel))) (send-event (ppointer->process (-> this parent)) 'get-player-pos-vel s5-0) - (set! (-> this gun-info last-known-player-pos quad) (-> s5-0 position quad)) + (vector-copy! (-> this gun-info last-known-player-pos) (-> s5-0 position)) ) (if (not (and *target* (not (logtest? (-> *target* focus-status) (focus-status disable dead ignore grabbed))))) (set! (-> this gun-info next-fire-time) (generate-next-fire-time (-> this gun-info fire-speed-scalar))) diff --git a/goal_src/jak3/levels/gungame/gungame-manager.gc b/goal_src/jak3/levels/gungame/gungame-manager.gc index 65a386d6387..fce1417feb8 100644 --- a/goal_src/jak3/levels/gungame/gungame-manager.gc +++ b/goal_src/jak3/levels/gungame/gungame-manager.gc @@ -167,8 +167,8 @@ ) (when s4-0 (let ((s5-1 (new 'stack-no-clear 'primary-target-pos-vel))) - (set! (-> s5-1 position quad) (-> (get-trans s4-0 3) quad)) - (set! (-> s5-1 velocity quad) (-> (get-transv s4-0) quad)) + (vector-copy! (-> s5-1 position) (get-trans s4-0 3)) + (vector-copy! (-> s5-1 velocity) (get-transv s4-0)) (set! (-> s5-1 time) (the-as uint (current-time))) (if (>= (- (-> s5-1 time) (-> this primary-target-history 1 time)) (the-as uint 30)) (qmem-copy->! @@ -863,6 +863,7 @@ ) (defmethod init-from-entity! ((this training-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (length "training-path-")) (a0-3 (length (-> this name))) (v1-2 0) @@ -996,7 +997,7 @@ ) (dotimes (s3-0 (-> this actor-group 2 length)) (when (not (handle->process (-> this course-crates s3-0))) - (set! (-> s5-0 quad) (-> this actor-group 2 data s3-0 actor trans quad)) + (vector-copy! s5-0 (-> this actor-group 2 data s3-0 actor trans)) (set! (-> s5-0 w) 1.0) (gungame-manager-method-28 this s5-0) (format 0 "Name is ~s~%" (-> this actor-group 2 data s3-0 actor)) @@ -1030,7 +1031,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (set-vector! (-> s5-0 move-dist) 0.0 -8192.0 0.0 1.0) (let ((v1-2 s5-0)) (set! (-> v1-2 radius) 40.96) @@ -1269,7 +1270,7 @@ (defstate wait-load (gungame-mgr-rnc) :virtual #t :code (behavior () - (until (= (status-of-level-and-borrows *level* 'lgunrnc #f) 'active) + (until (= (level-status? *level* 'lgunrnc #f) 'active) (suspend) ) (go-virtual wait-start) @@ -1398,7 +1399,7 @@ (defstate wait-load (gungame-mgr-1) :virtual #t :code (behavior () - (until (= (status-of-level-and-borrows *level* 'lgunnorm #f) 'active) + (until (= (level-status? *level* 'lgunnorm #f) 'active) (suspend) ) (go-virtual wait-start) @@ -1408,7 +1409,7 @@ (defstate wait-load (gungame-mgr-2) :virtual #t :code (behavior () - (until (= (status-of-level-and-borrows *level* 'lgunnorm #f) 'active) + (until (= (level-status? *level* 'lgunnorm #f) 'active) (suspend) ) (go-virtual wait-start) @@ -1440,7 +1441,7 @@ (defstate wait-load (gungame-mgr-4) :virtual #t :code (behavior () - (until (= (status-of-level-and-borrows *level* 'lgunrnc #f) 'active) + (until (= (level-status? *level* 'lgunrnc #f) 'active) (suspend) ) (go-virtual wait-start) @@ -1611,8 +1612,10 @@ (set-setting! 'features 'clear (shr t1-0 32) t1-0) ) (if (>= 1 (-> self course-list length)) - (suspend-for (seconds 1)) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 1) + ) + (suspend-for (seconds 0.5) + ) ) (let ((gp-2 (get-process *default-dead-pool* (-> self activated-course etype) #x4000 1))) (when gp-2 diff --git a/goal_src/jak3/levels/gungame/gungame-obs.gc b/goal_src/jak3/levels/gungame/gungame-obs.gc index 59f90560091..14d02217f68 100644 --- a/goal_src/jak3/levels/gungame/gungame-obs.gc +++ b/goal_src/jak3/levels/gungame/gungame-obs.gc @@ -135,7 +135,9 @@ :event gungame-door-handler :code (behavior () (sound-play "gungame-door") - (suspend-for (seconds 0.2) (suspend)) + (suspend-for (seconds 0.2) + (suspend) + ) (ja-no-eval :group! fort-entry-gate-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -256,6 +258,7 @@ ) (defmethod init-from-entity! ((this gungame-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak3/levels/hiphog/hiphog-scenes.gc b/goal_src/jak3/levels/hiphog/hiphog-scenes.gc index 64e5091b252..d36fcd56689 100644 --- a/goal_src/jak3/levels/hiphog/hiphog-scenes.gc +++ b/goal_src/jak3/levels/hiphog/hiphog-scenes.gc @@ -37,6 +37,7 @@ ) (defmethod init-from-entity! ((this hip-door-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -106,6 +107,7 @@ ) (defmethod init-from-entity! ((this hip-mirror) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -120,7 +122,7 @@ (defun hiphog-activate () (let ((a0-1 (entity-by-name "hip-mirror-2"))) (when a0-1 - (set! (-> *math-camera* mirror-trans quad) (-> a0-1 extra trans quad)) + (vector-copy! (-> *math-camera* mirror-trans) (-> a0-1 extra trans)) (vector-rotate-y! (-> *math-camera* mirror-normal) (new 'static 'vector :x 1.0 :w 1.0) -10297.162) ) ) diff --git a/goal_src/jak3/levels/intro/intro-obs.gc b/goal_src/jak3/levels/intro/intro-obs.gc index cef1ca7ae4a..58d85696a13 100644 --- a/goal_src/jak3/levels/intro/intro-obs.gc +++ b/goal_src/jak3/levels/intro/intro-obs.gc @@ -36,6 +36,7 @@ ) (defmethod init-from-entity! ((this ctypal-ctyfarma) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc b/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc index afd92960968..9c541b69c66 100644 --- a/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc +++ b/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc @@ -264,7 +264,7 @@ ) 0 (let ((gp-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) - (set! (-> gp-1 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 325 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -315,7 +315,7 @@ (set! sv-688 (new 'stack-no-clear 'collide-query)) (set! sv-704 (the-as symbol #f)) (set! sv-768 (new 'stack-no-clear 'vector)) - (set! (-> sv-688 start-pos quad) (-> arg1 quad)) + (vector-copy! (-> sv-688 start-pos) arg1) (set! sv-720 (-> sv-688 move-dist)) (set! (-> sv-720 x) (rand-vu-float-range 0.0 65536.0)) (set! (-> sv-720 y) (rand-vu-float-range 0.0 65536.0)) @@ -339,7 +339,7 @@ ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) (set-time! (-> s5-0 last-valid-time)) - (set! (-> sv-768 quad) (-> sv-688 best-other-tri intersect quad)) + (vector-copy! sv-768 (-> sv-688 best-other-tri intersect)) (when (< 16384.0 (vector-vector-distance sv-768 (-> sv-688 start-pos))) (set! sv-704 #t) (goto cfg-7) @@ -373,7 +373,7 @@ (a0-26 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (vector-copy! (-> a2-5 trans) (-> s5-0 end-pos)) (t9-12 a0-26 arg4 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -499,7 +499,7 @@ ) (sound-play "de-tower-zap" :id (-> self plasma-sound) :position (-> self root trans)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> self root trans quad)) + (vector-copy! s3-0 (-> self root trans)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-2 (new 'stack-no-clear 'vector)) (gp-2 (new 'stack-no-clear 'vector)) @@ -510,10 +510,10 @@ ) (set! (-> s3-0 y) (+ f0-6 (- f1-3 (* (the float (the int (/ f1-3 f2-3))) f2-3)))) ) - (set! (-> gp-2 quad) (-> s3-0 quad)) + (vector-copy! gp-2 s3-0) (sound-play "tree-shocker" :id (-> self shock-sound) :position gp-2) (+! (-> s3-0 x) 28672.0) - (set! (-> s4-0 start-pos quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 start-pos) s3-0) (vector-float*! (-> s4-0 move-dist) *x-vector* -40960.0) (let ((v1-39 s4-0)) (set! (-> v1-39 radius) 2048.0) @@ -529,7 +529,7 @@ (s3-1 (-> self discs)) ) (when (>= f0-12 0.0) - (set! (-> s5-2 quad) (-> s4-0 best-other-tri intersect quad)) + (vector-copy! s5-2 (-> s4-0 best-other-tri intersect)) (let ((s4-1 *x-vector*) (f30-0 9362.286) (s2-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> s3-1 0 orient))) @@ -563,7 +563,7 @@ (set! (-> gp-3 spans data a0-37 random-offset-size-start) 4096.0) (set! (-> gp-3 spans-internal data a0-37 num-inner-points) 2) (set! (-> gp-3 spans data a0-37 inner-random-offset-size) 4096.0) - (set! (-> gp-3 span-pts-start data a0-37 quad) (-> v1-55 pts a0-37 quad)) + (vector-copy! (-> gp-3 span-pts-start data a0-37) (-> v1-55 pts a0-37)) ) (set! (-> gp-3 spans data 0 random-offset-size-start) 0.0) (set! (-> gp-3 spans data 7 random-offset-size-start) 0.0) @@ -667,9 +667,9 @@ (set! (-> self shock-sound) (new-sound-id)) (set! (-> self plasma-sound) (new-sound-id)) (set! (-> self entity) arg0) - (set! (-> self root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> self root trans) (-> arg0 extra trans)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) - (set! (-> self root scale quad) (-> (res-lump-struct arg0 'scale vector) quad)) + (vector-copy! (-> self root scale) (res-lump-struct arg0 'scale vector)) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-orb" (the-as (pointer level) #f))) @@ -736,7 +736,7 @@ (set! (-> self root) s4-0) ) (quaternion-identity! (-> self root quat)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set-vector! (-> self root scale) arg1 arg1 arg1 1.0) (set! (-> self shock-sound) (new-sound-id)) (set! (-> self plasma-sound) (new-sound-id)) @@ -836,6 +836,7 @@ ) (defmethod init-from-entity! ((this dark-eco-tower) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -886,9 +887,9 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> self root trans) (-> arg0 extra trans)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) - (set! (-> self root scale quad) (-> (res-lump-struct arg0 'scale vector) quad)) + (vector-copy! (-> self root scale) (res-lump-struct arg0 'scale vector)) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-tower" (the-as (pointer level) #f))) @@ -1255,8 +1256,8 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self root trans quad)) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! s5-0 (-> self root trans)) + (vector-copy! gp-0 (-> self root trans)) (let ((s2-0 s5-0)) (let ((s4-0 s5-0)) (let ((s3-0 *x-vector*)) @@ -1375,7 +1376,7 @@ (a1-10 sv-52) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> s5-0 quad)) + (vector-copy! (-> a2-3 trans) s5-0) (t9-10 a0-20 a1-10 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (let ((t9-11 sp-launch-particles-var) @@ -1383,7 +1384,7 @@ (a1-11 sv-52) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> gp-0 quad)) + (vector-copy! (-> a2-4 trans) gp-0) (t9-11 a0-21 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1395,6 +1396,7 @@ ) (defmethod init-from-entity! ((this grind-electricity) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (go (method-of-object this idle)) diff --git a/goal_src/jak3/levels/mhcity/mhcity-obs.gc b/goal_src/jak3/levels/mhcity/mhcity-obs.gc index 10269b2ad90..73d43bd05b6 100644 --- a/goal_src/jak3/levels/mhcity/mhcity-obs.gc +++ b/goal_src/jak3/levels/mhcity/mhcity-obs.gc @@ -727,6 +727,7 @@ ) (defmethod init-from-entity! ((this mhcity-dark-eco-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -798,7 +799,7 @@ (defbehavior mhcity-dark-eco-door-broken-init-by-other mhcity-dark-eco-door-broken ((arg0 process-drawable)) (set! (-> self level) (level-get *level* 'mhcitya)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (initialize-skeleton self @@ -843,15 +844,15 @@ :virtual #t :code (behavior () (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> self root trans quad)) + (vector-copy! v1-0 (-> self root trans)) (+! (-> v1-0 y) 40960.0) (cond ((logtest? (-> *part-group-id-table* 327 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-0 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 327)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-0 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 327)) ) ) @@ -862,7 +863,8 @@ (ja :num! (seek!)) ) (logior! (-> self draw status) (draw-control-status no-draw)) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (task-node-close! (game-task-node city-destroy-darkeco-resolution) 'event) (sleep-code) ) @@ -915,7 +917,8 @@ (label cfg-9) (ja-channel-push! 1 (seconds 0.5)) (ja :group! mhcity-dark-eco-door-idle-ja :num! (seek! 15.0) :frame-num 15.0) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (go-virtual cracked) ) #f @@ -1017,6 +1020,7 @@ (define *darkeco-nodule-task-nodes* (the-as array (new 'static 'boxed-array :type uint16))) (defmethod init-from-entity! ((this mhcity-dark-eco-nodule) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (initialize-skeleton this @@ -1077,15 +1081,16 @@ (sound-play "egg-explode") (cond ((logtest? (-> *part-group-id-table* 326 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 326)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 326)) ) ) - (suspend-for (seconds 0.1)) + (suspend-for (seconds 0.1) + ) (process-entity-status! self (entity-perm-status dead) #t) ) :post ja-post @@ -1146,11 +1151,11 @@ (sound-play "egg-explode") (cond ((logtest? (-> *part-group-id-table* 325 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 325)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 325)) ) ) @@ -1174,7 +1179,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this mhcity-ambient-killable)) +(defmethod get-search-info-flag ((this mhcity-ambient-killable)) + "Get search-info-flag for this process." (the-as search-info-flag 2) ) @@ -1233,6 +1239,7 @@ ) (defmethod init-from-entity! ((this mhcity-vein-writhing-large) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (initialize-skeleton @@ -1279,6 +1286,7 @@ ) (defmethod init-from-entity! ((this mhcity-vein-writhing-small) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (initialize-skeleton @@ -1330,6 +1338,7 @@ ) (defmethod init-from-entity! ((this mhcity-claw-finger-small) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this sphere-size) 12288.0) (set! (-> this hit-points) 1.0) (set! (-> this drop-type) 7) @@ -1477,6 +1486,7 @@ ) (defmethod init-from-entity! ((this mhcity-twitch-blade) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1517,6 +1527,7 @@ ) (defmethod init-from-entity! ((this mhcity-vine-wriggler) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1562,6 +1573,7 @@ ) (defmethod init-from-entity! ((this mhcity-vine-wriggler-big) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1607,6 +1619,7 @@ ) (defmethod init-from-entity! ((this mhcity-de-tower-undervines) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1652,6 +1665,7 @@ ) (defmethod init-from-entity! ((this mhcity-grunt-egg-c) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1694,6 +1708,7 @@ ) (defmethod init-from-entity! ((this mhcity-grunt-egg-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1736,6 +1751,7 @@ ) (defmethod init-from-entity! ((this mhcity-grunt-egg-d) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1778,6 +1794,7 @@ ) (defmethod init-from-entity! ((this mhcity-grunt-egg-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1825,6 +1842,7 @@ ) (defmethod init-from-entity! ((this mhcity-tower-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/goal_src/jak3/levels/mhcity/mhcity-obs2.gc b/goal_src/jak3/levels/mhcity/mhcity-obs2.gc index 2fa10c25b0e..866ca1153e5 100644 --- a/goal_src/jak3/levels/mhcity/mhcity-obs2.gc +++ b/goal_src/jak3/levels/mhcity/mhcity-obs2.gc @@ -59,6 +59,7 @@ ) (defmethod init-from-entity! ((this mhcity-puffer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this 1.0) (process-drawable-from-entity! this arg0) (process-drawable-scale-from-entity! this arg0) @@ -118,7 +119,7 @@ (defbehavior puffer-init-by-other mhcity-puffer ((arg0 puffer-init-by-other-params)) (set! (-> self level) (level-get *level* 'lctydest)) (init-collision! self (-> arg0 scale)) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 orient)) (initialize-skeleton self @@ -223,7 +224,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('move-to) - (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self root trans) (the-as vector (-> block param 0))) (quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 1))) ) ) diff --git a/goal_src/jak3/levels/mhcity/mhcity-part.gc b/goal_src/jak3/levels/mhcity/mhcity-part.gc index bbef08b6bb0..33e10ec1b4d 100644 --- a/goal_src/jak3/levels/mhcity/mhcity-part.gc +++ b/goal_src/jak3/levels/mhcity/mhcity-part.gc @@ -858,6 +858,7 @@ (defmethod init-from-entity! ((this bubbles-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -920,12 +921,12 @@ (s2-2 (vector-! (new 'stack-no-clear 'vector) s4-2 (-> self path curve cverts s5-1))) ) (let ((a0-16 s3-3)) - (set! (-> a0-16 quad) (-> s3-3 quad)) + (vector-copy! a0-16 s3-3) (set! (-> a0-16 y) 0.0) (vector-normalize! a0-16 1.0) ) (let ((a0-17 s2-2)) - (set! (-> a0-17 quad) (-> s2-2 quad)) + (vector-copy! a0-17 s2-2) (set! (-> a0-17 y) 0.0) (vector-normalize! a0-17 1.0) ) @@ -934,7 +935,7 @@ ) ) ) - (set! (-> gp-0 trans quad) (-> s4-2 quad)) + (vector-copy! (-> gp-0 trans) s4-2) (launch-particles (-> *part-id-table* 1371) gp-0 :origin-is-matrix #t) (+! f28-2 (rand-vu)) ) diff --git a/goal_src/jak3/levels/mine/gekko.gc b/goal_src/jak3/levels/mine/gekko.gc index 80d9eddf947..f2fc330b6c7 100644 --- a/goal_src/jak3/levels/mine/gekko.gc +++ b/goal_src/jak3/levels/mine/gekko.gc @@ -247,34 +247,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp -1.0 - :knocked-soft-vxz-lo 113049.6 - :knocked-soft-vxz-hi 149094.4 - :knocked-soft-vy-lo 122880.0 - :knocked-soft-vy-hi 163840.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 27.6) + :knocked-soft-vxz-hi (meters 36.4) + :knocked-soft-vy-lo (meters 30) + :knocked-soft-vy-hi (meters 40) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x -0.9169 :y -0.314 :z 0.2441 :w 2358.841) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -729,6 +729,7 @@ (set! (-> *gekko-nav-enemy-info* fact-defaults) *fact-info-gekko-defaults*) (defmethod init-enemy-collision! ((this gekko)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1054,7 +1055,7 @@ (ja-channel-push! 1 (seconds 0.017)) (ja-no-eval :group! (-> self draw art-group data gp-3) :num! (loop!) :frame-num 0.0) ) - (until (enemy-method-104 self (-> self turn-face-point) 910.2222) + (until (pointing-toward? self (-> self turn-face-point) 910.2222) (suspend) (ja :num! (loop!)) ) @@ -1117,7 +1118,7 @@ (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node gekko-lod0-jg head))) (s4-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-1 quad) (-> self focus-pos quad)) + (vector-copy! s4-1 (-> self focus-pos)) (set! (-> s4-1 y) (- (-> s4-1 y) (* 4096.0 (rnd-float-range self 0.0 10.0)))) (sound-play "gekko-shot") (spawn-metalhead-projectile (the-as metalhead-shot self) s5-1 s4-1 532480.0) @@ -1223,15 +1224,15 @@ ) (when (not (logtest? (-> self root root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-20 (-> self root dynam gravity-normal))) - (set! (-> self root local-normal quad) (-> v1-20 quad)) - (set! (-> self root surface-normal quad) (-> v1-20 quad)) - (set! (-> self root poly-normal quad) (-> v1-20 quad)) + (vector-copy! (-> self root local-normal) v1-20) + (vector-copy! (-> self root surface-normal) v1-20) + (vector-copy! (-> self root poly-normal) v1-20) ) (set! (-> self root coverage) 0.0) (set! (-> self root touch-angle) 0.0) ) (logior! (-> self focus-status) (focus-status dangerous)) - (enemy-method-50 self 3) + (update-collision-action self 3) (dotimes (gp-0 4) (enable-set! (-> self foot gp-0 leg-ik) #f) ) @@ -1326,7 +1327,7 @@ ) :exit (behavior () (local-vars (v1-9 enemy-flag) (v1-11 enemy-flag) (v1-13 enemy-flag)) - (enemy-method-50 self 0) + (update-collision-action self 0) (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -1359,7 +1360,7 @@ (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) ) :trans (behavior () - (if (and (time-elapsed? (-> self state-time) (seconds 0.2)) (within-gspot-range? self)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.2)) (invalid-height? self)) (go-die self) ) ) @@ -1378,9 +1379,9 @@ (ja :num! (seek!)) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) - (go-best-state self) + (go-state-for-focused self) ) ) :post (behavior () @@ -1409,12 +1410,12 @@ 24 ) ) - (s4-0 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (s4-0 (rnd-time-frame self (seconds 0.007) (seconds 0.017))) (gp-0 (new 'stack-no-clear 'vector)) ) (nav-enemy-method-164 self) (let ((a1-2 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-2 target-pos quad)) + (vector-copy! gp-0 (-> a1-2 target-pos)) ) (let ((v1-13 self)) (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logclear (-> v1-13 enemy-flags) (enemy-flag ef37)))) @@ -1432,7 +1433,7 @@ (ja :num! (seek! max f30-1)) ) ) - (when (not (enemy-method-104 self gp-0 8192.0)) + (when (not (pointing-toward? self gp-0 8192.0)) (let ((v1-48 self)) (set! (-> v1-48 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-48 enemy-flags)))) ) @@ -1453,7 +1454,7 @@ (set! f28-0 (* -1.0 f28-0)) ) ) - (until (enemy-method-104 self gp-0 6371.5557) + (until (pointing-toward? self gp-0 6371.5557) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* -81920.0 (seconds-per-frame) f28-0)) (suspend) (ja :num! (loop! f30-2)) @@ -1473,7 +1474,7 @@ 14 ) ) - (s4-1 (set-reaction-time! self (seconds 0.017) (seconds 0.027))) + (s4-1 (rnd-time-frame self (seconds 0.017) (seconds 0.027))) ) (let ((v1-95 self)) (if (not (logtest? (enemy-flag ef37) (-> v1-95 enemy-flags))) @@ -1517,7 +1518,7 @@ ) (until #f (cond - ((enemy-method-104 self (-> self focus-pos) 8192.0) + ((pointing-toward? self (-> self focus-pos) 8192.0) (let ((v1-10 self)) (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) ) @@ -1536,7 +1537,7 @@ (ja :num! (seek! max f30-1)) ) ) - ((or (enemy-method-104 self (-> self focus-pos) 30947.555) (rnd-chance? self 0.3)) + ((or (pointing-toward? self (-> self focus-pos) 30947.555) (rnd-chance? self 0.3)) (let ((v1-50 self)) (set! (-> v1-50 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-50 enemy-flags)))) ) @@ -1551,7 +1552,7 @@ (ja-no-eval :group! gekko-turn-left0-ja :num! (loop! f28-0) :frame-num 0.0) (ja-no-eval :group! gekko-turn-right0-ja :num! (loop! f28-0) :frame-num 0.0) ) - (until (enemy-method-104 self (-> self focus-pos) 6371.5557) + (until (pointing-toward? self (-> self focus-pos) 6371.5557) (suspend) (ja :num! (loop! f28-0)) ) @@ -1653,14 +1654,14 @@ (set! (-> s4-1 y) 0.0) (vector-xz-normalize! s4-1 24576.0) (vector+! gp-0 (-> self focus-pos) s4-1) - (set! (-> s5-0 quad) (-> gp-0 quad)) + (vector-copy! s5-0 gp-0) (closest-point-on-mesh (-> self nav) s5-0 gp-0 (the-as nav-poly #f)) - (set! (-> self move-dest quad) (-> s5-0 quad)) + (vector-copy! (-> self move-dest) s5-0) ) (let ((v1-8 (-> self nav state))) (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-8 target-pos) gp-0) ) ) 0 @@ -1680,7 +1681,7 @@ (when (time-elapsed? (-> self state-time) (seconds 0.3)) (cond ((and (get-focus! self) - (enemy-method-104 self (-> self focus-pos) 8192.0) + (pointing-toward? self (-> self focus-pos) 8192.0) (let ((f0-0 (vector-vector-distance (-> self root trans) (-> self focus-pos)))) (< f0-0 40960.0) (and (< 4096.0 f0-0) (gekko-method-204 self)) @@ -1690,7 +1691,7 @@ ) (else (set! (-> self scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 0.8 2.1))))) - (go-best-state self) + (go-state-for-focused self) ) ) ) @@ -1796,7 +1797,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-chase-post ) @@ -1817,8 +1818,8 @@ (logclear! (-> self flags) (gekko-flag follow-terrain)) ) :trans (behavior () - (if (enemy-method-104 self (-> self focus-pos) 2730.6667) - (go-best-state self) + (if (pointing-toward? self (-> self focus-pos) 2730.6667) + (go-state-for-focused self) ) ) :code (behavior () @@ -1877,7 +1878,7 @@ (if (nav-enemy-method-174 self) (go-stare2 self) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -1950,7 +1951,7 @@ (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) (suspend-for (seconds 0.4) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -2011,7 +2012,7 @@ (let ((v1-2 1) (a0-2 (new 'stack-no-clear 'inline-array 'vector 1)) ) - (set! (-> a0-2 0 quad) (-> s3-0 trans quad)) + (vector-copy! (-> a0-2 0) (-> s3-0 trans)) (set! (-> a0-2 0 w) (+ 409.6 sv-560 (sqrtf (+ (* 25600.0 (-> gp-0 scale) (-> gp-0 scale)) (* (/ f30-0 4) f30-0)))) ) @@ -2069,14 +2070,14 @@ (vector-normalize! sv-696 1.0) ) (else - (set! (-> sv-692 quad) (-> sv-1008 quad)) + (vector-copy! sv-692 sv-1008) (set! (-> sv-692 y) (-> gp-0 root gspot-pos y)) - (set! (-> sv-696 quad) (-> gp-0 rot-matrix uvec quad)) + (vector-copy! sv-696 (-> gp-0 rot-matrix uvec)) ) ) (if (logtest? (-> gp-0 flags) (gekko-flag on-wall?)) - (set! (-> s0-0 ground-normal quad) (-> sv-696 quad)) - (set! (-> s0-0 ground-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> s0-0 ground-normal) sv-696) + (vector-copy! (-> s0-0 ground-normal) *y-vector*) ) (when (logtest? (-> gp-0 flags) (gekko-flag update-foot-position?)) (set! sv-992 intersect-ray-plane) @@ -2172,7 +2173,7 @@ (vector-normalize-copy! (-> gp-0 gspot-normal) s1-1 1.0) ) (when (logtest? (-> gp-0 flags) (gekko-flag follow-terrain)) - (set! (-> gp-0 root gspot-pos quad) (-> s2-1 quad)) + (vector-copy! (-> gp-0 root gspot-pos) s2-1) (let ((a2-15 (vector-! (new 'stack-no-clear 'vector) s2-1 (-> s3-0 trans)))) (vector+float*! (-> s3-0 trans) @@ -2242,15 +2243,15 @@ (f30-0 (sqrtf (+ (* (-> v1-6 x) (-> v1-6 x)) (* (-> v1-6 z) (-> v1-6 z))))) ) (cond - ((and (get-focus! this) (and (and (< f30-0 32768.0) (< 16384.0 f30-0)) (enemy-method-104 this s5-0 6371.5557))) + ((and (get-focus! this) (and (and (< f30-0 32768.0) (< 16384.0 f30-0)) (pointing-toward? this s5-0 6371.5557))) (go (method-of-object this pre-attack)) ) ((< 32768.0 f30-0) (cond - ((not (enemy-method-104 this s5-0 29127.111)) + ((not (pointing-toward? this s5-0 29127.111)) (go (method-of-object this turn-quick)) ) - ((not (enemy-method-104 this s5-0 6371.5557)) + ((not (pointing-toward? this s5-0 6371.5557)) (go (method-of-object this turn)) ) ) @@ -2258,7 +2259,7 @@ ) ) (set! (-> this scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 1.3 2.25))))) - (go-best-state this) + (go-state-for-focused this) ) 0 (none) @@ -2267,7 +2268,7 @@ ;; WARN: Return type mismatch symbol vs none. (defmethod gekko-method-204 ((this gekko)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this root trans)) (let* ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (closest-point-on-mesh (-> this nav) s5-0 s3-0 (the-as nav-poly #f))) ) @@ -2286,7 +2287,8 @@ (none) ) -(defmethod is-pfoc-in-mesh? ((this gekko) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this gekko) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (and arg0 (not arg1)) (set! arg1 (get-trans arg0 1)) ) @@ -2313,7 +2315,9 @@ ) ) -(defmethod enemy-method-109 ((this gekko)) +(defmethod out-of-bounds? ((this gekko)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (let ((gp-0 (-> this root)) (s3-0 (-> this nav state)) ) @@ -2321,7 +2325,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (cond ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ) (else (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) @@ -2354,13 +2358,14 @@ ;; WARN: Return type mismatch object vs none. (defmethod gekko-method-207 ((this gekko)) (set-look-at-mode! this 1) - (set! (-> this turn-face-point quad) (-> this focus-pos quad)) + (vector-copy! (-> this turn-face-point) (-> this focus-pos)) (set! (-> this turn-next-state) (method-of-type gekko attack-wall)) (go (method-of-object this turn-wall)) (none) ) (defmethod get-focus! ((this gekko)) + "If we're focusing on something alive, return it." (let* ((t9-0 (method-of-type nav-enemy get-focus!)) (v0-0 (t9-0 this)) ) @@ -2399,8 +2404,8 @@ (set! s2-0 (mod (+ s2-0 1) s5-0)) ) (label cfg-11) - (set! (-> this move-dest quad) (-> s4-0 quad)) - (set! (-> this turn-face-point quad) (-> s4-0 quad)) + (vector-copy! (-> this move-dest) s4-0) + (vector-copy! (-> this turn-face-point) s4-0) ) ) (vector-! (-> this dest-to-me-dir) (-> this root trans) (-> this move-dest)) @@ -2411,7 +2416,8 @@ ) ;; WARN: disable def twice: 33. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod enemy-method-108 ((this gekko) (arg0 process-focusable)) +(defmethod should-flee-from? ((this gekko) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (< (current-time) (-> this scared-timer)) (let ((v1-4 (handle->process (-> this focus handle)))) (if v1-4 @@ -2429,6 +2435,7 @@ ) (defmethod knocked-anim ((this gekko) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (cond ((logtest? (-> this flags) (gekko-flag falling-off-wall?)) @@ -2458,6 +2465,7 @@ ) (defmethod knocked-land-anim ((this gekko) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-2 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) @@ -2503,6 +2511,7 @@ ) (defmethod go-hostile ((this gekko)) + "Go to the hostile state, actively trying to attack the target." (if (logtest? (-> this flags) (gekko-flag on-wall?)) (gekko-method-206 this) (go (method-of-object this hostile)) @@ -2510,6 +2519,7 @@ ) (defmethod get-knockback-dir! ((this gekko) (arg0 vector)) + "Compute the knockback direction for an incoming attack." (local-vars (v1-2 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2517,7 +2527,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + (vector-copy! arg0 (-> this incoming attack-direction)) (.lvf vf1 (&-> arg0 quad)) (.add.w.vf.x vf2 vf0 vf0) (.mul.vf vf1 vf1 vf1) @@ -2536,6 +2546,7 @@ ;; WARN: Return type mismatch vector vs object. (defmethod knocked-handler ((this gekko) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (let ((s4-0 (-> this enemy-info)) (f28-0 0.0) @@ -2610,7 +2621,7 @@ ) ) ((= v1-2 (knocked-type vehicle)) - (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + (vector-copy! arg0 (-> this incoming attack-direction)) f30-0 ) (else @@ -2628,11 +2639,12 @@ ) ) -(defmethod enemy-method-103 ((this gekko) (arg0 vector) (arg1 float)) +(defmethod heading-matches-direction? ((this gekko) (arg0 vector) (arg1 float)) + "Does this enemy's heading match the given heading? Threshold in degrees." (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (vector-flatten! s4-0 s4-0 (-> this rot-matrix uvec)) (vector-normalize! s4-0 1.0) (vector-flatten! s5-0 s5-0 (-> this rot-matrix uvec)) @@ -2643,6 +2655,7 @@ ;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this gekko)) + "Has the ragdoll stopped moving?" (local-vars (v1-18 gekko-shadow-spot)) (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (or (not s5-0) @@ -2667,7 +2680,7 @@ (let ((s4-0 (-> this foot s5-0)) (s3-0 (-> *gekko-ik-setup* s5-0)) ) - (set! (-> s4-0 ground-normal quad) (-> this rot-matrix uvec quad)) + (vector-copy! (-> s4-0 ground-normal) (-> this rot-matrix uvec)) (vector<-cspace! (-> s4-0 ground-pos) (-> this node-list data (-> s3-0 hand-index))) (vector+float*! (-> s4-0 ground-pos) (-> s4-0 ground-pos) (-> s4-0 ground-normal) (-> s3-0 hand-dist)) ) @@ -2676,15 +2689,17 @@ (none) ) -(defmethod send-attack ((this gekko) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this gekko) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (sound-play "gekko-impact") - ((method-of-type nav-enemy send-attack) this arg0 arg1 arg2) + ((method-of-type nav-enemy send-attack-from-tshape) this arg0 arg1 arg2) ) (defmethod enemy-common-post ((this gekko)) + "Common implementation of post. Runs ja-post." (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-2) 3)) ) ) (if (and (nonzero? (-> this path-wall)) (not (logtest? (-> this path-wall flags) (path-control-flag not-found)))) @@ -2707,7 +2722,7 @@ (s5-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this rot-matrix uvec))) (f30-0 81920.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) s5-0 f30-0) (let ((v1-10 s4-0)) (set! (-> v1-10 radius) 3276.8) @@ -2771,7 +2786,8 @@ (none) ) -(defmethod enemy-method-50 ((this gekko) (arg0 int)) +(defmethod update-collision-action ((this gekko) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((or (zero? v1-0) (= v1-0 2)) @@ -2807,6 +2823,7 @@ ) (defmethod event-handler ((this gekko) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -2818,7 +2835,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -2836,6 +2853,7 @@ ) (defmethod coin-flip? ((this gekko)) + "Return #t half the time, #f the other." #f ) @@ -2852,12 +2870,13 @@ ) (defmethod init-enemy! ((this gekko)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-gekko" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *gekko-nav-enemy-info*) + (setup-enemy! this *gekko-nav-enemy-info*) (set! (-> this scale) (rnd-float-range this 1.15 1.35)) (let ((f0-1 (-> this scale))) (set-vector! (-> this root scale) f0-1 f0-1 f0-1 1.0) @@ -2888,7 +2907,7 @@ (set! (-> a0-18 param1) this) (set! (-> a0-18 param2) (the-as basic s4-1)) ) - (set! (-> s4-1 foot-transform scale quad) (-> *identity-vector* quad)) + (vector-copy! (-> s4-1 foot-transform scale) *identity-vector*) ) ) (logior! (-> this foot 2 leg-ik flags) (joint-mod-ik-flags elbow-trans-neg)) @@ -2922,7 +2941,8 @@ (none) ) -(defmethod within-gspot-range? ((this gekko)) +(defmethod invalid-height? ((this gekko)) + "Return #t if the enemy is too high in the air, or below the ground." (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) diff --git a/goal_src/jak3/levels/mine/manta.gc b/goal_src/jak3/levels/mine/manta.gc index cd8f2d9fc51..34ebbc3709d 100644 --- a/goal_src/jak3/levels/mine/manta.gc +++ b/goal_src/jak3/levels/mine/manta.gc @@ -153,34 +153,34 @@ :ragdoll-rotate-velocity-mult 1.0 :jump-height-min (meters 3) :jump-height-factor 0.5 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 57344.0 - :knocked-red-vxz-hi 57344.0 - :knocked-red-vy-lo 81920.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 14) + :knocked-red-vxz-hi (meters 14) + :knocked-red-vy-lo (meters 20) + :knocked-red-vy-hi (meters 20) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -219,6 +219,7 @@ (set! (-> *manta-nav-enemy-info* fact-defaults) *fact-info-manta-defaults*) (defmethod init-enemy-collision! ((this manta)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -308,7 +309,7 @@ (vector-rotate-y! gp-1 gp-1 (* (-> self orbit-speed) (seconds-per-frame))) (vector-xz-normalize! gp-1 81920.0) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> s4-0 trans quad)) + (vector-copy! s2-0 (-> s4-0 trans)) (let ((s5-0 (-> self dest-pos))) (closest-point-on-mesh (-> self nav) s2-0 (-> s4-0 trans) (the-as nav-poly #f)) (cond @@ -327,7 +328,7 @@ (let ((v1-15 (-> self nav state))) (logclear! (-> v1-15 flags) (nav-state-flag directional-mode)) (logior! (-> v1-15 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-15 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-15 target-pos) s5-0) ) ) ) @@ -344,7 +345,7 @@ (set! (-> self offset-difference) (- (-> self dest-pos y) (-> self root trans y))) (vector-! (-> self forward-dir) (-> self focus-pos) (-> self root trans)) (vector-normalize! (-> self forward-dir) 1.0) - (set! (-> self up-dir quad) (-> *y-vector* quad)) + (vector-copy! (-> self up-dir) *y-vector*) (manta-method-200 self) (do-impact self) (manta-method-203 self -4096.0) @@ -491,8 +492,8 @@ (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) - (set! (-> self landed-pos quad) (-> self root trans quad)) + (move-to-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (vector-copy! (-> self landed-pos) (-> self root trans)) (logior! (-> self draw status) (draw-control-status no-draw)) ) :exit (behavior () @@ -509,9 +510,9 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (until #f - (let ((s5-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (let ((s5-0 (rnd-time-frame self (seconds 0.007) (seconds 0.015))) (f28-0 (rnd-float-range self 0.5 0.3)) - (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.01))) (f30-0 (rnd-float-range self 0.5 0.3)) ) (dotimes (s4-0 s5-0) @@ -548,14 +549,14 @@ (logclear! (-> self flags) (manta-flags mf0)) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) - (set! (-> self dest-pos quad) (-> self landed-pos quad)) + (vector-copy! (-> self dest-pos) (-> self landed-pos)) (set! (-> self dest-pos y) (+ 8192.0 (-> self default-y-offset) (-> self landed-pos y))) (let ((a0-7 (-> self nav state)) (v1-9 (-> self dest-pos)) ) (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-7 target-pos quad) (-> v1-9 quad)) + (vector-copy! (-> a0-7 target-pos) v1-9) ) 0 (set! (-> self go-enable) #t) @@ -598,7 +599,7 @@ :event enemy-event-handler :enter (behavior () (logclear! (-> self flags) (manta-flags mf0)) - (set! (-> self dest-pos quad) (-> self landed-pos quad)) + (vector-copy! (-> self dest-pos) (-> self landed-pos)) (set! (-> self dest-pos y) (+ (-> self landed-pos y) (-> self default-y-offset))) (set! (-> self restart-fly-anims) #t) ) @@ -698,8 +699,8 @@ (t9-0) ) ) - (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) - (set! (-> self landed-pos quad) (-> self root trans quad)) + (move-to-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (vector-copy! (-> self landed-pos) (-> self root trans)) (manta-method-206 self) (logclear! (-> self draw status) (draw-control-status no-draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -753,7 +754,7 @@ 0 (set! (-> self fly-anim-speed) 1.5) (set! (-> self y-offset) (-> self default-y-offset)) - (set! (-> self dest-pos quad) (-> self root trans quad)) + (vector-copy! (-> self dest-pos) (-> self root trans)) (set! (-> self dest-pos y) (+ (-> self root gspot-pos y) (-> self y-offset))) ) :exit (behavior () @@ -914,7 +915,7 @@ (set! (-> self move-u) 0.0) (set! (-> self move-du) (* 0.94 f30-0)) ) - (set! (-> self attack-pos quad) (-> self focus-pos quad)) + (vector-copy! (-> self attack-pos) (-> self focus-pos)) (set! (-> self y-offset) (+ 24576.0 (-> self default-y-offset))) (set! (-> self move-matrix rvec quad) (-> self root trans quad)) (manta-method-195 self) @@ -1113,7 +1114,7 @@ ) ) (let ((a1-9 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-9 start-pos quad) (-> self rbody position quad)) + (vector-copy! (-> a1-9 start-pos) (-> self rbody position)) (vector-float*! (-> a1-9 move-dist) (-> self rbody lin-velocity) (seconds-per-frame)) (let ((v1-21 a1-9)) (set! (-> v1-21 radius) (+ 4096.0 (-> self root root-prim local-sphere w))) @@ -1149,14 +1150,14 @@ (ja :num! (seek! max 1.5)) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> self rbody position quad)) + (vector-copy! (-> a1-0 start-pos) (-> self rbody position)) (vector-float*! (-> a1-0 move-dist) (-> self rbody lin-velocity) (seconds-per-frame)) (let ((v1-3 a1-0)) (set! (-> v1-3 radius) (+ 4096.0 (-> self root root-prim local-sphere w))) @@ -1173,10 +1174,11 @@ ) ) -(defmethod go-best-state ((this manta)) +(defmethod go-state-for-focused ((this manta)) + "Go to the appropriate state for the current awareness of the focused process." (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware ea3)) (get-focus! this)) + ((and (= s5-0 (enemy-aware hostile)) (get-focus! this)) (go-hostile this) ) ((<= (the-as int s5-0) 0) @@ -1185,7 +1187,7 @@ ((>= 1 (the-as int s5-0)) (go (method-of-object this land-approach)) ) - ((= s5-0 (enemy-aware ea4)) + ((= s5-0 (enemy-aware flee)) (go-flee this) ) (else @@ -1199,7 +1201,7 @@ (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (the-as vector (-> this move-matrix))))) (set! (-> s5-1 y) (-> this attack-y-offset)) (vector-normalize! s5-1 (-> this move-force)) - (set! (-> this move-matrix fvec quad) (-> s5-1 quad)) + (vector-copy! (-> this move-matrix fvec) s5-1) (vector+! (-> this move-matrix uvec) (the-as vector (-> this move-matrix)) s5-1) ) (vector-! (-> this move-matrix trans) (-> this focus-pos) (-> this move-matrix uvec)) @@ -1212,7 +1214,7 @@ (defmethod manta-method-196 ((this manta)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this root trans)) (let* ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (closest-point-on-mesh (-> this nav) s5-0 s3-0 (the-as nav-poly #f))) ) @@ -1234,6 +1236,7 @@ ) (defmethod get-focus! ((this manta)) + "If we're focusing on something alive, return it." (let* ((t9-0 (method-of-type nav-enemy get-focus!)) (v0-0 (t9-0 this)) ) @@ -1265,11 +1268,13 @@ (none) ) -(defmethod within-gspot-range? ((this manta)) +(defmethod invalid-height? ((this manta)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) -(defmethod enemy-method-88 ((this manta) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this manta) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" (let ((v1-0 (-> this root))) (or (>= (-> arg0 on-surface-count) 3) (>= (-> this hit-ground-count) (the-as uint 1)) @@ -1304,7 +1309,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s5-0 (-> this root root-prim prim-core)) ) - (set! (-> s3-0 quad) (-> s5-0 world-sphere quad)) + (vector-copy! s3-0 (-> s5-0 world-sphere)) (set! (-> s3-0 w) (-> s5-0 world-sphere w)) (let ((s4-0 544)) (set! *actor-list-length* 0) @@ -1434,7 +1439,7 @@ (set! (-> v1-2 rvec w) 1.0) ) (set-vector! (-> gp-0 1 uvec) 0.0 16384.0 0.0 1.0) - (set! (-> gp-0 0 uvec quad) (-> gp-0 0 rvec quad)) + (vector-copy! (-> gp-0 0 uvec) (-> gp-0 0 rvec)) (set! (-> gp-0 0 uvec y) 0.0) (let* ((v1-5 (-> gp-0 0)) (f30-0 (sqrtf (+ (* (-> v1-5 rvec x) (-> v1-5 rvec x)) (* (-> v1-5 rvec z) (-> v1-5 rvec z))))) @@ -1561,7 +1566,7 @@ (defmethod nav-enemy-method-161 ((this manta) (arg0 nav-control)) (let ((a2-0 (-> arg0 state))) - (set! (-> this move-vel quad) (-> a2-0 velocity quad)) + (vector-copy! (-> this move-vel) (-> a2-0 velocity)) ) (manta-method-201 this 201326600.0) (none) @@ -1584,7 +1589,7 @@ (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 81920.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-12 s4-0)) (set! (-> v1-12 radius) 3276.8) @@ -1640,11 +1645,12 @@ ) (defmethod enemy-common-post ((this manta)) - (set! (-> this root gspot-pos quad) (-> this root trans quad)) + "Common implementation of post. Runs ja-post." + (vector-copy! (-> this root gspot-pos) (-> this root trans)) (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set-ground-pat! + (find-ground-and-set-pat! this a1-0 (-> this enemy-info recover-gnd-collide-with) @@ -1682,6 +1688,7 @@ ;; WARN: disable def twice: 150. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. ;; WARN: disable def twice: 100. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this manta) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-4 object)) (case arg2 (('hit 'hit-flinch 'hit-knocked) @@ -1694,7 +1701,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1743,21 +1750,22 @@ (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-2) 3)) (if (not (manta-method-196 this)) (set-time! (-> this attack-path-blocked-time)) ) ) (else - (set! (-> this focus-pos quad) (-> (target-pos 0) quad)) - (set! (-> this dest-pos quad) (-> this root trans quad)) + (vector-copy! (-> this focus-pos) (target-pos 0)) + (vector-copy! (-> this dest-pos) (-> this root trans)) ) ) ) (none) ) -(defmethod enemy-method-50 ((this manta) (arg0 int)) +(defmethod update-collision-action ((this manta) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -1793,6 +1801,7 @@ ) (defmethod knocked-anim-handler ((this manta) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (let ((s5-0 (ja-done? 0))) @@ -1822,6 +1831,7 @@ ) (defmethod knocked-anim ((this manta) (arg0 enemy-knocked-info)) + "start the knocked animation." (cond ((= (-> this hit-points) 0.0) (ja-channel-push! 1 (seconds 0.1)) @@ -1869,6 +1879,7 @@ ) (defmethod knocked-land-anim ((this manta) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (set! (-> arg0 anim-speed) 0.5) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) @@ -1914,13 +1925,14 @@ ) (defmethod init-enemy! ((this manta)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-manta" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *manta-nav-enemy-info*) + (setup-enemy! this *manta-nav-enemy-info*) (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) ) @@ -1955,8 +1967,8 @@ (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) (set! (-> this go-enable) #t) - (set! (-> this up-dir quad) (-> *y-vector* quad)) - (set! (-> this forward-dir quad) (-> *z-vector* quad)) + (vector-copy! (-> this up-dir) *y-vector*) + (vector-copy! (-> this forward-dir) *z-vector*) (set! (-> this last-attack-time) 0) (set! (-> this attack-path-blocked-time) 0) (set! (-> this track-timer) 0) diff --git a/goal_src/jak3/levels/mine/mine-obs.gc b/goal_src/jak3/levels/mine/mine-obs.gc index bad64de41d5..1fadf807e2e 100644 --- a/goal_src/jak3/levels/mine/mine-obs.gc +++ b/goal_src/jak3/levels/mine/mine-obs.gc @@ -140,6 +140,7 @@ ) (defmethod init-from-entity! ((this rat-light-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -361,7 +362,7 @@ ) ) :enter (behavior () - (set! (-> self force-pos quad) (-> self root trans quad)) + (vector-copy! (-> self force-pos) (-> self root trans)) ) :trans (behavior () (if (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 204800.0) @@ -381,7 +382,7 @@ :virtual #t :event (-> (method-of-type min-rat-engine inactive) event) :trans (behavior () - (set! (-> self force-pos quad) (-> self root trans quad)) + (vector-copy! (-> self force-pos) (-> self root trans)) (rider-trans) (if (< 245760.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans))) (go-virtual inactive) @@ -599,7 +600,7 @@ (when (= arg0 this) (let ((a2-1 (handle->process (-> arg1 handle)))) (if a2-1 - (set! (-> this force-pos quad) (-> (the-as process-focusable a2-1) root trans quad)) + (vector-copy! (-> this force-pos) (-> (the-as process-focusable a2-1) root trans)) ) ) ) @@ -674,6 +675,7 @@ ) (defmethod init-from-entity! ((this min-rat-engine) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (min-rat-engine-method-24 this) (process-drawable-from-entity! this arg0) @@ -832,6 +834,7 @@ ) (defmethod init-from-entity! ((this min-crane) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (min-crane-method-21 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1170,7 +1173,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this min-target-sign)) +(defmethod get-search-info-flag ((this min-target-sign)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (set! v0-0 (logior v0-0 40)) @@ -1180,6 +1184,7 @@ ) (defmethod init-from-entity! ((this min-target-sign) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) (t9-0 this arg0) ) @@ -1605,6 +1610,7 @@ ) (defmethod init-from-entity! ((this min-elev-doors) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (min-elev-doors-method-23 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1674,7 +1680,7 @@ (= (-> self rog) #f) ) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 pos) (-> self root trans)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf8)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -1894,6 +1900,7 @@ ) (defmethod init-from-entity! ((this min-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (cond ((or (task-node-closed? (game-task-node mine-blow-resolution)) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) @@ -2065,6 +2072,7 @@ (defmethod init-from-entity! ((this min-airlock-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/goal_src/jak3/levels/mine/mine-platforms.gc b/goal_src/jak3/levels/mine/mine-platforms.gc index fe008cb64c3..61b14ca4187 100644 --- a/goal_src/jak3/levels/mine/mine-platforms.gc +++ b/goal_src/jak3/levels/mine/mine-platforms.gc @@ -39,6 +39,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this mine-platform-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -77,7 +78,7 @@ (stack-size-set! (-> self main-thread) 32) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self spool-sound) (new-sound-id)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (queue-drill-sound self) (go-virtual active) ) @@ -239,6 +240,7 @@ ) (defmethod init-from-entity! ((this min-moving-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) (t9-0 this arg0) ) @@ -437,7 +439,8 @@ ) :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (let ((gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s4-0 #t) @@ -461,8 +464,8 @@ (vector+float*! (-> s3-1 trans) (-> s3-1 trans) gp-1 (* 106496.0 (-> self root scale x))) (vector+float*! (-> s3-1 trans) (-> s3-1 trans) s5-0 (* -8192.0 (-> self root scale x))) (vector-float*! (-> s3-1 fvec) gp-1 1.0) - (set! (-> s3-1 uvec quad) (-> *up-vector* quad)) - (set! (-> s3-1 rvec quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 uvec) *up-vector*) + (vector-copy! (-> s3-1 rvec) s5-0) (launch-particles (-> *part-id-table* 2316) s3-1 :origin-is-matrix #t) (launch-particles (-> *part-id-table* 2315) s3-1 :origin-is-matrix #t) ) @@ -546,6 +549,7 @@ ) (defmethod init-from-entity! ((this min-rotating-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) (t9-0 this arg0) ) @@ -610,7 +614,8 @@ :trans plat-trans :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (ja-channel-push! 1 0) (ja-no-eval :group! min-rotating-plat-idle-ja :num! min) (sync-now! (-> self sync) 0.0) @@ -914,7 +919,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this min-falling-step)) +(defmethod get-search-info-flag ((this min-falling-step)) + "Get search-info-flag for this process." (let ((v0-0 0)) (cond ((and (-> this next-state) (= (-> this next-state name) 'idle)) @@ -1078,6 +1084,7 @@ ) (defmethod init-from-entity! ((this min-falling-step) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) (t9-0 this arg0) @@ -1225,7 +1232,8 @@ ) :trans rider-trans :code (behavior () - (suspend-for (seconds 1.5)) + (suspend-for (seconds 1.5) + ) (when (-> self stop-sound) (set! (-> self stop-sound) #f) (sound-params-set! *gui-control* (-> self sound-id) #t -1 -1 -1 -1.0) @@ -1270,6 +1278,7 @@ ) (defmethod init-from-entity! ((this min-folding-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1420,7 +1429,8 @@ ) :code (behavior () (when (-> self play-ramp-sound?) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (until (= (get-status *gui-control* (-> self ramp-sound)) (gui-status ready)) (suspend) ) @@ -1463,6 +1473,7 @@ ) (defmethod init-from-entity! ((this min-ramp) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (s5-3 symbol)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -1582,7 +1593,8 @@ :trans rider-trans :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (suspend-for (seconds 1.5)) + (suspend-for (seconds 1.5) + ) (when (-> self stop-bridge-sound) (set! (-> self stop-bridge-sound) #f) (sound-params-set! *gui-control* (-> self bridge-sound) #t -1 150 2 -1.0) @@ -1675,6 +1687,7 @@ ) (defmethod init-from-entity! ((this min-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1752,6 +1765,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this min-plat-updown) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) diff --git a/goal_src/jak3/levels/mine/mine-scenes.gc b/goal_src/jak3/levels/mine/mine-scenes.gc index 7f613b310ac..af63b322c60 100644 --- a/goal_src/jak3/levels/mine/mine-scenes.gc +++ b/goal_src/jak3/levels/mine/mine-scenes.gc @@ -1482,6 +1482,7 @@ ) (defmethod init-from-entity! ((this leggings) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (when (task-node-closed? (game-task-node mine-explore-resolution)) (cleanup-for-death this) (return #f) diff --git a/goal_src/jak3/levels/mine/mine-train.gc b/goal_src/jak3/levels/mine/mine-train.gc index 22e8f748b2f..66a3018ccea 100644 --- a/goal_src/jak3/levels/mine/mine-train.gc +++ b/goal_src/jak3/levels/mine/mine-train.gc @@ -483,7 +483,8 @@ (quaternion-normalize! (-> self root quat)) ) :code (behavior () - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (when (type? (-> self root) collide-shape) (let ((v1-7 (-> self root root-prim))) (set! (-> v1-7 prim-core collide-as) (collide-spec)) @@ -497,11 +498,11 @@ (explode-sound self) (cond ((logtest? (-> *part-group-id-table* 604 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 604)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 604)) ) ) @@ -537,11 +538,11 @@ (explode-sound self) (cond ((logtest? (-> *part-group-id-table* 604 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 604)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 604)) ) ) @@ -734,7 +735,7 @@ (a1-7 (new 'stack-no-clear 'matrix)) ) (let ((a0-7 (new 'stack-no-clear 'vector))) - (set! (-> a0-7 quad) (-> *up-vector* quad)) + (vector-copy! a0-7 *up-vector*) (vector-! v1-11 a2-6 s4-0) (let ((a2-7 v1-11)) (let ((f0-4 1.0)) @@ -756,14 +757,14 @@ (.svf (&-> a2-7 quad) vf1) ) (let ((a2-8 a1-7)) - (set! (-> a2-8 fvec quad) (-> v1-11 quad)) - (set! (-> a2-8 uvec quad) (-> a0-7 quad)) + (vector-copy! (-> a2-8 fvec) v1-11) + (vector-copy! (-> a2-8 uvec) a0-7) (vector-cross! (-> a2-8 rvec) (-> a2-8 uvec) v1-11) ) ) (matrix->quaternion (-> this root quat) a1-7) ) - (set! (-> this root trans quad) (-> s5-1 quad)) + (vector-copy! (-> this root trans) s5-1) ) f30-0 ) @@ -811,6 +812,7 @@ ) (defmethod init-from-entity! ((this min-bomb-train) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (when (task-node-closed? (game-task-node mine-blow-resolution)) (cleanup-for-death this) diff --git a/goal_src/jak3/levels/mine/mined-mood.gc b/goal_src/jak3/levels/mine/mined-mood.gc index 8424237dbb2..79332c18637 100644 --- a/goal_src/jak3/levels/mine/mined-mood.gc +++ b/goal_src/jak3/levels/mine/mined-mood.gc @@ -56,8 +56,8 @@ (set! (-> s5-0 light 1) (set-mined-filter-light! "light-3803" s4-1 (-> s5-0 filter 1) (-> s5-0 light 1))) ) (set! (-> arg0 times 0 w) 1.0) - (set! (-> arg0 times 1 quad) (-> s5-0 filter 0 quad)) - (set! (-> arg0 times 2 quad) (-> s5-0 filter 1 quad)) + (vector-copy! (-> arg0 times 1) (-> s5-0 filter 0)) + (vector-copy! (-> arg0 times 2) (-> s5-0 filter 1)) ) ) ) @@ -70,7 +70,7 @@ (let ((v1-1 (level-get *level* 'mined))) (when v1-1 (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) - (set! (-> (the-as mined-states v1-2) filter arg1 quad) (-> arg0 quad)) + (vector-copy! (-> (the-as mined-states v1-2) filter arg1) arg0) ) ) ) diff --git a/goal_src/jak3/levels/mine/mined-scenes.gc b/goal_src/jak3/levels/mine/mined-scenes.gc index 6c35854662e..a203a77c141 100644 --- a/goal_src/jak3/levels/mine/mined-scenes.gc +++ b/goal_src/jak3/levels/mine/mined-scenes.gc @@ -37,6 +37,7 @@ ) (defmethod init-from-entity! ((this cav-airlock-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) @@ -1177,7 +1178,7 @@ ,(lambda :behavior scene-player ((arg0 process-drawable) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-0 spawn-point quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 spawn-point) arg1) (quaternion-identity! (-> s5-0 spawn-quat)) (set! (-> s5-0 radius) 8192.0) (set! (-> s5-0 scale) 1.0) @@ -1581,7 +1582,7 @@ ,(lambda :behavior scene-player ((arg0 process-drawable) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-0 spawn-point quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 spawn-point) arg1) (quaternion-identity! (-> s5-0 spawn-quat)) (set! (-> s5-0 radius) 8192.0) (set! (-> s5-0 scale) 1.0) diff --git a/goal_src/jak3/levels/mine/minee-scenes.gc b/goal_src/jak3/levels/mine/minee-scenes.gc index eb1d171a284..3fff935fd62 100644 --- a/goal_src/jak3/levels/mine/minee-scenes.gc +++ b/goal_src/jak3/levels/mine/minee-scenes.gc @@ -119,6 +119,7 @@ ) (defmethod init-from-entity! ((this minee-elevator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) diff --git a/goal_src/jak3/levels/mine/monster-frog.gc b/goal_src/jak3/levels/mine/monster-frog.gc index 2b2ec1ad709..366475e91e2 100644 --- a/goal_src/jak3/levels/mine/monster-frog.gc +++ b/goal_src/jak3/levels/mine/monster-frog.gc @@ -121,34 +121,34 @@ :jump-height-min (meters 2.87) :jump-height-factor 0.1 :knocked-seek-ry-clamp 4551.1113 - :knocked-soft-vxz-lo 75776.0 - :knocked-soft-vxz-hi 75776.0 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 81920.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 79872.0 - :knocked-hard-vxz-hi 79872.0 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 75776.0 - :knocked-yellow-vxz-hi 75776.0 - :knocked-yellow-vy-lo 81920.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 73728.0 - :knocked-red-vxz-hi 73728.0 - :knocked-red-vy-lo 96256.0 - :knocked-red-vy-hi 96256.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 18.5) + :knocked-soft-vxz-hi (meters 18.5) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 20) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.5) + :knocked-hard-vxz-hi (meters 19.5) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 18.5) + :knocked-yellow-vxz-hi (meters 18.5) + :knocked-yellow-vy-lo (meters 20) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 18) + :knocked-red-vxz-hi (meters 18) + :knocked-red-vy-lo (meters 23.5) + :knocked-red-vy-hi (meters 23.5) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -194,7 +194,7 @@ (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) ) 0 - (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (dotimes (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.01))) (cond ((zero? (rnd-int self 4)) (let ((v1-7 (ja-group))) @@ -323,7 +323,7 @@ (set! (-> v1-37 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-37 prim-core collide-with) (-> self root backup-collide-with)) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -360,7 +360,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -382,7 +382,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (when (enemy-method-134 self 0.2) + (when (rnd-chance-for-idle? self 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.6)) (let ((v1-57 self)) @@ -400,7 +400,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -496,7 +496,7 @@ ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) (go-stare self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -525,7 +525,7 @@ (gp-1 (-> self enemy-info)) ) (let ((a1-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-4 1.0))) - (if (not (enemy-method-103 self a1-5 6371.5557)) + (if (not (heading-matches-direction? self a1-5 6371.5557)) (go-virtual turn) ) ) @@ -614,7 +614,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 self)) @@ -670,7 +670,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-17 quad)) + (vector-copy! (-> a0-3 target-pos) v1-17) ) ) 0 @@ -745,12 +745,13 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) (defmethod knocked-anim ((this monster-frog) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 0) @@ -811,6 +812,7 @@ ) (defmethod knocked-land-anim ((this monster-frog) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.17)) @@ -871,12 +873,14 @@ ) (defmethod enemy-common-post ((this monster-frog)) + "Common implementation of post. Runs ja-post." (water-control-method-10 (-> this water)) ((method-of-type nav-enemy enemy-common-post) this) (none) ) (defmethod init-enemy-collision! ((this monster-frog)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -939,12 +943,13 @@ ) (defmethod init-enemy! ((this monster-frog)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-monster-frog" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *monster-frog-nav-enemy-info*) + (setup-enemy! this *monster-frog-nav-enemy-info*) (set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0)) (set! (-> this water flags) (water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) diff --git a/goal_src/jak3/levels/mine/prebot-extras.gc b/goal_src/jak3/levels/mine/prebot-extras.gc index 81293f78820..2414f06ca0e 100644 --- a/goal_src/jak3/levels/mine/prebot-extras.gc +++ b/goal_src/jak3/levels/mine/prebot-extras.gc @@ -24,6 +24,7 @@ ) (defmethod init-from-entity! ((this cav-break-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -69,7 +70,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this cav-railblocker)) +(defmethod get-search-info-flag ((this cav-railblocker)) + "Get search-info-flag for this process." (the-as search-info-flag (if (-> this trackable) 24 1 @@ -207,7 +209,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -276,6 +278,7 @@ ) (defmethod init-from-entity! ((this cav-railblocker) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -347,6 +350,7 @@ ) (defmethod init-from-entity! ((this cav-minecar) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -446,7 +450,7 @@ 0.5 ) (vector-! s5-0 gp-0 (-> self prev-position)) - (set! (-> self prev-position quad) (-> gp-0 quad)) + (vector-copy! (-> self prev-position) gp-0) (let ((v1-13 s5-0)) (.lvf vf1 (&-> s5-0 quad)) (let ((f0-7 (-> self clock frames-per-second))) @@ -600,8 +604,8 @@ ) ) (vector<-cspace! (-> s4-0 min) (-> self node-list data (-> s5-0 (+ (-> s5-0 length) -1) joint-index))) - (set! (-> s4-0 max quad) (-> s4-0 min quad)) - (set! (-> s5-0 (+ (-> s5-0 length) -1) position quad) (-> s4-0 min quad)) + (vector-copy! (-> s4-0 max) (-> s4-0 min)) + (vector-copy! (-> s5-0 (+ (-> s5-0 length) -1) position) (-> s4-0 min)) (dotimes (s3-0 (+ (-> s5-0 length) -1)) (let ((s2-0 (new 'stack-no-clear 'vector))) (vector<-cspace! (-> s5-0 s3-0 position) (-> self node-list data (-> s5-0 s3-0 joint-index))) @@ -625,7 +629,7 @@ (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer s4-0) 32) (fill-using-bounding-box *collide-cache* gp-0) (dotimes (s4-1 (+ (-> s5-0 length) -1)) - (set! (-> gp-0 start-pos quad) (-> s5-0 s4-1 position quad)) + (vector-copy! (-> gp-0 start-pos) (-> s5-0 s4-1 position)) (vector-! (-> gp-0 move-dist) (-> s5-0 (+ s4-1 1) position) (-> gp-0 start-pos)) (let ((v1-52 gp-0)) (set! (-> v1-52 radius) 2048.0) @@ -794,7 +798,7 @@ ) 0 (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 8192.0) (set! (-> gp-0 scale) 1.0) @@ -829,17 +833,16 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-gun-lod0-jg gunTip)) quad) - ) - (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! - (new 'stack-no-clear 'vector) - (-> self node-list data 7 bone transform uvec) - (* 4096.0 (-> self clock frames-per-second)) - ) - quad - ) - ) + (vector-copy! + (-> gp-0 pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-gun-lod0-jg gunTip)) + ) + (vector-copy! (-> gp-0 vel) (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> self node-list data 7 bone transform uvec) + (* 4096.0 (-> self clock frames-per-second)) + ) + ) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1036,7 +1039,7 @@ (let ((a1-12 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-12 hit-xz-reaction) 0.95) (set! (-> a1-12 hit-y-reaction) 0.6) - (set! (-> a1-12 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> a1-12 fountain-rand-transv-lo) (-> self root trans)) (+! (-> a1-12 fountain-rand-transv-lo z) 4096.0) (debris-spawn (the-as process-drawable (ppointer->process (-> self parent))) @@ -1048,11 +1051,11 @@ (sound-play "columns-break" :position (-> self root trans)) (cond ((logtest? (-> *part-group-id-table* 1344 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1344)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1344)) ) ) @@ -1106,7 +1109,7 @@ (set-vector! (-> self draw color-mult) f30-0 f30-0 f30-0 1.0) ) (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self root trans quad)) + (vector-copy! a1-2 (-> self root trans)) (set! (-> a1-2 y) (-> self start-y)) (spawn (-> self cool-part) a1-2) ) @@ -1131,7 +1134,7 @@ ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 y) (-> self start-y)) (spawn (-> self part) a1-0) ) @@ -1169,7 +1172,7 @@ (go-virtual wait-to-cool) ) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self root trans quad)) + (vector-copy! a1-1 (-> self root trans)) (set! (-> a1-1 y) (-> self start-y)) (spawn (-> self part) a1-1) ) @@ -1201,7 +1204,7 @@ (go-virtual grow) ) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 y) (-> self start-y)) (spawn (-> self heat-part) a1-0) ) @@ -1269,6 +1272,7 @@ ) (defmethod init-from-entity! ((this cav-exit-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) diff --git a/goal_src/jak3/levels/mine/prebot-setup.gc b/goal_src/jak3/levels/mine/prebot-setup.gc index 0d8e2241886..1cb11e128f4 100644 --- a/goal_src/jak3/levels/mine/prebot-setup.gc +++ b/goal_src/jak3/levels/mine/prebot-setup.gc @@ -489,7 +489,7 @@ ) (quaternion-set! (-> self root quat) 0.0 (-> s4-8 x) 0.0 (-> s4-8 y)) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self start-y) (-> self root trans y)) (set! (-> self end-y) (+ (-> arg0 y) (-> arg1 height))) (set! (-> self vulnerable) #f) @@ -616,7 +616,7 @@ (set! (-> *prebot-sword-color-array* zbuffer?) #t) -(set! (-> *prebot-sword-color-array* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *prebot-sword-color-array* lie-vector) *up-vector*) (set! (-> *prebot-sword-color-array* use-tape-mode?) #t) @@ -649,8 +649,8 @@ (set! (-> self root) s2-0) ) (set! (-> self root pause-adjust-distance) 409600.0) - (set! (-> self root trans quad) (-> arg1 quad)) - (set! (-> self prev-position quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) + (vector-copy! (-> self prev-position) arg1) (set! (-> self old-target-dist) 204800.0) (set! (-> self prefix) arg0) (initialize-skeleton @@ -745,7 +745,7 @@ (set! (-> self root) s4-0) ) (set! (-> self root pause-adjust-distance) 409600.0) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self @@ -788,7 +788,7 @@ (set! (-> self root) s4-0) ) (set! (-> self root pause-adjust-distance) 409600.0) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (set! (-> self prefix) arg0) (initialize-skeleton self @@ -847,7 +847,7 @@ (set! (-> self root) s3-0) ) (set! (-> self root pause-adjust-distance) 409600.0) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (set! (-> self prefix) arg0) (initialize-skeleton self @@ -887,6 +887,7 @@ ) (defmethod init-from-entity! ((this prebot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1044,7 +1045,7 @@ (the-as pair 0) ) (logior! (-> this mask) (process-mask enemy)) - (set! (-> this original-position quad) (-> this root trans quad)) + (vector-copy! (-> this original-position) (-> this root trans)) (init (-> this position) (-> this original-position) 0.004096 2048.0 0.125) (set! (-> this draw light-index) (the-as uint 10)) (dotimes (v1-64 28) diff --git a/goal_src/jak3/levels/mine/prebot-states.gc b/goal_src/jak3/levels/mine/prebot-states.gc index a878a9a8f0e..ddd834db5b9 100644 --- a/goal_src/jak3/levels/mine/prebot-states.gc +++ b/goal_src/jak3/levels/mine/prebot-states.gc @@ -40,10 +40,10 @@ (let ((a1-9 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s5-0 (* 8192.0 (-> s4-1 neck-angle value)))) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> arg0 bone transform trans quad)) + (vector-copy! s5-1 (-> arg0 bone transform trans)) (vector-reset! (-> arg0 bone transform trans)) (matrix*! (-> arg0 bone transform) a1-9 (-> arg0 bone transform)) - (set! (-> arg0 bone transform trans quad) (-> s5-1 quad)) + (vector-copy! (-> arg0 bone transform trans) s5-1) ) ) ) @@ -142,7 +142,7 @@ (set! (-> a0-16 pickup-type) (pickup-type ammo-random)) (set! (-> a0-16 pickup-amount) 10.0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self root trans quad)) + (vector-copy! s5-0 (-> self root trans)) (set! (-> self root trans quad) (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 gp-0)))) ) @@ -150,7 +150,7 @@ (set! (-> self ammo gp-0 handle) (ppointer->handle (drop-pickup a0-16 #t *entity-pool* (the-as fact-info #f) 0 #t)) ) - (set! (-> self root trans quad) (-> s5-0 quad)) + (vector-copy! (-> self root trans) s5-0) ) ) ) @@ -172,7 +172,7 @@ (set! (-> *game-info* counter) (the float (-> self stage))) (prebot-prespool) (update! (-> self position) (the-as vector #f)) - (set! (-> self root trans quad) (-> self position value quad)) + (vector-copy! (-> self root trans) (-> self position value)) (let* ((f0-17 (* 54.613335 (the float (current-time)))) (f0-18 (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0))) ) @@ -184,7 +184,7 @@ ) (else (let ((t0-1 (new 'static 'vector))) - (set! (-> t0-1 quad) (-> self root trans quad)) + (vector-copy! t0-1 (-> self root trans)) (+! (-> t0-1 y) 16384.0) (set-setting! 'point-of-interest 'abs t0-1 0) ) @@ -244,11 +244,11 @@ (remove-setting! 'entity-name) (when (and (< (-> self stage) 4) (not (handle->process (-> self blocker)))) (let ((gp-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) - (set! (-> gp-0 0 quad) (-> self entity extra trans quad)) + (vector-copy! (-> gp-0 0) (-> self entity extra trans)) (+! (-> gp-0 0 x) 163840.0) (+! (-> gp-0 0 y) -81920.0) (+! (-> gp-0 0 z) 4096.0) - (set! (-> gp-0 1 quad) (-> self entity extra trans quad)) + (vector-copy! (-> gp-0 1) (-> self entity extra trans)) (+! (-> gp-0 1 x) -163840.0) (+! (-> gp-0 1 y) -81920.0) (+! (-> gp-0 1 z) 4096.0) @@ -282,7 +282,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this prebot)) +(defmethod get-search-info-flag ((this prebot)) + "Get search-info-flag for this process." (the-as search-info-flag 0) ) @@ -451,7 +452,7 @@ (process-grab? *target* #f) (ja :num! (seek!)) (when (ja-done? 0) - (set! (-> self root trans quad) (-> self entity extra trans quad)) + (vector-copy! (-> self root trans) (-> self entity extra trans)) (process-release? *target*) (go-virtual play-fma) ) @@ -460,7 +461,7 @@ (let ((gp-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) (let ((v1-19 (the-as entity-actor (entity-by-name "scene-stage-133")))) (when v1-19 - (set! (-> self root trans quad) (-> v1-19 extra trans quad)) + (vector-copy! (-> self root trans) (-> v1-19 extra trans)) (quaternion-copy! gp-0 (-> v1-19 quat)) ) ) @@ -609,7 +610,7 @@ (when gp-3 (blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f) (let ((a1-10 (new 'stack-no-clear 'vector))) - (set! (-> a1-10 quad) (-> (the-as process-drawable gp-3) root trans quad)) + (vector-copy! a1-10 (-> (the-as process-drawable gp-3) root trans)) (+! (-> a1-10 y) -14336.0) (set-target! (-> self shoulder-aim-jm) a1-10) ) @@ -806,7 +807,7 @@ (else (blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f) (let ((gp-10 (new 'stack-no-clear 'vector))) - (set! (-> gp-10 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-10 (target-pos 0)) (let ((s5-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-lod0-jg shoulderL)))) (+! (-> gp-10 y) (-> self shot-extra-y)) (set! (-> s5-6 y) (-> s5-6 x)) @@ -859,7 +860,7 @@ ;; WARN: Return type mismatch none vs object. (defbehavior prebot-fire-tentacle prebot ((arg0 handle) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self root trans quad)) + (vector-copy! s5-0 (-> self root trans)) (let ((v1-2 (handle->process arg0))) (if v1-2 (vector<-cspace! s5-0 (-> (the-as prebot-tentacle v1-2) node-list data 14)) @@ -987,7 +988,7 @@ (set! (-> self num-attacks) (the-as uint 0)) (dotimes (s3-0 (min 5 (-> gp-0 length))) (vector+! s5-0 (-> gp-0 s3-0 offset) (-> self original-position)) - (set! (-> s4-0 quad) (-> s5-0 quad)) + (vector-copy! s4-0 s5-0) (+! (-> s4-0 x) (* 4096.0 (cos (* 1747.6267 (the float (+ (* 30 s3-0) (- (current-time) (-> self state-time))))))) ) @@ -1215,7 +1216,7 @@ ) ) ) - (set! (-> s5-0 quad) (-> self nav state mesh bounds quad)) + (vector-copy! s5-0 (-> self nav state mesh bounds)) (case (-> self stage) ((1) (+! (-> s5-0 x) 61440.0) @@ -1226,7 +1227,7 @@ (set! (-> s5-0 x) (- (-> s5-0 x) (* 28672.0 (the float (-> self critters-to-launch))))) ) ) - (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-0 trans) gp-0) (quaternion-copy! (-> s4-0 quat) (-> self root quat)) (set! (-> s4-0 entity) (-> self entity)) (set! (-> s4-0 directed?) #f) @@ -1928,7 +1929,7 @@ ;; WARN: Return type mismatch int vs object. (defbehavior prebot-spawn-shockwave prebot () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) ;; og:preserve-this unused lambda? ;; L162 @@ -2350,8 +2351,8 @@ (else (let ((gp-0 (new 'stack-no-clear 'enemy-init-by-other-params))) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> self nav state mesh bounds quad)) - (set! (-> gp-0 trans quad) (-> v1-4 quad)) + (vector-copy! v1-4 (-> self nav state mesh bounds)) + (vector-copy! (-> gp-0 trans) v1-4) ) (quaternion-copy! (-> gp-0 quat) (-> self root quat)) (set! (-> gp-0 entity) (-> self entity)) diff --git a/goal_src/jak3/levels/mine/rat.gc b/goal_src/jak3/levels/mine/rat.gc index cfdcfb3bd0c..bfaf7484a2b 100644 --- a/goal_src/jak3/levels/mine/rat.gc +++ b/goal_src/jak3/levels/mine/rat.gc @@ -192,34 +192,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 49152.0 - :knocked-soft-vxz-hi 77824.0 - :knocked-soft-vy-lo 65536.0 - :knocked-soft-vy-hi 102400.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 12) + :knocked-soft-vxz-hi (meters 19) + :knocked-soft-vy-lo (meters 16) + :knocked-soft-vy-hi (meters 25) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9898 :y 0.0756 :z 0.1191 :w 16871.352) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -626,6 +626,7 @@ (set! (-> *rat-nav-enemy-info* fact-defaults) *fact-info-rat-defaults*) (defmethod init-enemy-collision! ((this rat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -734,7 +735,7 @@ (defstate idle (rat) :virtual #t :enter (behavior () - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-virtual die) ) (call-parent-state-handler enter) @@ -771,7 +772,7 @@ (if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y)) ) - (set! (-> self root gspot-pos quad) (-> gp-0 quad)) + (vector-copy! (-> self root gspot-pos) gp-0) ) (sound-play "rat-spawner") ) @@ -860,7 +861,7 @@ ) (logclear! (-> a0-22 flags) (nav-state-flag directional-mode)) (logior! (-> a0-22 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-22 target-pos quad) (-> v1-18 quad)) + (vector-copy! (-> a0-22 target-pos) v1-18) ) 0 ) @@ -931,7 +932,7 @@ ) ) ) - (if (enemy-method-103 self (-> self face-dir) 1820.4445) + (if (heading-matches-direction? self (-> self face-dir) 1820.4445) (go-virtual active) ) ) @@ -999,7 +1000,7 @@ (ja :num! (seek!)) ) (set-look-at-mode! self 1) - (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (dotimes (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.015))) (ja-no-eval :group! rat-sit-alert-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1011,7 +1012,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1062,7 +1063,7 @@ a1-0 ) ) - (set! (-> gp-0 quad) (-> self wheel-actor extra trans quad)) + (vector-copy! gp-0 (-> self wheel-actor extra trans)) ) ) ) @@ -1073,7 +1074,7 @@ ) (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-7 target-pos quad) (-> v1-11 quad)) + (vector-copy! (-> a0-7 target-pos) v1-11) ) 0 (nav-enemy-method-187 self) @@ -1099,7 +1100,7 @@ ) :code (behavior () (until #f - (when (not (enemy-method-105 self 4551.1113 #t)) + (when (not (pointing-toward-focus? self 4551.1113 #t)) (let ((v1-3 self)) (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) ) @@ -1107,7 +1108,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! rat-turn-left-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop!)) @@ -1172,7 +1173,7 @@ (suspend) (ja :num! (seek! max 1.5)) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-chase-post ) @@ -1200,7 +1201,7 @@ ) 0 (set-look-at-mode! self 1) - (set! (-> self flee-focus-pos quad) (-> self focus-pos quad)) + (vector-copy! (-> self flee-focus-pos) (-> self focus-pos)) ) :trans (behavior () (when (time-elapsed? (-> self state-time) (seconds 1)) @@ -1213,7 +1214,7 @@ ) :code (behavior () (until #f - (when (not (enemy-method-105 self 4551.1113 #t)) + (when (not (pointing-toward-focus? self 4551.1113 #t)) (let ((v1-3 self)) (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) ) @@ -1221,7 +1222,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! rat-turn-left-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop!)) @@ -1259,7 +1260,7 @@ ) :code (behavior () (until #f - (when (not (enemy-method-105 self 4551.1113 #t)) + (when (not (pointing-toward-focus? self 4551.1113 #t)) (let ((v1-3 self)) (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) ) @@ -1267,7 +1268,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! rat-turn-left-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop!)) @@ -1324,7 +1325,7 @@ (cond ((handle->process (-> self ragdoll-proc)) (vector-reset! (-> self root transv)) - (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (move-to-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) (ja-channel-push! 1 0) (ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0) (let ((gp-0 (-> (the-as ragdoll-proc (-> self ragdoll-proc process 0)) ragdoll))) @@ -1393,7 +1394,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-virtual flee) ) @@ -1590,11 +1591,14 @@ (none) ) -(defmethod enemy-method-108 ((this rat) (arg0 process-focusable)) +(defmethod should-flee-from? ((this rat) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (not (time-elapsed? (-> this scared-timer) (-> this scared-interval))) (-> this permanently-scared)) ) -(defmethod enemy-method-109 ((this rat)) +(defmethod out-of-bounds? ((this rat)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -1626,7 +1630,8 @@ ) ) -(defmethod within-gspot-range? ((this rat)) +(defmethod invalid-height? ((this rat)) + "Return #t if the enemy is too high in the air, or below the ground." (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -1642,7 +1647,7 @@ a1-0 ) ) - ((method-of-type nav-enemy within-gspot-range?) this) + ((method-of-type nav-enemy invalid-height?) this) ) ) ) @@ -1650,6 +1655,7 @@ ) (defmethod ragdoll-settled? ((this rat)) + "Has the ragdoll stopped moving?" (with-pp (and (or (time-elapsed? (-> this state-time) (seconds 3)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -1674,6 +1680,7 @@ ;; WARN: Return type mismatch float vs object. (defmethod knocked-handler ((this rat) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (let ((f30-0 (rnd-float-range this 0.9 1.0))) (let ((f0-0 0.0) @@ -1685,7 +1692,10 @@ ) ) -(defmethod enemy-method-63 ((this rat) (arg0 float)) +(defmethod apply-incoming-hitpoint-mods ((this rat) (arg0 float)) + "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (if (= (-> this hit-points) (-> this enemy-info default-hit-points)) 1.0 0.0 @@ -1694,6 +1704,7 @@ ;; WARN: Return type mismatch int vs knocked-type. (defmethod penetrate->knocked-type ((this rat) (arg0 penetrate)) + "Based on the penetrate of an attacker, pick the knocked-type." (the-as knocked-type (cond ((logtest? arg0 (penetrate vehicle)) 7 @@ -1715,6 +1726,7 @@ ) (defmethod go-hostile ((this rat)) + "Go to the hostile state, actively trying to attack the target." (if (logtest? (-> this fact enemy-options) (enemy-option user8)) (go (method-of-object this wait-by-wheel-seek)) (go (method-of-object this hostile)) @@ -1722,18 +1734,20 @@ ) (defmethod coin-flip? ((this rat)) + "Return #t half the time, #f the other." #f ) (defmethod enemy-common-post ((this rat)) + "Common implementation of post. Runs ja-post." (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-2) 3)) ) ) (when (-> this return-to-nav-mesh?) (format *stdebug* "~s ~d off nav-mesh~%" (-> this name) (-> this pid)) - (when (enemy-method-109 this) + (when (out-of-bounds? this) (set! (-> this return-to-nav-mesh?) #f) (go-die this) ) @@ -1752,7 +1766,8 @@ (none) ) -(defmethod enemy-method-50 ((this rat) (arg0 int)) +(defmethod update-collision-action ((this rat) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -1776,11 +1791,13 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this rat)) +(defmethod get-search-info-flag ((this rat)) + "Get search-info-flag for this process." (the-as search-info-flag 8) ) (defmethod event-handler ((this rat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-5 object)) (case arg2 (('hit 'hit-knocked 'hit-flinch) @@ -1793,7 +1810,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1830,6 +1847,7 @@ ) (defmethod init-enemy! ((this rat)) + "Typical place for shared init code. Runs from entity or process style init." (with-pp (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -1838,7 +1856,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-rat" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *rat-nav-enemy-info*) + (setup-enemy! this *rat-nav-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -1965,7 +1983,7 @@ (let ((s5-2 (-> self entity)) (gp-2 (new 'stack-no-clear 'enemy-init-by-other-params)) ) - (set! (-> gp-2 trans quad) (-> s5-2 extra trans quad)) + (vector-copy! (-> gp-2 trans) (-> s5-2 extra trans)) (quaternion-copy! (-> gp-2 quat) (-> s5-2 quat)) (set! (-> gp-2 entity) s5-2) (set! (-> gp-2 directed?) #f) @@ -2006,6 +2024,7 @@ ) (defmethod init-from-entity! ((this rat-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this wheel-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (set! (-> this rats-spawned) (the-as uint 0)) diff --git a/goal_src/jak3/levels/nest/egg-spider.gc b/goal_src/jak3/levels/nest/egg-spider.gc index 8eddde7ec4f..4a48e275420 100644 --- a/goal_src/jak3/levels/nest/egg-spider.gc +++ b/goal_src/jak3/levels/nest/egg-spider.gc @@ -583,34 +583,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 275251.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 67.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -659,6 +659,7 @@ ;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 (defmethod event-handler ((this egg-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (sv-16 float) (sv-32 float)) (case arg2 (('attack) @@ -699,9 +700,10 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this egg-spider)) +(defmethod get-search-info-flag ((this egg-spider)) + "Get search-info-flag for this process." (the-as search-info-flag (if (or *egg-spider-always-trackable?* (-> this trackable?)) - (the-as int ((method-of-type nav-enemy process-mask->search-info-flag) this)) + (the-as int ((method-of-type nav-enemy get-search-info-flag) this)) 0 ) ) @@ -713,7 +715,7 @@ (a3-0 (-> arg0 state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (vector-copy! a2-0 (-> a3-0 heading)) (t9-0 this v1-1 a2-0) ) 0 @@ -745,7 +747,7 @@ (cond ((logtest? (enemy-flag ef39) (-> this enemy-flags)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) - (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (vector-copy! (-> this root gspot-pos) (-> this root trans)) ) (else (normalize-heading! this (-> this nav)) @@ -823,11 +825,11 @@ ) (cond ((< f30-0 (-> this enemy-info notice-nav-radius)) - (set! (-> this target-pos quad) (-> s5-2 quad)) + (vector-copy! (-> this target-pos) s5-2) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s4-2 quad)) + (vector-copy! s3-1 s4-2) (let ((s5-3 (new 'stack-no-clear 'vector))) - (set! (-> s5-3 quad) (-> this root transv quad)) + (vector-copy! s5-3 (-> this root transv)) (vector-normalize! s5-3 f30-0) (if (>= (vector-dot s3-1 s5-3) 0.98) (go (method-of-object this attack)) @@ -857,7 +859,7 @@ ) (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-1 s5-2 s3-2) - (set! (-> this target-pos quad) (-> s2-1 quad)) + (vector-copy! (-> this target-pos) s2-1) ) ) ) @@ -910,6 +912,7 @@ ;; WARN: Return type mismatch object vs none. (defmethod enemy-common-post ((this egg-spider)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -924,7 +927,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-2 quad)) + (vector-copy! (-> v1-1 target-pos) a0-2) ) 0 (none) @@ -970,7 +973,7 @@ ) (logclear! (-> gp-1 flags) (nav-state-flag directional-mode)) (logior! (-> gp-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-1 target-pos quad) (-> v1-10 quad)) + (vector-copy! (-> gp-1 target-pos) v1-10) ) 0 ) @@ -1000,7 +1003,7 @@ (ja :num! (seek!)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-travel-post ) @@ -1010,7 +1013,7 @@ :enter (behavior () (set-time! (-> self state-time)) (nav-enemy-method-182 self) - (set! (-> self init-pos quad) (-> self root trans quad)) + (vector-copy! (-> self init-pos) (-> self root trans)) (set! (-> self jump-pos) 0.0) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (collide-spec)) @@ -1076,7 +1079,7 @@ (set! (-> self attack-id) a0-2) ) (sound-play "spider-land-veh") - (set! (-> self init-pos quad) (-> self root trans quad)) + (vector-copy! (-> self init-pos) (-> self root trans)) ) :exit (behavior () (let ((a0-1 (handle->process (-> self wvehicle)))) @@ -1142,7 +1145,7 @@ (.svf (&-> a1-7 quad) vf6) ) (vector-normalize! (-> self vec-up) 1.0) - (set! (-> self root trans quad) (-> s1-0 quad)) + (vector-copy! (-> self root trans) s1-0) (quaternion-from-two-vectors! s3-0 (-> self vec-up) s2-0) (quaternion*! (-> self root quat) (the-as quaternion s4-0) s3-0) (send-event @@ -1253,7 +1256,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1270,11 +1273,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 638 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 638)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 638)) ) ) @@ -1322,11 +1325,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 639 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 639)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 639)) ) ) @@ -1376,6 +1379,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this egg-spider) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1385,9 +1389,9 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod init-enemy-defaults! ((this egg-spider) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this egg-spider) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1415,6 +1419,7 @@ ) (defmethod init-enemy-collision! ((this egg-spider)) + "Typical place to construct collision shapes" (let ((f30-0 (* 3276.8 (-> this size))) (s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))) ) @@ -1455,12 +1460,13 @@ ) (defmethod init-enemy! ((this egg-spider)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-egg-spider" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *egg-spider-nav-enemy-info*) + (setup-enemy! this *egg-spider-nav-enemy-info*) (set! (-> this move-angle) 10922.667) (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) #t @@ -1548,10 +1554,10 @@ (defmethod spider-manager-method-24 ((this spider-manager) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> s5-0 vec0 quad) (-> arg0 quad)) - (set! (-> s5-0 cquery start-pos quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec0) arg0) + (vector-copy! (-> s5-0 cquery start-pos) (-> s5-0 vec0)) (set-vector! (-> s5-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) - (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (when (= (level-status? *level* 'desert #f) 'active) (set-vector! (-> s5-0 cquery move-dist) 0.0 -409600.0 0.0 1.0) (+! (-> s5-0 cquery start-pos y) 204800.0) ) @@ -1568,8 +1574,8 @@ (let ((f0-11 (fill-and-probe-using-line-sphere *collide-cache* (-> s5-0 cquery)))) (when (>= f0-11 0.0) (vector+float*! (-> s5-0 vec0) (-> s5-0 cquery start-pos) (-> s5-0 cquery move-dist) f0-11) - (set! (-> s5-0 vec1 quad) (-> s5-0 cquery best-other-tri normal quad)) - (set! (-> arg0 quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 cquery best-other-tri normal)) + (vector-copy! arg0 (-> s5-0 vec0)) ) ) ) @@ -1584,12 +1590,12 @@ (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (let ((a1-2 (new 'stack-no-clear 'nav-poly))) (set! (-> a1-2 vertex1 x) 122880.0) (set! (-> a1-2 data 20) (the-as uint 2)) (vector-! (the-as vector (-> a1-2 vertex)) s3-0 (the-as vector (-> s4-0 bounds))) - (set! (-> s3-0 quad) (-> a1-2 vertex 0 quad)) + (vector-copy! s3-0 (-> a1-2 vertex 0)) (let ((a1-3 (nav-mesh-method-45 s4-0 a1-2))) (when a1-3 (let ((s2-1 (new 'stack-no-clear 'vector))) @@ -1660,7 +1666,7 @@ (check-can-rid self) (when (< (-> self next-spot-time) (current-time)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (camera-pos) quad)) + (vector-copy! s5-0 (camera-pos)) (let ((f28-0 (camera-angle)) (s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) @@ -1683,7 +1689,7 @@ ) ) (when (spider-manager-method-25 self (the-as sphere gp-0)) - (set! (-> self spawn-pos quad) (-> gp-0 quad)) + (vector-copy! (-> self spawn-pos) gp-0) (set! (-> self next-spot-time) (+ (current-time) (rand-vu-int-range (-> self min-spot-delay) (-> self max-spot-delay))) ) @@ -1709,7 +1715,7 @@ (set! (-> gp-3 r) 4096.0) (when (and (sphere-in-view-frustum? gp-3) (spider-manager-method-25 self gp-3)) (let ((s5-1 (new 'stack-no-clear 'enemy-init-by-other-params))) - (set! (-> s5-1 trans quad) (-> gp-3 quad)) + (vector-copy! (-> s5-1 trans) gp-3) (quaternion-copy! (-> s5-1 quat) *unity-quaternion*) (set! (-> s5-1 entity) (-> self actor-group 0 data 0 actor)) (set! (-> s5-1 directed?) #f) @@ -1767,11 +1773,12 @@ ) (defmethod init-from-entity! ((this spider-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag) (sv-32 res-tag)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'trsqv))) (set! (-> this root) s4-0) - (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> s4-0 trans) (-> arg0 extra trans)) (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) (vector-identity! (-> s4-0 scale)) ) diff --git a/goal_src/jak3/levels/nest/mh-bat.gc b/goal_src/jak3/levels/nest/mh-bat.gc index a48c788ab9e..a8995f054e3 100644 --- a/goal_src/jak3/levels/nest/mh-bat.gc +++ b/goal_src/jak3/levels/nest/mh-bat.gc @@ -567,34 +567,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd) @@ -983,6 +983,7 @@ (set! (-> *mh-bat-enemy-info* fact-defaults) *fact-info-mh-bat-defaults*) (defmethod init-enemy-collision! ((this mh-bat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1174,7 +1175,7 @@ :enter (behavior () (call-parent-state-handler enter) (set-time! (-> self state-time)) - (set! (-> self start-pos quad) (-> self root trans quad)) + (vector-copy! (-> self start-pos) (-> self root trans)) (set-vector! (-> self root transv) 0.0 -81920.0 0.0 0.0) (set! (-> self orbit-angle) (vector-vector-angle-safe @@ -1222,7 +1223,7 @@ :event enemy-event-handler :enter (behavior () (set-time! (-> self state-time)) - (set! (-> self event-param-point quad) (-> self start-pos quad)) + (vector-copy! (-> self event-param-point) (-> self start-pos)) (vector-reset! (-> self target-velocity)) ) :code (behavior () @@ -1262,10 +1263,10 @@ ((>= 1 (the-as int gp-0)) (go-virtual retreat) ) - ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + ((and (= gp-0 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -1442,7 +1443,7 @@ (logior! (-> gp-0 options) (projectile-options po14)) (set! (-> gp-0 vehicle-impulse-factor) 1.5) (logior! (-> gp-0 options) (projectile-options po16)) - (set! (-> gp-0 pos quad) (-> a2-2 quad)) + (vector-copy! (-> gp-0 pos) a2-2) (vector-normalize-copy! (-> gp-0 vel) (vector-! (new 'stack-no-clear 'vector) v1-23 a2-2) 532480.0) ) (spawn-projectile metalhead-shot gp-0 self *default-dead-pool*) @@ -1499,7 +1500,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1611,7 +1612,7 @@ (s5-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 81920.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) s5-0 f30-0) (let ((v1-17 s4-0)) (set! (-> v1-17 radius) 3276.8) @@ -1667,11 +1668,13 @@ (none) ) -(defmethod within-gspot-range? ((this mh-bat)) +(defmethod invalid-height? ((this mh-bat)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) -(defmethod enemy-method-50 ((this mh-bat) (arg0 int)) +(defmethod update-collision-action ((this mh-bat) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((or (zero? v1-0) (= v1-0 2)) @@ -1695,6 +1698,7 @@ ;; WARN: Return type mismatch ragdoll-flag vs vector. (defmethod ragdoll-spawn! ((this mh-bat) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." (let ((t9-0 (method-of-type enemy ragdoll-spawn!))) (t9-0 this arg0 arg1) ) @@ -1714,6 +1718,7 @@ ) (defmethod enemy-common-post ((this mh-bat)) + "Common implementation of post. Runs ja-post." (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this last-off-screen-time)) ) @@ -1721,8 +1726,8 @@ (when (< 1 (the-as int (-> this focus aware))) (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans s5-0 0) quad)) - (set! (-> this focus-bullseye-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans s5-0 0)) + (vector-copy! (-> this focus-bullseye-pos) (get-trans s5-0 3)) (vector-! (-> this focus-xz-dir) (-> this focus-pos) (-> this root trans)) (set! (-> this focus-xz-dir y) 0.0) (vector-xz-normalize! (-> this focus-xz-dir) 1.0) @@ -1735,6 +1740,7 @@ ) (defmethod event-handler ((this mh-bat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1746,7 +1752,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1775,16 +1781,18 @@ ) (defmethod coin-flip? ((this mh-bat)) + "Return #t half the time, #f the other." #f ) (defmethod init-enemy! ((this mh-bat)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-bat" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *mh-bat-enemy-info*) + (setup-enemy! this *mh-bat-enemy-info*) (set-scale! this 1.0) (set! (-> this root pause-adjust-distance) 368640.0) (let ((v1-9 (-> this neck))) diff --git a/goal_src/jak3/levels/nest/mh-centipede-part.gc b/goal_src/jak3/levels/nest/mh-centipede-part.gc index 727e21f5476..a3506154843 100644 --- a/goal_src/jak3/levels/nest/mh-centipede-part.gc +++ b/goal_src/jak3/levels/nest/mh-centipede-part.gc @@ -1041,11 +1041,11 @@ (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) (cond ((logtest? (-> *part-group-id-table* 648 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 648)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 648)) ) ) diff --git a/goal_src/jak3/levels/nest/mh-centipede.gc b/goal_src/jak3/levels/nest/mh-centipede.gc index e3fac7f6210..b30103b53c3 100644 --- a/goal_src/jak3/levels/nest/mh-centipede.gc +++ b/goal_src/jak3/levels/nest/mh-centipede.gc @@ -665,7 +665,7 @@ (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set-vector! (-> gp-0 move-dist) 0.0 -204800.0 0.0 1.0) - (set! (-> gp-0 start-pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> self root trans)) (+! (-> gp-0 start-pos y) 102400.0) (let ((v1-17 gp-0)) (set! (-> v1-17 radius) 409.6) @@ -704,7 +704,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-1 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 pos) (-> self root trans)) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags taf3 taf5)) (set! (-> gp-1 map-icon) (the-as uint 12)) @@ -788,6 +788,7 @@ ) (defmethod init-from-entity! ((this rod-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -947,7 +948,7 @@ ) 0 (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -998,7 +999,7 @@ (defmethod init! ((this mh-centipede-crater-pt-array) (arg0 vector) (arg1 float)) - (set! (-> this origin quad) (-> arg0 quad)) + (vector-copy! (-> this origin) arg0) (set! (-> this radius) arg1) (set! (-> this current-point) 0) 0 @@ -1072,7 +1073,7 @@ ) (vector-cross! s3-1 (-> s5-0 normal) (vector-get-unique! (new 'stack-no-clear 'vector) (-> s5-0 normal))) (vector-normalize! s3-1 10240.0) - (set! (-> s4-1 0 quad) (-> s3-1 quad)) + (vector-copy! (-> s4-1 0) s3-1) (vector-cross! (-> s4-1 1) s3-1 (-> s5-0 normal)) (vector-negate! (-> s4-1 2) s3-1) (vector-cross! (-> s4-1 3) (-> s5-0 normal) s3-1) @@ -1107,7 +1108,7 @@ (fill-using-bounding-box *collide-cache* s3-2) ) (dotimes (s3-3 4) - (set! (-> gp-0 start-pos quad) (-> s4-1 s3-3 quad)) + (vector-copy! (-> gp-0 start-pos) (-> s4-1 s3-3)) (when (< (probe-using-line-sphere *collide-cache* gp-0) 0.0) (set! (-> s5-0 found?) #f) (return 0) @@ -1137,7 +1138,7 @@ ) (let ((s1-0 (-> this points (-> this current-point)))) (when (-> s1-0 found?) - (set! (-> s3-0 uvec quad) (-> s1-0 normal quad)) + (vector-copy! (-> s3-0 uvec) (-> s1-0 normal)) (vector-cross! (-> s3-0 rvec) (-> s3-0 uvec) @@ -1305,7 +1306,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this mh-centipede)) +(defmethod get-search-info-flag ((this mh-centipede)) + "Get search-info-flag for this process." (the-as search-info-flag 120) ) @@ -1316,7 +1318,7 @@ (let ((gp-0 (new 'static 'vector))) (cond ((logtest? (-> this flags) (mh-centipede-flag mc5)) - (set! (-> gp-0 quad) (-> this landing-position quad)) + (vector-copy! gp-0 (-> this landing-position)) (+! (-> gp-0 y) 8192.0) ) (else @@ -1336,8 +1338,8 @@ (set! (-> this effect-sphere) (nest-hunt-find-sphere (-> this root trans))) (when (!= (-> this prev-time) (current-time)) (set-time! (-> this prev-time)) - (set! (-> this prev-target-position quad) (-> this current-target-position quad)) - (set! (-> this current-target-position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this prev-target-position) (-> this current-target-position)) + (vector-copy! (-> this current-target-position) (target-pos 0)) ) (nest-hunt-play-speech 1 (-> this effect-sphere)) 0 @@ -1355,7 +1357,7 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (+! (-> s5-0 start-pos y) 20480.0) (let ((v1-3 s5-0)) (set! (-> v1-3 radius) 409.6) @@ -1415,13 +1417,13 @@ (set! (-> this current-anim) (-> this breach-anims (rand-vu-int-count (-> this breach-anims length)))) ) (set! (-> this pre-breach-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) - (set! (-> s4-0 rvec quad) (-> (camera-matrix) fvec quad)) + (vector-copy! (-> s4-0 rvec) (-> (camera-matrix) fvec)) (set! (-> s4-0 rvec y) 0.0) (vector-normalize! (-> s4-0 rvec) 1.0) - (set! (-> s4-0 uvec quad) (-> (camera-matrix) rvec quad)) + (vector-copy! (-> s4-0 uvec) (-> (camera-matrix) rvec)) (set! (-> s4-0 uvec y) 0.0) (vector-normalize! (-> s4-0 uvec) 1.0) - (set! (-> s4-0 fvec quad) (-> s4-0 rvec quad)) + (vector-copy! (-> s4-0 fvec) (-> s4-0 rvec)) (vector-normalize! (-> s4-0 fvec) 327680.0) (vector+! (-> s4-0 fvec) (-> s4-0 fvec) (target-pos 0)) (let ((s3-3 (closest-point-on-mesh (-> this nav) (-> this landing-position) (-> s4-0 fvec) (the-as nav-poly #f))) @@ -1501,7 +1503,7 @@ (when (probe-ground this (-> this launch-position)) (when arg0 (logior! (-> this flags) (mh-centipede-flag mc8)) - (set! (-> this landing-position quad) (-> this launch-position quad)) + (vector-copy! (-> this landing-position) (-> this launch-position)) ) (return #t) ) @@ -1523,10 +1525,10 @@ (let ((s5-0 (new 'stack-no-clear 'matrix))) (set! (-> this current-anim) (-> this breach-anims (rand-vu-int-count (-> this breach-anims length)))) (set! (-> this pre-breach-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) - (set! (-> s5-0 rvec quad) (-> (camera-matrix) fvec quad)) + (vector-copy! (-> s5-0 rvec) (-> (camera-matrix) fvec)) (set! (-> s5-0 rvec y) 0.0) (vector-normalize! (-> s5-0 rvec) 1.0) - (set! (-> s5-0 uvec quad) (-> (camera-matrix) rvec quad)) + (vector-copy! (-> s5-0 uvec) (-> (camera-matrix) rvec)) (set! (-> s5-0 uvec y) 0.0) (vector-normalize! (-> s5-0 uvec) 1.0) (let* ((s4-2 (-> s5-0 fvec)) @@ -1647,23 +1649,12 @@ (let ((s4-0 (get-field-spec-by-id (-> *part-id-table* 2512) (sp-field-id spt-omega))) (s5-0 (new 'stack-no-clear 'matrix)) ) - (let* ((v1-2 s5-0) - (a3-0 (-> this node-list data arg0 bone transform)) - (a0-5 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-2 rvec quad) a0-5) - (set! (-> v1-2 uvec quad) a1-3) - (set! (-> v1-2 fvec quad) a2-0) - (set! (-> v1-2 trans quad) a3-1) - ) + (matrix-copy! s5-0 (-> this node-list data arg0 bone transform)) (vector<-cspace! (-> s5-0 trans) (-> this node-list data arg0)) (cond (s4-0 (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> s5-0 trans quad)) + (vector-copy! (-> s3-1 start-pos) (-> s5-0 trans)) (vector-float*! (-> s3-1 move-dist) (-> this root dynam gravity-normal) -163840.0) (let ((v1-8 s3-1)) (set! (-> v1-8 radius) 1228.8) @@ -1720,10 +1711,10 @@ (s1-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> this root quat))) (s4-3 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-3 quad) (-> this root trans quad)) + (vector-copy! s4-3 (-> this root trans)) (let ((s3-2 (new 'stack-no-clear 'vector))) - (set! (-> s3-2 quad) (-> this root scale quad)) - (set! (-> this root trans quad) (-> s5-0 trans quad)) + (vector-copy! s3-2 (-> this root scale)) + (vector-copy! (-> this root trans) (-> s5-0 trans)) (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) (let ((s5-1 (get-process *default-dead-pool* joint-exploder #x4000 0))) (when s5-1 @@ -1744,8 +1735,8 @@ ) ) (quaternion-copy! (-> this root quat) s1-0) - (set! (-> this root trans quad) (-> s4-3 quad)) - (set! (-> this root scale quad) (-> s3-2 quad)) + (vector-copy! (-> this root trans) s4-3) + (vector-copy! (-> this root scale) s3-2) ) ) ) @@ -1901,7 +1892,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s2-0 (target-pos 0)) (vector<-cspace! s3-0 (-> this node-list data 77)) (let ((s1-0 sound-play-by-name) (sname (static-sound-name "cent-fire-spit")) @@ -1943,8 +1934,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s3-0 quad)) - (set! (-> gp-0 vel quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 pos) s3-0) + (vector-copy! (-> gp-0 vel) s4-0) ) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) @@ -2155,7 +2146,7 @@ :enter (behavior () (nest-hunt-play-speech 0 (-> self effect-sphere)) (set-time! (-> self state-time)) - (set! (-> self root trans quad) (-> self launch-position quad)) + (vector-copy! (-> self root trans) (-> self launch-position)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self landing-position) (-> self launch-position)))) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -2431,7 +2422,7 @@ :enter (behavior () (nest-hunt-play-speech 0 (-> self effect-sphere)) (set-time! (-> self state-time)) - (set! (-> self root trans quad) (-> self launch-position quad)) + (vector-copy! (-> self root trans) (-> self launch-position)) (let* ((gp-0 lerp-scale) (s5-0 1638.4) (s4-0 0.0) @@ -2833,7 +2824,7 @@ (when (not (logtest? (-> self flags) (mh-centipede-flag mc7))) (when (mh-centipede-method-38 self #f) (ja :group! mh-centipede-shoot-ja :num! min) - (set! (-> self root trans quad) (-> self launch-position quad)) + (vector-copy! (-> self root trans) (-> self launch-position)) (logior! (-> self flags) (mh-centipede-flag mc7)) ) ) @@ -2899,6 +2890,7 @@ ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this mh-centipede) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -3010,7 +3002,7 @@ (let ((s4-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) (when s4-2 (change-to s4-2 this) - (set! (-> this root trans quad) (-> s4-2 bounds quad)) + (vector-copy! (-> this root trans) (-> s4-2 bounds)) (if (nonzero? (-> this nav)) (closest-point-on-mesh (-> this nav) (-> this root trans) (-> this root trans) (the-as nav-poly #f)) ) @@ -3086,8 +3078,8 @@ (set! (-> this minimap) #f) (set! (-> this mm-handle) (the-as handle #f)) (set-time! (-> this prev-time)) - (set! (-> this prev-target-position quad) (-> (target-pos 0) quad)) - (set! (-> this current-target-position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this prev-target-position) (target-pos 0)) + (vector-copy! (-> this current-target-position) (target-pos 0)) (set! (-> this effect-sphere) #f) (go (method-of-object this hidden)) 0 @@ -3246,7 +3238,7 @@ (defmethod taskman-event-handler ((this task-manager-mh-centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('centipede-died) - (set! (-> this last-centipede-position quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> this last-centipede-position) (the-as vector (-> arg3 param 0))) (let ((gp-0 (the-as object (-> this last-target-position)))) (set! (-> (the-as vector gp-0) quad) (-> (target-pos 0) quad)) gp-0 diff --git a/goal_src/jak3/levels/nest/nst-obs.gc b/goal_src/jak3/levels/nest/nst-obs.gc index be735a089c6..e0fdb2360ac 100644 --- a/goal_src/jak3/levels/nest/nst-obs.gc +++ b/goal_src/jak3/levels/nest/nst-obs.gc @@ -127,20 +127,21 @@ (set! *nst-metalhead-eggs-last-sound-time* (current-time)) ) (let ((v1-18 (new 'stack-no-clear 'vector))) - (set! (-> v1-18 quad) (-> self root trans quad)) + (vector-copy! v1-18 (-> self root trans)) (+! (-> v1-18 y) 8192.0) (cond ((logtest? (-> *part-group-id-table* 611 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-18 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-18) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 611)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-18 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-18) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 611)) ) ) ) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (cleanup-for-death self) ) ) @@ -164,11 +165,13 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this nst-metalhead-eggs)) +(defmethod get-search-info-flag ((this nst-metalhead-eggs)) + "Get search-info-flag for this process." (the-as search-info-flag 24) ) (defmethod init-from-entity! ((this nst-metalhead-eggs) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -382,6 +385,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this nst-bridge-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -475,7 +479,7 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 622 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -484,7 +488,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -518,6 +522,7 @@ ) (defmethod init-from-entity! ((this nst-falling-stone-bridge-goo) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -628,7 +633,7 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 4 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 4 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -637,7 +642,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 4 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 4 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -648,7 +653,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 5 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -657,7 +662,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 5 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -668,7 +673,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 6 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 6 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -677,7 +682,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 6 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 6 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -688,7 +693,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 7 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 7 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -697,7 +702,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 7 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 7 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -709,7 +714,8 @@ (when (-> self actor-group) (let ((f30-0 (* 0.0005 (the float (-> self actor-group length))))) (dotimes (gp-8 (-> self actor-group length)) - (suspend-for (the int (* 300.0 f30-0))) + (suspend-for (the int (* 300.0 f30-0)) + ) (let ((a1-24 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-24 from) (process->ppointer self)) (set! (-> a1-24 num-params) 0) @@ -728,9 +734,10 @@ (when (not (logtest? gp-8 1)) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> self node-list data (-> *nst-falling-stone-bridge-part-nodes* (logand gp-8 3)) bone transform trans quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (-> self node-list data (-> *nst-falling-stone-bridge-part-nodes* (logand gp-8 3)) bone transform trans) + ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -739,9 +746,10 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) - (-> self node-list data (-> *nst-falling-stone-bridge-part-nodes* (logand gp-8 3)) bone transform trans quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (-> self node-list data (-> *nst-falling-stone-bridge-part-nodes* (logand gp-8 3)) bone transform trans) + ) (part-tracker-spawn part-tracker :to *entity-pool* @@ -791,7 +799,7 @@ (when (= (the int f30-0) (+ gp-0 -10)) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 4 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 4 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -800,7 +808,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 4 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 4 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -811,7 +819,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 5 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -820,7 +828,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 5 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -831,7 +839,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 7 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 7 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -840,7 +848,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 7 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 7 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -851,7 +859,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 8 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 8 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -860,7 +868,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 8 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 8 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -871,7 +879,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 9 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 9 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -880,7 +888,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 9 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 9 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -891,7 +899,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 10 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 10 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -900,7 +908,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 10 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 10 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -913,7 +921,7 @@ (when (= (the int f30-0) (+ gp-0 -3)) (cond ((logtest? (-> *part-group-id-table* 621 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 12 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 12 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -922,7 +930,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 12 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 12 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1002,6 +1010,7 @@ ) (defmethod init-from-entity! ((this nst-falling-stone-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 512) (let ((t9-1 (method-of-type nst-bridge-base init-from-entity!))) @@ -1182,7 +1191,8 @@ ) :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (suspend-for (seconds 0.2)) + (suspend-for (seconds 0.2) + ) (when (-> self anim) (-> self draw bounds w) (set! (-> self draw bounds w) 737280.0) @@ -1346,6 +1356,7 @@ ) (defmethod init-from-entity! ((this nst-collapsing-stone-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (let ((t9-1 (method-of-type nst-bridge-base init-from-entity!))) (t9-1 this arg0) @@ -1384,11 +1395,11 @@ (defmethod projectile-method-26 ((this cocoon-grenade-shot)) (cond ((logtest? (-> *part-group-id-table* 105 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 105)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 105)) ) ) @@ -1515,34 +1526,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -1608,7 +1619,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1715,9 +1726,13 @@ (set! (-> self cycling?) #t) (spawn (-> self charge-up-part) (-> self node-list data 12 bone transform trans)) (set! (-> self cycle-rot) -1820.4445) - (suspend-for (seconds 0.5) (ja :num! (loop!))) + (suspend-for (seconds 0.5) + (ja :num! (loop!)) + ) (set! (-> self cycle-rot) 1820.4445) - (suspend-for (seconds 0.5) (ja :num! (loop!))) + (suspend-for (seconds 0.5) + (ja :num! (loop!)) + ) (set! (-> self cycling?) #f) (set! (-> self shots-left) (the-as uint 4)) (set! (-> self can-shoot?) #f) @@ -1808,11 +1823,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 617 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self incoming attack-position quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self incoming attack-position)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 617)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self incoming attack-position quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self incoming attack-position)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 617)) ) ) @@ -1856,7 +1871,7 @@ (kill-particles (-> self charge-up-part)) (cond ((logtest? (-> *part-group-id-table* 616 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 12 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 12 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -1865,7 +1880,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 12 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 12 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1896,11 +1911,13 @@ (if (>= (-> self palette-id) 0) (set-nstb-lights! (-> self palette-id) 4.0 8.0 #f) ) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (if (>= (-> self palette-id) 0) (set-nstb-lights! (-> self palette-id) 0.0 6.0 #f) ) - (suspend-for (seconds 0.35)) + (suspend-for (seconds 0.35) + ) (let ((gp-6 (-> self child))) (while gp-6 (send-event (ppointer->process gp-6) 'notice 'die) @@ -1917,12 +1934,14 @@ ) (defmethod event-handler ((this nst-cocoon-a) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (if (not (and (= arg2 'attack) (type? arg0 cocoon-grenade-shot))) ((method-of-type nav-enemy event-handler) (the-as nav-enemy this) arg0 arg1 arg2 arg3) ) ) (defmethod enemy-common-post ((this nst-cocoon-a)) + "Common implementation of post. Runs ja-post." (let ((f0-1 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) (set-vector! (-> this draw color-mult) 1.0 f0-1 f0-1 1.0) ) @@ -1966,7 +1985,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) 0.0 - (set! (-> s5-0 quad) (-> this node-list data 5 bone transform fvec quad)) + (vector-copy! s5-0 (-> this node-list data 5 bone transform fvec)) (set! (-> s3-0 initial-tilt) (asin (-> s5-0 y))) (set! (-> s3-0 gravity) 102400.0) (let ((f30-0 4095996000.0) @@ -2016,7 +2035,7 @@ (set! (-> s2-0 charge) 1.0) (set! (-> s2-0 options) (projectile-options)) (logclear! (-> s2-0 options) (projectile-options po14 po15 po16)) - (set! (-> s2-0 pos quad) (-> this node-list data s1-0 bone transform trans quad)) + (vector-copy! (-> s2-0 pos) (-> this node-list data s1-0 bone transform trans)) (set! (-> s2-0 notify-handle) (the-as handle #f)) (set! (-> s2-0 owner-handle) (process->handle this)) (set! (-> s2-0 target-handle) (the-as handle #f)) @@ -2035,7 +2054,7 @@ (logior! (-> s2-0 options) (projectile-options po15)) (set! (-> s2-0 vehicle-impulse-factor) 1.5) (logior! (-> s2-0 options) (projectile-options po16)) - (set! (-> s5-0 quad) (-> this node-list data s1-0 bone transform fvec quad)) + (vector-copy! s5-0 (-> this node-list data s1-0 bone transform fvec)) (vector-normalize-copy! (-> s2-0 vel) s5-0 (-> s3-0 initial-speed)) (spawn-projectile cocoon-grenade-shot s2-0 this *default-dead-pool*) ) @@ -2047,7 +2066,8 @@ (none) ) -(defmethod is-pfoc-in-mesh? ((this nst-cocoon-a) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this nst-cocoon-a) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (cond ((= (-> this activate-distance) 0.0) (return #t) @@ -2062,6 +2082,7 @@ ) (defmethod coin-flip? ((this nst-cocoon-a)) + "Return #t half the time, #f the other." #f ) @@ -2075,6 +2096,7 @@ ) (defmethod init-enemy-collision! ((this nst-cocoon-a)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2132,13 +2154,14 @@ ;; WARN: Return type mismatch connection-minimap vs none. (defmethod init-enemy! ((this nst-cocoon-a)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-nst-cocoon-a" (the-as (pointer level) #f))) (the-as pair 0) ) (set! (-> this enemy-info) *nst-cocoon-a-enemy-info*) - (init-enemy-defaults! this (-> this enemy-info)) + (setup-enemy! this (-> this enemy-info)) (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) ) @@ -2168,12 +2191,14 @@ ) (defmethod init-from-entity! ((this nst-cocoon-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) ((method-of-type enemy init-from-entity!) this arg0) ) -(defmethod go-idle2 ((this nst-cocoon-a)) +(defmethod go-fallback-init ((this nst-cocoon-a)) + "If there's no specific settings for initial state, go to this state after spawning." (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (task-node-closed? (game-task-node nest-eggs-resolution)) ) @@ -2289,6 +2314,7 @@ ) (defmethod init-from-entity! ((this nst-cocoon-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2422,9 +2448,10 @@ ) (defmethod init-from-entity! ((this nst-light-barrier) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'trsqv))) (set! (-> this root) (the-as collide-shape s4-0)) - (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> s4-0 trans) (-> arg0 extra trans)) (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) (vector-identity! (-> s4-0 scale)) ) diff --git a/goal_src/jak3/levels/nest/nst-part.gc b/goal_src/jak3/levels/nest/nst-part.gc index 8d53acc5cad..cd37b30c29e 100644 --- a/goal_src/jak3/levels/nest/nst-part.gc +++ b/goal_src/jak3/levels/nest/nst-part.gc @@ -686,7 +686,7 @@ (set! (-> a0-2 action-mask) (collide-action solid)) ) (+! (-> v1-0 y) -163840.0) - (set! (-> s5-0 start-pos quad) (-> v1-0 quad)) + (vector-copy! (-> s5-0 start-pos) v1-0) ) (vector-reset! (-> s5-0 move-dist)) (set! (-> s5-0 move-dist y) -163840.0) @@ -1244,7 +1244,7 @@ (v1-18 (-> (the-as part-tracker (-> a0-12 proc)) root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1343,7 +1343,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -1442,7 +1442,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1541,7 +1541,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1640,7 +1640,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -1739,7 +1739,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1838,7 +1838,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -1937,7 +1937,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -2036,7 +2036,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -2246,7 +2246,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) diff --git a/goal_src/jak3/levels/precursor/precura-obs.gc b/goal_src/jak3/levels/precursor/precura-obs.gc index 2db2bf03ed9..b9a4b916b86 100644 --- a/goal_src/jak3/levels/precursor/precura-obs.gc +++ b/goal_src/jak3/levels/precursor/precura-obs.gc @@ -23,19 +23,20 @@ (lambda :behavior process () (let ((gp-0 (current-time))) - (suspend-for (seconds 1) (when (time-elapsed? gp-0 (seconds 0.03)) - (set! gp-0 (current-time)) - (process-drawable-shock-effect - *target* - (-> *lightning-spec-id-table* 1) - lightning-probe-callback - (-> *part-id-table* 160) - 0 - 0 - 40960.0 - ) - ) - ) + (suspend-for (seconds 1) + (when (time-elapsed? gp-0 (seconds 0.03)) + (set! gp-0 (current-time)) + (process-drawable-shock-effect + *target* + (-> *lightning-spec-id-table* 1) + lightning-probe-callback + (-> *part-id-table* 160) + 0 + 0 + 40960.0 + ) + ) + ) ) #f ) @@ -156,6 +157,7 @@ ) (defmethod init-from-entity! ((this precur-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -300,6 +302,7 @@ ) (defmethod init-from-entity! ((this precur-jump-plate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set-time! (-> this state-time)) (set-time! (-> this turn-start)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -466,7 +469,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (vector-! gp-1 (target-pos 0) (-> self root trans)) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -631,11 +634,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -690,6 +693,7 @@ ) (defmethod init-from-entity! ((this precur-generator-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) @@ -801,11 +805,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -848,6 +852,7 @@ ) (defmethod init-from-entity! ((this precur-generator-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -1002,11 +1007,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1042,15 +1047,18 @@ ) (logior! (-> self draw status) (draw-control-status no-draw)) (transform-post) - (suspend-for (seconds 1.2)) + (suspend-for (seconds 1.2) + ) (when (res-lump-struct (-> self entity) 'art-name structure) (logclear! (-> self mask) (process-mask actor-pause)) (process-grab? *target* #f) (set-setting! 'entity-name "camera-359" 0.0 0) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (task-close! "precursor-tour-generator-trigger") (send-event (process-by-name "precur-door-b-4" *active-pool*) 'open) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (set-setting! 'interp-time 'abs 450.0 0) (remove-setting! 'entity-name) (process-release? *target*) @@ -1062,6 +1070,7 @@ ) (defmethod init-from-entity! ((this precur-generator-c) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -1141,8 +1150,8 @@ (let ((v1-1 (the-as object (-> block param 0))) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> (the-as vector (-> block param 1)) quad)) - (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + (vector-copy! gp-0 (the-as vector (-> block param 1))) + (vector-copy! (-> self root trans) (the-as vector v1-1)) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 1.0) (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) @@ -1181,7 +1190,7 @@ (vector-rotate-around-y! (-> self offset-vec) (-> self offset-vec) (* (-> self ang-vel) (seconds-per-frame))) (vector+! (-> self root trans) (-> self init-pos) (-> self offset-vec)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self offset-vec quad)) + (vector-copy! gp-0 (-> self offset-vec)) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 1.0) (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) @@ -1216,7 +1225,7 @@ ) (vector+! (-> self root trans) (-> self init-pos) (-> self offset-vec)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self offset-vec quad)) + (vector-copy! gp-0 (-> self offset-vec)) (let ((s5-0 (new 'stack-no-clear 'vector))) (rand-vu-sphere-point! s5-0 3072.0) (vector+! (-> self root trans) (-> self root trans) s5-0) @@ -1245,11 +1254,11 @@ (transform-post) (cond ((logtest? (-> *part-group-id-table* 1318 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1318)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1318)) ) ) @@ -1290,11 +1299,11 @@ (set! (-> self root) s3-0) ) (set! (-> self sound-id) (new-sound-id)) - (set! (-> self offset-vec quad) (-> arg2 quad)) + (vector-copy! (-> self offset-vec) arg2) (set! (-> self ang-vel) arg1) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1317) self)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self init-pos quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self init-pos) arg0) (initialize-skeleton self (the-as @@ -1373,7 +1382,7 @@ (defmethod spawn-gems ((this precur-generator-d)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> this proc-handle 0) (ppointer->handle (process-spawn precur-generator-d-gem s5-0 @@ -1456,11 +1465,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1512,11 +1521,11 @@ (set! (-> gp-0 y) -20480.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-0 (-> self root trans) gp-0) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-0 (-> self root trans) gp-0)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-0 (-> self root trans) gp-0) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-0 (-> self root trans) gp-0)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1525,11 +1534,11 @@ (set! (-> gp-0 y) -32768.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-0 (-> self root trans) gp-0) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-0 (-> self root trans) gp-0)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-0 (-> self root trans) gp-0) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-0 (-> self root trans) gp-0)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1554,11 +1563,11 @@ (set! (-> gp-4 y) -61440.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-4 (-> self root trans) gp-4) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-4 (-> self root trans) gp-4)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-4 (-> self root trans) gp-4) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-4 (-> self root trans) gp-4)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1567,11 +1576,11 @@ (set! (-> gp-4 y) -20480.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-4 (-> self root trans) gp-4) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-4 (-> self root trans) gp-4)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-4 (-> self root trans) gp-4) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-4 (-> self root trans) gp-4)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1585,11 +1594,11 @@ (set! (-> gp-8 y) -61440.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-8 (-> self root trans) gp-8) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-8 (-> self root trans) gp-8)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-8 (-> self root trans) gp-8) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-8 (-> self root trans) gp-8)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1598,11 +1607,11 @@ (set! (-> gp-8 y) -20480.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-8 (-> self root trans) gp-8) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-8 (-> self root trans) gp-8)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-8 (-> self root trans) gp-8) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-8 (-> self root trans) gp-8)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1616,6 +1625,7 @@ ) (defmethod init-from-entity! ((this precur-generator-d) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) @@ -1835,6 +1845,7 @@ ) (defmethod init-from-entity! ((this precur-platform-round) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1980,7 +1991,7 @@ ) (quaternion-copy! s5-0 (-> self root quat)) (quaternion-rotate-local-y! s5-0 s5-0 16384.0) - (when (= (status-of-level-and-borrows *level* 'lmech #f) 'active) + (when (= (level-status? *level* 'lmech #f) 'active) (mech-target-spawn (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :x 8192.0 :w 1.0) gp-0) self @@ -2053,6 +2064,7 @@ ) (defmethod init-from-entity! ((this precur-door-d) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -2310,6 +2322,7 @@ ) (defmethod init-from-entity! ((this precur-door-c) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2416,6 +2429,7 @@ (defmethod init-from-entity! ((this precura-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this open-started) 0) (set! (-> this open-frame) 45.0) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -2494,7 +2508,8 @@ (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) ) ) - (suspend-for (seconds 1.5)) + (suspend-for (seconds 1.5) + ) (set-setting! 'entity-name "camera-420" 0.0 0) (process-grab? *target* #f) (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -2568,7 +2583,8 @@ ) :code (behavior () (when (-> self precur-tour?) - (suspend-for (seconds 2.5)) + (suspend-for (seconds 2.5) + ) (remove-setting! 'entity-name) (process-release? *target*) ) diff --git a/goal_src/jak3/levels/precursor/precura-obs2.gc b/goal_src/jak3/levels/precursor/precura-obs2.gc index cb809d094b8..a44e90ee91e 100644 --- a/goal_src/jak3/levels/precursor/precura-obs2.gc +++ b/goal_src/jak3/levels/precursor/precura-obs2.gc @@ -256,7 +256,7 @@ ) (quaternion-copy! (-> self root quat) (the-as quaternion (&-> self stack 96))) (set-vector! (-> self root transv) 0.0 -4096.0 0.0 1.0) - (set! (-> self drop-point quad) (-> self origin quad)) + (vector-copy! (-> self drop-point) (-> self origin)) (go-virtual fall) ) ) @@ -284,8 +284,8 @@ (can-drop? self (the-as vector (-> block param 0))) ) (('drop) - (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) - (set! (-> self drop-point quad) (-> self root trans quad)) + (vector-copy! (-> self root transv) (the-as vector (-> block param 1))) + (vector-copy! (-> self drop-point) (-> self root trans)) (go-virtual fall) ) ) @@ -316,16 +316,16 @@ (if (handle->process (-> self carry other)) (drop! (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) (-> self carry)) ) - (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) - (set! (-> self drop-point quad) (-> self root trans quad)) + (vector-copy! (-> self root transv) (the-as vector (-> block param 1))) + (vector-copy! (-> self drop-point) (-> self root trans)) (go-virtual fall) ) (('move) (let ((s4-0 (-> self root)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> s4-0 trans quad)) - (set! (-> s4-0 transv quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! s5-0 (-> s4-0 trans)) + (vector-copy! (-> s4-0 transv) (the-as vector (-> block param 0))) (let ((s2-0 (-> self nav)) (s1-0 (-> s4-0 root-prim prim-core)) (s3-0 (new 'stack-no-clear 'vector)) @@ -483,11 +483,11 @@ (sound-play "block-break") (cond ((logtest? (-> *part-group-id-table* 195 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 195)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 195)) ) ) @@ -499,11 +499,11 @@ (sound-play "block-break") (cond ((logtest? (-> *part-group-id-table* 195 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 195)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 195)) ) ) @@ -571,7 +571,7 @@ (f0-6 (* f0-5 f0-5)) (f0-7 (- 1.0 f0-6)) ) - (set! (-> s3-0 quad) (-> arg0 surface-normal quad)) + (vector-copy! s3-0 (-> arg0 surface-normal)) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 f0-7) ) @@ -634,7 +634,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this precur-bomb)) +(defmethod get-search-info-flag ((this precur-bomb)) + "Get search-info-flag for this process." (the-as search-info-flag (logior 0 16)) ) @@ -689,10 +690,10 @@ (when (logtest? (-> s3-0 mask) (attack-mask intersection)) (let ((gp-1 (new 'stack-no-clear 'vector))) (vector-z-quaternion! gp-1 (target-rot)) - (set! (-> self drop-point quad) (-> self root trans quad)) + (vector-copy! (-> self drop-point) (-> self root trans)) (vector-normalize-copy! gp-1 gp-1 102400.0) (+! (-> gp-1 y) 102400.0) - (set! (-> self root transv quad) (-> gp-1 quad)) + (vector-copy! (-> self root transv) gp-1) ) (when (zero? (-> self bomb-timer)) (set! (-> self bomb-timer) (the-as uint (current-time))) @@ -724,10 +725,10 @@ (('fall) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-z-quaternion! gp-0 (target-rot)) - (set! (-> self drop-point quad) (-> self root trans quad)) + (vector-copy! (-> self drop-point) (-> self root trans)) (vector-normalize-copy! gp-0 gp-0 102400.0) (+! (-> gp-0 y) 102400.0) - (set! (-> self root transv quad) (-> gp-0 quad)) + (vector-copy! (-> self root transv) gp-0) ) (when (zero? (-> self bomb-timer)) (set! (-> self bomb-timer) (the-as uint (current-time))) @@ -905,7 +906,7 @@ (go-virtual idle) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root transv quad)) + (vector-copy! gp-1 (-> self root transv)) (let ((f0-9 32768.0)) (set! (-> gp-1 y) 0.0) (let* ((f0-11 (* (/ f0-9 (meters 5)) (vector-length gp-1))) @@ -937,7 +938,7 @@ :enter (behavior () (sound-play "prec-bomb-xplo") (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 40960.0) (set! (-> gp-1 scale) 1.0) @@ -1011,14 +1012,14 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-precur-bomb" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (mem-copy! (the-as pointer (-> self origin)) (the-as pointer (-> self root trans)) 48) (set! (-> self collide-timer) (the-as uint 0)) (set! (-> self bomb-timer) (the-as uint 0)) (set! (-> self blink-timer) (the-as uint 0)) (set! (-> self blink-rate) 600.0) (set! (-> self blink) #t) - (set! (-> self default-emissive-color quad) (-> self draw color-emissive quad)) + (vector-copy! (-> self default-emissive-color) (-> self draw color-emissive)) (set! (-> self allow-drag?) #f) (set! (-> self reset-on-land?) #f) (let* ((v1-22 *game-info*) @@ -1029,7 +1030,7 @@ ) (set! (-> self hit-something?) #f) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (+! (-> gp-1 y) 12288.0) (let ((v1-28 (new 'process 'carry-info self 3 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) 0.0))) (set! (-> v1-28 max-distance) 16384.0) @@ -1085,6 +1086,7 @@ ) (defmethod init-from-entity! ((this precur-box) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1189,7 +1191,7 @@ (defmethod spawn-bomb ((this precur-bomb-spawner)) (local-vars (v1-10 (pointer process))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (format 0 "spawning bomb~%") (sound-play "prec-bomb-spawn") (format 0 "spawning bomb-post~%") @@ -1318,6 +1320,7 @@ ) (defmethod init-from-entity! ((this precur-bomb-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -1487,7 +1490,7 @@ (local-vars (sv-560 collide-query) (sv-564 float)) (set! sv-560 (new 'stack-no-clear 'collide-query)) (set! sv-564 83968.0) - (set! (-> sv-560 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-560 start-pos) arg0) (vector-normalize-copy! arg1 arg1 sv-564) (vector-normalize-copy! (-> sv-560 move-dist) arg1 sv-564) (let ((v1-5 sv-560)) @@ -1562,7 +1565,7 @@ (local-vars (sv-560 collide-query) (sv-564 float)) (set! sv-560 (new 'stack-no-clear 'collide-query)) (set! sv-564 83968.0) - (set! (-> sv-560 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-560 start-pos) arg0) (vector-float*! (-> sv-560 move-dist) arg1 sv-564) (let ((v1-7 sv-560)) (set! (-> v1-7 radius) 40.96) @@ -1591,7 +1594,7 @@ ) (vector+float*! s3-0 arg0 arg1 sv-564) (matrix-f-compose s4-0 arg1) - (set! (-> s4-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 trans) s3-0) (if (logtest? (-> *part-group-id-table* 1326 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1603,7 +1606,7 @@ ) (vector+float*! s3-0 arg0 arg1 (- sv-564)) (matrix-f-compose s4-0 (vector-float*! (new 'stack-no-clear 'vector) arg1 -1.0)) - (set! (-> s4-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 trans) s3-0) (if (logtest? (-> *part-group-id-table* 1326 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1740,6 +1743,7 @@ ) (defmethod init-from-entity! ((this precur-laser-beam) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this on-duration) 60.0) @@ -1850,10 +1854,10 @@ (defmethod task-manager-method-26 ((this task-manager-precura)) (when *target* (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s4-0 (target-pos 0)) (let ((s3-0 (new 'stack-no-clear 'vector))) (when (and (>= (-> s4-0 z) (-> *pca-sph1* z)) (>= (-> *pca-sph2* z) (-> s4-0 z))) - (set! (-> s3-0 quad) (-> *pca-sph1* quad)) + (vector-copy! s3-0 *pca-sph1*) (set! (-> s4-0 z) 0.0) (set! (-> s3-0 z) 0.0) (when (< (vector-vector-distance s4-0 s3-0) (-> *pca-sph1* r)) @@ -1999,7 +2003,7 @@ (set! sv-656 (new 'stack-no-clear 'matrix)) (set! sv-672 (new 'stack-no-clear 'collide-query)) (set! sv-688 (the-as symbol #f)) - (set! (-> sv-672 start-pos quad) (-> arg4 quad)) + (vector-copy! (-> sv-672 start-pos) arg4) (set! sv-704 (-> sv-672 move-dist)) (set! (-> sv-704 x) (rand-vu-float-range 0.0 65536.0)) (set! (-> sv-704 y) (rand-vu-float-range 0.0 65536.0)) @@ -2023,7 +2027,7 @@ ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-672) 0.0) (set-time! (-> s5-0 last-valid-time)) - (set! (-> s5-0 end-pos quad) (-> sv-672 best-other-tri intersect quad)) + (vector-copy! (-> s5-0 end-pos) (-> sv-672 best-other-tri intersect)) (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-672 start-pos))) (set! sv-688 #t) (goto cfg-7) @@ -2057,7 +2061,7 @@ (a0-26 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (vector-copy! (-> a2-5 trans) (-> s5-0 end-pos)) (t9-12 a0-26 arg3 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -2117,21 +2121,21 @@ ;; WARN: Return type mismatch vector vs none. (defmethod set-inner-jmod-scale ((this precur-spot-shadow-effect) (arg0 vector)) - (set! (-> this jmod-inner transform scale quad) (-> arg0 quad)) + (vector-copy! (-> this jmod-inner transform scale) arg0) (none) ) ;; WARN: Return type mismatch vector vs none. (defmethod set-outer-jmod-scale ((this precur-spot-shadow-effect) (arg0 vector)) - (set! (-> this jmod-outer transform scale quad) (-> arg0 quad)) + (vector-copy! (-> this jmod-outer transform scale) arg0) (none) ) (defbehavior precur-spot-shadow-effect-init-by-other precur-spot-shadow-effect ((arg0 vector) (arg1 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) (the-as quaternion arg1)) - (set! (-> self pre-flicker-pos quad) (-> self root trans quad)) + (vector-copy! (-> self pre-flicker-pos) (-> self root trans)) (set! (-> self level) (-> *level* level-default)) (initialize-skeleton self @@ -2263,7 +2267,7 @@ (set! sv-576 (new 'stack-no-clear 'collide-query)) (set! sv-580 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (set! sv-584 (vector-vector-distance arg0 arg1)) - (set! (-> sv-576 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-576 start-pos) arg0) (vector-normalize-copy! (-> sv-576 move-dist) sv-580 sv-584) (let ((v1-5 sv-576)) (set! (-> v1-5 radius) 40.96) @@ -2370,7 +2374,7 @@ (let ((a0-8 (the-as precur-spot-shadow-effect (-> this shock-shadow-handle process 0))) (a1-6 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-8 root trans quad) (-> s3-0 quad)) + (vector-copy! (-> a0-8 root trans) s3-0) (set-vector! a1-6 (* 0.0001319679 f0-1) 0.4 0.4 1.0) (set-outer-jmod-scale a0-8 a1-6) ) @@ -2392,7 +2396,7 @@ (+! (-> gp-0 span-pts-start data 0 y) 4096.0) ) (when arg1 - (set! (-> gp-0 span-pts-start data 1 quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 span-pts-start data 1) arg1) (+! (-> gp-0 span-pts-start data 1 y) 4096.0) ) (set! (-> gp-0 spans-internal data 1 num-inner-points) 0) @@ -2507,6 +2511,7 @@ ) (defmethod init-from-entity! ((this precur-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (when (res-lump-data arg0 'patha pointer) @@ -2566,6 +2571,7 @@ (defmethod init-from-entity! ((this precur-door-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/goal_src/jak3/levels/precursor/precurc-obs.gc b/goal_src/jak3/levels/precursor/precurc-obs.gc index aef37823c92..1adf852d40d 100644 --- a/goal_src/jak3/levels/precursor/precurc-obs.gc +++ b/goal_src/jak3/levels/precursor/precurc-obs.gc @@ -94,6 +94,7 @@ (defmethod init-from-entity! ((this precur-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this open-started) 0) (set! (-> this open-frame) 45.0) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -280,7 +281,7 @@ (let ((f0-9 (cos (* 65536.0 (-> this tt))))) (set! (-> this movedist) (* 20480.0 (+ -1.0 f0-9))) ) - (set! (-> s5-0 quad) (-> this entity extra trans quad)) + (vector-copy! s5-0 (-> this entity extra trans)) (vector-normalize-copy! (-> this dir) (-> s4-0 bone transform fvec) 1.0) ) (let ((a1-3 s5-0)) @@ -311,7 +312,7 @@ ) (when (-> this player-grabbed?) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> this entity extra trans quad)) + (vector-copy! s5-2 (-> this entity extra trans)) (seek! (-> this movedist) 0.0 (* 36864.0 (seconds-per-frame))) (let ((a1-7 s5-2)) (let ((v1-48 s5-2)) @@ -415,6 +416,7 @@ ;; WARN: Return type mismatch symbol vs object. (defmethod init-from-entity! ((this precur-swingpole-pop) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (call-parent-method this arg0) (set! (-> this player-grabbed?) #f) (set! (-> this moving?) #f) diff --git a/goal_src/jak3/levels/precursor/precurd-obs.gc b/goal_src/jak3/levels/precursor/precurd-obs.gc index d9adcd16967..18afc445fa4 100644 --- a/goal_src/jak3/levels/precursor/precurd-obs.gc +++ b/goal_src/jak3/levels/precursor/precurd-obs.gc @@ -531,6 +531,7 @@ ) (defmethod init-from-entity! ((this pre-tformer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -578,6 +579,7 @@ ) (defmethod init-from-entity! ((this wall-window-big) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -592,7 +594,7 @@ (defbehavior wall-window-big-init-by-other wall-window-big ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-wall-window-big" (the-as (pointer level) #f))) @@ -612,6 +614,7 @@ (defmethod init-from-entity! ((this precurd-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -689,7 +692,7 @@ (defun precur-bridge-path-trigger ((arg0 int)) (when *target* (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-0 (target-pos 0)) (and (< (-> *precur-path-trigger-points* arg0) (-> gp-0 z)) (< (-> gp-0 z) 2048000.0) (< -40960.0 (-> gp-0 x)) @@ -704,7 +707,7 @@ (defun precur-bridge-path-2nd-trigger ((arg0 int)) (when *target* (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-0 (target-pos 0)) (and (< (-> *precur-path-2nd-trigger-points* arg0) (-> gp-0 z)) (< (-> gp-0 z) 2129920.0) (< -40960.0 (-> gp-0 x)) @@ -719,7 +722,7 @@ (defun precur-bridge-blocks-trigger ((arg0 int)) (when *target* (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-0 (target-pos 0)) (and (< (-> *precur-blocks-trigger-points* arg0) (-> gp-0 z)) (< (-> gp-0 z) 2048000.0) (< -40960.0 (-> gp-0 x)) @@ -1259,6 +1262,7 @@ ) (defmethod init-from-entity! ((this precur-bridge-path-break) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set-idx-by-name this) (init-collision! this) @@ -2242,7 +2246,7 @@ (('xform) (let ((v1-9 (-> block param 0))) (when (not (-> self triggered?)) - (set! (-> self root trans quad) (-> self entity extra trans quad)) + (vector-copy! (-> self root trans) (-> self entity extra trans)) (vector+! (-> self root trans) (-> self root trans) (the-as vector (+ v1-9 48))) ) ) @@ -2288,10 +2292,11 @@ ) (when (= (-> a0-8 type) collide-shape-prim-group) (dotimes (s4-0 (the-as int (-> gp-0 specific 0))) - (set! (-> (new 'stack-no-clear 'vector) quad) - (-> (the-as collide-shape-prim-group gp-0) child s4-0 prim-core world-sphere quad) - ) - (set! (-> s5-0 quad) (-> (the-as collide-shape-prim-group gp-0) child s4-0 prim-core world-sphere quad)) + (vector-copy! + (new 'stack-no-clear 'vector) + (-> (the-as collide-shape-prim-group gp-0) child s4-0 prim-core world-sphere) + ) + (vector-copy! s5-0 (-> (the-as collide-shape-prim-group gp-0) child s4-0 prim-core world-sphere)) (when (and (not (-> self toe-up? s4-0)) (< 831488.0 (-> s5-0 y))) (set! (-> self toe-up? s4-0) #t) (when (time-elapsed? *precurd-panel-tear-off-time* (seconds 1)) @@ -2327,6 +2332,7 @@ ) (defmethod init-from-entity! ((this precur-bridge-blocks-break) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set-idx-by-name this) (init-collision! this) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak3/levels/precursor/prim-beam.gc b/goal_src/jak3/levels/precursor/prim-beam.gc index e0a90031244..fb1375911dd 100644 --- a/goal_src/jak3/levels/precursor/prim-beam.gc +++ b/goal_src/jak3/levels/precursor/prim-beam.gc @@ -102,32 +102,32 @@ (s1-0 (new 'stack-no-clear 'vector)) (f30-0 (-> this appearance width)) ) - (set! (-> s5-0 quad) (-> this pos0 quad)) + (vector-copy! s5-0 (-> this pos0)) (vector-! s1-0 (-> this pos1) (-> this pos0)) (vector-! s2-0 v1-1 s5-0) - (set! (-> s2-0 quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! s2-0 (-> (math-camera-matrix) fvec)) (vector-cross! s4-0 s2-0 s1-0) (vector-normalize! s4-0 1.0) (vector+float*! s5-0 (-> this pos0) s4-0 f30-0) - (set! (-> s3-0 0 pos quad) (-> s5-0 quad)) + (vector-copy! (-> s3-0 0 pos) s5-0) (set! (-> s3-0 0 stq z) 0.0) (set! (-> s3-0 0 stq x) 0.0) (set! (-> s3-0 0 stq y) 0.0) (let ((v1-9 (-> s3-0 1))) (vector+float*! s5-0 (-> this pos0) s4-0 (- f30-0)) - (set! (-> v1-9 pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-9 pos) s5-0) (set! (-> v1-9 stq z) 0.0) (set! (-> v1-9 stq x) 1.0) (set! (-> v1-9 stq y) 0.0) (let ((v1-10 (&+ v1-9 32))) (vector+float*! s5-0 (-> this pos1) s4-0 f30-0) - (set! (-> v1-10 pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-10 pos) s5-0) (set! (-> v1-10 stq z) 0.0) (set! (-> v1-10 stq x) 0.0) (set! (-> v1-10 stq y) (-> this appearance num-tiles)) (let ((v1-11 (&+ v1-10 32))) (vector+float*! s5-0 (-> this pos1) s4-0 (- f30-0)) - (set! (-> v1-11 pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-11 pos) s5-0) (set! (-> v1-11 stq z) 0.0) (set! (-> v1-11 stq x) 1.0) (set! (-> v1-11 stq y) (-> this appearance num-tiles)) @@ -197,10 +197,10 @@ (set! (-> self track-joint1) (-> arg0 track-joint1)) (set! (-> self track-joint2) (-> arg0 track-joint2)) (if (-> arg0 pos0) - (set! (-> self pos0 quad) (-> arg0 pos0 quad)) + (vector-copy! (-> self pos0) (-> arg0 pos0)) ) (if (-> arg0 pos1) - (set! (-> self pos1 quad) (-> arg0 pos1 quad)) + (vector-copy! (-> self pos1) (-> arg0 pos1)) ) (set! (-> self duration) (-> arg0 duration)) (mem-copy! (the-as pointer (-> self appearance)) (the-as pointer (-> arg0 appearance)) 20) diff --git a/goal_src/jak3/levels/sewer/flyingsaw.gc b/goal_src/jak3/levels/sewer/flyingsaw.gc index 852cbe64993..3726fa47337 100644 --- a/goal_src/jak3/levels/sewer/flyingsaw.gc +++ b/goal_src/jak3/levels/sewer/flyingsaw.gc @@ -258,7 +258,7 @@ (vector-normalize! s5-1 1.0) (forward-down->inv-matrix (-> self spark-mat) s5-1 (new 'static 'vector :y -1.0)) ) - (set! (-> self spark-mat trans quad) (-> gp-0 spark quad)) + (vector-copy! (-> self spark-mat trans) (-> gp-0 spark)) (set-time! (-> self spark-timer)) (sound-play "flysaw-hit-wall" :position (-> self root trans)) ) @@ -278,7 +278,7 @@ ) (if (< 1228.8 f0-2) (vector+float*! (-> self root trans) (-> self root trans) v1-36 (/ 1228.8 f0-2)) - (set! (-> self root trans quad) (-> gp-0 position quad)) + (vector-copy! (-> self root trans) (-> gp-0 position)) ) ) (let ((s5-3 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self base-quat))) @@ -297,11 +297,11 @@ ) (update-with-delay! (-> self wobble-target)) (let ((s5-4 (new 'stack-no-clear 'vector))) - (set! (-> s5-4 quad) (-> self wobble-target value quad)) + (vector-copy! s5-4 (-> self wobble-target value)) (let ((gp-3 (new 'stack-no-clear 'quaternion))) (set! (-> s5-4 y) 0.0) (update! (-> self wobble) (-> self wobble-target value)) - (set! (-> s5-4 quad) (-> self wobble value quad)) + (vector-copy! s5-4 (-> self wobble value)) (set! (-> s5-4 y) 1.0) (vector-normalize! s5-4 1.0) (quaternion-from-two-vectors! gp-3 (new 'static 'vector :y 1.0) s5-4) @@ -362,6 +362,7 @@ ) (defmethod init-from-entity! ((this flyingsaw) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate @@ -455,7 +456,7 @@ ) (set! (-> this current-node) (the-as uint 0)) (if (-> this graph) - (set! (-> this root trans quad) (-> this graph node (-> this current-node) position quad)) + (vector-copy! (-> this root trans) (-> this graph node (-> this current-node) position)) ) (set! (-> this spin-1) (new 'process 'joint-mod (joint-mod-mode foot-rot) this 10)) (set! (-> this spin-1 track-mode) (track-mode no-trans no-scale)) diff --git a/goal_src/jak3/levels/sewer/jump-pad.gc b/goal_src/jak3/levels/sewer/jump-pad.gc index 935e98cb47d..2d276413e91 100644 --- a/goal_src/jak3/levels/sewer/jump-pad.gc +++ b/goal_src/jak3/levels/sewer/jump-pad.gc @@ -143,6 +143,7 @@ ) (defmethod init-from-entity! ((this jump-pad) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this fan-loop-sound) #f) (set! (-> this jump-sound) #f) (init-sounds this) diff --git a/goal_src/jak3/levels/sewer/kg-hopper.gc b/goal_src/jak3/levels/sewer/kg-hopper.gc index 34db51c8a94..d84969a05c9 100644 --- a/goal_src/jak3/levels/sewer/kg-hopper.gc +++ b/goal_src/jak3/levels/sewer/kg-hopper.gc @@ -94,10 +94,11 @@ ) (defmethod knocked-anim ((this kg-hopper) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type blue-shot)) (let* ((a2-0 (ash 1 (-> *kg-hopper-global-info* prev-blue-hit))) - (v1-3 (enemy-method-131 this 3 a2-0)) + (v1-3 (rnd-int-excluding-masked this 3 a2-0)) (a1-5 (-> this draw art-group data (-> *kg-hopper-global-info* blue-hit-anim v1-3 hit-anim-index))) ) (set! (-> *kg-hopper-global-info* prev-blue-hit) v1-3) @@ -113,7 +114,7 @@ (else (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-2 (ash 1 (-> *kg-hopper-global-info* prev-yellow-hit))) - (v1-13 (enemy-method-131 this 3 a2-2)) + (v1-13 (rnd-int-excluding-masked this 3 a2-2)) (a1-11 (-> this draw art-group data (-> *kg-hopper-global-info* yellow-hit-anim v1-13 hit-anim-index))) ) (set! (-> this land-anim-index) (-> *kg-hopper-global-info* yellow-hit-anim v1-13 land-anim-index)) @@ -132,6 +133,7 @@ ) (defmethod knocked-land-anim ((this kg-hopper) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this incoming knocked-type) (knocked-type blue-shot)) #f @@ -300,34 +302,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 4551.1113 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -366,6 +368,7 @@ (set! (-> *kg-hopper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod go-die ((this kg-hopper)) + "Go to the die state." (go (method-of-object this explode)) ) @@ -386,17 +389,17 @@ (set! (-> a1-1 hit-y-reaction) 0.6) (set! (-> a1-1 scale-rand-lo) 0.5) (set! (-> a1-1 scale-rand-hi) 1.2) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> self incoming attack-position)) (debris-spawn self a1-1 *kg-hopper-debris-params* (the-as process-drawable #f)) ) (let ((v1-8 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node kg-hopper-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-8 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-8) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 221)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-8 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-8) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 221)) ) ) @@ -409,6 +412,7 @@ ) (defmethod event-handler ((this kg-hopper) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -420,7 +424,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -441,10 +445,10 @@ ) ) -(defmethod jump-anim-handler ((this kg-hopper) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this kg-hopper) (arg0 jump-stage) (arg1 enemy-jump-info)) (when (= (-> this jump-why) 2) (cond - ((zero? arg0) + ((= arg0 (jump-stage init)) (logior! (-> this focus-status) (focus-status touch-water under-water)) ) (else @@ -470,16 +474,16 @@ (when v1-7 (logclear! (-> this focus-status) (focus-status under-water)) (let ((v1-10 (new 'stack-no-clear 'vector))) - (set! (-> v1-10 quad) (-> this root trans quad)) + (vector-copy! v1-10 (-> this root trans)) (when (logtest? (water-flag touch-water) (-> s3-0 flags)) (set! (-> v1-10 y) (-> s3-0 trans y)) (cond ((logtest? (-> *part-group-id-table* 192 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-10) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 192)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-10) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 192)) ) ) @@ -497,6 +501,7 @@ ) (defmethod jump-wind-up-anim ((this kg-hopper) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump-start-anim))) (a0-4 (-> this skel root-channel 0)) @@ -511,6 +516,7 @@ ) (defmethod jump-in-air-anim ((this kg-hopper) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump-air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -525,6 +531,7 @@ ) (defmethod jump-land-anim ((this kg-hopper) (arg0 enemy-jump-info)) + "Play the landing anim" (ja-channel-push! 1 (seconds 0.075)) (let ((a1-2 (-> this draw art-group data (-> this jump-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -629,9 +636,9 @@ (let ((f30-0 (vector-dot s3-0 (-> this direction)))) (new 'stack-no-clear 'vector) (let ((a1-3 (new 'stack-no-clear 'vector))) - (set! (-> a1-3 quad) (-> s5-0 quad)) + (vector-copy! a1-3 s5-0) (set! (-> a1-3 w) 6144.0) - (when (not (add-root-sphere-to-hash! (-> this nav) a1-3 #x10006c)) + (when (not (check-sphere-blocked! (-> this nav) a1-3 #x10006c)) (when (< (-> this best-score) f30-0) (set! (-> this best-score) f30-0) (let ((s2-0 (new 'stack-no-clear 'vector))) @@ -657,7 +664,7 @@ ) ) ) - (set! (-> this best-point quad) (-> s5-0 quad)) + (vector-copy! (-> this best-point) s5-0) ) ) ) @@ -701,7 +708,7 @@ (nav-enemy-method-183 self) (set! (-> self speed-y) 0.0) (set! (-> self accel-y) 0.0) - (set! (-> self next-jump-time) (the-as int (+ (current-time) (set-reaction-time! self 0 (seconds 0.4))))) + (set! (-> self next-jump-time) (the-as int (+ (current-time) (rnd-time-frame self 0 (seconds 0.4))))) (set! (-> self step-num) 0) (set! (-> self best-score) -2.0) ) @@ -732,12 +739,12 @@ (f30-0 (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z))))) ) (set! (-> self step-num) 16) - (set! (-> self direction quad) (-> s4-1 quad)) + (vector-copy! (-> self direction) s4-1) 0.0 (let ((s4-2 (new 'stack-no-clear 'vector)) (f28-0 (if (zero? s5-0) (rnd-float-range self 4096.0 8192.0) - (rnd-float-range self 8192.0 (fmin 40960.0 (fmax 16384.0 (* 0.5 f30-0)))) + (rnd-float-range self 8192.0 (fmin 40960.0 (fmax 16384.0 (/ f30-0 2)))) ) ) ) @@ -800,7 +807,7 @@ ) ) ) - (set! *kg-hopper-next-jump-time* (+ (current-time) (set-reaction-time! self (seconds 0.015) (seconds 0.075)))) + (set! *kg-hopper-next-jump-time* (+ (current-time) (rnd-time-frame self (seconds 0.015) (seconds 0.075)))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) ) @@ -832,7 +839,7 @@ (set! (-> self jump-anim-start-frame) 8.0) ) ) - (set! *kg-hopper-next-jump-time* (+ (current-time) (set-reaction-time! self (seconds 0.015) (seconds 0.075)))) + (set! *kg-hopper-next-jump-time* (+ (current-time) (rnd-time-frame self (seconds 0.015) (seconds 0.075)))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) ) @@ -863,7 +870,7 @@ (nav-enemy-method-164 self) (let ((v1-2 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> self nav state))) - (set! (-> v1-2 quad) (-> a2-0 target-pos quad)) + (vector-copy! v1-2 (-> a2-0 target-pos)) ) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) @@ -888,14 +895,14 @@ (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (let ((a1-4 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-4 travel quad)) + (vector-copy! gp-0 (-> a1-4 travel)) ) (seek-toward-heading-vec! (-> self root) gp-0 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -937,7 +944,7 @@ (quaternion-rotate-y! (-> gp-1 quat) (-> gp-1 quat) f0-3) ) ) - (set! (-> gp-1 trans quad) (-> s5-0 quad)) + (vector-copy! (-> gp-1 trans) s5-0) ) ) ) @@ -985,6 +992,7 @@ ) (defmethod init-enemy-collision! ((this kg-hopper)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1052,11 +1060,12 @@ ) (defmethod init-enemy! ((this kg-hopper)) + "Typical place for shared init code. Runs from entity or process style init." (stack-size-set! (-> this main-thread) 256) (logior! (-> this mask) (process-mask kg-robot)) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-defaults! this *kg-hopper-nav-enemy-info*) + (setup-enemy! this *kg-hopper-nav-enemy-info*) (set! (-> this can-go-knocked?) #t) (let ((v1-11 (-> this neck))) (set! (-> v1-11 up) (the-as uint 1)) diff --git a/goal_src/jak3/levels/sewer/mh-wasp.gc b/goal_src/jak3/levels/sewer/mh-wasp.gc index 1f7173a2eaf..ad531e88219 100644 --- a/goal_src/jak3/levels/sewer/mh-wasp.gc +++ b/goal_src/jak3/levels/sewer/mh-wasp.gc @@ -316,7 +316,7 @@ ) (defmethod init-proj-settings! ((this mh-wasp-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'mh-wasp-shot) (set! (-> this max-speed) 491520.0) (set! (-> this move) metalhead-shot-move) @@ -439,34 +439,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 101580.8 - :knocked-hard-vy-lo 60620.8 - :knocked-hard-vy-hi 95027.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 24.8) + :knocked-hard-vy-lo (meters 14.8) + :knocked-hard-vy-hi (meters 23.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -481,6 +481,7 @@ (set! (-> *mh-wasp-enemy-info* fact-defaults) *fact-info-mh-wasp-defaults*) (defmethod event-handler ((this mh-wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -492,7 +493,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -509,6 +510,7 @@ ) (defmethod knocked-handler ((this mh-wasp) (arg0 vector)) + "Called when this enemy is knocked." (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type explode-or-darkjak)) @@ -544,7 +546,8 @@ ) ) -(defmethod go-idle2 ((this mh-wasp)) +(defmethod go-fallback-init ((this mh-wasp)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) (go (method-of-object this ambush)) (go (method-of-object this notice)) @@ -552,14 +555,17 @@ ) (defmethod go-hostile ((this mh-wasp)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this hostile)) ) -(defmethod go-best-state ((this mh-wasp)) +(defmethod go-state-for-focused ((this mh-wasp)) + "Go to the appropriate state for the current awareness of the focused process." (go-hostile this) ) (defmethod enemy-common-post ((this mh-wasp)) + "Common implementation of post. Runs ja-post." (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) ((method-of-type hover-enemy enemy-common-post) this) (none) @@ -715,7 +721,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> self focus-pos quad)) + (vector-copy! v1-4 (-> self focus-pos)) (+! (-> v1-4 y) (-> self attack-miss-dist-curr)) (vector-! gp-0 v1-4 a0-2) ) @@ -803,11 +809,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 1530 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1530)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1530)) ) ) @@ -839,6 +845,7 @@ ) (defmethod get-focus! ((this mh-wasp)) + "If we're focusing on something alive, return it." (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) (when s5-0 (let* ((a0-4 (-> this root)) @@ -850,7 +857,7 @@ (if (and (and s5-0 (not (logtest? (-> s5-0 focus-status) (focus-status disable dead ignore grabbed)))) (< 0.0 (vector-dot s2-1 s3-2)) (< (vector-vector-distance s4-1 (-> this focus-pos)) 225280.0) - (and (< (fabs (vector-x-angle s3-2)) 3640.889) (enemy-method-104 this (-> this focus-pos) 5461.3335)) + (and (< (fabs (vector-x-angle s3-2)) 3640.889) (pointing-toward? this (-> this focus-pos) 5461.3335)) ) s5-0 ) @@ -860,6 +867,7 @@ ) (defmethod knocked-anim ((this mh-wasp) (arg0 enemy-knocked-info)) + "start the knocked animation." (cond ((rnd-chance? this 0.5) (set! (-> this knocked-anim) 10) @@ -884,6 +892,7 @@ ) (defmethod knocked-land-anim ((this mh-wasp) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -896,16 +905,19 @@ #t ) -(defmethod enemy-method-88 ((this mh-wasp) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this mh-wasp) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" (-> this root) (>= (-> arg0 on-surface-count) 1) ) -(defmethod within-gspot-range? ((this mh-wasp)) +(defmethod invalid-height? ((this mh-wasp)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) (defmethod go-die ((this mh-wasp)) + "Go to the die state." (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) (go (method-of-object this die-now)) @@ -960,7 +972,7 @@ (-> arg0 scale) (quaternion-rotate-local-z! (the-as quaternion sv-208) a1-3 sv-192) (quaternion->matrix s5-0 (the-as quaternion sv-208)) - (set! (-> s2-1 quad) (-> arg0 root scale quad)) + (vector-copy! s2-1 (-> arg0 root scale)) (scale-matrix! s5-0 s2-1 s5-0) (let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat))) (t9-6 vector-inv-orient-by-quat!) @@ -1005,7 +1017,7 @@ ) ) ) - (set! (-> s5-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 trans) s4-0) (spawn-from-mat (-> arg0 engine-part) s5-0) (let ((f0-18 (lerp-scale 0.75 1.0 f28-0 1638.4 f30-0))) (sound-play-by-name @@ -1051,6 +1063,7 @@ ) (defmethod init-enemy-collision! ((this mh-wasp)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1228,9 +1241,10 @@ ) (defmethod init-enemy! ((this mh-wasp)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) (hover-enemy-method-170 this) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (hover-enemy-method-176 this) (set! (-> this neck up) (the-as uint 1)) (set! (-> this neck nose) (the-as uint 2)) diff --git a/goal_src/jak3/levels/sewer/needle-fish.gc b/goal_src/jak3/levels/sewer/needle-fish.gc index d450692c61f..7012d42f017 100644 --- a/goal_src/jak3/levels/sewer/needle-fish.gc +++ b/goal_src/jak3/levels/sewer/needle-fish.gc @@ -158,7 +158,7 @@ (set! (-> s5-0 attack-id) a0-12) ) (set! (-> s5-0 timeout) (seconds 4)) - (set! (-> s5-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 pos) arg1) (vector-normalize-copy! (-> s5-0 vel) a1-2 arg3) ) (the-as (pointer needle-fish-shot) (spawn-projectile needle-fish-shot s5-0 arg0 *default-dead-pool*)) @@ -351,34 +351,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -417,6 +417,7 @@ (set! (-> *needle-fish-nav-enemy-info* fact-defaults) *fact-info-needle-fish-defaults*) (defmethod init-enemy-collision! ((this needle-fish)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -553,7 +554,7 @@ (let ((a0-2 (-> self nav state))) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-0 quad)) + (vector-copy! (-> a0-2 target-pos) v1-0) ) 0 ) @@ -576,7 +577,7 @@ :trans (behavior () (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (let ((v1-3 (-> self focus aware))) - (if (or (>= 2 (the-as int v1-3)) (= v1-3 (enemy-aware ea4)) (not (get-focus! self))) + (if (or (>= 2 (the-as int v1-3)) (= v1-3 (enemy-aware flee)) (not (get-focus! self))) (go-stare self) ) ) @@ -626,7 +627,7 @@ ) ) (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) 20480.0) (set! (-> gp-2 scale) 1.0) @@ -650,7 +651,8 @@ ) ) -(defmethod enemy-method-108 ((this needle-fish) (arg0 process-focusable)) +(defmethod should-flee-from? ((this needle-fish) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (< (current-time) (-> this scared-timer)) ) @@ -660,6 +662,7 @@ ) (defmethod event-handler ((this needle-fish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-flinch 'hit-knocked) (go (method-of-object this explode)) @@ -670,14 +673,16 @@ ) ) -(defmethod send-attack-on-jump-or-knocked ((this needle-fish) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this needle-fish) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (if (= arg0 *target*) (go (method-of-object this explode)) - ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type nav-enemy enemy-touched-handler) this arg0 arg1) ) ) (defmethod enemy-common-post ((this needle-fish)) + "Common implementation of post. Runs ja-post." (when (not (-> this tail-initialized)) (set! (-> this tail-initialized) #t) (initialize-chain-joints (-> this tail)) @@ -685,7 +690,7 @@ (update (-> this tail) this) (let ((a0-4 (handle->process (-> this focus handle)))) (if a0-4 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-4) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-4) 3)) ) ) (+! (-> this tail-clock) @@ -704,12 +709,13 @@ ) (defmethod init-enemy! ((this needle-fish)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-needle-fish" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *needle-fish-nav-enemy-info*) + (setup-enemy! this *needle-fish-nav-enemy-info*) (set! (-> this tail) (new 'process 'needle-fish-chain-physics)) (chain-physics-initialize this (-> this tail) 25 1638.4 *needle-fish-chain-setup*) (set! (-> this tail-initialized) #f) diff --git a/goal_src/jak3/levels/sewer/neo-grenadier.gc b/goal_src/jak3/levels/sewer/neo-grenadier.gc index 19740a13273..6f3d0de474c 100644 --- a/goal_src/jak3/levels/sewer/neo-grenadier.gc +++ b/goal_src/jak3/levels/sewer/neo-grenadier.gc @@ -290,34 +290,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 0.18204445 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -358,6 +358,7 @@ (set! (-> *neo-grenadier-nav-enemy-info* fact-defaults) *fact-info-neo-grenadier-defaults*) (defmethod event-handler ((this neo-grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit-knocked) (when (= (-> this incoming knocked-type) (knocked-type yellow-shot)) @@ -411,9 +412,9 @@ ;; WARN: Return type mismatch vector vs none. (defmethod set-bank-info! ((this neo-grenadier) (arg0 vector)) (closest-point-on-mesh (-> this nav) arg0 arg0 (the-as nav-poly #f)) - (set! (-> this bank final-pos quad) (-> arg0 quad)) - (set! (-> this bank tangent-pos quad) (-> arg0 quad)) - (set! (-> this move-pos quad) (-> this bank tangent-pos quad)) + (vector-copy! (-> this bank final-pos) arg0) + (vector-copy! (-> this bank tangent-pos) arg0) + (vector-copy! (-> this move-pos) (-> this bank tangent-pos)) (none) ) @@ -487,7 +488,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (when (enemy-method-134 self 0.2) + (when (rnd-chance-for-idle? self 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.6)) (nav-enemy-method-182 self) @@ -500,7 +501,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -571,18 +572,18 @@ (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (new 'stack-no-clear 'vector) (vector-normalize! s3-1 49152.0) (closest-point-on-mesh (-> self nav) s4-0 (vector+! s4-0 s5-0 s3-1) (the-as nav-poly #f)) (when (< 32768.0 (vector-vector-distance gp-0 s4-0)) - (set! (-> self move-pos quad) (-> s4-0 quad)) + (vector-copy! (-> self move-pos) s4-0) (let ((a0-11 (-> self nav state)) (v1-32 (-> self move-pos)) ) (logclear! (-> a0-11 flags) (nav-state-flag directional-mode)) (logior! (-> a0-11 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-11 target-pos quad) (-> v1-32 quad)) + (vector-copy! (-> a0-11 target-pos) v1-32) ) 0 (go-virtual backup) @@ -630,7 +631,7 @@ :post (behavior () (let ((gp-0 (-> self bank))) (if (< (vector-vector-xz-distance (-> self root trans) (-> gp-0 tangent-pos)) 9830.4) - (set! (-> self move-pos quad) (-> gp-0 final-pos quad)) + (vector-copy! (-> self move-pos) (-> gp-0 final-pos)) ) ) (let ((a0-3 (-> self nav state)) @@ -638,7 +639,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> a0-3 target-pos) v1-5) ) 0 (nav-enemy-travel-post) @@ -675,7 +676,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -738,6 +739,7 @@ ) (defmethod knocked-anim ((this neo-grenadier) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type none)) (let ((s4-1 (-> this @@ -750,7 +752,7 @@ ) ((= (-> this incoming knocked-type) (knocked-type yellow-shot)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this root transv quad)) + (vector-copy! s4-0 (-> this root transv)) (let* ((s3-0 quaternion-rotate-y-to-vector!) (s2-0 (new 'stack-no-clear 'quaternion)) (s1-0 (-> this root quat)) @@ -791,7 +793,7 @@ (s5-1 (new 'static 'array uint64 3 #x1b #x1c #x1d)) (s4-2 (new 'static 'array int32 4 0 0 0 0)) (a2-3 (ash 1 (-> s4-2 0))) - (v1-23 (enemy-method-131 this a1-11 a2-3)) + (v1-23 (rnd-int-excluding-masked this a1-11 a2-3)) (s5-2 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-23 8) (the-as int s5-1)))))) ) (set! (-> s4-2 0) v1-23) @@ -822,6 +824,7 @@ ) (defmethod knocked-land-anim ((this neo-grenadier) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this incoming knocked-type) (knocked-type blue-shot)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -891,7 +894,7 @@ (setup-from-to-xz-vel! (-> self shot-trajectory) gp-0 s4-1 f0-2 -102400.0) ) ) - (set! (-> s5-1 quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! s5-1 (-> self shot-trajectory initial-velocity)) (vector-normalize! s5-1 1638.4) (vector+! gp-0 gp-0 s5-1) ) @@ -900,8 +903,8 @@ (set! (-> a1-9 charge) 1.0) (set! (-> a1-9 options) (projectile-options)) (logclear! (-> a1-9 options) (projectile-options po14 po15 po16)) - (set! (-> a1-9 pos quad) (-> gp-0 quad)) - (set! (-> a1-9 vel quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! (-> a1-9 pos) gp-0) + (vector-copy! (-> a1-9 vel) (-> self shot-trajectory initial-velocity)) (set! (-> a1-9 notify-handle) (process->handle self)) (set! (-> a1-9 owner-handle) (the-as handle #f)) (set! (-> a1-9 target-handle) (the-as handle #f)) @@ -936,7 +939,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + (vector-copy! (-> v1-1 target-pos) a0-1) ) 0 (nav-enemy-method-181 self) @@ -969,7 +972,7 @@ (let* ((v1-8 (vector-float*! (new 'stack-no-clear 'vector) (-> self root transv) 0.3)) (a2-2 (vector+! (new 'stack-no-clear 'vector) (-> self root trans) v1-8)) ) - (set! (-> self move-pos quad) (-> self root trans quad)) + (vector-copy! (-> self move-pos) (-> self root trans)) (closest-point-on-mesh (-> self nav) (-> self move-pos) a2-2 (the-as nav-poly #f)) ) (let ((a0-10 (-> self nav state)) @@ -977,7 +980,7 @@ ) (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-10 target-pos quad) (-> v1-13 quad)) + (vector-copy! (-> a0-10 target-pos) v1-13) ) 0 (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) @@ -1007,12 +1010,12 @@ (logclear! (-> self status-flags) (grenadier-status-flag gsf0)) ) (else - (when (not (enemy-method-105 self 1820.4445 #t)) + (when (not (pointing-toward-focus? self 1820.4445 #t)) (nav-enemy-method-183 self) (ja-channel-push! 1 (seconds 0.2)) (ja :group! neo-grenadier-throw-turn-in-place-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 910.2222 #t) + (until (pointing-toward-focus? self 910.2222 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -1133,7 +1136,7 @@ (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) (logclear! (-> self focus-status) (focus-status hit)) (cond - ((= (-> self focus aware) (enemy-aware ea3)) + ((= (-> self focus aware) (enemy-aware hostile)) (if (and (handle->process (-> self focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) @@ -1152,6 +1155,7 @@ ) (defmethod go-hostile ((this neo-grenadier)) + "Go to the hostile state, actively trying to attack the target." (if (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) (and (logtest? (-> this status-flags) (grenadier-status-flag gsf0)) (handle->process (-> this focus handle)) @@ -1188,7 +1192,7 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1201,7 +1205,7 @@ (vector-reset! a2-0) (set! (-> a2-0 y) 1.0) (let ((t0-0 (-> arg0 state))) - (set! (-> v1-3 quad) (-> t0-0 heading quad)) + (vector-copy! v1-3 (-> t0-0 heading)) ) (let* ((a1-3 (-> *perf-stats* data 33)) (a3-3 (-> a1-3 ctrl)) @@ -1242,6 +1246,7 @@ ;; WARN: Return type mismatch object vs none. (defmethod enemy-common-post ((this neo-grenadier)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -1252,6 +1257,7 @@ ) (defmethod init-enemy-collision! ((this neo-grenadier)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1347,12 +1353,13 @@ ) (defmethod init-enemy! ((this neo-grenadier)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-grenadier" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *neo-grenadier-nav-enemy-info*) + (setup-enemy! this *neo-grenadier-nav-enemy-info*) (let ((v1-5 (-> this neck))) (when v1-5 (set! (-> v1-5 up) (the-as uint 1)) diff --git a/goal_src/jak3/levels/sewer/neo-juicer.gc b/goal_src/jak3/levels/sewer/neo-juicer.gc index a088860bab0..6f1fb93aaf4 100644 --- a/goal_src/jak3/levels/sewer/neo-juicer.gc +++ b/goal_src/jak3/levels/sewer/neo-juicer.gc @@ -116,10 +116,10 @@ (case arg2 (('reset) (let ((v1-1 (the-as object (-> arg3 param 0)))) - (set! (-> this root trans quad) (-> (the-as (inline-array vector) v1-1) 0 quad)) - (set! (-> this starting-pos quad) (-> (the-as (inline-array vector) v1-1) 0 quad)) - (set! (-> this root transv quad) (-> (the-as (inline-array vector) v1-1) 1 quad)) - (set! (-> this pre-move-transv quad) (-> (the-as (inline-array vector) v1-1) 1 quad)) + (vector-copy! (-> this root trans) (-> (the-as (inline-array vector) v1-1) 0)) + (vector-copy! (-> this starting-pos) (-> (the-as (inline-array vector) v1-1) 0)) + (vector-copy! (-> this root transv) (-> (the-as (inline-array vector) v1-1) 1)) + (vector-copy! (-> this pre-move-transv) (-> (the-as (inline-array vector) v1-1) 1)) ) (set! (-> this hits) 0) (set-time! (-> this spawn-time)) @@ -187,7 +187,7 @@ (let ((a0-20 (-> this lightning s0-0)) (v1-25 s4-0) ) - (set! (-> a0-20 state meet data (+ (-> a0-20 state points-to-draw) -1) quad) (-> v1-25 quad)) + (vector-copy! (-> a0-20 state meet data (+ (-> a0-20 state points-to-draw) -1)) v1-25) ) ) ) @@ -201,11 +201,11 @@ (projectile-method-25 this) (cond ((logtest? (-> *part-group-id-table* 1524 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1524)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1524)) ) ) @@ -243,7 +243,7 @@ (let ((s5-0 (handle->process (-> arg0 victim)))) (cond (s5-0 - (set! (-> arg0 root trans quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (vector-copy! (-> arg0 root trans) (get-trans (the-as process-focusable s5-0) 3)) ((method-of-type projectile deal-damage!) arg0 s5-0 (the-as event-message-block #f)) ) (else @@ -569,34 +569,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 65536.0 - :knocked-soft-vxz-hi 94208.0 - :knocked-soft-vy-lo 77824.0 - :knocked-soft-vy-hi 98304.0 - :knocked-medium-vxz-lo 81920.0 - :knocked-medium-vxz-hi 98304.0 - :knocked-medium-vy-lo 81920.0 - :knocked-medium-vy-hi 122880.0 - :knocked-hard-vxz-lo 65536.0 - :knocked-hard-vxz-hi 95846.4 - :knocked-hard-vy-lo 122880.0 - :knocked-hard-vy-hi 163840.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 98304.0 - :knocked-red-vy-lo 90112.0 - :knocked-red-vy-hi 131072.0 - :knocked-blue-vxz-lo 24576.0 - :knocked-blue-vxz-hi 32768.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 73728.0 + :knocked-soft-vxz-lo (meters 16) + :knocked-soft-vxz-hi (meters 23) + :knocked-soft-vy-lo (meters 19) + :knocked-soft-vy-hi (meters 24) + :knocked-medium-vxz-lo (meters 20) + :knocked-medium-vxz-hi (meters 24) + :knocked-medium-vy-lo (meters 20) + :knocked-medium-vy-hi (meters 30) + :knocked-hard-vxz-lo (meters 16) + :knocked-hard-vxz-hi (meters 23.4) + :knocked-hard-vy-lo (meters 30) + :knocked-hard-vy-hi (meters 40) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 24) + :knocked-red-vy-lo (meters 22) + :knocked-red-vy-hi (meters 32) + :knocked-blue-vxz-lo (meters 6) + :knocked-blue-vxz-hi (meters 8) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 18) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -642,7 +642,7 @@ (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) + (vector-copy! s5-0 (get-trans (the-as process-focusable s3-0) 3)) (let ((s3-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform fvec) 1.0) ) @@ -678,6 +678,7 @@ ) (defmethod enemy-common-post ((this neo-juicer)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -712,6 +713,7 @@ ) (defmethod event-handler ((this neo-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit-flinch) (cond @@ -725,7 +727,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -755,7 +757,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -784,7 +786,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -824,7 +826,7 @@ (let ((f30-0 (rnd-float-range self 0.9 1.1))) (until #f (let ((gp-0 (-> self draw art-group data (-> *neo-juicer-global-info* patrol-anim (rnd-int self 2) anim-index))) - (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + (s5-0 (rnd-time-frame self 1 (seconds 0.027))) ) (let ((v1-34 (ja-group))) (if (not (and v1-34 (= v1-34 gp-0))) @@ -843,8 +845,8 @@ (nav-enemy-method-182 self) (ja-channel-push! 1 (seconds 0.3)) (let ((gp-1 0)) - (until (not (enemy-method-134 self 0.4)) - (let* ((v1-61 (enemy-method-131 self 3 gp-1)) + (until (not (rnd-chance-for-idle? self 0.4)) + (let* ((v1-61 (rnd-int-excluding-masked self 3 gp-1)) (a1-15 (-> self draw art-group data (-> *neo-juicer-global-info* idle-anim v1-61 anim-index))) ) (set! gp-1 (ash 1 v1-61)) @@ -865,18 +867,20 @@ ) ) -(defmethod setup-jump! ((this neo-juicer) (arg0 enemy-jump-info)) - ((method-of-type nav-enemy setup-jump!) this arg0) +(defmethod setup-jump-trajectory! ((this neo-juicer) (arg0 enemy-jump-info)) + "Compute jump trajectory." + ((method-of-type nav-enemy setup-jump-trajectory!) this arg0) (none) ) -(defmethod go-directed2 ((this neo-juicer)) +(defmethod go-next-state-auto ((this neo-juicer)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (case (-> this jump-why) ((2) (go (method-of-object this ambush-cont)) ) (else - ((method-of-type nav-enemy go-directed2) this) + ((method-of-type nav-enemy go-next-state-auto) this) ) ) ) @@ -929,7 +933,7 @@ ) (if (< v1-1 (-> a0-0 curve num-cverts)) (set! (-> self ambush-path-pt) v1-1) - (go-best-state self) + (go-state-for-focused self) ) ) (until #f @@ -981,14 +985,14 @@ (let ((f30-1 (rnd-float-range self 0.8 1.2)) (gp-2 (new 'stack-no-clear 'vector)) ) - (let* ((a0-13 (enemy-method-131 self 2 s5-0)) + (let* ((a0-13 (rnd-int-excluding-masked self 2 s5-0)) (a1-8 (-> self draw art-group data (-> *neo-juicer-global-info* notice-anim a0-13 anim-index))) ) (ja-no-eval :group! a1-8 :num! (seek! max f30-1) :frame-num 0.0) ) (until (ja-done? 0) (let ((a1-9 (-> self nav state))) - (set! (-> gp-2 quad) (-> a1-9 travel quad)) + (vector-copy! gp-2 (-> a1-9 travel)) ) (seek-toward-heading-vec! (-> self root) gp-2 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) @@ -996,7 +1000,7 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1013,7 +1017,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1072,7 +1076,7 @@ (let ((v1-8 (-> self nav state))) (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-8 target-pos) gp-0) ) 0 (if (and (>= 53248.0 f0-0) (should-check-los? (-> self los) 0) (get-focus! self)) @@ -1086,6 +1090,7 @@ ) (defmethod get-focus! ((this neo-juicer)) + "If we're focusing on something alive, return it." (let* ((t9-0 (method-of-type nav-enemy get-focus!)) (v1-1 (t9-0 this)) ) @@ -1175,7 +1180,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + (vector-copy! (-> v1-1 target-pos) a0-1) ) 0 (set! (-> self torso-track-player) (the-as joint-mod #t)) @@ -1219,8 +1224,7 @@ (s5-0 (+ (-> v1-29 attack-id) 1)) ) (set! (-> v1-29 attack-id) s5-0) - (suspend-for - (seconds 0.25) + (suspend-for (seconds 0.25) (ja-no-eval :group! neo-juicer-attack0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((s3-0 (handle->process (-> self focus handle)))) @@ -1408,7 +1412,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.6)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) - (let ((gp-0 (set-reaction-time! self (seconds 0.2) (seconds 0.7))) + (let ((gp-0 (rnd-time-frame self (seconds 0.2) (seconds 0.7))) (s5-0 (current-time)) (f28-0 f30-0) ) @@ -1436,12 +1440,13 @@ ) (defmethod knocked-anim ((this neo-juicer) (arg0 enemy-knocked-info)) + "start the knocked animation." (local-vars (a2-2 int)) (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 0) (let* ((a2-0 (ash 1 (-> *neo-juicer-global-info* prev-yellow-hit))) - (v1-3 (enemy-method-131 this 4 a2-0)) + (v1-3 (rnd-int-excluding-masked this 4 a2-0)) (a1-6 (-> this draw art-group data (-> *neo-juicer-global-info* yellow-hit-anim v1-3 anim-index))) ) (set! (-> *neo-juicer-global-info* prev-yellow-hit) v1-3) @@ -1461,7 +1466,7 @@ (set! a2-2 (logior v1-11 7)) ) ) - (let* ((v1-15 (enemy-method-131 this 6 a2-2)) + (let* ((v1-15 (rnd-int-excluding-masked this 6 a2-2)) (s5-1 (-> this draw art-group data (-> *neo-juicer-global-info* blue-hit-anim v1-15 anim-index))) ) (set! (-> *neo-juicer-global-info* prev-blue-hit) v1-15) @@ -1501,6 +1506,7 @@ ) (defmethod knocked-land-anim ((this neo-juicer) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this incoming knocked-type) (knocked-type blue-shot)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -1557,11 +1563,13 @@ (none) ) -(defmethod enemy-method-108 ((this neo-juicer) (arg0 process-focusable)) +(defmethod should-flee-from? ((this neo-juicer) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (focus-test? arg0 invulnerable) ) (defmethod init-enemy-collision! ((this neo-juicer)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1668,12 +1676,13 @@ ) (defmethod init-enemy! ((this neo-juicer)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-juicer" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *neo-juicer-nav-enemy-info*) + (setup-enemy! this *neo-juicer-nav-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) diff --git a/goal_src/jak3/levels/sewer/saberfish-spawner.gc b/goal_src/jak3/levels/sewer/saberfish-spawner.gc index 058ad480f1f..c19172a5ef1 100644 --- a/goal_src/jak3/levels/sewer/saberfish-spawner.gc +++ b/goal_src/jak3/levels/sewer/saberfish-spawner.gc @@ -70,6 +70,7 @@ (defmethod init-from-entity! ((this saberfish-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (process-entity-set! this arg0) (set! (-> this root) (new 'process 'trsqv)) @@ -427,7 +428,7 @@ (set! sv-56 -1) (set! sv-64 40960000000.0) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> arg0 root trans quad)) + (vector-copy! v1-4 (-> arg0 root trans)) (set! sv-68 v1-4) ) (set! sv-72 (new 'stack-no-clear 'vector)) @@ -543,7 +544,7 @@ ) (logclear! (-> v1-74 flags) (nav-state-flag directional-mode)) (logior! (-> v1-74 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-74 target-pos quad) (-> a0-46 quad)) + (vector-copy! (-> v1-74 target-pos) a0-46) ) 0 ) @@ -648,7 +649,7 @@ (if (= arg1 'saberfish-crawl-out-of-tube) (sound-play "sf-spawner") ) - (set! (-> s4-0 trans quad) (-> this entity extra trans quad)) + (vector-copy! (-> s4-0 trans) (-> this entity extra trans)) (quaternion-copy! (-> s4-0 quat) (-> this entity quat)) (set! (-> s4-0 entity) (-> this entity)) (set! (-> s4-0 directed?) #f) @@ -657,7 +658,7 @@ (set! (-> s4-0 spawn-parent) (process->handle this)) (set! (-> s4-0 message) arg0) (set! (-> s4-0 initial-state) arg1) - (set! (-> s4-0 pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 pos) (-> this root trans)) (quaternion-copy! (-> s4-0 orient) (-> this root quat)) (set! (-> this last-spawned-process) (ppointer->handle (process-spawn saberfish this s4-0 :name "saberfish" :to arg2)) @@ -696,6 +697,7 @@ (defmethod init-from-entity! ((this saberfish-spawn-manager-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) ;; og:preserve-this added (stack-size-set! (-> this main-thread) 2048) diff --git a/goal_src/jak3/levels/sewer/saberfish.gc b/goal_src/jak3/levels/sewer/saberfish.gc index 4212232830a..98b88c2cd5c 100644 --- a/goal_src/jak3/levels/sewer/saberfish.gc +++ b/goal_src/jak3/levels/sewer/saberfish.gc @@ -352,34 +352,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 61440.0 - :knocked-medium-vxz-hi 61440.0 - :knocked-medium-vy-lo 49152.0 - :knocked-medium-vy-hi 69632.0 - :knocked-hard-vxz-lo 61440.0 - :knocked-hard-vxz-hi 90112.0 - :knocked-hard-vy-lo 49152.0 - :knocked-hard-vy-hi 73728.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 61440.0 - :knocked-yellow-vxz-hi 61440.0 - :knocked-yellow-vy-lo 49152.0 - :knocked-yellow-vy-hi 69632.0 - :knocked-red-vxz-lo 61440.0 - :knocked-red-vxz-hi 90112.0 - :knocked-red-vy-lo 49152.0 - :knocked-red-vy-hi 73728.0 - :knocked-blue-vxz-lo 20480.0 - :knocked-blue-vxz-hi 28672.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 15) + :knocked-medium-vxz-hi (meters 15) + :knocked-medium-vy-lo (meters 12) + :knocked-medium-vy-hi (meters 17) + :knocked-hard-vxz-lo (meters 15) + :knocked-hard-vxz-hi (meters 22) + :knocked-hard-vy-lo (meters 12) + :knocked-hard-vy-hi (meters 18) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 15) + :knocked-yellow-vxz-hi (meters 15) + :knocked-yellow-vy-lo (meters 12) + :knocked-yellow-vy-hi (meters 17) + :knocked-red-vxz-lo (meters 15) + :knocked-red-vxz-hi (meters 22) + :knocked-red-vy-lo (meters 12) + :knocked-red-vy-hi (meters 18) + :knocked-blue-vxz-lo (meters 5) + :knocked-blue-vxz-hi (meters 7) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9983 :y -0.0558 :z 0.0132 :w 27913.42) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -677,6 +677,7 @@ (set! (-> *saberfish-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod init-enemy-collision! ((this saberfish)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -773,12 +774,13 @@ ) (defmethod init-enemy! ((this saberfish)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-saberfish" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *saberfish-nav-enemy-info*) + (setup-enemy! this *saberfish-nav-enemy-info*) (set! (-> this last-attack-time) 0) (set! (-> this scare-start-time) 0) (set! (-> this scare-time) 0) @@ -820,7 +822,7 @@ (set! (-> this scare-time) 0) (set! (-> this desired-dest-mesh-index) (-> this current-nav-mesh-index)) (set! (-> this is-submerged?) #f) - (set! (-> this root trans quad) (-> this pos-start quad)) + (vector-copy! (-> this root trans) (-> this pos-start)) (quaternion-copy! (-> this root quat) (-> this quat-start)) (set! (-> this move-to-ground?) #f) (let ((s5-1 (-> this skel root-channel 0))) @@ -855,7 +857,7 @@ ) ) ) - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s4-0) 0) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s4-0) 0)) (set-dest-nav! this (-> this focus-pos) (find-behavior<-in-water? (the-as symbol s5-0))) ) ) @@ -994,7 +996,7 @@ (let ((v1-15 (-> self nav state))) (logclear! (-> v1-15 flags) (nav-state-flag directional-mode)) (logior! (-> v1-15 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-15 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-15 target-pos) gp-0) ) ) 0 @@ -1025,7 +1027,7 @@ :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) (if a0-1 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-1) 0)) ) ) (let ((a1-2 (get-cmd self))) @@ -1369,7 +1371,7 @@ (let ((v1-8 (-> self nav state))) (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-8 target-pos) gp-0) ) ) 0 @@ -1415,7 +1417,7 @@ (let ((a1-0 (-> self nav state)) (v1-8 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-8 quad) (-> a1-0 target-pos quad)) + (vector-copy! v1-8 (-> a1-0 target-pos)) (let ((gp-0 (new 'stack-no-clear 'vector))) 0.0 (vector-! gp-0 (-> self root trans) v1-8) @@ -1426,7 +1428,7 @@ (let ((v1-13 (-> self nav state))) (logclear! (-> v1-13 flags) (nav-state-flag directional-mode)) (logior! (-> v1-13 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-13 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-13 target-pos) s5-0) ) ) 0 @@ -1441,7 +1443,7 @@ (vector-z-quaternion! (-> self nav-velocity) (-> self root quat)) (set! (-> self nav-velocity y) 0.0) (vector-normalize! (-> self nav-velocity) 1.0) - (set! (-> self nav-dir quad) (-> self nav-velocity quad)) + (vector-copy! (-> self nav-dir) (-> self nav-velocity)) (set! (-> self doing-180-spin?) #f) (set-time! (-> self last-swim-flip-time)) (set! (-> self saberfish-y-rotate) 0.0) @@ -1472,7 +1474,7 @@ (let ((a0-16 (-> self nav state)) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 quad) (-> a0-16 travel quad)) + (vector-copy! s2-0 (-> a0-16 travel)) (let ((s3-0 (new 'stack-no-clear 'quaternion)) (s5-1 (new 'stack-no-clear 'quaternion)) ) @@ -1483,7 +1485,7 @@ (when (not gp-0) (set! gp-0 #t) (let ((a1-10 (new 'stack-no-clear 'vector))) - (set! (-> a1-10 quad) (-> self root trans quad)) + (vector-copy! a1-10 (-> self root trans)) (splash-spawn 0.0 a1-10 1) ) ) @@ -1587,7 +1589,7 @@ (let ((f0-0 (-> this swim-speed))) 0.0 0.0 - (set! (-> v1-3 quad) (-> arg0 quad)) + (vector-copy! v1-3 arg0) (set! (-> v1-3 y) (fmin (-> v1-3 y) (+ -8192.0 (-> this water surface-height)))) (vector-! s5-0 v1-3 (-> this root trans)) (let ((f1-4 (-> s5-0 y)) @@ -1623,7 +1625,7 @@ (let ((a0-0 (-> self nav state)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> a0-0 travel quad)) + (vector-copy! s5-0 (-> a0-0 travel)) (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) (let ((f30-0 (-> self swim-speed))) (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) @@ -1642,7 +1644,7 @@ (#f (set! f26-0 (-> self swim-anim-last-dot)) (set! f28-0 (-> self swim-rotate-last-dot)) - (set! (-> s5-0 quad) (-> gp-0 quad)) + (vector-copy! s5-0 gp-0) ) (else (let ((f0-6 (vector-dot s4-0 s5-0))) @@ -1675,7 +1677,7 @@ (a2-2 (-> self nav state)) (a1-7 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-7 quad) (-> a2-2 target-pos quad)) + (vector-copy! a1-7 (-> a2-2 target-pos)) (< f26-1 (t9-8 a0-15 a1-7)) ) (let ((v1-37 (ja-group))) @@ -1685,7 +1687,7 @@ (set! (-> self swim-travel-anim) -1) ) ((< 0.99999 f28-0) - (set! (-> gp-0 quad) (-> s5-0 quad)) + (vector-copy! gp-0 s5-0) ) (else (let ((s4-1 (new 'stack-no-clear 'vector))) @@ -1704,13 +1706,13 @@ (let ((a0-27 (-> self nav state)) (v1-48 gp-0) ) - (set! (-> a0-27 heading quad) (-> v1-48 quad)) + (vector-copy! (-> a0-27 heading) v1-48) ) 0 - (set! (-> self nav-dir quad) (-> gp-0 quad)) + (vector-copy! (-> self nav-dir) gp-0) (vector-normalize! gp-0 (-> self swim-speed)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> gp-0 quad)) + (vector-copy! s5-1 gp-0) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 24576.0) (saberfish-method-234 self s5-1) @@ -1723,10 +1725,10 @@ (let ((a0-34 (-> self nav state)) (v1-65 gp-0) ) - (set! (-> a0-34 velocity quad) (-> v1-65 quad)) + (vector-copy! (-> a0-34 velocity) v1-65) ) 0 - (set! (-> self nav-velocity quad) (-> gp-0 quad)) + (vector-copy! (-> self nav-velocity) gp-0) ) ) ) @@ -1811,7 +1813,7 @@ (let ((s4-0 #f)) (let ((s3-0 #f)) (when s5-0 - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable s5-0) 3)) (let ((f0-2 (- (vector-dot (-> self root trans) (-> self attack-dir)) (vector-dot gp-0 (-> self attack-dir))))) (if (< -61440.0 f0-2) (set! s3-0 #t) @@ -1830,7 +1832,7 @@ ) (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-7 target-pos quad) (-> v1-27 quad)) + (vector-copy! (-> a0-7 target-pos) v1-27) ) 0 (when (or (not (-> self adjusted-y-yet?)) (not s3-0)) @@ -1992,10 +1994,12 @@ ) (defmethod coin-flip? ((this saberfish)) + "Return #t half the time, #f the other." #f ) -(defmethod enemy-method-108 ((this saberfish) (arg0 process-focusable)) +(defmethod should-flee-from? ((this saberfish) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (not (time-elapsed? (-> this scare-start-time) (-> this scare-time))) ) @@ -2011,6 +2015,7 @@ ;; WARN: Return type mismatch enemy-jump-flags vs none. (defmethod init-jump-info! ((this saberfish) (arg0 enemy-jump-info)) + "Populate an enemy-jump-info for jumping to this enemy's event-param-point" (call-parent-method this arg0) (if (saberfish-method-243 this) (logior! (-> arg0 flags) (enemy-jump-flags ejf0)) @@ -2428,11 +2433,11 @@ (cond ((< sv-256 sv-252) (vector+float*! sv-192 (-> this root trans) sv-244 sv-196) - (set! (-> sv-204 quad) (-> sv-244 quad)) + (vector-copy! sv-204 sv-244) ) (else (vector+float*! sv-192 (-> this root trans) sv-248 sv-196) - (set! (-> sv-204 quad) (-> sv-248 quad)) + (vector-copy! sv-204 sv-248) ) ) (when (< (* sv-196 sv-196) (vector-vector-xz-distance-squared sv-192 (-> this jump-point-start))) @@ -2499,16 +2504,16 @@ (set! sv-256 (vector-dot s0-1 sv-200)) (cond ((< f30-2 40.96) - (set! (-> s2-1 quad) (-> s3-2 quad)) + (vector-copy! s2-1 s3-2) ) ((< f0-28 40.96) - (set! (-> s2-1 quad) (-> s1-1 quad)) + (vector-copy! s2-1 s1-1) ) ((< sv-256 sv-252) - (set! (-> s2-1 quad) (-> s3-2 quad)) + (vector-copy! s2-1 s3-2) ) (else - (set! (-> s2-1 quad) (-> s1-1 quad)) + (vector-copy! s2-1 s1-1) ) ) ) @@ -2541,8 +2546,8 @@ (set! sv-532 (the-as float 0.0)) (set! sv-536 (new 'stack-no-clear 'vector)) (set! sv-540 (new 'stack-no-clear 'vector)) - (set! (-> sv-536 quad) (-> this root trans quad)) - (set! (-> sv-540 quad) (-> s2-1 quad)) + (vector-copy! sv-536 (-> this root trans)) + (vector-copy! sv-540 s2-1) (set! (-> sv-536 y) (-> sv-512 y)) (set! (-> sv-540 y) (-> sv-512 y)) (let ((a1-37 (vector-! (new 'stack-no-clear 'vector) sv-516 sv-512)) @@ -2553,15 +2558,15 @@ (set-vector! v1-76 (- (-> s0-2 z)) 0.0 (-> s0-2 x) 1.0) (set! sv-252 (vector-dot a0-60 a1-37)) (if (< 0.0 sv-252) - (set! (-> sv-520 quad) (-> a0-60 quad)) - (set! (-> sv-520 quad) (-> v1-76 quad)) + (vector-copy! sv-520 a0-60) + (vector-copy! sv-520 v1-76) ) (set-vector! a0-60 (-> s1-2 z) 0.0 (- (-> s1-2 x)) 1.0) (set-vector! v1-76 (- (-> s1-2 z)) 0.0 (-> s1-2 x) 1.0) (set! sv-252 (vector-dot a0-60 a1-37)) (if (< 0.0 sv-252) - (set! (-> sv-524 quad) (-> v1-76 quad)) - (set! (-> sv-524 quad) (-> a0-60 quad)) + (vector-copy! sv-524 v1-76) + (vector-copy! sv-524 a0-60) ) ) ) @@ -2676,7 +2681,7 @@ (set! sv-80 (new 'stack-no-clear 'vector)) (set! sv-84 (the-as float -1.0)) (if arg2 - (set! (-> sv-64 quad) (-> arg3 quad)) + (vector-copy! sv-64 arg3) (vector-! sv-64 (-> this jump-point-start) (-> this jump-point-end)) ) (set! (-> sv-64 y) 0.0) @@ -2700,7 +2705,7 @@ ) (when (< sv-84 f0-7) (set! sv-84 f0-7) - (set! (-> sv-80 quad) (-> arg0 quad)) + (vector-copy! sv-80 arg0) ) ) (if (= (logand s0-0 1) 1) @@ -2709,7 +2714,7 @@ ) (set! sv-76 (+ sv-76 arg1)) ) - (set! (-> arg0 quad) (-> sv-80 quad)) + (vector-copy! arg0 sv-80) (set! (-> arg0 y) (-> this water surface-height)) (return #t) ) @@ -2734,7 +2739,7 @@ ) (defmethod set-dest-nav! ((this saberfish) (arg0 vector) (arg1 saberfish-find-behavior)) - (set! (-> this desired-dest-nav-point quad) (-> arg0 quad)) + (vector-copy! (-> this desired-dest-nav-point) arg0) (set! (-> this desired-dest-mesh-index) (get-nav-mesh-idx this arg0 arg1)) (when (= (-> this desired-dest-mesh-index) -1) ) @@ -2766,11 +2771,11 @@ ) (cond ((or (saberfish-method-243 this) (not (logtest? (enemy-flag ef37) (-> this enemy-flags)))) - (set! (-> s5-0 quad) (-> this nav-dir quad)) + (vector-copy! s5-0 (-> this nav-dir)) ) (else (let ((a1-3 (-> this nav state))) - (set! (-> s5-0 quad) (-> a1-3 heading quad)) + (vector-copy! s5-0 (-> a1-3 heading)) ) ) ) @@ -2799,6 +2804,7 @@ ) (defmethod jump-wind-up-anim ((this saberfish) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (when (not (saberfish-method-243 this)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump windup-anim))) @@ -2815,6 +2821,7 @@ ) (defmethod jump-in-air-anim ((this saberfish) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -2829,6 +2836,7 @@ ) (defmethod jump-land-anim ((this saberfish) (arg0 enemy-jump-info)) + "Play the landing anim" (cond ((zero? (-> this jump land-anim)) #f @@ -2850,7 +2858,8 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod setup-jump! ((this saberfish) (arg0 enemy-jump-info)) +(defmethod setup-jump-trajectory! ((this saberfish) (arg0 enemy-jump-info)) + "Compute jump trajectory." (let ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)))) (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0)) ) @@ -2869,8 +2878,8 @@ ) ) (let ((s4-0 (new 'stack-no-clear 'traj3d-params))) - (set! (-> s4-0 dest quad) (-> arg0 dest-pos quad)) - (set! (-> s4-0 src quad) (-> arg0 start-pos quad)) + (vector-copy! (-> s4-0 dest) (-> arg0 dest-pos)) + (vector-copy! (-> s4-0 src) (-> arg0 start-pos)) (let ((f30-1 11832.889)) (if (not (saberfish-method-243 this)) (set! f30-1 8192.0) @@ -2882,7 +2891,7 @@ (set! (-> arg0 traj initial-position quad) (-> arg0 start-pos quad)) (set! (-> arg0 traj gravity) -4.551111) (set! (-> arg0 traj time) (-> s4-0 time)) - (set! (-> arg0 traj initial-velocity quad) (-> s4-0 initial-velocity quad)) + (vector-copy! (-> arg0 traj initial-velocity) (-> s4-0 initial-velocity)) ) (none) ) @@ -2905,7 +2914,7 @@ (a2-0 (-> this nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-1 (-> a2-0 target-pos)) (t9-2 a0-3 a1-1 (saberfish-find-behavior none)) ) (if (saberfish-method-228 this) @@ -2918,7 +2927,7 @@ (defmethod nav-enemy-method-166 ((this saberfish) (arg0 vector) (arg1 vector)) (cond (#t - (set! (-> arg0 quad) (-> this flee-point-temp quad)) + (vector-copy! arg0 (-> this flee-point-temp)) #t ) (else @@ -2990,7 +2999,8 @@ ) ) -(defmethod is-pfoc-in-mesh? ((this saberfish) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this saberfish) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (and arg0 (not arg1)) (set! arg1 (get-trans arg0 1)) ) @@ -3012,6 +3022,7 @@ ) (defmethod enemy-common-post ((this saberfish)) + "Common implementation of post. Runs ja-post." (if (not (handle->process (-> this spawn-parent))) (go (method-of-object this die)) ) @@ -3019,7 +3030,7 @@ (let ((a1-1 (-> this nav state)) (a0-6 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-6 quad) (-> a1-1 heading quad)) + (vector-copy! a0-6 (-> a1-1 heading)) (set! (-> a0-6 y) 0.0) (vector-normalize! a0-6 1.0) ) @@ -3036,7 +3047,7 @@ (let ((a1-8 (-> this nav state)) (a0-14 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-14 quad) (-> a1-8 travel quad)) + (vector-copy! a0-14 (-> a1-8 travel)) (set! (-> a0-14 y) 0.0) (vector-normalize! a0-14 1.0) ) @@ -3053,10 +3064,10 @@ (none) ) -(defmethod jump-anim-handler ((this saberfish) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this saberfish) (arg0 jump-stage) (arg1 enemy-jump-info)) (when (saberfish-method-243 this) (case arg0 - ((5) + (((jump-stage landing)) (compute-alignment! (-> this align)) (align! (-> this align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) (vector-v++! (-> this root trans) (-> this root transv)) @@ -3080,14 +3091,16 @@ (call-parent-method this arg0 arg1) ) -(defmethod go-directed2 ((this saberfish)) +(defmethod go-next-state-auto ((this saberfish)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (if (saberfish-method-243 this) (go (method-of-object this water-land)) (call-parent-method this) ) ) -(defmethod enemy-method-50 ((this saberfish) (arg0 int)) +(defmethod update-collision-action ((this saberfish) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -3176,7 +3189,7 @@ ) (change-nav-mesh self) (water-control-method-10 (-> self water)) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -3184,12 +3197,14 @@ ) (defmethod go-die ((this saberfish)) + "Go to the die state." (sound-play "sabfish-death") (send-event (handle->process (-> this spawn-parent)) 'child-die) (call-parent-method this) ) -(defmethod process-mask->search-info-flag ((this saberfish)) +(defmethod get-search-info-flag ((this saberfish)) + "Get search-info-flag for this process." (let ((v0-1 (call-parent-method this))) (if (-> this is-submerged?) (set! v0-1 (logior v0-1 (search-info-flag abort))) @@ -3213,7 +3228,7 @@ :trans (behavior () (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (cond - ((= (-> self focus aware) (enemy-aware ea1)) + ((= (-> self focus aware) (enemy-aware aware1)) (go-virtual active) ) ((< 1 (the-as int (-> self focus aware))) @@ -3361,7 +3376,8 @@ ) ) -(defmethod go-idle2 ((this saberfish)) +(defmethod go-fallback-init ((this saberfish)) + "If there's no specific settings for initial state, go to this state after spawning." (case (-> this initial-state) (('saberfish-crawl-out-of-tube) (go (method-of-object this saberfish-crawl-out-of-tube)) @@ -3379,19 +3395,20 @@ ) (defmethod init-from-entity! ((this saberfish) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this ground-only?) #t) (set! (-> this spawn-parent) (process->handle this)) (set! (-> *saberfish-nav-enemy-info* nav-mesh) (find-nearest-nav-mesh (-> arg0 extra trans) (the-as float #x7f800000)) ) (set! (-> this initial-state) 'idle) - (set! (-> this pos-start quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this pos-start) (-> arg0 extra trans)) (quaternion-copy! (-> this quat-start) (-> arg0 quat)) (call-parent-method this arg0) ) (defbehavior saberfish-init-by-other saberfish ((arg0 process-drawable) (arg1 saberfish-init-by-other-params)) - (set! (-> self pos-start quad) (-> arg1 pos quad)) + (vector-copy! (-> self pos-start) (-> arg1 pos)) (quaternion-copy! (-> self quat-start) (-> arg1 orient)) (set! (-> self spawn-parent) (-> arg1 spawn-parent)) (set! (-> self initial-state) (-> arg1 initial-state)) @@ -3420,6 +3437,7 @@ ) (defmethod should-move-to-ground? ((this saberfish)) + "Should this enemy be moved to the ground while moving?" (-> this move-to-ground?) ) @@ -3427,11 +3445,11 @@ (defmethod copy-nav-state-vel! ((this saberfish) (arg0 vector)) (cond ((saberfish-method-243 this) - (set! (-> arg0 quad) (-> this nav-velocity quad)) + (vector-copy! arg0 (-> this nav-velocity)) ) (else (let ((a0-2 (-> this nav state))) - (set! (-> arg0 quad) (-> a0-2 velocity quad)) + (vector-copy! arg0 (-> a0-2 velocity)) ) ) ) @@ -3439,6 +3457,7 @@ ) (defmethod go-flee ((this saberfish)) + "Go to the flee state, running away." (go (method-of-object this flee)) ) @@ -3447,7 +3466,7 @@ (when s5-0 (disable-for-duration (the-as ragdoll-proc s5-0) arg0) (logclear! (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-flags) (ragdoll-flag rf9)) - (enemy-method-90 this (the-as ragdoll-proc s5-0)) + (copy-ragdoll-orientation-to-root this (the-as ragdoll-proc s5-0)) ) ) 0 @@ -3470,6 +3489,7 @@ ;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this saberfish)) + "Has the ragdoll stopped moving?" (let* ((s5-0 (handle->process (-> this ragdoll-proc))) (v0-0 (or (not s5-0) @@ -3495,7 +3515,8 @@ ) ) -(defmethod within-gspot-range? ((this saberfish)) +(defmethod invalid-height? ((this saberfish)) + "Return #t if the enemy is too high in the air, or below the ground." (if (-> this knocked-under-water?) #f (call-parent-method this) @@ -3626,6 +3647,7 @@ ) (defmethod event-handler ((this saberfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('saberfish-query) (let ((s5-1 (the-as saberfish-spawner-query-msg (-> arg3 param 0)))) diff --git a/goal_src/jak3/levels/sewer/sew-laser-guard.gc b/goal_src/jak3/levels/sewer/sew-laser-guard.gc index 9a632bd3938..896075fcc8c 100644 --- a/goal_src/jak3/levels/sewer/sew-laser-guard.gc +++ b/goal_src/jak3/levels/sewer/sew-laser-guard.gc @@ -314,34 +314,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -357,7 +357,7 @@ (defun fire-laser! ((arg0 vector) (arg1 vector) (arg2 sew-laser-guard) (arg3 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-float*! (-> s5-0 move-dist) arg1 arg3) (let ((v1-3 s5-0)) (set! (-> v1-3 radius) 40.96) @@ -399,7 +399,7 @@ (set! (-> s3-1 attack-id) a0-17) ) (set! (-> s3-1 timeout) (seconds 4)) - (set! (-> s3-1 pos quad) (-> s5-0 start-pos quad)) + (vector-copy! (-> s3-1 pos) (-> s5-0 start-pos)) (vector-normalize-copy! (-> s3-1 vel) (-> s5-0 move-dist) 4096000.0) (spawn-projectile sew-laser-shot s3-1 arg2 *default-dead-pool*) ) @@ -519,11 +519,13 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this sew-laser-guard)) +(defmethod get-search-info-flag ((this sew-laser-guard)) + "Get search-info-flag for this process." (the-as search-info-flag 1) ) (defmethod event-handler ((this sew-laser-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('start) #f @@ -576,11 +578,14 @@ (cleanup-for-death self) (ja-channel-set! 0) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (+! (-> gp-1 y) 10240.0) - (suspend-for (seconds 2) (spawn (-> self part) gp-1)) + (suspend-for (seconds 2) + (spawn (-> self part) gp-1) + ) + ) + (suspend-for (seconds 1) ) - (suspend-for (seconds 1)) (send-event self 'death-end) (while (-> self child) (suspend) @@ -592,6 +597,7 @@ ) (defmethod init-enemy-collision! ((this sew-laser-guard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -632,6 +638,7 @@ ) (defmethod coin-flip? ((this sew-laser-guard)) + "Return #t half the time, #f the other." #f ) @@ -646,12 +653,13 @@ ) (defmethod init-enemy! ((this sew-laser-guard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-guard" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *sew-laser-guard-enemy-info*) + (setup-enemy! this *sew-laser-guard-enemy-info*) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1505) this)) @@ -686,11 +694,13 @@ (none) ) -(defmethod go-idle2 ((this sew-laser-guard)) +(defmethod go-fallback-init ((this sew-laser-guard)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this hostile)) ) -(defmethod damage-enemy! ((this sew-laser-guard) (arg0 object) (arg1 event-message-block)) +(defmethod damage-enemy-from-attack! ((this sew-laser-guard) (arg0 object) (arg1 event-message-block)) + "Given an attack message, apply damage." (send-event (the-as process-tree arg0) 'shove diff --git a/goal_src/jak3/levels/sewer/sew-laser-turret.gc b/goal_src/jak3/levels/sewer/sew-laser-turret.gc index 0e05e2d75eb..6de2301a252 100644 --- a/goal_src/jak3/levels/sewer/sew-laser-turret.gc +++ b/goal_src/jak3/levels/sewer/sew-laser-turret.gc @@ -466,34 +466,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -513,7 +513,7 @@ (new 'stack-no-clear 'vector) (let ((a1-3 (new 'stack-no-clear 'vector))) (-> a0-2 y) - (set! (-> a1-3 quad) (-> this node-list data arg1 bone transform fvec quad)) + (vector-copy! a1-3 (-> this node-list data arg1 bone transform fvec)) (set! (-> a1-3 y) (/ (-> a1-3 y) 2)) (fire-laser! a0-2 a1-3 (the-as sew-laser-guard this) 491520.0) ) @@ -556,7 +556,7 @@ (defmethod check-suitable-focus ((this sew-laser-turret)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) (-> this awareness-radius)) (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-0 s4-0 384)) @@ -708,9 +708,9 @@ ;; WARN: Return type mismatch uint vs none. (defmethod generate-prim-verts! ((this sew-laser-turret) (arg0 float) (arg1 float)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> *x-vector* quad)) + (vector-copy! s3-0 *x-vector*) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *z-vector* quad)) + (vector-copy! s5-0 *z-vector*) (let ((s4-0 (new 'stack-no-clear 'vector)) ;; og:preserve-this ;; (s0-0 (new 'stack-no-clear 'rgbaf)) @@ -746,13 +746,13 @@ (vector+! s4-0 s4-0 s5-0) (dotimes (v1-39 3) (let ((a0-21 (-> this strip data (-> this strip num-verts)))) - (set! (-> a0-21 pos quad) (-> s4-0 quad)) + (vector-copy! (-> a0-21 pos) s4-0) (set! (-> a0-21 stq z) (the-as float #x1)) ) (+! (-> this strip num-verts) 1) ) (let ((v1-46 (-> this strip data (-> this strip num-verts)))) - (set! (-> v1-46 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-46 pos) s4-0) (set! (-> v1-46 stq z) 0.0) (set! (-> v1-46 stq x) 0.0) (set! (-> v1-46 stq y) 0.0) @@ -761,7 +761,7 @@ (let ((v1-47 (&+ v1-46 32))) (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) (vector+! s4-0 s4-0 s5-0) - (set! (-> v1-47 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-47 pos) s4-0) (set! (-> v1-47 stq z) 0.0) (set! (-> v1-47 stq x) 1.0) (set! (-> v1-47 stq y) 0.0) @@ -770,7 +770,7 @@ (let ((v1-48 (&+ v1-47 32))) (vector+! s4-0 (-> this root trans) s3-0) (vector+float*! s4-0 s4-0 s5-0 -1.0) - (set! (-> v1-48 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-48 pos) s4-0) (set! (-> v1-48 stq z) 0.0) (set! (-> v1-48 stq x) 0.0) (set! (-> v1-48 stq y) 1.0) @@ -779,7 +779,7 @@ (let ((v1-49 (&+ v1-48 32))) (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) (vector+float*! s4-0 s4-0 s5-0 -1.0) - (set! (-> v1-49 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-49 pos) s4-0) (set! (-> v1-49 stq z) 0.0) (set! (-> v1-49 stq x) 1.0) (set! (-> v1-49 stq y) 1.0) @@ -833,7 +833,7 @@ ) (setup-dma-and-tex (-> self strip) (-> self draw)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (set! (-> gp-0 w) (-> self awareness-radius)) (let* ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384)) (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-0 384)) @@ -988,6 +988,7 @@ ) (defmethod event-handler ((this sew-laser-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('start) (let ((v0-0 (the-as object #t))) @@ -1042,7 +1043,7 @@ ) 0 (set! (-> self hit-points) 0.0) - (play-communicator-speech! (-> *talker-speech* 49)) + (mark-played! (-> *talker-speech* 49)) ) :code (behavior () (new 'stack 'joint-exploder-tuning (the-as uint 0)) @@ -1052,7 +1053,7 @@ (cleanup-for-death self) (ja-channel-set! 0) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (+! (-> gp-1 y) 10240.0) (suspend-for (seconds 2) (spawn (-> self part) gp-1) @@ -1071,6 +1072,7 @@ ) (defmethod init-enemy-collision! ((this sew-laser-turret)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1131,6 +1133,7 @@ ) (defmethod coin-flip? ((this sew-laser-turret)) + "Return #t half the time, #f the other." #f ) @@ -1154,12 +1157,13 @@ ) (defmethod init-enemy! ((this sew-laser-turret)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-turret" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *sew-laser-turret-enemy-info*) + (setup-enemy! this *sew-laser-turret-enemy-info*) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1518) this)) @@ -1185,11 +1189,13 @@ (none) ) -(defmethod go-idle2 ((this sew-laser-turret)) +(defmethod go-fallback-init ((this sew-laser-turret)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this alert)) ) (defmethod go-hostile ((this sew-laser-turret)) + "Go to the hostile state, actively trying to attack the target." (cond ((and (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'spinning-up) (= v1-3 'hostile)) diff --git a/goal_src/jak3/levels/sewer/sew-platforms.gc b/goal_src/jak3/levels/sewer/sew-platforms.gc index 698f1c00eb7..08cd09ba1e9 100644 --- a/goal_src/jak3/levels/sewer/sew-platforms.gc +++ b/goal_src/jak3/levels/sewer/sew-platforms.gc @@ -57,6 +57,7 @@ ) (defmethod init-from-entity! ((this sew-plat-updown) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -211,7 +212,7 @@ (quaternion-copy! s5-0 (-> self entity quat)) (quaternion->matrix gp-0 s5-0) ) - (set! (-> gp-0 trans quad) (-> self entity extra trans quad)) + (vector-copy! (-> gp-0 trans) (-> self entity extra trans)) (+! (-> gp-0 trans y) 20480.0) (spawn-from-mat (-> self part) gp-0) ) @@ -283,6 +284,7 @@ ) (defmethod init-from-entity! ((this sew-moving-step-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (alloc-trsqv! this) (process-drawable-from-entity! this arg0) (set! (-> this sound-idle) (new-sound-id)) @@ -323,8 +325,8 @@ (vector-! s4-0 s4-0 s3-1) (vector-! s5-3 s5-3 s3-1) ) - (set! (-> this start-step-pos quad) (-> s4-0 quad)) - (set! (-> this end-step-pos quad) (-> s5-3 quad)) + (vector-copy! (-> this start-step-pos) s4-0) + (vector-copy! (-> this end-step-pos) s5-3) ) (go (method-of-object this active)) ) @@ -395,9 +397,9 @@ (defbehavior sew-moving-step-b-step-init-by-other sew-moving-step-b-step ((arg0 sew-moving-step-b-step-param)) (process-entity-set! self (-> arg0 ent)) (init-collision! self) - (set! (-> self root trans quad) (-> arg0 start-pos quad)) - (set! (-> self start-pos quad) (-> arg0 start-pos quad)) - (set! (-> self end-pos quad) (-> arg0 end-pos quad)) + (vector-copy! (-> self root trans) (-> arg0 start-pos)) + (vector-copy! (-> self start-pos) (-> arg0 start-pos)) + (vector-copy! (-> self end-pos) (-> arg0 end-pos)) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-moving-step-b" (the-as (pointer level) #f))) @@ -433,8 +435,8 @@ ;; WARN: Return type mismatch process vs sew-moving-step-b-step. (defun spawn-moving-step-b-step ((arg0 sew-moving-step-b) (arg1 float)) (let ((gp-0 (new 'stack-no-clear 'sew-moving-step-b-step-param))) - (set! (-> gp-0 start-pos quad) (-> arg0 start-step-pos quad)) - (set! (-> gp-0 end-pos quad) (-> arg0 end-step-pos quad)) + (vector-copy! (-> gp-0 start-pos) (-> arg0 start-step-pos)) + (vector-copy! (-> gp-0 end-pos) (-> arg0 end-step-pos)) (set! (-> gp-0 ent) (-> arg0 entity)) (set! (-> gp-0 period) (the-as time-frame (-> arg0 sync period))) (set! (-> gp-0 offset) arg1) @@ -671,7 +673,7 @@ (plat-event proc argc message block) ) :enter (behavior () - (set! (-> self basetrans quad) (-> self positions (-> self current-pos-index) quad)) + (vector-copy! (-> self basetrans) (-> self positions (-> self current-pos-index))) ) :trans (behavior () (plat-trans) @@ -733,7 +735,7 @@ ) (else (vector+float*! (-> self basetrans) (-> self basetrans) gp-2 f1-2) - (set! (-> self root trans quad) (-> self basetrans quad)) + (vector-copy! (-> self root trans) (-> self basetrans)) ) ) ) @@ -769,6 +771,7 @@ ) (defmethod init-from-entity! ((this sew-move-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -797,7 +800,7 @@ (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (get-point-at-percent-along-path! (-> this path) (the-as vector (-> this positions)) 0.0 'interp) (get-point-at-percent-along-path! (-> this path) (-> this positions 1) 1.0 'interp) - (set! (-> this basetrans quad) (-> this root trans quad)) + (vector-copy! (-> this basetrans) (-> this root trans)) (set! (-> this current-pos-index) (sew-move-plat-method-37 this)) (logclear! (-> this mask) (process-mask actor-pause)) (go (method-of-object this waiting)) diff --git a/goal_src/jak3/levels/sewer/sew-whirlpool.gc b/goal_src/jak3/levels/sewer/sew-whirlpool.gc index 6fe243672b0..6bb8417ee35 100644 --- a/goal_src/jak3/levels/sewer/sew-whirlpool.gc +++ b/goal_src/jak3/levels/sewer/sew-whirlpool.gc @@ -99,6 +99,7 @@ ) (defmethod init-from-entity! ((this sew-whirlpool) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this spool-sound-id) diff --git a/goal_src/jak3/levels/sewer/sewer-frog.gc b/goal_src/jak3/levels/sewer/sewer-frog.gc index 92f6ca67645..7a3736f8d74 100644 --- a/goal_src/jak3/levels/sewer/sewer-frog.gc +++ b/goal_src/jak3/levels/sewer/sewer-frog.gc @@ -154,34 +154,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.0676 :y -0.6016 :z 0.7959 :w 30666.041) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -496,6 +496,7 @@ (set! (-> *sewer-frog-nav-enemy-info* fact-defaults) *fact-info-sewer-frog-defaults*) (defmethod init-enemy-collision! ((this sewer-frog)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -569,7 +570,7 @@ (let ((a1-0 (-> self nav state)) (a0-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-0 quad) (-> a1-0 target-pos quad)) + (vector-copy! a0-0 (-> a1-0 target-pos)) (let* ((f0-0 (vector-vector-xz-distance a0-0 (-> self root trans))) (gp-0 (-> self enemy-info)) (f30-0 (lerp-scale 0.0 1.0 f0-0 12288.0 28672.0)) @@ -739,7 +740,7 @@ (a1-0 (-> self nav state)) (a0-3 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-3 quad) (-> a1-0 target-pos quad)) + (vector-copy! a0-3 (-> a1-0 target-pos)) (t9-3 a0-3) ) ((-> (method-of-type nav-enemy active) trans)) @@ -784,7 +785,7 @@ ) ) (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) - (not (enemy-method-104 self (-> self focus-pos) 10012.444)) + (not (pointing-toward? self (-> self focus-pos) 10012.444)) ) (go-virtual turn-to-face-focus) ) @@ -824,7 +825,7 @@ (a1-3 (-> self nav state)) (a0-4 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-4 quad) (-> a1-3 target-pos quad)) + (vector-copy! a0-4 (-> a1-3 target-pos)) (t9-4 a0-4) ) (sewer-frog-method-192 self) @@ -900,7 +901,7 @@ (ja :num! (seek!)) ) (set! (-> self scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 3.8 5.6))))) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-chase-post ) @@ -908,9 +909,9 @@ ;; WARN: Return type mismatch object vs none. (defbehavior sewer-frog-check-hop sewer-frog () (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self move-dest quad)) + (vector-copy! a1-0 (-> self move-dest)) (set! (-> a1-0 w) (-> self nav-radius-backup)) - (if (add-root-sphere-to-hash! (-> self nav) a1-0 #x100068) + (if (check-sphere-blocked! (-> self nav) a1-0 #x100068) (go-virtual stare) ) ) @@ -941,7 +942,7 @@ (a1-3 (-> self nav state)) (a0-4 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-4 quad) (-> a1-3 target-pos quad)) + (vector-copy! a0-4 (-> a1-3 target-pos)) (t9-5 a0-4) ) ((-> (method-of-type nav-enemy flee) trans)) @@ -982,14 +983,14 @@ vector (when (and a0-2 (nav-enemy-method-166 this s5-0 (get-trans (the-as process-focusable a0-2) 0))) (set! (-> s5-0 w) (-> this nav-radius-backup)) - (not (add-root-sphere-to-hash! (-> this nav) s5-0 #x100068)) + (not (check-sphere-blocked! (-> this nav) s5-0 #x100068)) ) ) ) ) (defmethod go-stare2 ((this sewer-frog)) - (if (not (enemy-method-104 this (-> this focus-pos) 6371.5557)) + (if (not (pointing-toward? this (-> this focus-pos) 6371.5557)) (go (method-of-object this turn-to-face-focus)) (go (method-of-object this stare)) ) @@ -1012,7 +1013,9 @@ (none) ) +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this sewer-frog)) + "Has the ragdoll stopped moving?" (let ((a0-2 (handle->process (-> this ragdoll-proc)))) (or (not a0-2) (ragdoll-proc-method-19 (the-as ragdoll-proc a0-2)) @@ -1022,7 +1025,8 @@ ) ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod enemy-method-108 ((this sewer-frog) (arg0 process-focusable)) +(defmethod should-flee-from? ((this sewer-frog) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (< (current-time) (-> this scared-timer)) (let ((v1-4 (handle->process (-> this focus handle)))) (if v1-4 @@ -1036,6 +1040,7 @@ ) (defmethod play-damage-sound ((this sewer-frog) (arg0 int)) + "Pick and play the damage/death sound." (case arg0 ((2) (if (and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -1050,10 +1055,11 @@ ) (defmethod enemy-common-post ((this sewer-frog)) + "Common implementation of post. Runs ja-post." (when (< 1 (the-as int (-> this focus aware))) (let ((a0-3 (handle->process (-> this focus handle)))) (if a0-3 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-3) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-3) 3)) ) ) ) @@ -1063,6 +1069,7 @@ ) (defmethod event-handler ((this sewer-frog) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1074,7 +1081,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1089,12 +1096,13 @@ ) (defmethod init-enemy! ((this sewer-frog)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sewer-frog" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *sewer-frog-nav-enemy-info*) + (setup-enemy! this *sewer-frog-nav-enemy-info*) (set! (-> this water) (new 'process 'water-control this 0 4096.0 8192.0 2048.0)) (set! (-> this water flags) (water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) diff --git a/goal_src/jak3/levels/sewer/sewer-move-turret.gc b/goal_src/jak3/levels/sewer/sewer-move-turret.gc index c5ce5f7251c..d864b593d1b 100644 --- a/goal_src/jak3/levels/sewer/sewer-move-turret.gc +++ b/goal_src/jak3/levels/sewer/sewer-move-turret.gc @@ -113,7 +113,7 @@ (defmethod sew-move-turret-method-22 ((this sew-move-turret) (arg0 int)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this node-list data arg0 bone transform fvec quad)) + (vector-copy! s5-0 (-> this node-list data arg0 bone transform fvec)) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0)))) (let ((f0-0 (ja-frame-num 0))) (cond @@ -160,6 +160,7 @@ ) (defmethod init-from-entity! ((this sew-move-turret) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -428,28 +429,28 @@ (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> s4-0 trans quad)) + (vector-copy! gp-0 (-> s4-0 trans)) (vector+! gp-0 gp-0 v1-1) (cond ((-> this hit-actor?) (sound-play "bullet-hit-jak") (cond ((logtest? (-> *part-group-id-table* 1506 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1506)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1506)) ) ) ) ((begin (sound-play "bullet-ricco") (logtest? (-> *part-group-id-table* 1507 flags) (sp-group-flag sp13))) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1507)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1507)) ) ) @@ -479,8 +480,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 40960.0) ) diff --git a/goal_src/jak3/levels/sewer/sewer-obs.gc b/goal_src/jak3/levels/sewer/sewer-obs.gc index f0ca75067f0..2d0cbcd579b 100644 --- a/goal_src/jak3/levels/sewer/sewer-obs.gc +++ b/goal_src/jak3/levels/sewer/sewer-obs.gc @@ -79,6 +79,7 @@ (defmethod init-from-entity! ((this sew-curved-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) @@ -203,7 +204,8 @@ (defstate active (sew-cam-sequencer) :virtual #t :code (behavior () - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (until (process-grab? *target* #f) (suspend) ) @@ -212,13 +214,15 @@ (sew-cam-eval-script a0-1) ) ) - (suspend-for (-> self timeout)) + (suspend-for (-> self timeout) + ) (let ((a0-3 (-> self activate-script))) (if a0-3 (sew-cam-eval-script a0-3) ) ) - (suspend-for (the-as time-frame (-> self offset))) + (suspend-for (the-as time-frame (-> self offset)) + ) (let ((a0-5 (-> self exit-script))) (if a0-5 (sew-cam-eval-script a0-5) @@ -302,6 +306,7 @@ ) (defmethod init-from-entity! ((this sew-floor-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -486,34 +491,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -685,7 +690,7 @@ (let ((v1-46 (vector-z-quaternion! gp-4 (-> self base-quat)))) (vector-float*! v1-46 v1-46 (* 4096.0 (* 30.0 f30-4))) (let ((t1-1 (new 'static 'vector))) - (set! (-> t1-1 quad) (-> v1-46 quad)) + (vector-copy! t1-1 v1-46) (set-setting! 'global-wind #f 0.0 t1-1) ) ) @@ -710,7 +715,7 @@ (defstate notice (sew-fan) :virtual #t :code (behavior () - (go-best-state self) + (go-state-for-focused self) ) ) @@ -790,6 +795,7 @@ ) (defmethod event-handler ((this sew-fan) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('touched) (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) @@ -870,14 +876,16 @@ ) (defmethod coin-flip? ((this sew-fan)) + "Return #t half the time, #f the other." #f ) -(defmethod enemy-method-103 ((this sew-fan) (arg0 vector) (arg1 float)) +(defmethod heading-matches-direction? ((this sew-fan) (arg0 vector) (arg1 float)) + "Does this enemy's heading match the given heading? Threshold in degrees." (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this base-quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (set! (-> s5-0 y) 0.0) @@ -886,7 +894,8 @@ ) ) -(defmethod is-pfoc-in-mesh? ((this sew-fan) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this sew-fan) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (local-vars (v0-0 symbol)) (cond ((= (-> this activate-distance) 0.0) @@ -901,7 +910,7 @@ (if (and *target* (focus-test? *target* edge-grab)) (return #f) ) - (return (enemy-method-103 this s5-1 5461.3335)) + (return (heading-matches-direction? this s5-1 5461.3335)) v0-0 ) ) @@ -910,6 +919,7 @@ ) (defmethod init-enemy-collision! ((this sew-fan)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -976,12 +986,13 @@ ;; WARN: Return type mismatch sound-id vs none. (defmethod init-enemy! ((this sew-fan)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-fan" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *sew-fan-enemy-info*) + (setup-enemy! this *sew-fan-enemy-info*) (set! (-> this activate-distance) (res-lump-float (-> this entity) 'distance :default 122880.0)) (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) (when (logtest? (-> this path flags) (path-control-flag not-found)) @@ -1025,11 +1036,13 @@ ) (defmethod init-from-entity! ((this sew-fan) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) ((method-of-type enemy init-from-entity!) this arg0) ) -(defmethod go-idle2 ((this sew-fan)) +(defmethod go-fallback-init ((this sew-fan)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this idle)) ) @@ -1094,6 +1107,7 @@ ) (defmethod init-from-entity! ((this sew-elevator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1171,6 +1185,7 @@ ) (defmethod init-from-entity! ((this sew-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -1292,12 +1307,14 @@ ) (let ((v1-25 (res-lump-value (-> self entity) 'extra-id uint128 :time -1000000000.0))) (when (= (the-as uint v1-25) 1) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-300" 0.0 0) (process-grab? *target* #f) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((gp-2 (-> self actor-group 1))) (dotimes (s5-0 (-> gp-2 length)) (let ((a1-7 (new 'stack-no-clear 'event-message-block))) @@ -1317,11 +1334,13 @@ ) ) ) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (process-release? *target*) (go-virtual opened) ) @@ -1363,6 +1382,7 @@ ) (defmethod init-from-entity! ((this sew-wall-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -1420,6 +1440,7 @@ (defmethod init-from-entity! ((this sew-fence-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -1642,6 +1663,7 @@ ) (defmethod init-from-entity! ((this sew-vent) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let* ((v1-1 *game-info*) @@ -1720,7 +1742,7 @@ (want-levels *load-state* a1-2) ) (want-display-level *load-state* 'ctyinda 'display) - (while (!= (status-of-level-and-borrows *level* 'ctyinda #f) 'active) + (while (!= (level-status? *level* 'ctyinda #f) 'active) (suspend) ) (let ((gp-2 (add-process *gui-control* self (gui-channel background) (gui-action queue) "pwrdown" -99.0 0))) @@ -1728,7 +1750,8 @@ (set-setting! 'entity-name "camera-224" 0.0 0) (set-setting! 'allow-progress #f 0.0 0) (process-grab? *target* #f) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (task-node-close! (game-task-node sewer-hum-kg-switch-off) 'event) (script-eval '(send-event "ctyinda-vingate-1" 'shutdown)) (set-action! @@ -1742,7 +1765,8 @@ (the-as process #f) ) ) - (suspend-for (seconds 2.4)) + (suspend-for (seconds 2.4) + ) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (set! (-> *ACTOR-bank* birth-max) 1000) @@ -1762,6 +1786,7 @@ ) (defmethod init-from-entity! ((this sew-power-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -1798,6 +1823,7 @@ ) (defmethod init-from-entity! ((this sew-gas-step) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak3/levels/sewer/sewer-obs2.gc b/goal_src/jak3/levels/sewer/sewer-obs2.gc index 977985896c7..1f54c038cd1 100644 --- a/goal_src/jak3/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak3/levels/sewer/sewer-obs2.gc @@ -28,7 +28,7 @@ (let ((s4-0 (new 'stack-no-clear 'collide-query)) (f30-0 47104.0) ) - (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 start-pos) arg0) (vector-normalize-copy! (-> s4-0 move-dist) arg1 f30-0) (let ((v1-2 s4-0)) (set! (-> v1-2 radius) 40.96) @@ -69,7 +69,7 @@ (set! (-> s2-1 attack-id) a0-17) ) (set! (-> s2-1 timeout) (seconds 4)) - (set! (-> s2-1 pos quad) (-> s4-0 start-pos quad)) + (vector-copy! (-> s2-1 pos) (-> s4-0 start-pos)) (vector-normalize-copy! (-> s2-1 vel) (-> s4-0 move-dist) 491520.0) (sound-play "laser-hit-jak") (spawn-projectile sew-laser-shot s2-1 arg2 *default-dead-pool*) @@ -125,6 +125,7 @@ ) (defmethod init-from-entity! ((this sew-laser-beam) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -217,12 +218,14 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-353" 0.0 0) (process-grab? *target* #f) - (suspend-for (seconds 2)) + (suspend-for (seconds 2) + ) (sound-play "gate-open") (ja-no-eval :group! sew-m-gate-gate-open-ja :num! (seek! max 0.1) :frame-num 0.0) (until (ja-done? 0) @@ -233,7 +236,8 @@ (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (process-release? *target*) (go-virtual raised) ) @@ -251,6 +255,7 @@ ) (defmethod init-from-entity! ((this sew-m-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -357,12 +362,14 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-352" 0.0 0) (process-grab? *target* #f) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (sound-play "pipe-lower") (set-time! (-> self state-time)) (ja-no-eval :group! sew-pipe-down-ja :num! (seek! max 0.1) :frame-num 0.0) @@ -377,7 +384,8 @@ (remove-setting! 'mode-name) (remove-setting! 'interp-time) (remove-setting! 'entity-name) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (process-release? *target*) (go-virtual down) ) @@ -395,6 +403,7 @@ ) (defmethod init-from-entity! ((this sew-pipe) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -520,6 +529,7 @@ ) (defmethod init-from-entity! ((this sew-grate-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -543,7 +553,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-grate-plat" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> this test-pos quad) (-> this root trans quad)) + (vector-copy! (-> this test-pos) (-> this root trans)) (+! (-> this test-pos x) -40960.0) (set! (-> this closed-x) (-> this root trans x)) (set! (-> this opened-x) (+ -32768.0 (-> this root trans x))) diff --git a/goal_src/jak3/levels/sewer/sewer-part.gc b/goal_src/jak3/levels/sewer/sewer-part.gc index 99f25ff048b..59ecdd7b073 100644 --- a/goal_src/jak3/levels/sewer/sewer-part.gc +++ b/goal_src/jak3/levels/sewer/sewer-part.gc @@ -1919,7 +1919,7 @@ (set! (-> a0-1 y) (-> arg2 launchrot y)) (set! (-> a0-1 z) (-> arg2 launchrot z)) (set! (-> a0-1 w) 1.0) - (set! (-> v1-6 quad) (-> a0-1 quad)) + (vector-copy! v1-6 a0-1) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1503)) ) @@ -1931,7 +1931,7 @@ (set! (-> a0-6 y) (-> arg2 launchrot y)) (set! (-> a0-6 z) (-> arg2 launchrot z)) (set! (-> a0-6 w) 1.0) - (set! (-> v1-19 quad) (-> a0-6 quad)) + (vector-copy! v1-19 a0-6) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1503)) ) diff --git a/goal_src/jak3/levels/stadium/dm-mine-spider.gc b/goal_src/jak3/levels/stadium/dm-mine-spider.gc index 1e87457998a..3d0398212e7 100644 --- a/goal_src/jak3/levels/stadium/dm-mine-spider.gc +++ b/goal_src/jak3/levels/stadium/dm-mine-spider.gc @@ -572,34 +572,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 275251.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 67.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -642,6 +642,7 @@ ) (defmethod event-handler ((this dm-mine-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('touched) (let* ((s3-0 arg0) @@ -655,7 +656,7 @@ (a1-3 (new 'stack 'collide-query)) ) 0.0 - (set! (-> a1-3 start-pos quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> a1-3 start-pos) (-> this root root-prim prim-core world-sphere)) (vector-! (-> a1-3 move-dist) (the-as vector (-> (the-as collide-shape s3-1) root-prim prim-core)) @@ -670,7 +671,7 @@ (set! (-> v1-6 action-mask) (collide-action solid)) ) (if (< (fill-and-probe-using-line-sphere *collide-cache* a1-3) 0.0) - (send-attack this arg0 (the-as touching-shapes-entry (-> arg3 param 0)) (-> this attack-id)) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry (-> arg3 param 0)) (-> this attack-id)) ) ) ) @@ -680,11 +681,11 @@ (sound-play "mnspider-blow") (cond ((logtest? (-> *part-group-id-table* 1029 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) ) @@ -697,9 +698,10 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this dm-mine-spider)) +(defmethod get-search-info-flag ((this dm-mine-spider)) + "Get search-info-flag for this process." (the-as search-info-flag (if (-> this trackable?) - (the-as int ((method-of-type nav-enemy process-mask->search-info-flag) this)) + (the-as int ((method-of-type nav-enemy get-search-info-flag) this)) 0 ) ) @@ -711,7 +713,7 @@ (a3-0 (-> arg0 state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (vector-copy! a2-0 (-> a3-0 heading)) (t9-0 this v1-1 a2-0) ) 0 @@ -743,7 +745,7 @@ (cond ((logtest? (enemy-flag ef39) (-> this enemy-flags)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) - (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (vector-copy! (-> this root gspot-pos) (-> this root trans)) ) (else (normalize-heading! this (-> this nav)) @@ -780,7 +782,7 @@ ) (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a1-4 (-> this nav state))) - (set! (-> s5-1 quad) (-> a1-4 target-pos quad)) + (vector-copy! s5-1 (-> a1-4 target-pos)) ) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) @@ -821,7 +823,7 @@ (let ((v1-32 (-> this nav state))) (logclear! (-> v1-32 flags) (nav-state-flag directional-mode)) (logior! (-> v1-32 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-32 target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> v1-32 target-pos) s5-1) ) ) 0 @@ -834,6 +836,7 @@ ;; WARN: Return type mismatch float vs none. (defmethod enemy-common-post ((this dm-mine-spider)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -847,7 +850,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-2 quad)) + (vector-copy! (-> v1-1 target-pos) a0-2) ) 0 (none) @@ -897,11 +900,11 @@ (sound-play "mnspider-blow") (cond ((logtest? (-> *part-group-id-table* 1029 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) ) @@ -1000,7 +1003,7 @@ (t0-0 (-> self nav state)) (a3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a3-0 quad) (-> t0-0 target-pos quad)) + (vector-copy! a3-0 (-> t0-0 target-pos)) (t9-0 a0-0 (the-as bucket-id a1-0) @@ -1072,7 +1075,7 @@ (ja :num! (seek!)) ) (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> self root trans quad)) + (vector-copy! gp-2 (-> self root trans)) (let ((s5-2 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) 14745.6))) (vector+! s5-2 gp-2 s5-2) (ja-no-eval :group! dm-mine-spider-climb-ja :num! (seek!) :frame-num 0.0) @@ -1100,19 +1103,21 @@ ) ) -(defmethod enemy-method-88 ((this dm-mine-spider) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this dm-mine-spider) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" #f ) ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this dm-mine-spider) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) ;; WARN: Return type mismatch int vs object. -(defmethod init-enemy-defaults! ((this dm-mine-spider) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this dm-mine-spider) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1142,6 +1147,7 @@ ) (defmethod init-enemy-collision! ((this dm-mine-spider)) + "Typical place to construct collision shapes" (set! (-> this size) (rnd-float-range this 0.8 1.2)) (let ((f30-0 (* 3276.8 (-> this size))) (s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))) @@ -1175,12 +1181,13 @@ ) (defmethod init-enemy! ((this dm-mine-spider)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dm-mine-spider" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *dm-mine-spider-nav-enemy-info*) + (setup-enemy! this *dm-mine-spider-nav-enemy-info*) (set! (-> this move-angle) 10922.667) (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) #t @@ -1259,8 +1266,8 @@ (defmethod dm-mine-spider-spawner-method-32 ((this dm-mine-spider-spawner) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> s5-0 vec0 quad) (-> arg0 quad)) - (set! (-> s5-0 cquery start-pos quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec0) arg0) + (vector-copy! (-> s5-0 cquery start-pos) (-> s5-0 vec0)) (set-vector! (-> s5-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) (let ((v1-3 (-> s5-0 cquery))) (set! (-> v1-3 radius) 1024.0) @@ -1275,8 +1282,8 @@ (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* (-> s5-0 cquery)))) (when (>= f0-5 0.0) (vector+float*! (-> s5-0 vec0) (-> s5-0 cquery start-pos) (-> s5-0 cquery move-dist) f0-5) - (set! (-> s5-0 vec1 quad) (-> s5-0 cquery best-other-tri normal quad)) - (set! (-> arg0 quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 cquery best-other-tri normal)) + (vector-copy! arg0 (-> s5-0 vec0)) ) ) ) @@ -1291,12 +1298,12 @@ (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (let ((a1-2 (new 'stack-no-clear 'nav-poly))) (set! (-> a1-2 vertex1 x) 122880.0) (set! (-> a1-2 data 20) (the-as uint 2)) (vector-! (the-as vector (-> a1-2 vertex)) s3-0 (the-as vector (-> s4-0 bounds))) - (set! (-> s3-0 quad) (-> a1-2 vertex 0 quad)) + (vector-copy! s3-0 (-> a1-2 vertex 0)) (let ((a1-3 (nav-mesh-method-45 s4-0 a1-2))) (when a1-3 (let ((s2-1 (new 'stack-no-clear 'vector))) @@ -1307,7 +1314,7 @@ ) (vector+! s3-0 s3-0 (the-as vector (-> s4-0 bounds))) (dm-mine-spider-spawner-method-32 this s3-0) - (set! (-> arg0 quad) (-> s3-0 quad)) + (vector-copy! arg0 s3-0) (set! (-> this nav-id) (-> s4-0 entity aid)) (return #t) ) @@ -1356,11 +1363,11 @@ (when (< (-> self hit-points) 0) (cond ((logtest? (-> *part-group-id-table* 1029 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) ) @@ -1419,7 +1426,7 @@ (let ((s5-1 (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :w 1.0)))) (when (dm-mine-spider-spawner-method-33 self s5-1) (let ((gp-1 (new 'stack-no-clear 'enemy-init-by-other-params))) - (set! (-> gp-1 trans quad) (-> s5-1 quad)) + (vector-copy! (-> gp-1 trans) s5-1) (let ((s5-2 quaternion-copy!) (s4-0 (-> gp-1 quat)) (s3-0 quaternion<-rotate-y-vector) @@ -1509,7 +1516,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this dm-mine-spider-spawner)) +(defmethod get-search-info-flag ((this dm-mine-spider-spawner)) + "Get search-info-flag for this process." (the-as search-info-flag 32) ) @@ -1542,6 +1550,7 @@ ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this dm-mine-spider-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag) (sv-32 vector)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) diff --git a/goal_src/jak3/levels/stadium/king-rider.gc b/goal_src/jak3/levels/stadium/king-rider.gc index f6d1c26c370..01b6c0dfa57 100644 --- a/goal_src/jak3/levels/stadium/king-rider.gc +++ b/goal_src/jak3/levels/stadium/king-rider.gc @@ -37,7 +37,7 @@ (set! (-> gp-0 uvec z) (sin (-> gp-0 uvec x))) (set! (-> gp-0 uvec w) (cos (-> gp-0 uvec x))) (set! (-> gp-0 uvec y) (seconds-per-frame)) - (set! (-> gp-0 rvec quad) (-> s5-0 local-accel quad)) + (vector-copy! (-> gp-0 rvec) (-> s5-0 local-accel)) (let ((f1-6 (+ (* 0.03 (-> gp-0 uvec z)) (* -1.0 (-> gp-0 rvec x) (-> s5-0 left-right-accel-factor))))) (+! (-> self left-right-interp) (* (- f1-6 (-> self left-right-interp)) (fmin 1.0 (* 8.0 (-> gp-0 uvec y))))) ) @@ -197,7 +197,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (set! (-> self level) (level-get *level* 'lpattack)) (initialize-skeleton diff --git a/goal_src/jak3/levels/stadium/rapid-gunner.gc b/goal_src/jak3/levels/stadium/rapid-gunner.gc index 7c005f04531..521f4c489dc 100644 --- a/goal_src/jak3/levels/stadium/rapid-gunner.gc +++ b/goal_src/jak3/levels/stadium/rapid-gunner.gc @@ -154,34 +154,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 78643.2 - :knocked-medium-vxz-hi 117964.8 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 135168.0 - :knocked-hard-vy-hi 151552.0 - :knocked-huge-vxz-lo 78643.2 - :knocked-huge-vxz-hi 117964.8 - :knocked-huge-vy-lo 135168.0 - :knocked-huge-vy-hi 151552.0 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 19.2) + :knocked-medium-vxz-hi (meters 28.8) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 33) + :knocked-hard-vy-hi (meters 37) + :knocked-huge-vxz-lo (meters 19.2) + :knocked-huge-vxz-hi (meters 28.8) + :knocked-huge-vy-lo (meters 33) + :knocked-huge-vy-hi (meters 37) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 32970.816) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -568,6 +568,7 @@ (set! (-> *rapid-gunner-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod init-enemy-collision! ((this rapid-gunner)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -840,7 +841,7 @@ ) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-8 quad)) + (vector-copy! (-> a0-2 target-pos) v1-8) ) 0 (nav-enemy-travel-post) @@ -893,7 +894,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! (-> self draw art-group data 19) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1046,7 +1047,7 @@ (a1-2 (-> self move-dest)) (f0-0 (-> v1-14 extra-nav-sphere w)) ) - (set! (-> v1-14 extra-nav-sphere quad) (-> a1-2 quad)) + (vector-copy! (-> v1-14 extra-nav-sphere) a1-2) (set! (-> v1-14 extra-nav-sphere w) f0-0) ) 0 @@ -1083,7 +1084,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! (-> self draw art-group data 22) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1101,7 +1102,7 @@ (suspend) (nav-enemy-falling-post) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1194,7 +1195,7 @@ (suspend) (ja :num! (seek! max 0.2)) ) - (go-best-state self) + (go-state-for-focused self) ) :post #f ) @@ -1235,7 +1236,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1244,6 +1245,7 @@ ;; WARN: Return type mismatch int vs process. (defmethod update-focus ((this rapid-gunner)) + "Potentially update the focus, if there is something better to focus on." (with-pp (let ((t9-0 (method-of-type enemy update-focus))) (t9-0 this) @@ -1266,7 +1268,7 @@ ) (let ((a0-5 (handle->process (-> this focus handle)))) (if a0-5 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-5) 1) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-5) 1)) ) ) (the-as process 0) @@ -1274,7 +1276,8 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-108 ((this rapid-gunner) (arg0 process-focusable)) +(defmethod should-flee-from? ((this rapid-gunner) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (with-pp (the-as symbol (or (focus-test? arg0 invulnerable) (let ((v1-3 (new 'stack-no-clear 'event-message-block))) @@ -1289,6 +1292,7 @@ ) (defmethod event-handler ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1300,7 +1304,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1328,28 +1332,31 @@ ) ) -(defmethod go-idle2 ((this rapid-gunner)) +(defmethod go-fallback-init ((this rapid-gunner)) + "If there's no specific settings for initial state, go to this state after spawning." (let ((v1-0 (-> this turret-actor))) (if (if v1-0 (-> v1-0 extra process) ) (go (method-of-object this turret-seek)) - ((method-of-type nav-enemy go-idle2) this) + ((method-of-type nav-enemy go-fallback-init) this) ) ) ) (defmethod coin-flip? ((this rapid-gunner)) + "Return #t half the time, #f the other." #f ) (defmethod init-enemy! ((this rapid-gunner)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-rapid-gunner" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *rapid-gunner-nav-enemy-info*) + (setup-enemy! this *rapid-gunner-nav-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -1375,7 +1382,7 @@ ) (set! (-> this turret-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (if (-> this turret-actor) - (set! (-> this turret-pos quad) (-> this turret-actor extra trans quad)) + (vector-copy! (-> this turret-pos) (-> this turret-actor extra trans)) ) (setup-masks (-> this draw) 0 4) (logior! (-> this focus collide-with) (collide-spec bot)) @@ -1386,6 +1393,7 @@ ;; WARN: Return type mismatch float vs object. (defmethod knocked-handler ((this rapid-gunner) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (let ((f30-0 (rnd-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp 73728.0 90112.0 f30-0)) diff --git a/goal_src/jak3/levels/stadium/rubble-attack.gc b/goal_src/jak3/levels/stadium/rubble-attack.gc index 04a8c0f6f83..189661d343c 100644 --- a/goal_src/jak3/levels/stadium/rubble-attack.gc +++ b/goal_src/jak3/levels/stadium/rubble-attack.gc @@ -36,7 +36,7 @@ (defmethod projectile-method-26 ((this rub-missile)) (cond ((logtest? (-> *part-group-id-table* 1021 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this @@ -45,7 +45,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 1021) :duration (seconds 0.167)) ) ) @@ -304,7 +304,7 @@ (defbehavior dm-missile-target-init-by-other dm-missile-target ((arg0 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-dm-missile-target" (the-as (pointer level) #f))) @@ -486,7 +486,7 @@ ) (set! (-> s5-0 y) (+ 204800.0 (-> s3-0 y) (-> s5-0 y))) (let ((s4-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-1 start-pos quad) (-> s5-0 quad)) + (vector-copy! (-> s4-1 start-pos) s5-0) (set-vector! (-> s4-1 move-dist) 0.0 -409600.0 0.0 1.0) (let ((v1-21 s4-1)) (set! (-> v1-21 radius) 40.96) @@ -507,7 +507,7 @@ ) (cond (s2-0 - (set! (-> s1-1 quad) (-> s2-0 quad)) + (vector-copy! s1-1 s2-0) ) (else (let ((s0-2 s1-1) @@ -524,8 +524,8 @@ ) (set! (-> s4-2 initial-tilt) 8192.0) (set! (-> s4-2 gravity) 409600.0) - (set! (-> s4-2 src quad) (-> s1-1 quad)) - (set! (-> s4-2 dest quad) (-> s5-0 quad)) + (vector-copy! (-> s4-2 src) s1-1) + (vector-copy! (-> s4-2 dest) s5-0) (when (traj3d-calc-initial-velocity-using-tilt s4-2) (let ((s3-1 (new 'stack-no-clear 'projectile-init-by-other-params))) (set! (-> this missile-target) @@ -535,11 +535,11 @@ (set! (-> s3-1 charge) 1.0) (set! (-> s3-1 options) (projectile-options)) (logclear! (-> s3-1 options) (projectile-options po14 po15 po16)) - (set! (-> s3-1 pos quad) (-> s1-1 quad)) + (vector-copy! (-> s3-1 pos) s1-1) (set! (-> s3-1 notify-handle) (the-as handle #f)) (set! (-> s3-1 owner-handle) (process->handle this)) (set! (-> s3-1 target-handle) (ppointer->handle (-> this missile-target process))) - (set! (-> s3-1 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 target-pos) s5-0) (set! (-> s3-1 ignore-handle) (process->handle this)) (let* ((v1-56 *game-info*) (a0-50 (+ (-> v1-56 attack-id) 1)) @@ -554,7 +554,7 @@ (logior! (-> s3-1 options) (projectile-options po15)) (set! (-> s3-1 vehicle-impulse-factor) 7.5) (logior! (-> s3-1 options) (projectile-options po16)) - (set! (-> s3-1 vel quad) (-> s4-2 initial-velocity quad)) + (vector-copy! (-> s3-1 vel) (-> s4-2 initial-velocity)) (set! (-> this missile) (process->handle (-> (spawn-projectile rub-missile s3-1 this *default-dead-pool*) 0))) ) ) @@ -668,7 +668,7 @@ ) :code (behavior () (local-vars (v1-23 object)) - (while (!= (status-of-level-and-borrows *level* 'lpattack #f) 'active) + (while (!= (level-status? *level* 'lpattack #f) 'active) (set-time! (-> self missile-timer)) (suspend) ) diff --git a/goal_src/jak3/levels/stadium/rubble-obs.gc b/goal_src/jak3/levels/stadium/rubble-obs.gc index dd9bb522b1c..4485f4c8990 100644 --- a/goal_src/jak3/levels/stadium/rubble-obs.gc +++ b/goal_src/jak3/levels/stadium/rubble-obs.gc @@ -87,11 +87,11 @@ (sound-play "rub-fall-impact") (cond ((logtest? (-> *part-group-id-table* 1026 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 11 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 11 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1026)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 11 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 11 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1026)) ) ) @@ -211,6 +211,7 @@ ) (defmethod init-from-entity! ((this rub-tower) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -316,11 +317,11 @@ (spawn-joint-exploder self) (cond ((logtest? (-> *part-group-id-table* 1024 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1024)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1024)) ) ) @@ -369,7 +370,7 @@ (defmethod spawn-joint-exploder ((this rub-electric-gate-switch)) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) (target-pos 0)) (set! (-> gp-0 fountain-rand-transv-hi x) 122880.0) (set! (-> gp-0 fountain-rand-transv-hi y) 245760.0) (set! (-> gp-0 fountain-rand-transv-hi z) 4096.0) @@ -415,6 +416,7 @@ ) (defmethod init-from-entity! ((this rub-electric-gate-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) @@ -532,11 +534,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 1027 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (the-as rigid-body-impact gp-1) point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as rigid-body-impact gp-1) point)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1027)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (the-as rigid-body-impact gp-1) point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as rigid-body-impact gp-1) point)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1027)) ) ) @@ -761,6 +763,7 @@ ) (defmethod init-from-entity! ((this rub-elec-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -853,6 +856,7 @@ ) (defmethod init-from-entity! ((this rub-electric-gate-panel) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) diff --git a/goal_src/jak3/levels/stadium/stadium-obs.gc b/goal_src/jak3/levels/stadium/stadium-obs.gc index 54b9c0d9555..54965282c48 100644 --- a/goal_src/jak3/levels/stadium/stadium-obs.gc +++ b/goal_src/jak3/levels/stadium/stadium-obs.gc @@ -40,6 +40,7 @@ ) (defmethod init-from-entity! ((this stadium-flag-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -166,11 +167,11 @@ (sound-play "door-blow") (cond ((logtest? (-> *part-group-id-table* 1001 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1001)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1001)) ) ) @@ -213,6 +214,7 @@ ) (defmethod init-from-entity! ((this rub-dark-jak-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (when (and (task-node-closed? (game-task-node palace-ruins-patrol-resolution)) (not (task-node-closed? (game-task-node palace-ruins-attack-resolution))) ) @@ -331,6 +333,7 @@ ) (defmethod init-from-entity! ((this rub-falling-step) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -531,7 +534,7 @@ ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 150) this)) (quaternion->matrix (-> this mat) (-> this root quat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) (go (method-of-object this idle)) ) @@ -697,7 +700,7 @@ (defmethod do-explode ((this rub-rhino-door)) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) (target-pos 0)) (set! (-> gp-0 fountain-rand-transv-hi x) 122880.0) (set! (-> gp-0 fountain-rand-transv-hi y) 245760.0) (set! (-> gp-0 fountain-rand-transv-hi z) 4096.0) @@ -748,6 +751,7 @@ ) (defmethod init-from-entity! ((this rub-rhino-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (when (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) (cleanup-for-death this) (return #f) @@ -852,6 +856,7 @@ ) (defmethod init-from-entity! ((this mh-tower-smoke-stda) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/goal_src/jak3/levels/temple/flamer-hover.gc b/goal_src/jak3/levels/temple/flamer-hover.gc index 5c6d4c6710e..070e8e25aa7 100644 --- a/goal_src/jak3/levels/temple/flamer-hover.gc +++ b/goal_src/jak3/levels/temple/flamer-hover.gc @@ -106,34 +106,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 101580.8 - :knocked-hard-vy-lo 60620.8 - :knocked-hard-vy-hi 95027.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 24.8) + :knocked-hard-vy-lo (meters 14.8) + :knocked-hard-vy-hi (meters 23.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -157,6 +157,7 @@ ) (defmethod enemy-common-post ((this flamer-hover)) + "Common implementation of post. Runs ja-post." (when (time-elapsed? (the-as int (-> this flit-timer)) (rand-vu-int-range (seconds 1.2) (seconds 3))) (set! (-> this flit-angle) (the float @@ -166,7 +167,7 @@ (set! (-> this flit-timer) (the-as uint (current-time))) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> *up-vector* quad)) + (vector-copy! s5-1 *up-vector*) (vector-normalize! s5-1 2048.0) (vector/! s5-1 s5-1 (-> this root scale)) (vector-rotate-around-z! s5-1 s5-1 (-> this flit-angle)) @@ -193,7 +194,7 @@ (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 122880.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-12 s4-0)) (set! (-> v1-12 radius) 3276.8) @@ -330,7 +331,7 @@ (if (and (time-elapsed? (the-as int (-> self last-fire-time)) (seconds 3)) (and (< (vector-vector-distance (-> self focus-pos) (-> self root trans)) 245760.0) (get-focus! self) - (enemy-method-104 self (-> self focus-pos) 910.2222) + (pointing-toward? self (-> self focus-pos) 910.2222) ) ) (go-virtual attack) @@ -350,7 +351,7 @@ (s5-1 (new 'stack-no-clear 'vector)) ) (setup-from-to-xz-vel! (-> self shot-trajectory) gp-0 a2-1 122880.0 -102400.0) - (set! (-> s5-1 quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! s5-1 (-> self shot-trajectory initial-velocity)) (vector-normalize! s5-1 1638.4) (vector+! gp-0 gp-0 s5-1) ) @@ -359,8 +360,8 @@ (set! (-> a1-6 charge) 1.0) (set! (-> a1-6 options) (projectile-options)) (logclear! (-> a1-6 options) (projectile-options po14 po15 po16)) - (set! (-> a1-6 pos quad) (-> gp-0 quad)) - (set! (-> a1-6 vel quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! (-> a1-6 pos) gp-0) + (vector-copy! (-> a1-6 vel) (-> self shot-trajectory initial-velocity)) (set! (-> a1-6 notify-handle) (process->handle self)) (set! (-> a1-6 owner-handle) (the-as handle #f)) (set! (-> a1-6 target-handle) (the-as handle #f)) @@ -484,7 +485,8 @@ :post enemy-falling-post ) -(defmethod enemy-method-50 ((this flamer-hover) (arg0 int)) +(defmethod update-collision-action ((this flamer-hover) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -519,6 +521,7 @@ ;; WARN: Return type mismatch object vs symbol. (defmethod knocked-anim ((this flamer-hover) (arg0 enemy-knocked-info)) + "start the knocked animation." (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol @@ -529,7 +532,7 @@ (s4-0 (new 'static 'array uint64 3 #x12 #x13 #x14)) (s3-0 (new 'static 'array int32 4 0 0 0 0)) (a2-0 (ash 1 (-> s3-0 0))) - (v1-6 (enemy-method-131 this a1-3 a2-0)) + (v1-6 (rnd-int-excluding-masked this a1-3 a2-0)) (s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0)))))) ) (set! (-> s3-0 0) v1-6) @@ -571,10 +574,12 @@ ) (defmethod coin-flip? ((this flamer-hover)) + "Return #t half the time, #f the other." #f ) (defmethod init-enemy-collision! ((this flamer-hover)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -715,8 +720,9 @@ ) (defmethod init-enemy! ((this flamer-hover)) + "Typical place for shared init code. Runs from entity or process style init." (hover-enemy-method-170 this) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (hover-enemy-method-176 this) (set! (-> this neck up) (the-as uint 1)) (set! (-> this neck nose) (the-as uint 2)) diff --git a/goal_src/jak3/levels/temple/hover-training.gc b/goal_src/jak3/levels/temple/hover-training.gc index d74565290e5..080b8dded98 100644 --- a/goal_src/jak3/levels/temple/hover-training.gc +++ b/goal_src/jak3/levels/temple/hover-training.gc @@ -486,12 +486,12 @@ ) ) ) - (set! (-> gp-4 s1-0 quad) (-> self entity trans quad)) + (vector-copy! (-> gp-4 s1-0) (-> self entity trans)) (let ((s3-1 (+ s1-0 1))) (dotimes (s1-1 (length (-> self actor-group (-> self group-num)))) (let ((v1-61 (-> self actor-group (-> self group-num) data s1-1))) (when (and v1-61 (-> v1-61 actor)) - (set! (-> gp-4 s3-1 quad) (-> v1-61 actor trans quad)) + (vector-copy! (-> gp-4 s3-1) (-> v1-61 actor trans)) (+! s3-1 1) ) ) @@ -555,7 +555,7 @@ (let ((v1-117 (-> self actor-group 0 data))) (when (and v1-117 (-> v1-117 0 actor)) (let ((gp-7 (new 'stack-no-clear 'vector))) - (set! (-> gp-7 quad) (-> v1-117 0 actor trans quad)) + (vector-copy! gp-7 (-> v1-117 0 actor trans)) (vector-seek-3d-smooth! (-> self root trans) gp-7 (* 409600.0 (seconds-per-frame)) 0.5) (cond ((< 409.6 (vector-vector-distance (-> self root trans) gp-7)) @@ -577,6 +577,7 @@ ) (defmethod init-from-entity! ((this tpl-token) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (with-pp (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -827,10 +828,12 @@ (until (process-grab? *target* #f) (suspend) ) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (persist-with-delay *setting-control* 'interp-time (seconds 4) 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-354" 0.0 0) - (suspend-for (seconds 3)) + (suspend-for (seconds 3) + ) (task-node-close! (game-task-node temple-tests-hover-training) 'event) (until (process-release? *target*) (suspend) @@ -901,6 +904,7 @@ ) (defmethod init-from-entity! ((this hover-training-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (process-entity-set! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1198,6 +1202,7 @@ ) (defmethod init-from-entity! ((this tpl-symbol) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak3/levels/temple/temple-obs.gc b/goal_src/jak3/levels/temple/temple-obs.gc index 676e8b10355..e98ac8e81bc 100644 --- a/goal_src/jak3/levels/temple/temple-obs.gc +++ b/goal_src/jak3/levels/temple/temple-obs.gc @@ -234,6 +234,7 @@ (defmethod init-from-entity! ((this tpl-outer-airlock-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -297,6 +298,7 @@ (defmethod init-from-entity! ((this tpl-mardoor) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -385,7 +387,7 @@ :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-0 (-> self info sphere-array 0))) - (set! (-> gp-0 pos quad) (-> a0-0 quad)) + (vector-copy! (-> gp-0 pos) a0-0) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf5)) @@ -932,8 +934,8 @@ (let ((a2-4 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* (-> self kill-angle)))) (quaternion*! (-> self root quat) (-> self kill-quat) a2-4) ) - (set! (-> self other-eyeball-jmod transform scale quad) (-> self root scale quad)) - (set! (-> self eyeball-jmod transform scale quad) (-> self root scale quad)) + (vector-copy! (-> self other-eyeball-jmod transform scale) (-> self root scale)) + (vector-copy! (-> self eyeball-jmod transform scale) (-> self root scale)) (let* ((f0-9 (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self state-time))) 0.0 60.0)) (f0-11 (* f0-9 f0-9)) ) @@ -995,6 +997,7 @@ ) (defmethod init-from-entity! ((this tpl-holo-eye) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 320) (set! (-> this root) (new 'process 'trsqv)) @@ -1017,7 +1020,7 @@ ) ) ) - (set! (-> this init-trans quad) (-> this root trans quad)) + (vector-copy! (-> this init-trans) (-> this root trans)) (init (-> this eyeball-jmod) this (the-as uint 4) (joint-mod-base-flags attached scale)) (init (-> this other-eyeball-jmod) this (the-as uint 9) (joint-mod-base-flags attached trans quat scale)) (set! (-> this perm-part) @@ -1186,6 +1189,7 @@ ) (defmethod init-from-entity! ((this tpl-spike-trap) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) projectile-bounce-reaction) @@ -1333,7 +1337,7 @@ (.mul.x.vf.xyz acc vf5 vf7) (.add.mul.w.vf.xyz vf6 vf4 vf0 acc) (.svf (&-> v1-20 quad) vf6) - (set! (-> a0-8 state meet data (+ (-> a0-8 state points-to-draw) -1) quad) (-> v1-20 quad)) + (vector-copy! (-> a0-8 state meet data (+ (-> a0-8 state points-to-draw) -1)) v1-20) ) ) (let ((v1-24 (-> this lightning s5-0)) @@ -1526,6 +1530,7 @@ ) (defmethod init-from-entity! ((this tpl-elec-swing-pole) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1540,7 +1545,7 @@ (set! (-> this electrify) #f) (set! (-> this sound-id) (new-sound-id)) (init-collision! this) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (quaternion-copy! (-> this root quat) (-> arg0 quat)) (vector-identity! (-> this root scale)) (vector-z-quaternion! (-> this dir) (-> this root quat)) @@ -1780,6 +1785,7 @@ ) (defmethod init-from-entity! ((this tpl-spindle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 int)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -1917,6 +1923,7 @@ ) (defmethod init-from-entity! ((this tpl-fan-two) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 int)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -2040,6 +2047,7 @@ ) (defmethod init-from-entity! ((this tpl-fan-three) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 int)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -2207,6 +2215,7 @@ ) (defmethod init-from-entity! ((this tpl-break-alcove) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) @@ -2370,6 +2379,7 @@ ) (defmethod init-from-entity! ((this tpl-break-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) diff --git a/goal_src/jak3/levels/temple/temple-obs2.gc b/goal_src/jak3/levels/temple/temple-obs2.gc index 24680808fc3..fc2c61cce0e 100644 --- a/goal_src/jak3/levels/temple/temple-obs2.gc +++ b/goal_src/jak3/levels/temple/temple-obs2.gc @@ -203,6 +203,7 @@ ) (defmethod init-from-entity! ((this tpl-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) @@ -514,11 +515,12 @@ ) (defmethod init-from-entity! ((this tpl-watcher-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this within-outer-ring) #f) (set! (-> this within-inner-ring) #f) (set! (-> this ouched) #f) - (set! (-> this trans quad) (-> arg0 trans quad)) + (vector-copy! (-> this trans) (-> arg0 trans)) (logclear! (-> this mask) (process-mask actor-pause)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-4 (res-lump-data arg0 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -621,7 +623,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this tpl-watcher)) +(defmethod get-search-info-flag ((this tpl-watcher)) + "Get search-info-flag for this process." (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -789,7 +792,7 @@ (s2-0 vector-xz-normalize!) (a0-7 v1-10) ) - (set! (-> a0-7 quad) (-> v1-10 quad)) + (vector-copy! a0-7 v1-10) (set! (-> a0-7 y) 0.0) (let* ((a1-7 (s2-0 (vector-normalize! a0-7 1.0) 1.0)) (a2-2 (vector-lerp-clamp! (new 'stack-no-clear 'vector) a1-7 *up-vector* f30-0)) @@ -938,11 +941,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 672 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 672)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 672)) ) ) @@ -1092,6 +1095,7 @@ ) (defmethod init-from-entity! ((this tpl-watcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 384) (init-collision! this) @@ -1331,6 +1335,7 @@ (defmethod init-from-entity! ((this tpl-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((a0-2 (res-lump-struct arg0 'task-name structure))) (when (and a0-2 (task-closed? (the-as string a0-2))) (cleanup-for-death this) @@ -1401,6 +1406,7 @@ (defmethod init-from-entity! ((this tpl-door-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1736,6 +1742,7 @@ ) (defmethod init-from-entity! ((this tpl-spinning-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (tpl-spinning-plat-method-24 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1744,7 +1751,7 @@ (the-as pair 0) ) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this basal-trans quad) (-> this root trans quad)) + (vector-copy! (-> this basal-trans) (-> this root trans)) (let* ((v1-8 *game-info*) (a0-10 (+ (-> v1-8 attack-id) 1)) ) @@ -1794,6 +1801,7 @@ ) (defmethod init-from-entity! ((this tpl-oracle-eye) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1862,6 +1870,7 @@ ) (defmethod init-from-entity! ((this tpl-banner-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1984,6 +1993,7 @@ ) (defmethod init-from-entity! ((this tpl-banner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak3/levels/temple/templed-obs.gc b/goal_src/jak3/levels/temple/templed-obs.gc index 364cf4d5e84..872ad5f2ace 100644 --- a/goal_src/jak3/levels/temple/templed-obs.gc +++ b/goal_src/jak3/levels/temple/templed-obs.gc @@ -682,11 +682,11 @@ (set! sv-32 (-> this node-list data (tpl-bbridge-panel arg0) bone transform trans)) (cond ((logtest? (-> *part-group-id-table* 701 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-32 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-32) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 701)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-32 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-32) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 701)) ) ) @@ -723,7 +723,7 @@ (let ((v1-24 (-> this node-list data (tpl-bbridge-panel arg0) bone transform trans))) (cond ((logtest? (-> *part-group-id-table* 700 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-24 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-24) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -732,7 +732,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-24 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-24) (part-tracker-spawn part-tracker :to *entity-pool* @@ -783,11 +783,11 @@ (let ((v1-81 (-> this node-list data (tpl-bbridge-panel arg0) bone transform trans))) (cond ((logtest? (-> *part-group-id-table* 700 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-81 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-81) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 700)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-81 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-81) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 700)) ) ) @@ -980,6 +980,7 @@ ) (defmethod init-from-entity! ((this tpl-break-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) diff --git a/goal_src/jak3/levels/temple/templex-obs.gc b/goal_src/jak3/levels/temple/templex-obs.gc index eb5153f6743..1f5eabed842 100644 --- a/goal_src/jak3/levels/temple/templex-obs.gc +++ b/goal_src/jak3/levels/temple/templex-obs.gc @@ -193,6 +193,7 @@ ) (defmethod init-from-entity! ((this tpl-stone-break) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak3/levels/temple/templex-scenes.gc b/goal_src/jak3/levels/temple/templex-scenes.gc index 14f68b198b9..5b669e55209 100644 --- a/goal_src/jak3/levels/temple/templex-scenes.gc +++ b/goal_src/jak3/levels/temple/templex-scenes.gc @@ -105,6 +105,7 @@ (defmethod init-from-entity! ((this tpl-inner-airlock-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/goal_src/jak3/levels/temple/tomb-baby-spider.gc b/goal_src/jak3/levels/temple/tomb-baby-spider.gc index d95517241bd..57a16a99775 100644 --- a/goal_src/jak3/levels/temple/tomb-baby-spider.gc +++ b/goal_src/jak3/levels/temple/tomb-baby-spider.gc @@ -111,34 +111,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 80281.6 - :knocked-soft-vxz-hi 87654.4 - :knocked-soft-vy-lo 67993.6 - :knocked-soft-vy-hi 112230.4 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 55705.6 - :knocked-hard-vxz-hi 71270.4 - :knocked-hard-vy-lo 88473.6 - :knocked-hard-vy-hi 132710.4 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 55705.6 - :knocked-red-vxz-hi 71270.4 - :knocked-red-vy-lo 88473.6 - :knocked-red-vy-hi 132710.4 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 19.6) + :knocked-soft-vxz-hi (meters 21.4) + :knocked-soft-vy-lo (meters 16.6) + :knocked-soft-vy-hi (meters 27.4) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 13.6) + :knocked-hard-vxz-hi (meters 17.4) + :knocked-hard-vy-lo (meters 21.6) + :knocked-hard-vy-hi (meters 32.4) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 13.6) + :knocked-red-vxz-hi (meters 17.4) + :knocked-red-vy-lo (meters 21.6) + :knocked-red-vy-hi (meters 32.4) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -190,7 +190,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (when (enemy-method-134 self 0.2) + (when (rnd-chance-for-idle? self 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.2)) (let ((v1-37 self)) @@ -208,7 +208,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -248,18 +248,18 @@ (defstate notice (tomb-baby-spider) :virtual #t :code (behavior () - (go-best-state self) + (go-state-for-focused self) (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a0-4 (handle->process (-> self focus handle)))) (cond (a0-4 - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-4) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-4) 0)) ) (else (let ((a1-4 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-4 target-pos quad)) + (vector-copy! gp-0 (-> a1-4 target-pos)) ) ) ) @@ -277,7 +277,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -292,7 +292,7 @@ (set! (-> v1-9 local-sphere w) 4915.2) ) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-14 *game-info*) (v0-2 (+ (-> v1-14 attack-id) 1)) ) @@ -312,7 +312,7 @@ (nav-enemy-method-176 self) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (if (logtest? (-> self enemy-flags) (enemy-flag victory)) (logclear! (-> self enemy-flags) (enemy-flag victory)) ) @@ -362,7 +362,7 @@ (suspend) (ja :num! (seek!)) ) - (when (not (enemy-method-105 self 6371.5557 #t)) + (when (not (pointing-toward-focus? self 6371.5557 #t)) (let ((v1-27 self)) (set! (-> v1-27 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-27 enemy-flags)))) ) @@ -372,7 +372,7 @@ (a2-3 (-> self nav state)) (v1-30 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-30 quad) (-> a2-3 target-pos quad)) + (vector-copy! v1-30 (-> a2-3 target-pos)) (let* ((s5-0 (t9-4 (vector-! a0-7 v1-30 (-> self root trans)) 1.0)) (f30-0 (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle s5-0))) ) @@ -389,7 +389,7 @@ ) ) ) - (until (enemy-method-105 self 910.2222 #t) + (until (pointing-toward-focus? self 910.2222 #t) (ja-blend-eval) (suspend) (ja :num! (loop!)) @@ -434,7 +434,9 @@ (let ((a0-1 (get-focus! self))) (when a0-1 (let ((a0-2 (get-trans a0-1 0))) - (if (and (< (vector-vector-distance a0-2 (-> self root trans)) 20480.0) (enemy-method-105 self 1274.3112 #t)) + (if (and (< (vector-vector-distance a0-2 (-> self root trans)) 20480.0) + (pointing-toward-focus? self 1274.3112 #t) + ) (go-virtual attack) ) ) @@ -444,6 +446,7 @@ ) (defmethod knocked-anim ((this tomb-baby-spider) (arg0 enemy-knocked-info)) + "start the knocked animation." (let* ((a2-0 (the-as collide-shape-prim-group (-> this root root-prim))) (v1-2 (-> a2-0 child 3)) ) @@ -488,6 +491,7 @@ ) (defmethod knocked-land-anim ((this tomb-baby-spider) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type blue-shot)) (let ((v1-3 (-> this skel root-channel 0))) @@ -520,6 +524,7 @@ ) (defmethod knocked-anim-handler ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((3) (let ((s4-0 (ja-done? 0))) @@ -586,7 +591,8 @@ ) ) -(defmethod send-attack ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (let* ((s1-0 arg0) (s2-0 (if (type? s1-0 process-focusable) s1-0 @@ -622,6 +628,7 @@ ) (defmethod init-enemy-collision! ((this tomb-baby-spider)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -696,12 +703,13 @@ ;; WARN: Return type mismatch vector vs none. (defmethod init-enemy! ((this tomb-baby-spider)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-baby-spider" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *tomb-baby-spider-nav-enemy-info*) + (setup-enemy! this *tomb-baby-spider-nav-enemy-info*) (let ((f0-0 (rnd-float-range this 0.75 1.0))) (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) ) diff --git a/goal_src/jak3/levels/title/title-obs.gc b/goal_src/jak3/levels/title/title-obs.gc index 1ef1709bfc2..435d476bf68 100644 --- a/goal_src/jak3/levels/title/title-obs.gc +++ b/goal_src/jak3/levels/title/title-obs.gc @@ -414,7 +414,7 @@ (want-levels *load-state* a1-12) ) (want-display-level *load-state* 'wasintro 'display) - (while (!= (status-of-level-and-borrows *level* 'wasintro #f) 'active) + (while (!= (level-status? *level* 'wasintro #f) 'active) (suspend) ) (set-setting! 'fog-special-interp-targ #f 0.15 0) @@ -587,7 +587,7 @@ ) (v0-3 (-> self root trans)) ) - (set! (-> v0-3 quad) (-> v1-14 quad)) + (vector-copy! v0-3 v1-14) v0-3 ) ) @@ -1324,9 +1324,9 @@ (gp-2 (new 'stack-no-clear 'vector)) ) (let ((a3-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-40 quad) (-> *math-camera* trans quad)) + (vector-copy! v1-40 (-> *math-camera* trans)) (set-vector! a3-0 (-> self pos-x) 0.0 0.0 1.0) - (set! (-> a2-3 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! a2-3 (-> *math-camera* inv-camera-rot fvec)) (let ((a0-42 a1-7)) (let ((t0-8 (-> *math-camera* inv-camera-rot fvec))) (let ((t1-0 (-> self zoom))) @@ -1342,7 +1342,7 @@ ) (reverse-transform-point! gp-2 a1-7 a2-3 a3-0) ) - (set! (-> self root trans quad) (-> gp-2 quad)) + (vector-copy! (-> self root trans) gp-2) ) (matrix->quaternion (-> self root quat) (-> *math-camera* inv-camera-rot)) (quaternion*! diff --git a/goal_src/jak3/levels/tower/tower-obs.gc b/goal_src/jak3/levels/tower/tower-obs.gc index 1b02b9b18c9..f9ae9dbaa0b 100644 --- a/goal_src/jak3/levels/tower/tower-obs.gc +++ b/goal_src/jak3/levels/tower/tower-obs.gc @@ -92,6 +92,7 @@ ) (defmethod init-from-entity! ((this actor-group-watcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -347,7 +348,8 @@ :virtual #t :code (behavior () (logclear! (-> self draw status) (draw-control-status force-fade)) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (process-spawn scene-player :init scene-player-init @@ -380,6 +382,7 @@ ) (defmethod init-from-entity! ((this tow-large-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -520,7 +523,8 @@ (set-time! (-> self state-time)) ) :code (behavior () - (suspend-for (seconds 0.75)) + (suspend-for (seconds 0.75) + ) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-6 prim-core collide-with) (-> self root backup-collide-with)) @@ -529,8 +533,7 @@ (logclear! (-> self draw status) (draw-control-status no-draw)) (let ((f30-0 1.0)) 0.0 - (suspend-for - (the int (* 300.0 f30-0)) + (suspend-for (the int (* 300.0 f30-0)) (let ((f0-2 (fmax 0.0 (fmin 1.0 (/ (the float (- (current-time) time)) (* 300.0 f30-0)))))) (set-vector! (-> self draw color-mult) f0-2 f0-2 f0-2 1.0) ) @@ -562,6 +565,7 @@ ) (defmethod init-from-entity! ((this tow-energy-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -741,18 +745,7 @@ (let ((a0-0 (joint-node tow-spawner-lod0-jg spawnerspew)) (a1-0 (new 'stack-no-clear 'matrix)) ) - (let* ((v1-1 a1-0) - (t0-0 (-> a0-0 bone transform)) - (a0-2 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-1 rvec quad) a0-2) - (set! (-> v1-1 uvec quad) a2-0) - (set! (-> v1-1 fvec quad) a3-0) - (set! (-> v1-1 trans quad) t0-1) - ) + (matrix-copy! a1-0 (-> a0-0 bone transform)) (vector+float*! (-> a1-0 trans) (-> a1-0 trans) (-> a1-0 fvec) 8192.0) (spawn-from-mat (-> self part) a1-0) ) @@ -770,7 +763,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (the-as (array collide-shape) (new 'stack 'boxed-array collide-shape 8))) ) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (set! (-> s3-0 w) arg1) (let ((gp-1 (fill-actor-list-for-box *actor-hash* s3-0 (-> s4-0 data) (-> s4-0 length)))) (or (zero? gp-1) (begin @@ -805,7 +798,7 @@ (when (and (project-point-to-nav-mesh (-> this entity) s5-0 s5-0 (the-as nav-poly #f) 40960.0) (can-spawn-creature? this s5-0 12288.0) ) - (set! (-> s3-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s3-0 trans) s4-0) (quaternion-copy! (-> s3-0 quat) (-> this root quat)) (set! (-> s3-0 entity) (-> this entity)) (set! (-> s3-0 directed?) #f) @@ -840,6 +833,7 @@ ) (defmethod init-from-entity! ((this tow-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -916,6 +910,7 @@ ) (defmethod init-from-entity! ((this tow-tentacle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 collide-shape-prim-sphere) (sv-32 collide-shape-prim-sphere) (sv-48 vector)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/goal_src/jak3/levels/volcano/flamer-lava.gc b/goal_src/jak3/levels/volcano/flamer-lava.gc index 1bd30ad4c20..1c749fe28ba 100644 --- a/goal_src/jak3/levels/volcano/flamer-lava.gc +++ b/goal_src/jak3/levels/volcano/flamer-lava.gc @@ -156,34 +156,34 @@ :ragdoll-rotate-velocity-mult 1.0 :jump-height-min (meters 3) :jump-height-factor 0.5 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 90112.0 - :knocked-blue-vy-lo 90112.0 - :knocked-blue-vy-hi 172032.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 22) + :knocked-blue-vy-lo (meters 22) + :knocked-blue-vy-hi (meters 42) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -224,6 +224,7 @@ (set! (-> *flamer-lava-nav-enemy-info* fact-defaults) *flamer-lava-fact-defaults*) (defmethod event-handler ((this flamer-lava) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-flinch 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -235,7 +236,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -359,7 +360,7 @@ ) (else (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> (get-trans arg1 0) quad)) + (vector-copy! s1-0 (get-trans arg1 0)) (let ((s3-1 (new 'stack-no-clear 'vector))) (let ((s2-1 (new 'stack-no-clear 'vector))) (vector-! s3-1 s1-0 (-> this root trans)) @@ -387,7 +388,7 @@ ) ) (else - (set! (-> arg0 quad) (-> this idle-pos quad)) + (vector-copy! arg0 (-> this idle-pos)) arg0 ) ) @@ -426,7 +427,7 @@ ) (logclear! (-> a0-8 flags) (nav-state-flag directional-mode)) (logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-8 target-pos quad) (-> v1-16 quad)) + (vector-copy! (-> a0-8 target-pos) v1-16) ) 0 (flamer-lava-method-197 self) @@ -543,7 +544,7 @@ (.mul.x.vf.xyz vf1 vf1 vf2) (.svf (&-> a2-4 quad) vf1) ) - (set! (-> this main-joint-pos quad) (-> a1-1 quad)) + (vector-copy! (-> this main-joint-pos) a1-1) (let* ((f0-2 0.4) (f1-1 (- 1.0 f0-2)) (a1-5 (-> this main-joint-vel)) @@ -552,7 +553,7 @@ (set! (-> a1-5 y) (+ (* f0-2 (-> a0-2 y)) (* f1-1 (-> a1-5 y)))) (set! (-> a1-5 z) (+ (* f0-2 (-> a0-2 z)) (* f1-1 (-> a1-5 z)))) ) - (set! (-> this main-joint-acc quad) (-> v1-1 quad)) + (vector-copy! (-> this main-joint-acc) v1-1) ) 0 0 @@ -562,6 +563,7 @@ ) (defmethod enemy-common-post ((this flamer-lava)) + "Common implementation of post. Runs ja-post." (update-vol! (-> this sound) (-> this sound-volume)) (shadow-draw-probe this) ((method-of-type nav-enemy enemy-common-post) this) @@ -581,7 +583,7 @@ (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 122880.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-12 s4-0)) (set! (-> v1-12 radius) 3276.8) @@ -691,7 +693,7 @@ ((zero? v1-0) (let ((a1-1 (new 'stack-no-clear 'collide-query))) (cond - ((set-ground-pat! this a1-1 (collide-spec backgnd) 8192.0 30720.0 1024.0 (the-as process #f)) + ((find-ground-and-set-pat! this a1-1 (collide-spec backgnd) 8192.0 30720.0 1024.0 (the-as process #f)) (set! (-> this base-pos y) (+ 26624.0 (-> this root gspot-pos y))) ) (else @@ -726,7 +728,7 @@ ) ) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> *up-vector* quad)) + (vector-copy! s5-2 *up-vector*) (vector-normalize! s5-2 2048.0) (vector/! s5-2 s5-2 (-> this root scale)) (vector-rotate-around-z! s5-2 s5-2 (-> this flit-angle)) @@ -770,7 +772,7 @@ (t9-0) ) ) - (set! (-> self root trans quad) (-> self idle-pos quad)) + (vector-copy! (-> self root trans) (-> self idle-pos)) ) ) @@ -782,7 +784,7 @@ (t9-0) ) ) - (set! (-> self root trans quad) (-> self idle-pos quad)) + (vector-copy! (-> self root trans) (-> self idle-pos)) ) :trans (behavior () (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (flamer-lava-method-196 self)) @@ -944,7 +946,7 @@ ) (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-18 target-pos quad) (-> v1-17 quad)) + (vector-copy! (-> a0-18 target-pos) v1-17) ) 0 (set! (-> self ground-mode) 1) @@ -1089,7 +1091,7 @@ (gp-1 (new 'stack-no-clear 'vector)) ) (setup-from-to-xz-vel! (-> self shot-trajectory) s5-0 a2-1 122880.0 -102400.0) - (set! (-> gp-1 quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! gp-1 (-> self shot-trajectory initial-velocity)) (vector-normalize! gp-1 1638.4) (vector+! s5-0 s5-0 gp-1) ) @@ -1098,8 +1100,8 @@ (set! (-> gp-2 charge) 1.0) (set! (-> gp-2 options) (projectile-options)) (logclear! (-> gp-2 options) (projectile-options po14 po15 po16)) - (set! (-> gp-2 pos quad) (-> s5-0 quad)) - (set! (-> gp-2 vel quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! (-> gp-2 pos) s5-0) + (vector-copy! (-> gp-2 vel) (-> self shot-trajectory initial-velocity)) (set! (-> gp-2 notify-handle) (process->handle self)) (set! (-> gp-2 owner-handle) (the-as handle #f)) (set! (-> gp-2 target-handle) (the-as handle #f)) @@ -1151,7 +1153,8 @@ :post flamer-lava-attack-post ) -(defmethod enemy-method-50 ((this flamer-lava) (arg0 int)) +(defmethod update-collision-action ((this flamer-lava) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -1186,6 +1189,7 @@ ;; WARN: Return type mismatch object vs symbol. (defmethod knocked-anim ((this flamer-lava) (arg0 enemy-knocked-info)) + "start the knocked animation." (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol @@ -1196,7 +1200,7 @@ (s4-0 (new 'static 'array int64 3 18 19 20)) (s3-0 (new 'static 'array int32 4 0 0 0 0)) (a2-0 (ash 1 (-> s3-0 0))) - (v1-6 (enemy-method-131 this a1-3 a2-0)) + (v1-6 (rnd-int-excluding-masked this a1-3 a2-0)) (s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0)))))) ) (set! (-> s3-0 0) v1-6) @@ -1254,7 +1258,7 @@ (when (logtest? (-> gp-0 status) (collide-status on-surface)) (when (not (-> self hit-surface?)) (set! (-> self hit-surface?) #t) - (set! (-> self surface-normal quad) (-> gp-0 poly-normal quad)) + (vector-copy! (-> self surface-normal) (-> gp-0 poly-normal)) ) ) (when (and (-> self hit-surface?) (= (-> self hit-points) 0.0)) @@ -1367,10 +1371,12 @@ ) (defmethod coin-flip? ((this flamer-lava)) + "Return #t half the time, #f the other." #f ) (defmethod init-enemy-collision! ((this flamer-lava)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1449,12 +1455,13 @@ ) (defmethod init-enemy! ((this flamer-lava)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flamer-lava" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flamer-lava-nav-enemy-info*) + (setup-enemy! this *flamer-lava-nav-enemy-info*) (set! (-> this neck up) (the-as uint 1)) (set! (-> this neck nose) (the-as uint 2)) (set! (-> this neck ear) (the-as uint 0)) @@ -1468,9 +1475,9 @@ (set! (-> this root dynam gravity-length) 225280.0) (set! (-> this root dynam gravity-max) 225280.0) (let ((v1-25 (-> this root trans))) - (set! (-> this base-pos quad) (-> v1-25 quad)) + (vector-copy! (-> this base-pos) v1-25) (+! (-> v1-25 y) 26624.0) - (set! (-> this idle-pos quad) (-> v1-25 quad)) + (vector-copy! (-> this idle-pos) v1-25) ) (init (-> this flit-joint) this (the-as uint 3) (joint-mod-base-flags attached trans)) (let ((f0-7 (res-lump-float (-> this entity) 'rotoffset))) @@ -1481,7 +1488,7 @@ (let ((f0-8 (quaternion-y-angle (-> this root quat)))) (matrix-rotate-y! (-> this zone-to-world) f0-8) ) - (set! (-> this zone-to-world trans quad) (-> this root trans quad)) + (vector-copy! (-> this zone-to-world trans) (-> this root trans)) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) (set! (-> this formation-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (let ((s5-1 (-> this offset)) @@ -1496,9 +1503,10 @@ (set! (-> t0-1 y) 0.0) (set! (-> t0-1 z) 94208.0) (set! (-> t0-1 w) 1.0) - (set! (-> s5-1 quad) - (-> (the-as vector (t9-12 a0-24 a1-13 a2-6 a3-2 t0-1 (the-as (pointer res-tag) #f) *res-static-buf*)) quad) - ) + (vector-copy! + s5-1 + (the-as vector (t9-12 a0-24 a1-13 a2-6 a3-2 t0-1 (the-as (pointer res-tag) #f) *res-static-buf*)) + ) ) (set! (-> this path) (new 'process 'curve-control this 'intro -1000000000.0)) (set! (-> this path-pos) 0.0) @@ -1538,7 +1546,8 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod go-idle2 ((this flamer-lava)) +(defmethod go-fallback-init ((this flamer-lava)) + "If there's no specific settings for initial state, go to this state after spawning." (if (-> this formation-entity) (go (method-of-object this wait-for-formation)) (go (method-of-object this idle)) diff --git a/goal_src/jak3/levels/volcano/flut-wild.gc b/goal_src/jak3/levels/volcano/flut-wild.gc index ca6a674ad9d..6a52e10be02 100644 --- a/goal_src/jak3/levels/volcano/flut-wild.gc +++ b/goal_src/jak3/levels/volcano/flut-wild.gc @@ -75,34 +75,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x -1.0 :w 1194.157) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -630,7 +630,7 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -656,7 +656,7 @@ (a2-0 (-> self nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-1 (-> a2-0 target-pos)) (and (< (t9-2 a0-1 a1-1) 8192.0) (< (the-as int (-> self focus aware)) 4)) ) (go-stare self) @@ -685,7 +685,7 @@ (let ((v1-9 (-> self nav state))) (logclear! (-> v1-9 flags) (nav-state-flag directional-mode)) (logior! (-> v1-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-9 target-pos quad) (-> gp-1 quad)) + (vector-copy! (-> v1-9 target-pos) gp-1) ) ) 0 @@ -722,6 +722,7 @@ ;; WARN: Return type mismatch float vs object. (defmethod knocked-handler ((this flut-wild) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (let ((f30-0 (rnd-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp 24576.0 57344.0 f30-0)) @@ -730,14 +731,17 @@ ) (defmethod jump-wind-up-anim ((this flut-wild) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" #f ) -(defmethod enemy-method-108 ((this flut-wild) (arg0 process-focusable)) +(defmethod should-flee-from? ((this flut-wild) (arg0 process-focusable)) + "Return if this enemy should flee from the process." #t ) (defmethod go-flee ((this flut-wild)) + "Go to the flee state, running away." (if (< (path-control-method-23 (-> this path) (-> this root trans)) 1.0) (go (method-of-object this flee-path)) (go (method-of-object this flee)) @@ -745,6 +749,7 @@ ) (defmethod enemy-common-post ((this flut-wild)) + "Common implementation of post. Runs ja-post." (if (task-node-closed? (game-task-node volcano-darkeco-catch-flut)) (go (method-of-object this disappear)) ) @@ -800,6 +805,7 @@ ) (defmethod event-handler ((this flut-wild) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -811,7 +817,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -835,6 +841,7 @@ ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod init-enemy-collision! ((this flut-wild)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -913,20 +920,22 @@ ) ) -(defmethod go-idle2 ((this flut-wild)) +(defmethod go-fallback-init ((this flut-wild)) + "If there's no specific settings for initial state, go to this state after spawning." (if (task-node-closed? (game-task-node volcano-darkeco-catch-flut)) (go (method-of-object this disappear)) - ((method-of-type nav-enemy go-idle2) this) + ((method-of-type nav-enemy go-fallback-init) this) ) ) (defmethod init-enemy! ((this flut-wild)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flut" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flut-wild-enemy-info*) + (setup-enemy! this *flut-wild-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) diff --git a/goal_src/jak3/levels/volcano/spiky-frog.gc b/goal_src/jak3/levels/volcano/spiky-frog.gc index 9beedb79f06..57afe2ed626 100644 --- a/goal_src/jak3/levels/volcano/spiky-frog.gc +++ b/goal_src/jak3/levels/volcano/spiky-frog.gc @@ -134,34 +134,34 @@ :jump-height-min (meters 2.87) :jump-height-factor 0.1 :knocked-seek-ry-clamp 4551.1113 - :knocked-soft-vxz-lo 75776.0 - :knocked-soft-vxz-hi 75776.0 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 81920.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 79872.0 - :knocked-hard-vxz-hi 79872.0 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 75776.0 - :knocked-yellow-vxz-hi 75776.0 - :knocked-yellow-vy-lo 81920.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 73728.0 - :knocked-red-vxz-hi 73728.0 - :knocked-red-vy-lo 96256.0 - :knocked-red-vy-hi 96256.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 18.5) + :knocked-soft-vxz-hi (meters 18.5) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 20) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.5) + :knocked-hard-vxz-hi (meters 19.5) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 18.5) + :knocked-yellow-vxz-hi (meters 18.5) + :knocked-yellow-vy-lo (meters 20) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 18) + :knocked-red-vxz-hi (meters 18) + :knocked-red-vy-lo (meters 23.5) + :knocked-red-vy-hi (meters 23.5) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 0.8 :y 0.8 :z 0.8) :bg-collide-with (collide-spec backgnd crate obstacle) @@ -415,7 +415,7 @@ (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) ) 0 - (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (dotimes (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.01))) (cond ((zero? (rnd-int self 4)) (let ((v1-7 (ja-group))) @@ -504,7 +504,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -540,6 +540,7 @@ ) (defmethod go-hostile ((this spiky-frog)) + "Go to the hostile state, actively trying to attack the target." (if (get-focus! this) (go (method-of-object this rolling-start)) (go (method-of-object this hostile)) @@ -554,7 +555,7 @@ ((get-focus! self) (go-virtual rolling-start) ) - ((not (enemy-method-104 self (-> self focus-pos) 8192.0)) + ((not (pointing-toward? self (-> self focus-pos) 8192.0)) (go-virtual turn) ) ) @@ -582,7 +583,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-9 *game-info*) (a0-5 (+ (-> v1-9 attack-id) 1)) ) @@ -645,7 +646,7 @@ (let ((v1-16 (-> self nav state))) (logclear! (-> v1-16 flags) (nav-state-flag directional-mode)) (logior! (-> v1-16 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-16 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-16 target-pos) gp-0) ) ) 0 @@ -751,7 +752,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 self)) @@ -798,7 +799,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-17 quad)) + (vector-copy! (-> a0-3 target-pos) v1-17) ) ) 0 @@ -873,7 +874,7 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -899,7 +900,7 @@ ) ) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set-ground-pat! self a1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f)) + (find-ground-and-set-pat! self a1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f)) ) ) :exit (behavior () @@ -919,8 +920,7 @@ :num! (identity (the float (+ (-> (the-as art-joint-anim spiky-frog-ball0-end-ja) frames num-frames) -1))) ) (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) - (suspend-for - (seconds 0.411) + (suspend-for (seconds 0.411) (if (!= (-> self root gspot-pos y) -40959590.0) (seek! (-> self root trans y) (-> self root gspot-pos y) (* 409600.0 (seconds-per-frame))) ) @@ -935,14 +935,16 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) ) ) +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this spiky-frog)) + "Has the ragdoll stopped moving?" (let ((s5-0 (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))))) (or (not s5-0) (or (ragdoll-proc-method-19 s5-0) @@ -989,6 +991,7 @@ ) (defmethod event-handler ((this spiky-frog) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-flinch 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1000,7 +1003,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1014,10 +1017,11 @@ ) (defmethod enemy-common-post ((this spiky-frog)) + "Common implementation of post. Runs ja-post." (when (< 1 (the-as int (-> this focus aware))) (let ((a0-3 (handle->process (-> this focus handle)))) (if a0-3 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-3) 1) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-3) 1)) ) ) ) @@ -1040,6 +1044,7 @@ ) (defmethod init-enemy-collision! ((this spiky-frog)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1119,12 +1124,13 @@ ) (defmethod init-enemy! ((this spiky-frog)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-spiky-frog" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *spiky-frog-nav-enemy-info*) + (setup-enemy! this *spiky-frog-nav-enemy-info*) (init-eyes! this 0 24) (init-eyes! this 1 25) (set! (-> this sound-id) (new-sound-id)) diff --git a/goal_src/jak3/levels/volcano/volcano-obs.gc b/goal_src/jak3/levels/volcano/volcano-obs.gc index 6e208afc3af..bdaf1d4dfc8 100644 --- a/goal_src/jak3/levels/volcano/volcano-obs.gc +++ b/goal_src/jak3/levels/volcano/volcano-obs.gc @@ -90,6 +90,7 @@ ) (defmethod init-from-entity! ((this vol-rising-step) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (vol-rising-step-method-24 this) (process-drawable-from-entity! this arg0) @@ -423,7 +424,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'matrix))) (quaternion->matrix gp-0 (-> self root quat)) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (spawn-from-mat (-> self part) gp-0) ) 0 @@ -438,6 +439,7 @@ ) (defmethod init-from-entity! ((this lava-shoot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -781,13 +783,13 @@ (set! (-> this rope) (new 'process 'vol-balance-plat-chain-physics)) (chain-physics-initialize this (-> this rope) 4 8192.0 *vol-balance-plat-chain-setup*) (alloc-rbody-control! this *vol-balance-plat-rigid-body-constants*) - (set! (-> this init-pos quad) (-> this root trans quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) (let ((a0-10 (-> this node-list data 4))) (set! (-> a0-10 param0) (lambda ((arg0 cspace) (arg1 transformq)) (let ((gp-0 (-> arg0 param1))) (cspace<-parented-transformq-joint! arg0 arg1) - (set! (-> arg0 bone transform trans quad) (-> (the-as vol-balance-plat gp-0) init-pos quad)) + (vector-copy! (-> arg0 bone transform trans) (-> (the-as vol-balance-plat gp-0) init-pos)) ) (none) ) @@ -1082,20 +1084,9 @@ ) ) (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-22 gp-0) - (a3-29 *identity-matrix*) - (v1-18 (-> a3-29 rvec quad)) - (a0-6 (-> a3-29 uvec quad)) - (a1-4 (-> a3-29 fvec quad)) - (a3-30 (-> a3-29 trans quad)) - ) - (set! (-> a2-22 rvec quad) v1-18) - (set! (-> a2-22 uvec quad) a0-6) - (set! (-> a2-22 fvec quad) a1-4) - (set! (-> a2-22 trans quad) a3-30) - ) + (matrix-copy! gp-0 *identity-matrix*) (matrix<-quat gp-0 (-> self root quat)) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (spawn-from-mat (-> self part) gp-0) ) 0 @@ -1110,6 +1101,7 @@ ) (defmethod init-from-entity! ((this vol-steam-explosion) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (vol-steam-explosion-method-23 this) (process-drawable-from-entity! this arg0) @@ -1480,7 +1472,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-vol-lava-ball" (the-as (pointer level) #f))) @@ -1597,20 +1589,9 @@ ) ) (let ((gp-2 (new 'stack-no-clear 'matrix))) - (let* ((a2-5 gp-2) - (a3-3 *identity-matrix*) - (v1-38 (-> a3-3 rvec quad)) - (a0-23 (-> a3-3 uvec quad)) - (a1-8 (-> a3-3 fvec quad)) - (a3-4 (-> a3-3 trans quad)) - ) - (set! (-> a2-5 rvec quad) v1-38) - (set! (-> a2-5 uvec quad) a0-23) - (set! (-> a2-5 fvec quad) a1-8) - (set! (-> a2-5 trans quad) a3-4) - ) + (matrix-copy! gp-2 *identity-matrix*) (matrix<-quat gp-2 (-> self root quat)) - (set! (-> gp-2 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 trans) (-> self root trans)) (spawn-from-mat (-> self part) gp-2) ) ) @@ -1625,6 +1606,7 @@ ) (defmethod init-from-entity! ((this vol-lava-ball-spout) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) @@ -1728,6 +1710,7 @@ ) (defmethod init-from-entity! ((this vol-collapsing-rock) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) diff --git a/goal_src/jak3/levels/volcano/volcano-obs2.gc b/goal_src/jak3/levels/volcano/volcano-obs2.gc index 6828ce3e3cc..d2d9c86dcea 100644 --- a/goal_src/jak3/levels/volcano/volcano-obs2.gc +++ b/goal_src/jak3/levels/volcano/volcano-obs2.gc @@ -207,6 +207,7 @@ ) (defmethod init-from-entity! ((this vol-lava-plat-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this path) (new 'process 'curve-control @@ -370,6 +371,7 @@ ) (defmethod init-from-entity! ((this vol-break-ground) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -898,7 +900,7 @@ (set! (-> s4-0 z) 0.0) (set! (-> s4-0 w) 0.0) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this rbody position quad)) + (vector-copy! s3-0 (-> this rbody position)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 x) 0.0) (set! (-> s2-0 y) 8192.0) @@ -912,9 +914,9 @@ ) 0 (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> this to-hole-vec quad)) + (vector-copy! s4-1 (-> this to-hole-vec)) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> this rbody position quad)) + (vector-copy! s3-1 (-> this rbody position)) (set! (-> s4-1 y) (/ (-> s4-1 y) -10)) (vector-float*! s4-1 s4-1 (lerp-scale 0.0 30.0 (-> this hole-dist-xz) 20480.0 4096.0)) (apply-impact! (-> this rbody) s3-1 s4-1) @@ -984,7 +986,7 @@ ) ) ) - (set! (-> s3-0 quad) (-> (get-trans (the-as process-focusable a0-8) 0) quad)) + (vector-copy! s3-0 (get-trans (the-as process-focusable a0-8) 0)) ) (vector-reset! s4-0) (let ((s2-2 (-> this hole)) @@ -1071,7 +1073,7 @@ ;; WARN: Return type mismatch symbol vs none. (defmethod rbody-post ((this vol-stone-lid)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> a1-0 start-pos) (-> this rbody position)) (vector-float*! (-> a1-0 move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) (let ((v1-3 a1-0)) (set! (-> v1-3 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) diff --git a/goal_src/jak3/levels/volcano/volcano-part.gc b/goal_src/jak3/levels/volcano/volcano-part.gc index 30488a2132d..17d3c262217 100644 --- a/goal_src/jak3/levels/volcano/volcano-part.gc +++ b/goal_src/jak3/levels/volcano/volcano-part.gc @@ -241,7 +241,7 @@ (set! (-> a0-1 y) (-> arg2 launchrot y)) (set! (-> a0-1 z) (-> arg2 launchrot z)) (set! (-> a0-1 w) 1.0) - (set! (-> v1-6 quad) (-> a0-1 quad)) + (vector-copy! v1-6 a0-1) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1391)) ) @@ -253,7 +253,7 @@ (set! (-> a0-6 y) (-> arg2 launchrot y)) (set! (-> a0-6 z) (-> arg2 launchrot z)) (set! (-> a0-6 w) 1.0) - (set! (-> v1-19 quad) (-> a0-6 quad)) + (vector-copy! v1-19 a0-6) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1391)) ) diff --git a/goal_src/jak3/levels/volcano/volcano-scenes.gc b/goal_src/jak3/levels/volcano/volcano-scenes.gc index b6174628065..fd1a915694d 100644 --- a/goal_src/jak3/levels/volcano/volcano-scenes.gc +++ b/goal_src/jak3/levels/volcano/volcano-scenes.gc @@ -525,7 +525,7 @@ (logand! (-> self draw mgeo effect v1-13 effect-usage) -9) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> (camera-pos) quad)) + (vector-copy! gp-1 (camera-pos)) (dotimes (s5-0 (-> *vol-invis-joint-list* length)) (when (-> *vol-invis-joint-list* s5-0 spawn?) (let ((v1-26 (-> *vol-invis-joint-list* s5-0 joint)) diff --git a/goal_src/jak3/levels/volcano/volcanox-obs.gc b/goal_src/jak3/levels/volcano/volcanox-obs.gc index 1bd802639b3..1f68bfd0e45 100644 --- a/goal_src/jak3/levels/volcano/volcanox-obs.gc +++ b/goal_src/jak3/levels/volcano/volcanox-obs.gc @@ -371,8 +371,8 @@ (let ((a2-4 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* (-> self kill-angle)))) (quaternion*! (-> self root quat) (-> self kill-quat) a2-4) ) - (set! (-> self other-eyeball-jmod transform scale quad) (-> self root scale quad)) - (set! (-> self eyeball-jmod transform scale quad) (-> self root scale quad)) + (vector-copy! (-> self other-eyeball-jmod transform scale) (-> self root scale)) + (vector-copy! (-> self eyeball-jmod transform scale) (-> self root scale)) (let* ((f0-9 (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self state-time))) 0.0 60.0)) (f0-11 (* f0-9 f0-9)) ) @@ -429,6 +429,7 @@ ) (defmethod init-from-entity! ((this vol-holo-eye) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -450,7 +451,7 @@ ) ) ) - (set! (-> this init-trans quad) (-> this root trans quad)) + (vector-copy! (-> this init-trans) (-> this root trans)) (init (-> this eyeball-jmod) this (the-as uint 4) (joint-mod-base-flags attached scale)) (init (-> this other-eyeball-jmod) this (the-as uint 9) (joint-mod-base-flags attached trans quat scale)) (set! (-> this perm-part) @@ -514,6 +515,7 @@ ) (defmethod init-from-entity! ((this tpl-glider-broken) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -637,6 +639,7 @@ ) (defmethod init-from-entity! ((this dm-spines) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this level) (level-get *level* 'volcanox)) (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) "init for the auto spawner" diff --git a/goal_src/jak3/levels/wascity/bbush/des-bush-time-chase.gc b/goal_src/jak3/levels/wascity/bbush/des-bush-time-chase.gc index cb0869a6472..d816bf77691 100644 --- a/goal_src/jak3/levels/wascity/bbush/des-bush-time-chase.gc +++ b/goal_src/jak3/levels/wascity/bbush/des-bush-time-chase.gc @@ -233,7 +233,7 @@ (case message (('trans) (let ((v1-1 (the-as object (-> block param 0)))) - (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + (vector-copy! (-> self root trans) (the-as vector v1-1)) ) (send-event (handle->process (-> self trail)) 'start-tracking) ) @@ -324,7 +324,7 @@ (set! (-> *bb-timer-chase-trail* zbuffer?) #f) -(set! (-> *bb-timer-chase-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *bb-timer-chase-trail* lie-vector) *up-vector*) (set! (-> *bb-timer-chase-trail* use-tape-mode?) #f) @@ -436,7 +436,7 @@ (defbehavior trail-effect-init-by-other trail-effect ((arg0 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1534) self)) (set! (-> self goal-part) (create-launch-control (-> *part-group-id-table* 1532) self)) (let ((gp-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) @@ -540,11 +540,11 @@ :enter (behavior () (cond ((logtest? (-> *part-group-id-table* 1531 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1531)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1531)) ) ) @@ -568,6 +568,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this bb-goal) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1269,6 +1270,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this bb-freeze) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1502,7 +1504,7 @@ (defmethod set-sbanks ((this task-manager-bbush-timer-chase)) (cond - ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + ((= (level-status? *level* 'waswide #f) 'active) (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) (set-setting! 'music 'wastimer 0.0 0) ) diff --git a/goal_src/jak3/levels/wascity/chase/kanga-lizard.gc b/goal_src/jak3/levels/wascity/chase/kanga-lizard.gc index 1a8354b95a9..2719564c1d7 100644 --- a/goal_src/jak3/levels/wascity/chase/kanga-lizard.gc +++ b/goal_src/jak3/levels/wascity/chase/kanga-lizard.gc @@ -684,34 +684,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9999 :y -0.0032 :z 0.0024 :w 13772.991) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -953,6 +953,7 @@ (set! (-> *kanga-lizard-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod coin-flip? ((this kanga-lizard)) + "Return #t half the time, #f the other." #f ) @@ -966,6 +967,7 @@ ) (defmethod event-handler ((this kanga-lizard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('death-end) (when (-> this minimap) @@ -978,7 +980,8 @@ ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) ) -(defmethod go-idle2 ((this kanga-lizard)) +(defmethod go-fallback-init ((this kanga-lizard)) + "If there's no specific settings for initial state, go to this state after spawning." (when (= (-> this nav state mesh) *default-nav-mesh*) (set! (-> *kanga-lizard-nav-enemy-info* nav-mesh) #f) (go (method-of-object this reinit-if-find-nav-mesh)) @@ -1022,15 +1025,18 @@ (none) ) -(defmethod enemy-method-108 ((this kanga-lizard) (arg0 process-focusable)) +(defmethod should-flee-from? ((this kanga-lizard) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (not (logtest? (-> arg0 focus-status) (focus-status ignore))) ) -(defmethod is-pfoc-in-mesh? ((this kanga-lizard) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this kanga-lizard) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." #t ) -(defmethod update-awareness! ((this kanga-lizard) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod get-awareness-of-proc ((this kanga-lizard) (arg0 process-focusable) (arg1 enemy-best-focus)) + "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (cond ((< (+ (current-time) (seconds -3)) (-> this last-focus-ping)) (set! (-> this enemy-info notice-distance) 409600.0) @@ -1045,7 +1051,7 @@ (set! (-> this enemy-info proximity-notice-distance) 286720.0) ) ) - (let* ((t9-0 (method-of-type nav-enemy update-awareness!)) + (let* ((t9-0 (method-of-type nav-enemy get-awareness-of-proc)) (v0-0 (t9-0 this arg0 arg1)) ) (set! (-> this enemy-info notice-distance) 286720.0) @@ -1055,12 +1061,14 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this kanga-lizard)) +(defmethod get-search-info-flag ((this kanga-lizard)) + "Get search-info-flag for this process." (set-time! (-> this last-focus-ping)) (the-as search-info-flag 0) ) (defmethod init-enemy-collision! ((this kanga-lizard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1105,6 +1113,7 @@ ) (defmethod init-enemy! ((this kanga-lizard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-kanga-lizard" (the-as (pointer level) #f))) @@ -1114,7 +1123,7 @@ (set! (-> *kanga-lizard-nav-enemy-info* nav-mesh) #f) (set! (-> *kanga-lizard-nav-enemy-info* nav-mesh) *default-nav-mesh*) ) - (init-enemy-defaults! this *kanga-lizard-nav-enemy-info*) + (setup-enemy! this *kanga-lizard-nav-enemy-info*) (let ((v1-8 (-> this nav))) (set! (-> v1-8 speed-scale) 1.0) ) diff --git a/goal_src/jak3/levels/wascity/cty-faction.gc b/goal_src/jak3/levels/wascity/cty-faction.gc index 155315564d6..82c03097b19 100644 --- a/goal_src/jak3/levels/wascity/cty-faction.gc +++ b/goal_src/jak3/levels/wascity/cty-faction.gc @@ -437,9 +437,7 @@ ) (cond (s5-2 - (when (or (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) - (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) - ) + (when (or (= (level-status? *level* 'ctypesc #f) 'active) (= (level-status? *level* 'ctypesb #f) 'active)) (if (zero? (-> this start-fight-music-time)) (set-time! (-> this start-fight-music-time)) ) @@ -900,27 +898,25 @@ (defun is-faction-level-loaded? ((arg0 cty-faction-level)) (case arg0 (((cty-faction-level pesc)) - (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) + (= (level-status? *level* 'ctypesc #f) 'active) ) (((cty-faction-level pesb)) - (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) + (= (level-status? *level* 'ctypesb #f) 'active) ) (((cty-faction-level pesa)) - (= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) + (= (level-status? *level* 'ctypesa #f) 'active) ) (((cty-faction-level pepa)) - (= (status-of-level-and-borrows *level* 'ctypepa #f) 'active) + (= (level-status? *level* 'ctypepa #f) 'active) ) (((cty-faction-level car)) - (or (= (status-of-level-and-borrows *level* 'ctycara #f) 'active) - (= (status-of-level-and-borrows *level* 'ctycarb #f) 'active) - ) + (or (= (level-status? *level* 'ctycara #f) 'active) (= (level-status? *level* 'ctycarb #f) 'active)) ) (((cty-faction-level pepc)) - (= (status-of-level-and-borrows *level* 'ctypepc #f) 'active) + (= (level-status? *level* 'ctypepc #f) 'active) ) (((cty-faction-level pepb)) - (= (status-of-level-and-borrows *level* 'ctypepb #f) 'active) + (= (level-status? *level* 'ctypepb #f) 'active) ) ) ) diff --git a/goal_src/jak3/levels/wascity/ctymark-obs-h.gc b/goal_src/jak3/levels/wascity/ctymark-obs-h.gc index cbc9941621f..bbf1e4606b5 100644 --- a/goal_src/jak3/levels/wascity/ctymark-obs-h.gc +++ b/goal_src/jak3/levels/wascity/ctymark-obs-h.gc @@ -63,7 +63,7 @@ (set! (-> this fact pickup-type) (pickup-type none)) 0 ) - (set! (-> this base quad) (-> this root trans quad)) + (vector-copy! (-> this base) (-> this root trans)) (crate-post) (nav-mesh-connect-from-ent this) (none) @@ -94,7 +94,7 @@ (vector-! (new 'stack-no-clear 'vector) (-> v1-9 root trans) (-> self root trans)) *up-vector* ) - (set! (-> self explode-matrix trans quad) (-> self root trans quad)) + (vector-copy! (-> self explode-matrix trans) (-> self root trans)) ) ) ) diff --git a/goal_src/jak3/levels/wascity/ctymark-obs.gc b/goal_src/jak3/levels/wascity/ctymark-obs.gc index ad224da8e70..f6e74fbd2e9 100644 --- a/goal_src/jak3/levels/wascity/ctymark-obs.gc +++ b/goal_src/jak3/levels/wascity/ctymark-obs.gc @@ -1442,7 +1442,7 @@ (s4-0 (-> *sp-particle-system-2d* cpuinfo-table (-> self sparts-index gp-0))) ) (when (and (nonzero? (-> s4-0 key)) (= (-> s4-0 key group) (lookup-part-group-by-name "group-ctywide-fruit"))) - (set! (-> s5-0 start-pos quad) (-> self sparts-pos gp-0 quad)) + (vector-copy! (-> s5-0 start-pos) (-> self sparts-pos gp-0)) (+! (-> s5-0 start-pos y) 4096.0) (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0) (let ((v1-11 s5-0)) @@ -1538,6 +1538,7 @@ ) (defmethod init-from-entity! ((this fruit-stand) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (fruit-stand-method-29 this) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak3/levels/wascity/defend/was-pre-game.gc b/goal_src/jak3/levels/wascity/defend/was-pre-game.gc index 9700b7c9d84..61c5586d0a6 100644 --- a/goal_src/jak3/levels/wascity/defend/was-pre-game.gc +++ b/goal_src/jak3/levels/wascity/defend/was-pre-game.gc @@ -1722,7 +1722,7 @@ ) (sp-group-flag sp13) ) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) (when gp-0 (let ((t9-1 (method-of-type part-tracker-subsampler activate))) @@ -1767,7 +1767,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000 0))) (when gp-1 (let ((t9-4 (method-of-type part-tracker activate))) @@ -1867,7 +1867,7 @@ ) (sp-group-flag sp13) ) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) (when gp-4 (let ((t9-10 (method-of-type part-tracker-subsampler activate))) @@ -1912,7 +1912,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-5 (get-process *default-dead-pool* part-tracker #x4000 0))) (when gp-5 (let ((t9-13 (method-of-type part-tracker activate))) @@ -1986,7 +1986,7 @@ ) (sp-group-flag sp13) ) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) (when gp-0 (let ((t9-1 (method-of-type part-tracker-subsampler activate))) @@ -2031,7 +2031,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000 0))) (when gp-1 (let ((t9-4 (method-of-type part-tracker activate))) @@ -2094,7 +2094,7 @@ (set! (-> self start-delay) arg3) (set! (-> self gravity) arg4) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self screen-pos quad) (-> arg1 quad)) + (vector-copy! (-> self screen-pos) arg1) (logclear! (-> self mask) (process-mask actor-pause)) (initialize-skeleton self @@ -2869,6 +2869,7 @@ ) (defmethod init-from-entity! ((this was-pre-game) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/goal_src/jak3/levels/wascity/dm-flyer.gc b/goal_src/jak3/levels/wascity/dm-flyer.gc index 76f20e0558e..14f825e39bd 100644 --- a/goal_src/jak3/levels/wascity/dm-flyer.gc +++ b/goal_src/jak3/levels/wascity/dm-flyer.gc @@ -118,7 +118,7 @@ (set! (-> *dm-flyer-missile-trail* zbuffer?) #f) -(set! (-> *dm-flyer-missile-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *dm-flyer-missile-trail* lie-vector) *up-vector*) (set! (-> *dm-flyer-missile-trail* use-tape-mode?) #f) @@ -176,7 +176,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'matrix))) (let ((s5-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> s5-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> s5-0 spawn-quat)) (set! (-> s5-0 radius) 40960.0) (set! (-> s5-0 scale) 1.0) @@ -195,7 +195,7 @@ (cond ((< (* f0-6 f0-6) (vector-vector-distance-squared (-> self root trans) (target-pos 0))) (forward-up->inv-matrix gp-0 (-> self pre-move-transv) *up-vector*) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 539 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -209,7 +209,7 @@ ) (else (quaternion->matrix gp-0 (-> *target* control quat)) - (set! (-> gp-0 trans quad) (-> *target* control trans quad)) + (vector-copy! (-> gp-0 trans) (-> *target* control trans)) (if (logtest? (-> *part-group-id-table* 541 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -287,21 +287,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 102 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 102)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 102)) ) ) ) ((logtest? (-> *part-group-id-table* 101 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 101)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 101)) ) ) @@ -393,7 +393,7 @@ (let ((v1-32 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-13 (-> arg0 hit-pos)) ) - (set! (-> a1-13 quad) (-> s5-0 trans quad)) + (vector-copy! a1-13 (-> s5-0 trans)) (vector+! a1-13 a1-13 v1-32) (move-to-point! (-> arg0 root) a1-13) ) @@ -481,7 +481,7 @@ (wascity-turret-add-radar (-> this root trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this root transv quad)) + (vector-copy! s4-0 (-> this root transv)) (vector-normalize! s4-0 17612.8) (vector+! s5-0 (-> this root trans) s4-0) ) @@ -514,7 +514,7 @@ (the-as pair 0) ) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this swirl) (rand-vu-float-range 0.0 65536.0)) (set! (-> this swirlvel) (rand-vu-float-range 8192.0 24576.0)) (set! (-> this swirlvel) (* (-> this swirlvel) (if (>= (rand-vu) 0.5) diff --git a/goal_src/jak3/levels/wascity/dogat.gc b/goal_src/jak3/levels/wascity/dogat.gc index 4c70e37aaa2..8e7905c9e62 100644 --- a/goal_src/jak3/levels/wascity/dogat.gc +++ b/goal_src/jak3/levels/wascity/dogat.gc @@ -165,34 +165,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -266,7 +266,7 @@ :trans (behavior () (let ((v1-0 (-> self focus aware))) (cond - ((= v1-0 (enemy-aware ea4)) + ((= v1-0 (enemy-aware flee)) (go-flee self) ) ((< (the-as int v1-0) 1) @@ -359,7 +359,7 @@ (label cfg-8) (if v1-12 (vector+! (-> self move-dest) gp-0 s5-0) - (set! (-> self move-dest quad) (-> gp-0 quad)) + (vector-copy! (-> self move-dest) gp-0) ) ) ) @@ -387,7 +387,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-method-187 self) @@ -416,21 +416,27 @@ ) (defmethod go-hostile ((this dogat)) + "Go to the hostile state, actively trying to attack the target." (set-time! (-> this scared-timer)) (go (method-of-object this flee)) ) -(defmethod enemy-method-108 ((this dogat) (arg0 process-focusable)) +(defmethod should-flee-from? ((this dogat) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (< (vector-vector-xz-distance (-> this root trans) (get-trans arg0 0)) 143360.0) (not (time-elapsed? (-> this scared-timer) (seconds 4))) ) ) -(defmethod send-attack-to-all-tshapes ((this dogat) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this dogat) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." 0 ) (defmethod init-enemy-collision! ((this dogat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -481,7 +487,8 @@ (none) ) -(defmethod enemy-method-50 ((this dogat) (arg0 int)) +(defmethod update-collision-action ((this dogat) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -504,12 +511,13 @@ ;; WARN: Return type mismatch shadow-control vs none. (defmethod init-enemy! ((this dogat)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dogat" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *dogat-nav-enemy-info*) + (setup-enemy! this *dogat-nav-enemy-info*) (set-vector! (-> this root scale) 2.5 2.5 2.5 1.0) (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) (logior! (-> this skel status) (joint-control-status sync-math)) diff --git a/goal_src/jak3/levels/wascity/doors/wasdoors-init.gc b/goal_src/jak3/levels/wascity/doors/wasdoors-init.gc index a59d457a353..cab8faee42d 100644 --- a/goal_src/jak3/levels/wascity/doors/wasdoors-init.gc +++ b/goal_src/jak3/levels/wascity/doors/wasdoors-init.gc @@ -9,8 +9,8 @@ (defun wasdoors-point-inside? ((arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) - (set! (-> gp-0 0 quad) (-> (new 'static 'vector :z -1.0 :w 957235.2) quad)) - (set! (-> gp-0 1 quad) (-> (new 'static 'vector :x 9246720.0 :y 125747.2 :z 625049.6 :w 450560.0) quad)) + (vector-copy! (-> gp-0 0) (new 'static 'vector :z -1.0 :w 957235.2)) + (vector-copy! (-> gp-0 1) (new 'static 'vector :x 9246720.0 :y 125747.2 :z 625049.6 :w 450560.0)) (set! (-> gp-0 2 x) (vector4-dot (-> gp-0 0) arg0)) (set! (-> gp-0 2 y) (vector-vector-distance (-> gp-0 1) arg0)) (and (< 0.0 (-> gp-0 2 x)) (< (-> gp-0 2 y) (-> gp-0 1 w))) @@ -80,7 +80,7 @@ (a0-0 *level*) ) (cond - ((= (status-of-level-and-borrows a0-0 'desert #f) gp-0) + ((= (level-status? a0-0 'desert #f) gp-0) (wasdoors-cleanup (the-as level a0-0)) ) (else diff --git a/goal_src/jak3/levels/wascity/flee-info.gc b/goal_src/jak3/levels/wascity/flee-info.gc index caed831be4e..31d6c029d2e 100644 --- a/goal_src/jak3/levels/wascity/flee-info.gc +++ b/goal_src/jak3/levels/wascity/flee-info.gc @@ -31,7 +31,7 @@ (a2-1 s2-0) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-1 position quad)) + (vector-copy! a1-1 (-> a2-1 position)) (set! (-> a1-1 w) 1.0) (let ((s0-0 (t9-0 a0-1 a1-1)) (s1-0 (-> s2-0 branch-count)) @@ -52,7 +52,7 @@ (defmethod flee-info-method-10 ((this flee-info) (arg0 citizen) (arg1 vector)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> arg0 root trans quad)) + (vector-copy! a1-1 (-> arg0 root trans)) (set! (-> a1-1 w) 81920.0) (let ((s5-0 (find-segment arg0 a1-1 arg1))) (if s5-0 @@ -114,15 +114,15 @@ (when s4-0 (vehicle-controller-method-11 s5-0) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s5-0 turn-exit-point quad)) + (vector-copy! s3-1 (-> s5-0 turn-exit-point)) (vehicle-controller-method-10 s5-0 s4-0) - (set! (-> s5-0 path-prev-point quad) (-> s3-1 quad)) + (vector-copy! (-> s5-0 path-prev-point) s3-1) ) (set! (-> s5-0 branch) s4-0) (let ((a1-4 (-> s4-0 dest-node)) (v1-21 (-> s5-0 turn-exit-point)) ) - (set! (-> v1-21 quad) (-> a1-4 position quad)) + (vector-copy! v1-21 (-> a1-4 position)) (set! (-> v1-21 w) 1.0) ) ) @@ -131,7 +131,7 @@ ) ) (when (< (-> arg0 cp-next-time) (current-time)) - (set! (-> arg0 cp-next-time) (+ (current-time) (set-reaction-time! arg0 (seconds 2) (seconds 4)))) + (set! (-> arg0 cp-next-time) (+ (current-time) (rnd-time-frame arg0 (seconds 2) (seconds 4)))) (citizen-method-203 arg0 (-> arg0 cp-force)) ) (add-offset-to-target! (-> arg0 nav state) (-> arg0 cp-force)) @@ -140,10 +140,10 @@ ) (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-18 target-pos quad) (-> v1-32 quad)) + (vector-copy! (-> a0-18 target-pos) v1-32) ) 0 - (set! (-> (new 'stack-no-clear 'vector) quad) (-> arg0 nav state target-pos quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> arg0 nav state target-pos)) (nav-enemy-method-187 arg0) (none) ) diff --git a/goal_src/jak3/levels/wascity/formation-object.gc b/goal_src/jak3/levels/wascity/formation-object.gc index 88ed604d0f4..026a3fe3571 100644 --- a/goal_src/jak3/levels/wascity/formation-object.gc +++ b/goal_src/jak3/levels/wascity/formation-object.gc @@ -129,7 +129,7 @@ ) ) ) - (set! (-> this root trans quad) (-> s5-2 position quad)) + (vector-copy! (-> this root trans) (-> s5-2 position)) (set! (-> s5-2 handle-parent) (process->handle this)) (set! (-> s5-2 object-type) (traffic-type guard-a)) (logior! (-> s5-2 flags) (traffic-spawn-flags tsf4)) @@ -177,7 +177,7 @@ (defbehavior formation-init-by-other formation-object ((arg0 traffic-object-spawn-params)) (stack-size-set! (-> self main-thread) 128) (init-collision! self) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 rotation)) (traffic-entity-hack (-> arg0 object-type)) (set! (-> self formation) (new 'process 'formation-layout)) @@ -339,7 +339,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self controller turn-exit-point quad)) + (vector-copy! s5-0 (-> self controller turn-exit-point)) (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) (vector-! gp-0 (-> self controller turn-exit-point) s5-0) (set! (-> gp-0 y) 0.0) @@ -400,7 +400,7 @@ ) ) (if a0-6 - (set! (-> this root trans quad) (-> (get-trans (the-as process-focusable a0-6) 0) quad)) + (vector-copy! (-> this root trans) (get-trans (the-as process-focusable a0-6) 0)) ) ) (set! (-> this root trans y) (+ 20480.0 (-> this root trans y))) diff --git a/goal_src/jak3/levels/wascity/formations.gc b/goal_src/jak3/levels/wascity/formations.gc index e1ec3cdd8f4..3154fa60075 100644 --- a/goal_src/jak3/levels/wascity/formations.gc +++ b/goal_src/jak3/levels/wascity/formations.gc @@ -36,7 +36,7 @@ (f0-0 0.0) ) (dotimes (a0-2 v1-1) - (set! (-> this formation-points a0-2 quad) (-> s4-0 a0-2 quad)) + (vector-copy! (-> this formation-points a0-2) (-> s4-0 a0-2)) (let* ((a1-6 (-> this formation-points a0-2)) (f1-3 (+ (* (-> a1-6 x) (-> a1-6 x)) (* (-> a1-6 z) (-> a1-6 z)))) ) diff --git a/goal_src/jak3/levels/wascity/leaper/was-leaper-race.gc b/goal_src/jak3/levels/wascity/leaper/was-leaper-race.gc index 92e36db234b..436a3da704f 100644 --- a/goal_src/jak3/levels/wascity/leaper/was-leaper-race.gc +++ b/goal_src/jak3/levels/wascity/leaper/was-leaper-race.gc @@ -388,7 +388,7 @@ (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 13) (the-as int #f) (the-as vector #t) 0)) ) (when s4-0 - (set! (-> gp-0 quad) (-> s4-0 control trans quad)) + (vector-copy! gp-0 (-> s4-0 control trans)) (+! (-> gp-0 y) 8192.0) (vector-! gp-0 gp-0 (-> self root trans)) (let ((s5-0 (-> self root quat))) @@ -567,13 +567,14 @@ ) (defmethod init-from-entity! ((this wascity-race-ring) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this active?) #f) (set! (-> this minimap) #f) (quaternion->matrix (-> this mat) (-> this root quat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) (set! (-> this taskman) (the-as handle #f)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 518) this)) (set! (-> this player-part) (create-launch-control (-> *part-group-id-table* 519) this)) @@ -740,7 +741,7 @@ (new 'static 'talker-speech-class :name "dax366" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x14 :neg #x1 :on-close #f @@ -1134,9 +1135,7 @@ ) ) (when (not s5-2) - (when (and (= (status-of-level-and-borrows *level* 'wascitya #f) 'active) - (= (status-of-level-and-borrows *level* 'wascityb #f) 'active) - ) + (when (and (= (level-status? *level* 'wascitya #f) 'active) (= (level-status? *level* 'wascityb #f) 'active)) (let ((s4-3 (-> (level-get *level* 'wasleapr) bsp nav-meshes 0 nav-mesh))) (when s4-3 (set! (-> s4-3 next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> s4-3 entity) 'next-actor 0))) diff --git a/goal_src/jak3/levels/wascity/maker-projectile.gc b/goal_src/jak3/levels/wascity/maker-projectile.gc index d49c592d542..efe25fbf81f 100644 --- a/goal_src/jak3/levels/wascity/maker-projectile.gc +++ b/goal_src/jak3/levels/wascity/maker-projectile.gc @@ -108,7 +108,7 @@ (set! (-> *maker-grenade-trail* zbuffer?) #f) -(set! (-> *maker-grenade-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *maker-grenade-trail* lie-vector) *up-vector*) (set! (-> *maker-grenade-trail* use-tape-mode?) #f) @@ -706,7 +706,7 @@ :code (behavior () (let ((gp-0 (new 'stack-no-clear 'matrix))) (let ((s5-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> s5-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> s5-0 spawn-quat)) (set! (-> s5-0 radius) (-> self blast-radius)) (set! (-> s5-0 scale) 1.0) @@ -725,7 +725,7 @@ (cond ((< (* f0-6 f0-6) (vector-vector-distance-squared (-> self root trans) (target-pos 0))) (forward-up->inv-matrix gp-0 (-> self pre-move-transv) *up-vector*) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 539 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -739,7 +739,7 @@ ) (else (quaternion->matrix gp-0 (-> *target* control quat)) - (set! (-> gp-0 trans quad) (-> *target* control trans quad)) + (vector-copy! (-> gp-0 trans) (-> *target* control trans)) (if (logtest? (-> *part-group-id-table* 541 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -765,7 +765,9 @@ (set! (-> v1-85 prim-core collide-with) (collide-spec)) ) 0 - (suspend-for (seconds 3) (suspend)) + (suspend-for (seconds 3) + (suspend) + ) ) ) @@ -773,7 +775,7 @@ (let ((t9-0 (method-of-type projectile-bounce handle-proj-hit!))) (when (not (t9-0 this arg0 arg1)) (when (type? arg0 wascity-turret-shot) - (set! (-> this pre-move-transv quad) (-> (the-as wascity-turret-shot arg0) pre-move-transv quad)) + (vector-copy! (-> this pre-move-transv) (-> (the-as wascity-turret-shot arg0) pre-move-transv)) (go (method-of-object this impact)) ) ) diff --git a/goal_src/jak3/levels/wascity/palace/waspala-obs.gc b/goal_src/jak3/levels/wascity/palace/waspala-obs.gc index 7b443238750..ffff2a59b63 100644 --- a/goal_src/jak3/levels/wascity/palace/waspala-obs.gc +++ b/goal_src/jak3/levels/wascity/palace/waspala-obs.gc @@ -74,6 +74,7 @@ ) (defmethod init-from-entity! ((this waspala-paddle-wheel) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -138,6 +139,7 @@ ) (defmethod init-from-entity! ((this waspala-windmill) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -205,7 +207,8 @@ ) (let ((gp-0 27)) (set-setting! 'change-gun #t 0.0 0) - (suspend-for (seconds 5)) + (suspend-for (seconds 5) + ) (set! (-> self gui-id) (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) @@ -272,6 +275,7 @@ ) (defmethod init-from-entity! ((this waspala-blocker) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/goal_src/jak3/levels/wascity/squad-control-city.gc b/goal_src/jak3/levels/wascity/squad-control-city.gc index c2018873660..8dd6fd77a8d 100644 --- a/goal_src/jak3/levels/wascity/squad-control-city.gc +++ b/goal_src/jak3/levels/wascity/squad-control-city.gc @@ -355,7 +355,7 @@ (vector-float*! s5-1 s5-1 0.0625) ) (else - (set! (-> s5-1 quad) (-> (the-as process-focusable s4-0) root transv quad)) + (vector-copy! s5-1 (-> (the-as process-focusable s4-0) root transv)) ) ) (set! (-> s5-1 y) 0.0) diff --git a/goal_src/jak3/levels/wascity/tizard.gc b/goal_src/jak3/levels/wascity/tizard.gc index 4c6fe8f12cf..1d4d4bf4931 100644 --- a/goal_src/jak3/levels/wascity/tizard.gc +++ b/goal_src/jak3/levels/wascity/tizard.gc @@ -359,7 +359,8 @@ ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this tizard)) +(defmethod get-search-info-flag ((this tizard)) + "Get search-info-flag for this process." (the-as search-info-flag 8) ) @@ -413,6 +414,7 @@ ) (defmethod init-from-entity! ((this tizard) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/goal_src/jak3/levels/wascity/traffic-util.gc b/goal_src/jak3/levels/wascity/traffic-util.gc index ef37f15cbfc..53858403589 100644 --- a/goal_src/jak3/levels/wascity/traffic-util.gc +++ b/goal_src/jak3/levels/wascity/traffic-util.gc @@ -283,8 +283,8 @@ (dotimes (s3-0 16) (let ((v1-3 (-> this array s3-0))) (when (logtest? (-> v1-3 flags) (traffic-suppression-box-flag in-use)) - (set! (-> s5-0 min quad) (-> v1-3 bbox min quad)) - (set! (-> s5-0 max quad) (-> v1-3 bbox max quad)) + (vector-copy! (-> s5-0 min) (-> v1-3 bbox min)) + (vector-copy! (-> s5-0 max) (-> v1-3 bbox max)) (set! (-> s5-0 min w) 1.0) (set! (-> s5-0 max w) 1.0) (add-debug-box #t (bucket-id debug-no-zbuf1) (-> s5-0 min) (-> s5-0 max) s4-0) @@ -490,8 +490,8 @@ ) (defmethod init-vis-ray ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) - (set! (-> arg0 pos quad) (-> arg1 quad)) - (set! (-> arg0 dest-pos quad) (-> arg2 quad)) + (vector-copy! (-> arg0 pos) arg1) + (vector-copy! (-> arg0 dest-pos) arg2) (let ((v1-2 (new 'stack-no-clear 'vector))) (vector-! v1-2 arg2 arg1) (set! (-> arg0 len) (vector-length v1-2)) @@ -545,7 +545,7 @@ ) (cond ((= s4-0 -1) - (set! (-> arg0 pos quad) (-> arg0 dest-pos quad)) + (vector-copy! (-> arg0 pos) (-> arg0 dest-pos)) (set! (-> arg0 len) 0.0) ) (else @@ -590,7 +590,7 @@ (let ((a1-1 s2-0) (v1-0 (-> s5-0 2)) ) - (set! (-> v1-0 quad) (-> a1-1 position quad)) + (vector-copy! v1-0 (-> a1-1 position)) (set! (-> v1-0 w) 1.0) ) (let ((v1-1 s2-0) @@ -607,7 +607,7 @@ (set! (-> s1-0 w) 1.0) ) (vector-! (-> s5-0 5) (-> s5-0 2) arg0) - (set! (-> s5-0 4 quad) (-> s5-0 3 quad)) + (vector-copy! (-> s5-0 4) (-> s5-0 3)) (set! (-> s5-0 4 x) (-> s5-0 3 z)) (set! (-> s5-0 4 z) (- (-> s5-0 3 x))) (when (< 0.0 (vector-dot (-> s5-0 5) (-> s5-0 4))) @@ -652,7 +652,7 @@ (f0-35 (/ (* f28-0 f1-12) f30-0)) ) (let ((f1-15 (/ (* f1-12 f1-12) f30-0))) - (set! (-> arg2 quad) (-> arg0 quad)) + (vector-copy! arg2 arg0) (let ((a1-13 arg2)) (let ((v1-26 arg2)) (let ((a0-14 (-> s5-0 0))) @@ -704,7 +704,7 @@ (let ((a1-1 s3-0) (v1-4 (-> gp-0 min)) ) - (set! (-> v1-4 quad) (-> a1-1 position quad)) + (vector-copy! v1-4 (-> a1-1 position)) (set! (-> v1-4 w) 1.0) ) (dotimes (s2-0 (-> s3-0 branch-count)) @@ -712,7 +712,7 @@ (let ((a1-4 (-> s1-0 dest-node)) (v1-6 (-> gp-0 max)) ) - (set! (-> v1-6 quad) (-> a1-4 position quad)) + (vector-copy! v1-6 (-> a1-4 position)) (set! (-> v1-6 w) 1.0) ) (set! (-> s1-0 max-user-count) @@ -789,7 +789,7 @@ (let ((a1-1 s3-0) (v1-26 sv-168) ) - (set! (-> v1-26 quad) (-> a1-1 position quad)) + (vector-copy! v1-26 (-> a1-1 position)) (set! (-> v1-26 w) 1.0) ) (cond @@ -797,7 +797,7 @@ (let ((a1-4 (-> a2-0 dest-node)) (v1-29 sv-164) ) - (set! (-> v1-29 quad) (-> a1-4 position quad)) + (vector-copy! v1-29 (-> a1-4 position)) (set! (-> v1-29 w) 1.0) ) ) @@ -865,7 +865,7 @@ (let ((a1-16 s4-2) (v1-72 sv-244) ) - (set! (-> v1-72 quad) (-> a1-16 position quad)) + (vector-copy! v1-72 (-> a1-16 position)) (set! (-> v1-72 w) 1.0) ) (cond @@ -873,7 +873,7 @@ (let ((a1-19 (-> sv-184 dest-node)) (v1-76 sv-252) ) - (set! (-> v1-76 quad) (-> a1-19 position quad)) + (vector-copy! v1-76 (-> a1-19 position)) (set! (-> v1-76 w) 1.0) ) ) @@ -883,7 +883,7 @@ ) (init-vis-ray this sv-104 sv-244 sv-252) (while (< 0.0 (-> sv-104 len)) - (set! (-> sv-248 quad) (-> sv-104 pos quad)) + (vector-copy! sv-248 (-> sv-104 pos)) (set! sv-260 (-> sv-104 cell)) (city-level-info-method-11 this sv-104) (let ((a2-14 (-> sv-260 incoming-segment-count))) @@ -902,7 +902,7 @@ ) (let ((s2-1 (-> sv-260 segment-array a2-14))) (set! (-> s2-1 vertex 0 quad) (-> sv-248 quad)) - (set! (-> s2-1 vertex 1 quad) (-> sv-104 pos quad)) + (vector-copy! (-> s2-1 vertex 1) (-> sv-104 pos)) (set! (-> s2-1 length) (vector-vector-distance (the-as vector (-> s2-1 vertex)) (-> s2-1 vertex 1))) (let* ((f0-9 (if (logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian)) 24576.0 @@ -1106,13 +1106,13 @@ (let ((a1-7 sv-16) (v1-35 sv-88) ) - (set! (-> v1-35 quad) (-> a1-7 position quad)) + (vector-copy! v1-35 (-> a1-7 position)) (set! (-> v1-35 w) 1.0) ) (let ((a1-10 sv-80) (v1-36 sv-92) ) - (set! (-> v1-36 quad) (-> a1-10 position quad)) + (vector-copy! v1-36 (-> a1-10 position)) (set! (-> v1-36 w) 1.0) ) (vector-! sv-84 sv-92 sv-88) diff --git a/goal_src/jak3/levels/wascity/wasall-obs.gc b/goal_src/jak3/levels/wascity/wasall-obs.gc index 9a66ee59050..dfda0a60a09 100644 --- a/goal_src/jak3/levels/wascity/wasall-obs.gc +++ b/goal_src/jak3/levels/wascity/wasall-obs.gc @@ -18,6 +18,7 @@ (defmethod init-from-entity! ((this wascity-airlock) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -78,6 +79,7 @@ (defmethod init-from-entity! ((this wascity-airlock-small) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) @@ -180,6 +182,7 @@ ) (defmethod init-from-entity! ((this wascity-elevator-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) @@ -248,7 +251,7 @@ (defbehavior tentacle-follow-post tentacle () (let ((a0-0 *target*)) (when a0-0 - (set! (-> self focus-pos quad) (-> (get-trans a0-0 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans a0-0 0)) (set-vector! (-> self root trans) (-> self focus-pos x) (-> self root trans y) (-> self focus-pos z) 1.0) ) ) @@ -310,9 +313,9 @@ (set-time! (-> self active-timer)) ) (when (and gp-0 (time-elapsed? (-> self active-timer) (seconds 0.1))) - (set! (-> self root trans quad) (-> (get-trans gp-0 0) quad)) + (vector-copy! (-> self root trans) (get-trans gp-0 0)) (set! (-> self root trans y) (+ -114688.0 (get-base-height *ocean-map*))) - (set! (-> self init-pos quad) (-> self root trans quad)) + (vector-copy! (-> self init-pos) (-> self root trans)) (if (focus-test? gp-0 under-water) (go-virtual un-dive-player) (go-virtual attacking-0) @@ -408,11 +411,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 409 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 409)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 409)) ) ) @@ -466,6 +469,7 @@ ) (defmethod init-from-entity! ((this tentacle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 64) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/goal_src/jak3/levels/wascity/wasall-tasks.gc b/goal_src/jak3/levels/wascity/wasall-tasks.gc index 0d9a1c118c8..6ac54613afb 100644 --- a/goal_src/jak3/levels/wascity/wasall-tasks.gc +++ b/goal_src/jak3/levels/wascity/wasall-tasks.gc @@ -129,7 +129,7 @@ (!= (-> *bigmap* load-index) 20) ) (let ((s4-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s4-1 pos quad) (-> (the-as process-focusable s5-0) root trans quad)) + (vector-copy! (-> s4-1 pos) (-> (the-as process-focusable s5-0) root trans)) (quaternion-identity! (-> s4-1 quat)) (set! (-> s4-1 flags) (task-arrow-flags)) (set! (-> s4-1 map-icon) (the-as uint 13)) @@ -195,7 +195,7 @@ (until #f (suspend) (cond - ((= (status-of-level-and-borrows *level* 'desert #f) 'active) + ((= (level-status? *level* 'desert #f) 'active) (set-setting! 'scarf 'abs 1.0 0) (set-setting! 'goggles 'abs 1.0 0) ) @@ -328,7 +328,7 @@ (defstate active (task-manager-desert-interceptors-attack) :virtual #t :code (behavior () - (while (!= (status-of-level-and-borrows *level* 'desert #f) 'active) + (while (!= (level-status? *level* 'desert #f) 'active) (suspend) ) (suspend) @@ -857,7 +857,7 @@ (format *stdebug* "nest-hunt task manager waiting for scorpion~%") ) ((not (handle->process (-> this sig-handle))) - (if (= (status-of-level-and-borrows *level* 'lwassig #f) 'active) + (if (= (level-status? *level* 'lwassig #f) 'active) (set! (-> this sig-handle) (process->handle (sig-rider-spawn (the-as vehicle (handle->process (-> this vehicle-handle))) #f)) ) diff --git a/goal_src/jak3/levels/wascity/wascity-turret.gc b/goal_src/jak3/levels/wascity/wascity-turret.gc index 3fe522e80ce..53ef8bf893a 100644 --- a/goal_src/jak3/levels/wascity/wascity-turret.gc +++ b/goal_src/jak3/levels/wascity/wascity-turret.gc @@ -218,15 +218,15 @@ ) (set! (-> *game-info* health-bar-vehicle) 0.0) (let ((v1-12 (new 'stack-no-clear 'vector))) - (set! (-> v1-12 quad) (-> this root trans quad)) + (vector-copy! v1-12 (-> this root trans)) (+! (-> v1-12 y) 8192.0) (cond ((logtest? (-> *part-group-id-table* 542 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-12 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-12) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 542)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-12 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-12) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 542)) ) ) @@ -323,11 +323,11 @@ (s5-0 (new 'stack-no-clear 'matrix)) ) (quaternion->matrix s4-0 (-> this root quat)) - (set! (-> s4-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 trans) (-> this root trans)) (matrix-identity! s5-0) - (set! (-> s5-0 trans quad) (-> *wascity-display-offset* quad)) + (vector-copy! (-> s5-0 trans) *wascity-display-offset*) (matrix*! s5-0 s5-0 s4-0) - (set! (-> s4-0 trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> s4-0 trans) (-> s5-0 trans)) (dotimes (s3-0 (the-as int (-> this radar-object-counter))) (let* ((f0-1 (* 2867.2 (-> this radar-object s3-0 x))) (f1-2 (* 819.2 (+ -0.12 (-> this radar-object s3-0 y)))) @@ -647,7 +647,7 @@ (('radar-pos) (let ((v1-26 (new 'stack-no-clear 'vector))) (when (< (-> this radar-object-counter) (the-as uint 64)) - (set! (-> v1-26 quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! v1-26 (the-as vector (-> arg3 param 0))) (let ((a0-21 (-> this radar-object (-> this radar-object-counter)))) (set! (-> a0-21 x) (-> v1-26 x)) (set! (-> a0-21 y) (-> v1-26 y)) @@ -893,8 +893,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po13 po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg0 quad)) - (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 7372800.0) quad)) + (vector-copy! (-> gp-0 pos) arg0) + (vector-copy! (-> gp-0 vel) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 7372800.0)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1273,7 +1273,7 @@ (f30-0 91.022224) ) (quaternion->matrix s5-0 (-> this root quat)) - (set! (-> s5-0 trans quad) (-> (wascity-turret-gun-pos) quad)) + (vector-copy! (-> s5-0 trans) (wascity-turret-gun-pos)) (seek! (-> this lerp) 0.0 (* 0.25 (seconds-per-frame))) (set! (-> this lerp2) 0.0) (vector-lerp! (-> this aim-dir) (-> s5-0 fvec) (-> this aim-dir) (-> this lerp)) @@ -1370,9 +1370,9 @@ (set! sv-1040 (new 'stack-no-clear 'vector)) (set! sv-976 (-> (the-as collide-shape (-> (the-as process-drawable s2-2) root)) root-prim)) (set! sv-944 -1) - (set! (-> s1-1 quad) (-> sv-976 prim-core world-sphere quad)) - (set! (-> sv-1024 quad) (-> s1-1 quad)) - (set! (-> s0-1 quad) (-> s1-1 quad)) + (vector-copy! s1-1 (-> sv-976 prim-core world-sphere)) + (vector-copy! sv-1024 s1-1) + (vector-copy! s0-1 s1-1) (when (= (-> s2-2 type) skeet) (set! sv-960 s2-2) (let ((f28-1 (/ f28-0 (meters 1800)))) @@ -1423,9 +1423,9 @@ (set! (-> a1-20 message) 'is-section-shot) (set! (-> a1-20 param 0) (-> (the-as collide-shape-prim-group sv-976) child sv-992 prim-id)) (when (and (not (send-event-function s2-2 a1-20)) (< f26-2 f28-2)) - (set! (-> s0-1 quad) (-> (the-as collide-shape-prim-group sv-976) child sv-992 prim-core world-sphere quad)) - (set! (-> sv-1024 quad) (-> s0-1 quad)) - (set! (-> s1-1 quad) (-> s0-1 quad)) + (vector-copy! s0-1 (-> (the-as collide-shape-prim-group sv-976) child sv-992 prim-core world-sphere)) + (vector-copy! sv-1024 s0-1) + (vector-copy! s1-1 s0-1) (if #f (add-debug-sphere #t (bucket-id debug) s0-1 (-> s0-1 w) *color-blue*) ) diff --git a/goal_src/jak3/levels/wascity/wascitya-obs.gc b/goal_src/jak3/levels/wascity/wascitya-obs.gc index 20808ff3b85..58f4c9c95db 100644 --- a/goal_src/jak3/levels/wascity/wascitya-obs.gc +++ b/goal_src/jak3/levels/wascity/wascitya-obs.gc @@ -18,6 +18,7 @@ (defmethod init-from-entity! ((this wascity-stad-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) diff --git a/goal_src/jak3/levels/wascity/wasdef-manager.gc b/goal_src/jak3/levels/wascity/wasdef-manager.gc index 8f149a57690..72f00222685 100644 --- a/goal_src/jak3/levels/wascity/wasdef-manager.gc +++ b/goal_src/jak3/levels/wascity/wasdef-manager.gc @@ -486,7 +486,7 @@ (set! (-> *maker-entry-trail* zbuffer?) #f) -(set! (-> *maker-entry-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *maker-entry-trail* lie-vector) *up-vector*) (set! (-> *maker-entry-trail* use-tape-mode?) #f) @@ -757,7 +757,7 @@ (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 start-pos) arg0) (+! (-> s4-0 start-pos y) 81920.0) (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) (let ((v1-3 s4-0)) @@ -1137,18 +1137,7 @@ (set! *maker-first-hit* #t) ) (let ((s3-2 (new 'stack-no-clear 'vector))) - (let ((a2-7 (new 'stack-no-clear 'matrix))) - (let* ((a3-6 (-> self node-list data s4-1 bone transform)) - (v1-65 (-> a3-6 rvec quad)) - (a0-70 (-> a3-6 uvec quad)) - (a1-14 (-> a3-6 fvec quad)) - (a3-7 (-> a3-6 trans quad)) - ) - (set! (-> a2-7 rvec quad) v1-65) - (set! (-> a2-7 uvec quad) a0-70) - (set! (-> a2-7 fvec quad) a1-14) - (set! (-> a2-7 trans quad) a3-7) - ) + (let ((a2-7 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data s4-1 bone transform)))) (maker-world-to-local-vec! s3-2 (-> (the-as attack-info gp-0) trans) a2-7) ) (when (< (the-as uint 2) (-> self damage-info s5-1 counter)) @@ -1187,11 +1176,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 538 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (the-as attack-info gp-0) trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as attack-info gp-0) trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 538)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (the-as attack-info gp-0) trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as attack-info gp-0) trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 538)) ) ) @@ -1284,7 +1273,7 @@ (s4-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 bone transform fvec) 1.0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s3-0 (target-pos 0)) (new 'stack-no-clear 'vector) 0.0 0.0 @@ -1325,8 +1314,8 @@ (set! (-> s3-1 charge) 1.0) (set! (-> s3-1 options) (projectile-options)) (logclear! (-> s3-1 options) (projectile-options po14 po15 po16)) - (set! (-> s3-1 pos quad) (-> s5-0 quad)) - (set! (-> s3-1 vel quad) (-> s2-3 quad)) + (vector-copy! (-> s3-1 pos) s5-0) + (vector-copy! (-> s3-1 vel) s2-3) ) (set! (-> s3-1 notify-handle) (the-as handle #f)) (set! (-> s3-1 owner-handle) (the-as handle #f)) @@ -1359,12 +1348,12 @@ (set! (-> s3-2 charge) 1.0) (set! (-> s3-2 options) (projectile-options)) (logclear! (-> s3-2 options) (projectile-options po14 po15 po16)) - (set! (-> s3-2 pos quad) (-> s5-0 quad)) - (set! (-> s3-2 vel quad) (-> s4-1 quad)) + (vector-copy! (-> s3-2 pos) s5-0) + (vector-copy! (-> s3-2 vel) s4-1) (set! (-> s3-2 notify-handle) (the-as handle #f)) (set! (-> s3-2 owner-handle) (process->handle this)) (set! (-> s3-2 target-handle) (the-as handle #f)) - (set! (-> s3-2 target-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s3-2 target-pos) (target-pos 0)) (set! (-> s3-2 ignore-handle) (process->handle this)) (let* ((v1-50 *game-info*) (a0-41 (+ (-> v1-50 attack-id) 1)) @@ -1575,7 +1564,7 @@ ) ) (let ((a0-16 (new 'stack-no-clear 'vector))) - (set! (-> a0-16 quad) (-> self root trans quad)) + (vector-copy! a0-16 (-> self root trans)) (+! (-> a0-16 y) 143360.0) (wascity-turret-add-radar a0-16) ) @@ -1657,7 +1646,7 @@ (set! (-> s4-2 y) (get-base-height *ocean-map*)) (cond ((logtest? (-> *part-group-id-table* 535 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-2 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-2) (part-tracker-spawn part-tracker-subsampler :to self @@ -1666,7 +1655,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-2 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-2) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 535) :duration (seconds 1)) ) ) @@ -1684,7 +1673,7 @@ (set! (-> s4-5 y) (get-base-height *ocean-map*)) (cond ((logtest? (-> *part-group-id-table* 535 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-5 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-5) (part-tracker-spawn part-tracker-subsampler :to self @@ -1693,7 +1682,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-5 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-5) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 535) :duration (seconds 1)) ) ) @@ -1707,7 +1696,7 @@ (vector+! (-> self root trans) (-> self root trans) gp-0) ) (let ((a0-42 (new 'stack-no-clear 'vector))) - (set! (-> a0-42 quad) (-> self root trans quad)) + (vector-copy! a0-42 (-> self root trans)) (+! (-> a0-42 y) 307200.0) (wascity-turret-add-radar a0-42) ) @@ -1840,14 +1829,14 @@ :virtual #t :event maker-standard-event-handler :enter (behavior () - (set! (-> self pacc quad) (-> self pvel quad)) + (vector-copy! (-> self pacc) (-> self pvel)) (vector-normalize! (-> self pacc) 20480.0) (if (not (-> self maker-sound-playing?)) (set! (-> self maker-sound-playing?) #t) ) (cond ((logtest? (-> *part-group-id-table* 534 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self @@ -1856,7 +1845,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 534) :duration (seconds 1)) ) ) @@ -1890,12 +1879,12 @@ ) (set! (-> self made-splash?) #t) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (set! (-> s4-0 y) (get-base-height *ocean-map*)) (sound-play "ball-splash") (cond ((logtest? (-> *part-group-id-table* 536 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker-subsampler :to self @@ -1904,7 +1893,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 536) :duration (seconds 5)) ) ) @@ -1942,7 +1931,7 @@ ) ) (let ((a0-46 (new 'stack-no-clear 'vector))) - (set! (-> a0-46 quad) (-> self root trans quad)) + (vector-copy! a0-46 (-> self root trans)) (+! (-> a0-46 y) 143360.0) (wascity-turret-add-radar a0-46) ) @@ -1957,7 +1946,7 @@ (set! (-> a1-1 gravity) -163840.0) (set! (-> a1-1 scale-rand-lo) 7.5) (set! (-> a1-1 scale-rand-hi) 10.0) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> this root trans quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> this root trans)) (debris-spawn this a1-1 *maker-debris-params* (the-as process-drawable #f)) ) 0 @@ -2004,7 +1993,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 545 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-7 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-7) (part-tracker-spawn part-tracker-subsampler :to self @@ -2013,7 +2002,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-7 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-7) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 545) :duration (seconds 5)) ) ) @@ -2186,10 +2175,10 @@ (defmethod maker-method-34 ((this maker)) (cond ((= (-> this path-idx) -1) - (set! (-> this seek-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this seek-pos) (target-pos 0)) ) (else - (set! (-> this seek-pos quad) (-> *maker-traverse-paths* (-> this path-idx) (-> this path-pt) quad)) + (vector-copy! (-> this seek-pos) (-> *maker-traverse-paths* (-> this path-idx) (-> this path-pt))) (if (< (-> this seek-pos z) -1937408.0) (set! (-> this seek-pos y) (get-ocean-floor-height (-> this seek-pos))) ) @@ -2213,7 +2202,7 @@ (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-9) ) (quaternion->matrix s5-1 (-> this root quat)) - (set! (-> this pvel quad) (-> s5-1 fvec quad)) + (vector-copy! (-> this pvel) (-> s5-1 fvec)) (set! (-> this pvel y) 0.0) (vector-normalize! (-> this pvel) 81920.0) (set! (-> this pvel y) (* 81920.0 (/ (- (-> this seek-pos y) (-> this root trans y)) @@ -2271,7 +2260,7 @@ (set! (-> self path-idx) arg0) (set! (-> self path-pt) 0) (set! (-> self path-len) (length (-> *maker-traverse-paths* arg0))) - (set! (-> self seek-pos quad) (-> *maker-traverse-paths* arg0 0 quad)) + (vector-copy! (-> self seek-pos) (-> *maker-traverse-paths* arg0 0)) (if (< (-> self seek-pos z) -1937408.0) (set! (-> self seek-pos y) (get-ocean-floor-height (-> self seek-pos))) ) @@ -2294,7 +2283,7 @@ (+! (-> s4-1 y) 819200.0) ) ) - (set! (-> self root trans quad) (-> s4-1 quad)) + (vector-copy! (-> self root trans) s4-1) (vector-! (-> self pvel) (-> self seek-pos) (-> self root trans)) (vector-normalize! (-> self pvel) arg2) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) f30-0) diff --git a/goal_src/jak3/levels/wascity/wasgun-hud.gc b/goal_src/jak3/levels/wascity/wasgun-hud.gc index 0c5f7573fa3..cdbb0c8f18e 100644 --- a/goal_src/jak3/levels/wascity/wasgun-hud.gc +++ b/goal_src/jak3/levels/wascity/wasgun-hud.gc @@ -291,7 +291,7 @@ (('maker-update) (when (< (-> this maker-idx) (the-as uint 15)) (let ((v1-12 (-> this minfo (-> this maker-idx)))) - (set! (-> v1-12 pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> v1-12 pos) (the-as vector (-> arg3 param 0))) (set! (-> v1-12 hit-points) (the-as float (-> arg3 param 1))) (set! (-> v1-12 targeted) (the-as symbol (-> arg3 param 2))) ) @@ -307,7 +307,7 @@ (b! #t cfg-4 :delay (nop!)) (label cfg-1) (b! (nonzero? (-> this scoretimes v1-0)) cfg-3 :delay (empty-form)) - (set! (-> this position v1-0 quad) (-> arg2 quad)) + (vector-copy! (-> this position v1-0) arg2) (set! (-> this vel v1-0) 0.0) (set! (-> this multiplier v1-0) (the-as uint arg1)) (set! (-> this scores v1-0) arg0) diff --git a/goal_src/jak3/levels/wascity/wasgun-manager.gc b/goal_src/jak3/levels/wascity/wasgun-manager.gc index 136ef2c532c..3ce8ad82830 100644 --- a/goal_src/jak3/levels/wascity/wasgun-manager.gc +++ b/goal_src/jak3/levels/wascity/wasgun-manager.gc @@ -1225,11 +1225,11 @@ (set! (-> self disappear) #t) (cond ((logtest? (-> *part-group-id-table* 546 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 546)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 546)) ) ) @@ -1260,7 +1260,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 533 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self @@ -1269,7 +1269,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 533) :duration (seconds 5)) ) ) @@ -1606,7 +1606,7 @@ (defbehavior skeet-init-by-other skeet ((arg0 task-manager-wascity-gungame) (arg1 skeet-mode) (arg2 vector) (arg3 float) (arg4 float)) (init-collision! self) - (set! (-> self root trans quad) (-> arg2 quad)) + (vector-copy! (-> self root trans) arg2) (set! (-> self angle) (-> arg2 w)) (quaternion-identity! (-> self root quat)) (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) 16384.0) @@ -1714,7 +1714,7 @@ (defun spawn-skeet ((arg0 task-manager-wascity-gungame) (arg1 skeet-mode) (arg2 vector) (arg3 float) (arg4 float)) (cond ((logtest? (-> *part-group-id-table* 533 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> arg2 quad)) + (vector-copy! (-> *launch-matrix* trans) arg2) (part-tracker-spawn part-tracker-subsampler :to arg0 @@ -1723,7 +1723,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg2 quad)) + (vector-copy! (-> *launch-matrix* trans) arg2) (part-tracker-spawn part-tracker :to arg0 :group (-> *part-group-id-table* 533) :duration (seconds 5)) ) ) @@ -1791,7 +1791,7 @@ (.svf (&-> a1-0 quad) vf6) ) (set! (-> gp-0 w) (-> *skeet-offset-table* s4-0 w)) - (set! (-> *skeet-offset-table* s4-0 quad) (-> gp-0 quad)) + (vector-copy! (-> *skeet-offset-table* s4-0) gp-0) (+! s4-0 1) ) ) @@ -1807,7 +1807,7 @@ (if (= (-> *skeet-offset-table* 1 y) 0.0) (def-launch-circle) ) - (set! (-> s4-0 quad) (-> *skeet-offset-table* arg2 quad)) + (vector-copy! s4-0 (-> *skeet-offset-table* arg2)) (spawn-skeet arg0 arg1 s4-0 arg3 arg4) ) (none) @@ -1875,7 +1875,7 @@ ) (send-event (handle->process (-> this wct)) 'radar-reset) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s5-0 (target-pos 0)) (let ((a1-3 (new 'stack-no-clear 'vector))) (set! (-> a1-3 x) 6582272.0) (set! (-> a1-3 y) 262144.0) diff --git a/goal_src/jak3/levels/wascity/wasstadium/nst-eggs-h.gc b/goal_src/jak3/levels/wascity/wasstadium/nst-eggs-h.gc index a6d43227002..9791d607821 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/nst-eggs-h.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/nst-eggs-h.gc @@ -12,7 +12,7 @@ (new 'static 'talker-speech-class :name "dam002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x1 :neg #x1 :on-close '(kiosk-complete) @@ -21,7 +21,7 @@ (new 'static 'talker-speech-class :name "sig173" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -30,7 +30,7 @@ (new 'static 'talker-speech-class :name "sig174" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :neg #x1 :on-close #f @@ -39,7 +39,7 @@ (new 'static 'talker-speech-class :name "sig175" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :neg #x1 :on-close #f @@ -48,7 +48,7 @@ (new 'static 'talker-speech-class :name "sig176" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5 :neg #x1 :on-close #f @@ -57,7 +57,7 @@ (new 'static 'talker-speech-class :name "sig177" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x6 :neg #x1 :on-close #f @@ -66,7 +66,7 @@ (new 'static 'talker-speech-class :name "sig178" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x7 :neg #x1 :on-close #f @@ -75,7 +75,7 @@ (new 'static 'talker-speech-class :name "sig197" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x8 :neg #x1 :on-close #f @@ -340,7 +340,7 @@ (new 'static 'talker-speech-class :name "sig260" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x29 :neg #x1 :on-close #f @@ -349,7 +349,7 @@ (new 'static 'talker-speech-class :name "sig261" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2a :neg #x1 :on-close #f @@ -358,7 +358,7 @@ (new 'static 'talker-speech-class :name "sig262" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2b :neg #x1 :on-close #f @@ -367,7 +367,7 @@ (new 'static 'talker-speech-class :name "sig264" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2c :neg #x1 :on-close #f @@ -376,7 +376,7 @@ (new 'static 'talker-speech-class :name "sig269" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2d :neg #x1 :on-close #f diff --git a/goal_src/jak3/levels/wascity/wasstadium/nst-gas.gc b/goal_src/jak3/levels/wascity/wasstadium/nst-gas.gc index 1983b4fc81f..9821ff93393 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/nst-gas.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/nst-gas.gc @@ -57,8 +57,8 @@ (set-setting! 'pilot-death #t 0.0 0) (set-setting! 'music 'nestgas 0.0 0) (if (and (< 6225920.0 (vector-vector-xz-distance (camera-pos) *nest-poison-center*)) - (!= (status-of-level-and-borrows *level* 'nsta #f) 'active) - (!= (status-of-level-and-borrows *level* 'nstb #f) 'active) + (!= (level-status? *level* 'nsta #f) 'active) + (!= (level-status? *level* 'nstb #f) 'active) ) (go-virtual paused) ) @@ -212,17 +212,15 @@ (format *stdebug* "task-manager: ~A paused~%" (-> self node-info name)) ) (if (and (< (vector-vector-xz-distance (camera-pos) *nest-poison-center*) 5980160.0) - (or (= (status-of-level-and-borrows *level* 'nsta #f) 'active) - (= (status-of-level-and-borrows *level* 'nstb #f) 'active) - ) + (or (= (level-status? *level* 'nsta #f) 'active) (= (level-status? *level* 'nstb #f) 'active)) ) (go-virtual active) ) (-> *minimap-class-list* 26) - (when (and (-> self minimap) (= (status-of-level-and-borrows *level* 'wasdoors #f) 'active)) + (when (and (-> self minimap) (= (level-status? *level* 'wasdoors #f) 'active)) (logior! (-> self minimap flags) (minimap-flag fade-out)) (let ((gp-2 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-2 pos quad) (-> *garage-center* quad)) + (vector-copy! (-> gp-2 pos) *garage-center*) (quaternion-identity! (-> gp-2 quat)) (set! (-> gp-2 flags) (task-arrow-flags taf5)) (set! (-> gp-2 map-icon) (the-as uint 12)) @@ -250,9 +248,8 @@ (let ((f30-0 (lerp-scale 1.0 0.0 (vector-vector-xz-distance (camera-pos) *nest-poison-center*) 1638400.0 6144000.0)) ) (cond - ((and (< 0.0 f30-0) (or (= (status-of-level-and-borrows *level* 'nsta #f) 'active) - (= (status-of-level-and-borrows *level* 'nstb #f) 'active) - ) + ((and (< 0.0 f30-0) + (or (= (level-status? *level* 'nsta #f) 'active) (= (level-status? *level* 'nstb #f) 'active)) ) (let* ((s5-1 lerp-scale) (s4-1 0.4) @@ -267,7 +264,7 @@ (while (< 0.0 f30-1) (when (or (< 1.0 f30-1) (rand-vu-percent? f30-1)) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> *z-vector* quad)) + (vector-copy! s5-2 *z-vector*) (vector-rotate-around-y! s5-2 s5-2 (* 182.04445 (rand-vu-float-range -180.0 180.0))) (vector-float*! s5-2 s5-2 (* 4096.0 (rand-vu-float-range 5.0 40.0))) (set! (-> s5-2 y) (* 4096.0 (rand-vu-float-range -5.0 18.0))) diff --git a/goal_src/jak3/levels/wascity/wasstadium/nst-tasks.gc b/goal_src/jak3/levels/wascity/wasstadium/nst-tasks.gc index 5e628858f68..818f706bff9 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/nst-tasks.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/nst-tasks.gc @@ -96,7 +96,7 @@ (defmethod task-manager-method-26 ((this task-manager-nest-cocoons)) (set-nst-poison! (the-as mood-context 0)) (cond - ((= (status-of-level-and-borrows *level* 'nstb #f) 'active) + ((= (level-status? *level* 'nstb #f) 'active) (if (task-manager-nest-cocoons-method-34 this) (task-manager-nest-cocoons-method-33 this) (init-actor-group! this) @@ -111,9 +111,7 @@ ) (cond ((and (< 819200.0 (vector-vector-xz-distance (target-pos 0) (the-as vector (-> *minimap-class-list* 9)))) - (or (= (status-of-level-and-borrows *level* 'desert #f) 'active) - (= (status-of-level-and-borrows *level* 'waswide #f) 'active) - ) + (or (= (level-status? *level* 'desert #f) 'active) (= (level-status? *level* 'waswide #f) 'active)) ) (if (not (-> this minimap)) (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 9) (the-as int #f) (the-as vector #f) 0)) @@ -273,11 +271,11 @@ ) :code (behavior () (local-vars (a0-15 vector) (a1-7 vector) (gp-6 (function vector vector float))) - (suspend-for (seconds 0.1)) + (suspend-for (seconds 0.1) + ) (when (not (task-node-closed? (game-task-node nest-eggs-wall))) (until (level-get *level* 'wasdoors) - (suspend-for - (seconds 1) + (suspend-for (seconds 1) (format *stdebug* "wait for player to get to garage~%") (b! (task-node-closed? (game-task-node nest-eggs-wall)) cfg-34 :delay (nop!)) (empty-form) @@ -285,7 +283,8 @@ ) (setup-scorpion) (task-node-close! (game-task-node nest-eggs-get-to-scorpion) 'event) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) (let ((v1-20 (rand-vu-int-range 0 1))) (b! (nonzero? v1-20) cfg-11 :delay (empty-form)) (talker-spawn-func (-> *nest-eggs-speech-list* 8) *entity-pool* (target-pos 0) (the-as region #f)) @@ -296,7 +295,8 @@ ) ) (label cfg-13) - (suspend-for (seconds 4)) + (suspend-for (seconds 4) + ) (until (< (gp-6 a0-15 a1-7) 491520.0) (format *stdebug* "wait for player to drive to eggwall~%") (b! (task-node-closed? (game-task-node nest-eggs-wall)) cfg-34 :delay (nop!)) @@ -322,12 +322,14 @@ (label cfg-25) (b! (handle->process (the-as handle gp-8)) cfg-24 :delay (nop!)) ) - (suspend-for (seconds 0.5)) + (suspend-for (seconds 0.5) + ) ) (label cfg-34) (setup-scorpion) (set-setting! 'music 'nesteggs 0.0 0) - (suspend-for (seconds 1)) + (suspend-for (seconds 1) + ) (let ((v1-57 (rand-vu-int-range 0 6))) (cond ((zero? v1-57) @@ -370,7 +372,8 @@ ) :code (behavior () (task-node-close! (-> self info final-node) 'event) - (suspend-for (seconds 0.6)) + (suspend-for (seconds 0.6) + ) (let ((v1-6 (rand-vu-int-range 0 3))) (cond ((zero? v1-6) @@ -387,7 +390,9 @@ ) ) ) - (suspend-for (seconds 3) (format *stdebug* "task-manager-nest-cocoons: done!~%")) + (suspend-for (seconds 3) + (format *stdebug* "task-manager-nest-cocoons: done!~%") + ) (call-parent-state-handler code) ) ) diff --git a/goal_src/jak3/levels/wascity/wasstadium/sig-rider.gc b/goal_src/jak3/levels/wascity/wasstadium/sig-rider.gc index 6567f7696fa..cdbb4b31fc9 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/sig-rider.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/sig-rider.gc @@ -36,7 +36,7 @@ (set! (-> gp-0 uvec z) (sin (-> gp-0 uvec x))) (set! (-> gp-0 uvec w) (cos (-> gp-0 uvec x))) (set! (-> gp-0 uvec y) (seconds-per-frame)) - (set! (-> gp-0 rvec quad) (-> s5-0 local-accel quad)) + (vector-copy! (-> gp-0 rvec) (-> s5-0 local-accel)) (let ((f1-6 (+ (* 0.03 (-> gp-0 uvec z)) (* -1.0 (-> gp-0 rvec x) (-> s5-0 left-right-accel-factor))))) (+! (-> self left-right-interp) (* (- f1-6 (-> self left-right-interp)) (fmin 1.0 (* 8.0 (-> gp-0 uvec y))))) ) @@ -239,7 +239,7 @@ ) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (set! (-> self level) (level-get *level* 'lwassig)) (initialize-skeleton @@ -273,7 +273,7 @@ ;; WARN: Return type mismatch process vs sig-rider. (defun sig-rider-spawn ((arg0 vehicle) (arg1 symbol)) (let ((s4-0 (the-as process #f))) - (when (= (status-of-level-and-borrows *level* 'lwassig #f) 'active) + (when (= (level-status? *level* 'lwassig #f) 'active) (dotimes (s4-1 4) (let ((s3-1 (get-rider-in-seat arg0 s4-1))) (when (type? s3-1 sig-rider) diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstada-obs.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstada-obs.gc index db7d9f001ca..8c574485167 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstada-obs.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstada-obs.gc @@ -258,6 +258,7 @@ (defmethod init-from-entity! ((this wstd-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) @@ -665,7 +666,7 @@ (defmethod update-part-and-sfx! ((this wstd-arena-plat)) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -695,6 +696,7 @@ ) (defmethod init-from-entity! ((this wstd-arena-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (v1-75 uint128)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -835,6 +837,7 @@ ) (defmethod init-from-entity! ((this wstd-flag-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -879,6 +882,7 @@ ) (defmethod init-from-entity! ((this wstd-blocker) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1026,7 +1030,7 @@ (when (and (time-elapsed? (+ (-> self dur-sound) (seconds 1.2)) (-> self next-sound)) (-> self start-sound)) (set! (-> self snd-id-2) (-> self snd-id-1)) (set! (-> self volume-2) (-> self volume-1)) - (set! (-> self trans-2 quad) (-> self trans-1 quad)) + (vector-copy! (-> self trans-2) (-> self trans-1)) (cond ((nonzero? (-> self channel)) 32 @@ -1111,6 +1115,7 @@ ) (defmethod init-from-entity! ((this crowd-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! *crowd-manager* (the-as (pointer crowd-manager) (process->ppointer this))) (set! (-> this snd-count) (the-as uint 0)) (set! (-> this snd-id-1) (new 'static 'sound-id)) @@ -1119,6 +1124,6 @@ (set! (-> this crowd-intensity) 0.0) (set! (-> this training?) (task-node-open? (game-task-node arena-training-1-collect))) (set! (-> this darkjak?) #f) - (set! (-> this trans quad) (-> arg0 trans quad)) + (vector-copy! (-> this trans) (-> arg0 trans)) (go (method-of-object this idle)) ) diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstada-part.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstada-part.gc index e13c9e72943..b91b5e4cf94 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstada-part.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstada-part.gc @@ -1134,7 +1134,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1242,7 +1242,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -1350,7 +1350,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1458,7 +1458,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1566,7 +1566,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -2012,7 +2012,7 @@ :enter (behavior () (dotimes (gp-0 15) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *crowd-dudes-position* gp-0 quad)) + (vector-copy! s5-0 (-> *crowd-dudes-position* gp-0)) (let ((s4-0 (-> self spectators gp-0))) (if (rand-vu-percent? 0.5) (logior! (-> s4-0 flags) 1) @@ -2085,6 +2085,7 @@ ) (defmethod init-from-entity! ((this wasstada-crowd) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (matrix-identity! (-> this mat)) (matrix<-quat (-> this mat) (-> arg0 quat)) (matrix<-trans (-> this mat) (-> arg0 extra trans)) diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc index eb02d0ec0ee..9fe73672563 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc @@ -405,11 +405,11 @@ (('touch 'attack) (cond ((logtest? (-> *part-group-id-table* 500 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 500)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 500)) ) ) @@ -445,11 +445,11 @@ (ppointer->handle (cond ((logtest? (-> *part-group-id-table* 501 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self gspot quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self gspot)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 501)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self gspot quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self gspot)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 501)) ) ) @@ -536,7 +536,7 @@ (defmethod probe-background ((this arena-token)) (let ((s5-0 (new 'stack 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 start-pos) (-> this root trans)) (set-vector! (-> s5-0 move-dist) 0.0 -204800.0 0.0 1.0) (let ((v1-3 s5-0)) (set! (-> v1-3 radius) 40.96) @@ -549,7 +549,7 @@ (set! (-> v1-3 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) - (set! (-> this gspot quad) (-> s5-0 best-other-tri intersect quad)) + (vector-copy! (-> this gspot) (-> s5-0 best-other-tri intersect)) (+! (-> this gspot y) 204.8) #t ) @@ -557,6 +557,7 @@ ) (defmethod init-from-entity! ((this arena-token) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logior! (-> this mask) (process-mask collectable)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -676,7 +677,7 @@ ) ) (if a0-5 - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (get-trans a0-5 0) quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) (get-trans a0-5 0)) ) ) (set! (-> gp-0 fountain-rand-transv-hi x) 24576.0) @@ -741,6 +742,7 @@ ) (defmethod init-from-entity! ((this wstd-training-dummy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -788,7 +790,7 @@ :parent (task-manager-arena-training active) :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self entity trans quad)) + (vector-copy! (-> gp-0 pos) (-> self entity trans)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf3)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -1058,7 +1060,7 @@ ) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-16 (new 'static 'vector :x 9527214.0 :y 196812.8 :z -1693368.4 :w 1.0))) - (set! (-> gp-1 pos quad) (-> a0-16 quad)) + (vector-copy! (-> gp-1 pos) a0-16) ) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags)) @@ -1276,7 +1278,7 @@ ) ) (when a0-4 - (set! (-> gp-1 fountain-rand-transv-lo quad) (-> (get-trans a0-4 0) quad)) + (vector-copy! (-> gp-1 fountain-rand-transv-lo) (get-trans a0-4 0)) (+! (-> gp-1 fountain-rand-transv-lo y) -16384.0) ) ) @@ -1312,6 +1314,7 @@ ) (defmethod init-from-entity! ((this wstd-trapdoor) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1375,6 +1378,7 @@ ) (defmethod init-from-entity! ((this wstd-flag) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc index 7eec82dcd6f..14d32887b10 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstadc-obs.gc @@ -36,7 +36,7 @@ :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-0 (new 'static 'vector :x 9527214.0 :y 196812.8 :z -1693368.4 :w 1.0))) - (set! (-> gp-0 pos quad) (-> a0-0 quad)) + (vector-copy! (-> gp-0 pos) a0-0) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf5)) @@ -97,7 +97,7 @@ ;; og:preserve-this ; (gpr->fpr #x7f800000) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) 32768.0) (if (and *target* (< (vector-vector-distance (target-pos 0) s4-0) (-> s4-0 w))) (return #f) @@ -137,7 +137,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s4-0 pickup-type) (pickup-type ammo-random)) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (when (or (zero? (-> this crate-h)) (not (handle->process (-> this crate-h)))) (let* ((s4-1 (ppointer->process (process-spawn crate #f s5-0 'wood s4-0 :name "crate" :to *entity-pool*))) (s5-1 (if (type? s4-1 process-focusable) @@ -540,7 +540,7 @@ (defmethod update-part-and-sfx! ((this wstd-fight-plat)) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -635,7 +635,7 @@ ) :trans (behavior () (wstd-fight-plat-method-40 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) (when (and (< (-> self next-crate-spawn) (current-time)) (or (< (-> *game-info* gun-ammo 0) 20.0) @@ -693,7 +693,7 @@ ) (init-vf0-vector) (wstd-fight-plat-method-40 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (when (-> self spawn-lava?) (activate! @@ -713,7 +713,7 @@ (vector-matrix*! gp-1 (-> *fight-plat-lava-pos* (rand-vu-int-count (-> *fight-plat-lava-pos* length))) s3-1) ) (set! (-> gp-1 y) 40960.0) - (set! (-> self part-lava-pos quad) (-> gp-1 quad)) + (vector-copy! (-> self part-lava-pos) gp-1) ) (set! (-> self next-lava-part) (+ (current-time) (seconds 0.01))) ) @@ -852,13 +852,14 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this wstd-fight-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) (defbehavior wstd-fight-plat-init-by-other wstd-fight-plat ((arg0 vector) (arg1 int) (arg2 float) (arg3 float)) (init-collision! self) - (set! (-> self basepos quad) (-> arg0 quad)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self basepos) arg0) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (initialize-skeleton @@ -940,7 +941,7 @@ (defmethod update-part-and-sfx! ((this wstd-fight-plat-smlplat)) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -1022,7 +1023,7 @@ (go-virtual go-up-fma) ) (wstd-fight-plat-smlplat-method-42 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) ) @@ -1093,7 +1094,7 @@ (go-virtual go-up-fma) ) (wstd-fight-plat-smlplat-method-42 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) ) @@ -1137,7 +1138,7 @@ ) :trans (behavior () (wstd-fight-plat-smlplat-method-42 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) ) @@ -1185,6 +1186,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this wstd-fight-plat-smlplat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1273,7 +1275,7 @@ (defmethod update-part-and-sfx! ((this wstd-fight-plat-large)) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -1444,7 +1446,7 @@ ) ) (set! (-> s5-0 y) 40960.0) - (set! (-> this part-lava-pos quad) (-> s5-0 quad)) + (vector-copy! (-> this part-lava-pos) s5-0) ) (set! (-> this next-lava-part) (+ (current-time) (seconds 0.01))) ) @@ -1481,7 +1483,7 @@ ) :trans (behavior () (wstd-fight-plat-large-method-41 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) ) @@ -1546,7 +1548,7 @@ ) (init-vf0-vector) (wstd-fight-plat-large-method-41 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (when (-> self spawn-lava?) (wstd-fight-plat-large-method-42 self) @@ -1675,7 +1677,7 @@ ) (init-vf0-vector) (wstd-fight-plat-large-method-41 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (if (-> self spawn-lava?) (wstd-fight-plat-large-method-42 self) @@ -1795,6 +1797,7 @@ ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this wstd-fight-plat-large) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1802,8 +1805,8 @@ (defbehavior wstd-fight-plat-large-init-by-other wstd-fight-plat-large ((arg0 vector) (arg1 int) (arg2 float)) (local-vars (t0-0 none)) (init-collision! self) - (set! (-> self basepos quad) (-> arg0 quad)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self basepos) arg0) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (initialize-skeleton @@ -1913,7 +1916,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s4-0 pickup-type) arg2) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (let* ((s4-1 (ppointer->process (process-spawn crate #f s5-0 'wood s4-0 :name "crate" :to *entity-pool*))) (s5-1 (if (type? s4-1 process-focusable) s4-1 @@ -2034,7 +2037,7 @@ (arg4 symbol) ) (let ((s5-0 (new 'stack-no-clear 'marauder-init-by-other-params))) - (set! (-> s5-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 trans) arg0) (quaternion-copy! (-> s5-0 quat) arg1) (set! (-> s5-0 entity) #f) (set! (-> s5-0 directed?) #f) @@ -2405,7 +2408,7 @@ ) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-11 (new 'static 'vector :x 9527214.0 :y 196812.8 :z -1693368.4 :w 1.0))) - (set! (-> gp-1 pos quad) (-> a0-11 quad)) + (vector-copy! (-> gp-1 pos) a0-11) ) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags)) @@ -2791,7 +2794,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-6 (new 'static 'vector :x 9527214.0 :y 196812.8 :z -1693368.4 :w 1.0))) - (set! (-> gp-0 pos quad) (-> a0-6 quad)) + (vector-copy! (-> gp-0 pos) a0-6) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf8)) @@ -3139,7 +3142,7 @@ (else (let ((s5-6 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-54 (new 'static 'vector :x 9419366.0 :y 47349.76 :z -1833369.6 :w 1.0))) - (set! (-> s5-6 pos quad) (-> a0-54 quad)) + (vector-copy! (-> s5-6 pos) a0-54) ) (quaternion-identity! (-> s5-6 quat)) (set! (-> s5-6 flags) (task-arrow-flags taf5 taf8)) @@ -3364,7 +3367,7 @@ (else (let ((s5-3 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-24 (new 'static 'vector :x 9523200.0 :y 49152.0 :z -1929216.0 :w 1.0))) - (set! (-> s5-3 pos quad) (-> a0-24 quad)) + (vector-copy! (-> s5-3 pos) a0-24) ) (quaternion-identity! (-> s5-3 quat)) (set! (-> s5-3 flags) (task-arrow-flags taf5 taf8)) diff --git a/goal_src/jak3/levels/wascity/waswide-obs.gc b/goal_src/jak3/levels/wascity/waswide-obs.gc index 94e1896ffe6..c8e6393c92b 100644 --- a/goal_src/jak3/levels/wascity/waswide-obs.gc +++ b/goal_src/jak3/levels/wascity/waswide-obs.gc @@ -51,6 +51,7 @@ ) (defmethod init-from-entity! ((this wascity-windmill) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -102,6 +103,7 @@ ) (defmethod init-from-entity! ((this wascity-flag-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -193,6 +195,7 @@ ) (defmethod init-from-entity! ((this wascity-wind-fan) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -384,7 +387,7 @@ (set! (-> a0-19 param2) (the-as basic 0)) ) (let ((v1-23 (-> self shakers 1))) - (set! (-> v1-23 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-23 axis) gp-2) (set! (-> v1-23 start-time) (+ (current-time) (seconds -0.06))) (set! (-> v1-23 decay-time) 600.0) (set! (-> v1-23 freq) 150.0) @@ -400,7 +403,7 @@ (set! (-> v1-25 param2) (the-as basic 1)) ) (let ((v1-26 (-> self shakers 2))) - (set! (-> v1-26 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-26 axis) gp-2) (set! (-> v1-26 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-26 decay-time) 600.0) (set! (-> v1-26 freq) 150.0) @@ -415,7 +418,7 @@ (set! (-> v1-28 param2) (the-as basic 2)) ) (let ((v1-29 (-> self shakers 3))) - (set! (-> v1-29 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-29 axis) gp-2) (set! (-> v1-29 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-29 decay-time) 600.0) (set! (-> v1-29 freq) 150.0) @@ -430,7 +433,7 @@ (set! (-> v1-31 param2) (the-as basic 2)) ) (let ((v1-32 (-> self shakers 4))) - (set! (-> v1-32 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-32 axis) gp-2) (set! (-> v1-32 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-32 decay-time) 600.0) (set! (-> v1-32 freq) 150.0) @@ -445,7 +448,7 @@ (set! (-> v1-34 param2) (the-as basic 2)) ) (let ((v1-35 (-> self shakers 5))) - (set! (-> v1-35 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-35 axis) gp-2) (set! (-> v1-35 start-time) (+ (current-time) (seconds -0.4))) (set! (-> v1-35 decay-time) 600.0) (set! (-> v1-35 freq) 150.0) @@ -465,7 +468,7 @@ (else (sound-play "cactus-burst") (let ((gp-4 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> gp-4 fountain-rand-transv-lo quad) (-> s5-0 root trans quad)) + (vector-copy! (-> gp-4 fountain-rand-transv-lo) (-> s5-0 root trans)) (set! (-> gp-4 fountain-rand-transv-hi x) 4096.0) (set! (-> gp-4 fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -535,6 +538,7 @@ ) (defmethod init-from-entity! ((this wascity-cactus) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (wascity-cactus-method-30 this) (process-drawable-from-entity! this arg0) @@ -615,6 +619,7 @@ ) (defmethod init-from-entity! ((this wascity-water-pump) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) diff --git a/goal_src/jak3/levels/wascity/wlander-female.gc b/goal_src/jak3/levels/wascity/wlander-female.gc index 663f82b69c1..2ad67423717 100644 --- a/goal_src/jak3/levels/wascity/wlander-female.gc +++ b/goal_src/jak3/levels/wascity/wlander-female.gc @@ -160,34 +160,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 20480.0 - :knocked-soft-vy-hi 40960.0 - :knocked-medium-vxz-lo 40960.0 - :knocked-medium-vxz-hi 73728.0 - :knocked-medium-vy-lo 24576.0 - :knocked-medium-vy-hi 53248.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 102400.0 - :knocked-hard-vy-lo 40960.0 - :knocked-hard-vy-hi 81920.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 8192.0 - :knocked-yellow-vxz-hi 16384.0 - :knocked-yellow-vy-lo 12288.0 - :knocked-yellow-vy-hi 24576.0 - :knocked-red-vxz-lo 12288.0 - :knocked-red-vxz-hi 24576.0 - :knocked-red-vy-lo 20480.0 - :knocked-red-vy-hi 36864.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 32768.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 5) + :knocked-soft-vy-hi (meters 10) + :knocked-medium-vxz-lo (meters 10) + :knocked-medium-vxz-hi (meters 18) + :knocked-medium-vy-lo (meters 6) + :knocked-medium-vy-hi (meters 13) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 25) + :knocked-hard-vy-lo (meters 10) + :knocked-hard-vy-hi (meters 20) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 2) + :knocked-yellow-vxz-hi (meters 4) + :knocked-yellow-vy-lo (meters 3) + :knocked-yellow-vy-hi (meters 6) + :knocked-red-vxz-lo (meters 3) + :knocked-red-vxz-hi (meters 6) + :knocked-red-vy-lo (meters 5) + :knocked-red-vy-hi (meters 9) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 8) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9956 :y 0.0755 :z -0.0549 :w 34275.477) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -418,6 +418,7 @@ (set! (-> *waster-b-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) (defmethod coin-flip? ((this waster-b)) + "Return #t half the time, #f the other." #f ) @@ -427,6 +428,7 @@ ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this waster-b)) + "Get the yaw angle for the current knock." (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) @@ -434,7 +436,7 @@ (when a0-5 (get-trans (the-as process-focusable a0-5) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -447,7 +449,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this root transv quad)) + (vector-copy! s5-1 (-> this root transv)) (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) @@ -487,6 +489,7 @@ ) (defmethod knocked-anim-handler ((this waster-b) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (case (-> this incoming knocked-type) @@ -537,11 +540,12 @@ ) (defmethod knocked-anim ((this waster-b) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) - (v1-3 (enemy-method-131 this 1 a2-0)) + (v1-3 (rnd-int-excluding-masked this 1 a2-0)) (a1-7 (-> this draw @@ -568,7 +572,7 @@ (((knocked-type blue-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) - (v1-12 (enemy-method-131 this 3 a2-2)) + (v1-12 (rnd-int-excluding-masked this 3 a2-2)) (a1-14 (-> this draw @@ -614,6 +618,7 @@ ) (defmethod knocked-land-anim ((this waster-b) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -751,6 +756,7 @@ ) (defmethod init-enemy-collision! ((this waster-b)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -808,12 +814,13 @@ ) (defmethod init-enemy! ((this waster-b)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-waster-b" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *waster-b-nav-enemy-info*) + (setup-enemy! this *waster-b-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -821,7 +828,7 @@ (set! (-> this draw lod-set lod 0 dist) 204800.0) (set! (-> this draw lod-set lod 1 dist) 491520.0) (set! (-> this info) *waster-b-global-info*) - (try-update-focus (-> this focus) *target* this) + (focus-on! (-> this focus) *target* this) (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) (set! (-> this anim-shuffle) 12) (let ((v1-18 (rnd-int this 3))) diff --git a/goal_src/jak3/levels/wascity/wlander-male.gc b/goal_src/jak3/levels/wascity/wlander-male.gc index 79ee48e77d7..7fc47369425 100644 --- a/goal_src/jak3/levels/wascity/wlander-male.gc +++ b/goal_src/jak3/levels/wascity/wlander-male.gc @@ -58,7 +58,8 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-123 ((this wlander)) +(defmethod allow-ragdoll? ((this wlander)) + "Can this enemy ragdoll now?" (the-as symbol (or (and (>= (-> this incoming blue-juggle-count) (the-as uint 2)) (-> this incoming knocked-type) 6) @@ -86,7 +87,8 @@ ; ) ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this wlander)) +(defmethod get-search-info-flag ((this wlander)) + "Get search-info-flag for this process." (let ((v1-1 (handle->process (-> this focus handle)))) (the-as search-info-flag (if (if v1-1 (= (-> v1-1 type) target) @@ -100,6 +102,7 @@ ;; WARN: Return type mismatch float vs vector. (defmethod ragdoll-spawn! ((this wlander) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." (let ((t9-0 (method-of-type nav-enemy ragdoll-spawn!))) (t9-0 this arg0 arg1) ) @@ -113,6 +116,7 @@ ) (defmethod ragdoll-settled? ((this wlander)) + "Has the ragdoll stopped moving?" (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (if s5-0 (seek! (-> (the-as ragdoll-proc s5-0) ragdoll momentum) 0.7 (seconds-per-frame)) @@ -129,6 +133,7 @@ ;; WARN: disable def twice: 165. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this wlander) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('help) (let ((v1-1 (-> arg3 param 0)) @@ -164,7 +169,7 @@ ) ) (when a1-12 - (enemy-method-70 this (the-as process-focusable a1-12) (the-as enemy-aware #f)) + (set-focus! this (the-as process-focusable a1-12) (the-as enemy-aware #f)) (call-for-help this (* 4096.0 (* 10.0 (-> this mad-level)))) (if (-> this male) (speech-control-method-12 *speech-control* this (speech-type civ-m-shot-by-player)) @@ -202,7 +207,7 @@ (let ((v1-37 (the-as traffic-danger-info (-> arg3 param 0)))) (set! (-> this cp-valid?) #t) (set! (-> this cp-sphere quad) (-> v1-37 sphere quad)) - (set! (-> this cp-vec quad) (-> v1-37 velocity quad)) + (vector-copy! (-> this cp-vec) (-> v1-37 velocity)) (when (= (-> v1-37 danger-type) 8) (set! (-> this allow-dive) #f) (set! (-> this cp-factor) 50.0) @@ -238,10 +243,10 @@ (v1-5 *null-vector*) ) (logior! (-> a0-2 flags) (nav-state-flag directional-mode)) - (set! (-> a0-2 travel quad) (-> v1-5 quad)) + (vector-copy! (-> a0-2 travel) v1-5) ) 0 - (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (move-to-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) (set! (-> self gnd-height) (-> self root gspot-pos y)) (vector-reset! (-> self root transv)) ) @@ -298,7 +303,7 @@ (let ((gp-0 (-> self root))) (cond ((focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) ) (else (if (logtest? (-> gp-0 status) (collide-status touch-surface)) @@ -306,7 +311,7 @@ ) (when (and (not (-> self knocked-collide)) (!= (-> self incoming knocked-type) 4)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! s5-0 (ja-linear-vel 0)) (vector-orient-by-quat! s5-0 s5-0 (-> gp-0 quat)) (vector-xz-normalize! (-> gp-0 transv) @@ -442,6 +447,7 @@ ) (defmethod go-hostile ((this wlander)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this hostile)) ) @@ -505,7 +511,7 @@ ) ) (else - (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (vector-copy! (-> this target-pos) (get-trans (the-as process-focusable s4-0) 3)) ) ) ) @@ -633,7 +639,7 @@ (clamp-vector-to-mesh-no-gaps (-> self nav) (-> self root trans) s4-0 s3-0 s5-0) ) (if (-> s5-0 found-boundary) - (set! (-> self root trans quad) (-> s5-0 intersection quad)) + (vector-copy! (-> self root trans) (-> s5-0 intersection)) (vector+! (-> self root trans) (-> self root trans) gp-0) ) ) @@ -715,12 +721,12 @@ ) (cond ((should-check-los? (-> self los) 0) - (set! (-> self target-pos quad) (-> (get-trans gp-0 3) quad)) - (if (and (enemy-method-105 self 6371.5557 #t) (>= 12288.0 f30-0)) + (vector-copy! (-> self target-pos) (get-trans gp-0 3)) + (if (and (pointing-toward-focus? self 6371.5557 #t) (>= 12288.0 f30-0)) (go-virtual close-attack) ) (if (or (< f30-0 204800.0) - (and (enemy-method-105 self 910.2222 #t) (< (seconds 4) (- (current-time) (-> self last-time-far)))) + (and (pointing-toward-focus? self 910.2222 #t) (< (seconds 4) (- (current-time) (-> self last-time-far)))) ) (go-virtual gun-shoot) ) @@ -852,8 +858,8 @@ ) (cond ((should-check-los? (-> self los) 0) - (set! (-> self target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) - (if (and (enemy-method-105 self 6371.5557 #t) (>= 12288.0 f30-0)) + (vector-copy! (-> self target-pos) (get-trans (the-as process-focusable gp-0) 3)) + (if (and (pointing-toward-focus? self 6371.5557 #t) (>= 12288.0 f30-0)) (go-virtual close-attack) ) (set-time! (-> self last-time-los)) @@ -876,7 +882,7 @@ (let ((v1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'array 'collide-shape 64)) ) - (set! (-> v1-0 quad) (-> this root trans quad)) + (vector-copy! v1-0 (-> this root trans)) (set! (-> v1-0 w) arg0) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* v1-0 s5-0 64)) (let* ((s3-0 (-> s5-0 s4-0)) @@ -911,7 +917,7 @@ (let ((a1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'array 'collide-shape 64)) ) - (set! (-> a1-0 quad) (-> this root trans quad)) + (vector-copy! a1-0 (-> this root trans)) (set! (-> a1-0 w) 245760.0) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* a1-0 s5-0 64)) (let* ((s3-0 (-> s5-0 s4-0)) @@ -935,7 +941,7 @@ (not (focus-test? (the-as process-focusable a1-3) dead)) (logtest? (process-mask enemy) (-> a1-3 mask)) ) - (try-update-focus (-> this focus) (the-as process-focusable a1-3) this) + (focus-on! (-> this focus) (the-as process-focusable a1-3) this) (return #f) ) ) @@ -1067,34 +1073,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 49152.0 - :knocked-medium-vy-hi 102400.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 32768.0 - :knocked-yellow-vy-hi 49152.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 32768.0 - :knocked-red-vy-hi 49152.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 15) + :knocked-soft-vy-hi (meters 15) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 12) + :knocked-medium-vy-hi (meters 25) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 24) + :knocked-hard-vy-hi (meters 26) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 8) + :knocked-yellow-vy-hi (meters 12) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 8) + :knocked-red-vy-hi (meters 12) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 8) + :knocked-blue-vy-hi (meters 12) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9955 :y 0.0573 :z 0.0754 :w 35528.34) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -1381,7 +1387,8 @@ (none) ) -(defmethod enemy-method-123 ((this wlander-male)) +(defmethod allow-ragdoll? ((this wlander-male)) + "Can this enemy ragdoll now?" (when (call-parent-method this) (set! (-> this skel postbind-function) wlander-male-joint-callback) #t @@ -1389,6 +1396,7 @@ ) (defmethod knocked-anim ((this wlander-male) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 (seconds 0.01)) (cond ((zero? (-> this hit-face)) @@ -1418,6 +1426,7 @@ ) (defmethod knocked-land-anim ((this wlander-male) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.01)) (cond ((zero? (-> this hit-face)) @@ -1458,7 +1467,7 @@ (ja :num! (seek!)) ) (until #f - (while (not (enemy-method-105 self 4187.0225 #t)) + (while (not (pointing-toward-focus? self 4187.0225 #t)) (let* ((gp-0 (handle->process (-> self focus handle))) (s5-0 (if (type? gp-0 process-focusable) gp-0 @@ -1595,6 +1604,7 @@ ) (defmethod init-enemy-collision! ((this wlander-male)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1676,12 +1686,13 @@ ) (defmethod init-enemy! ((this wlander-male)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wlander-male" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *wlander-male-nav-enemy-info*) + (setup-enemy! this *wlander-male-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -1832,7 +1843,7 @@ ) ) ) - (set! (-> this shoot-time) (set-reaction-time! this (seconds 1) (seconds 3))) + (set! (-> this shoot-time) (rnd-time-frame this (seconds 1) (seconds 3))) (set! (-> this shot-sound) (rnd-int this 7)) (toggle-cspec this #f -1) (ja-channel-set! 0) @@ -1968,34 +1979,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 61440.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 15) + :knocked-soft-vy-hi (meters 15) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 24) + :knocked-hard-vy-hi (meters 26) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 15) + :knocked-red-vy-hi (meters 15) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 37977.51) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -2290,6 +2301,7 @@ ) (defmethod event-handler ((this wlander-female) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-0 object)) (case arg2 (('event-gunout) @@ -2311,6 +2323,7 @@ ) (defmethod knocked-anim ((this wlander-female) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 (seconds 0.01)) (cond ((zero? (-> this hit-face)) @@ -2340,6 +2353,7 @@ ) (defmethod knocked-land-anim ((this wlander-female) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.01)) (cond ((zero? (-> this hit-face)) @@ -2440,7 +2454,7 @@ (ja :num! (seek!)) ) (until #f - (while (not (enemy-method-105 self 4187.0225 #t)) + (while (not (pointing-toward-focus? self 4187.0225 #t)) (let* ((gp-0 (handle->process (-> self focus handle))) (s5-0 (if (type? gp-0 process-focusable) gp-0 @@ -2533,6 +2547,7 @@ ) (defmethod init-enemy-collision! ((this wlander-female)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2608,13 +2623,14 @@ ) (defmethod init-enemy! ((this wlander-female)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wlander-female" (the-as (pointer level) #f))) (the-as pair 0) ) (set! (-> this skel postbind-function) wlander-female-joint-callback) - (init-enemy-defaults! this *wlander-female-nav-enemy-info*) + (setup-enemy! this *wlander-female-nav-enemy-info*) (let ((v1-6 (-> this nav))) (set! (-> v1-6 speed-scale) 1.0) ) @@ -2719,7 +2735,7 @@ ) ) (set! (-> this anim-get-up-front) 17) - (set! (-> this shoot-time) (set-reaction-time! this (seconds 1) (seconds 3))) + (set! (-> this shoot-time) (rnd-time-frame this (seconds 1) (seconds 3))) (set! (-> this shot-sound) (rnd-int this 7)) (set! (-> this gunout) (if (rnd-int this 2) #f diff --git a/test/decompiler/reference/jak3/decompiler-macros.gc b/test/decompiler/reference/jak3/decompiler-macros.gc index a8875a6bbb1..cffda32457d 100644 --- a/test/decompiler/reference/jak3/decompiler-macros.gc +++ b/test/decompiler/reference/jak3/decompiler-macros.gc @@ -37,6 +37,18 @@ ) ) +(defmacro new-stack-matrix0 () + "Get a new matrix on the stack that's set to zero." + `(let ((mat (new 'stack-no-clear 'matrix))) + (set! (-> mat quad 0) (the-as uint128 0)) + (set! (-> mat quad 1) (the-as uint128 0)) + (set! (-> mat quad 2) (the-as uint128 0)) + (set! (-> mat quad 3) (the-as uint128 0)) + mat + ) + ) + + (defmacro with-pp (&rest body) "execute the body with pp bound to the current process register." `(rlet ((pp :reg r13 :reset-here #t :type process)) diff --git a/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc index 93fbffb0fa9..1e35a6ab4c2 100644 --- a/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc @@ -7,8 +7,8 @@ (flags enemy-flag) ) (:methods - (try-update-focus (_type_ process-focusable enemy) symbol :replace) - (enemy-focus-method-13 (_type_ process-focusable enemy-aware) symbol) + (focus-on! (_type_ process-focusable enemy) symbol :replace) + (focus-on-with-awareness! (_type_ process-focusable enemy-aware) symbol) ) ) @@ -78,34 +78,34 @@ (jump-height-min meters) (jump-height-factor float) (knocked-seek-ry-clamp float) - (knocked-soft-vxz-lo float) - (knocked-soft-vxz-hi float) - (knocked-soft-vy-lo float) - (knocked-soft-vy-hi float) - (knocked-medium-vxz-lo float) - (knocked-medium-vxz-hi float) - (knocked-medium-vy-lo float) - (knocked-medium-vy-hi float) - (knocked-hard-vxz-lo float) - (knocked-hard-vxz-hi float) - (knocked-hard-vy-lo float) - (knocked-hard-vy-hi float) - (knocked-huge-vxz-lo float) - (knocked-huge-vxz-hi float) - (knocked-huge-vy-lo float) - (knocked-huge-vy-hi float) - (knocked-yellow-vxz-lo float) - (knocked-yellow-vxz-hi float) - (knocked-yellow-vy-lo float) - (knocked-yellow-vy-hi float) - (knocked-red-vxz-lo float) - (knocked-red-vxz-hi float) - (knocked-red-vy-lo float) - (knocked-red-vy-hi float) - (knocked-blue-vxz-lo float) - (knocked-blue-vxz-hi float) - (knocked-blue-vy-lo float) - (knocked-blue-vy-hi float) + (knocked-soft-vxz-lo meters) + (knocked-soft-vxz-hi meters) + (knocked-soft-vy-lo meters) + (knocked-soft-vy-hi meters) + (knocked-medium-vxz-lo meters) + (knocked-medium-vxz-hi meters) + (knocked-medium-vy-lo meters) + (knocked-medium-vy-hi meters) + (knocked-hard-vxz-lo meters) + (knocked-hard-vxz-hi meters) + (knocked-hard-vy-lo meters) + (knocked-hard-vy-hi meters) + (knocked-huge-vxz-lo meters) + (knocked-huge-vxz-hi meters) + (knocked-huge-vy-lo meters) + (knocked-huge-vy-hi meters) + (knocked-yellow-vxz-lo meters) + (knocked-yellow-vxz-hi meters) + (knocked-yellow-vy-lo meters) + (knocked-yellow-vy-hi meters) + (knocked-red-vxz-lo meters) + (knocked-red-vxz-hi meters) + (knocked-red-vy-lo meters) + (knocked-red-vy-hi meters) + (knocked-blue-vxz-lo meters) + (knocked-blue-vxz-hi meters) + (knocked-blue-vy-lo meters) + (knocked-blue-vy-hi meters) (ragdoll-info ragdoll-setup) (shadow-size meters) (shadow-max-y meters) @@ -425,80 +425,80 @@ gun-dark-2-stretch ) (:methods - (enemy-method-50 (_type_ int) none) - (accelerate-fall! (_type_ vector) float) - (damage-enemy! (_type_ object event-message-block) float) - (reset-penetrate! (_type_) none) + (update-collision-action (_type_ int) none) + (adjust-transv-under-water! (_type_ vector) float) + (damage-enemy-from-attack! (_type_ object event-message-block) float) + (reset-penetrate-later! (_type_) none) (get-knockback-dir! (_type_ vector) vector) (get-knockback-angle (_type_) degrees) (knocked-handler (_type_ vector) object) - (can-collide-with-focus? (_type_ process-focusable) object) + (can-focus-on? (_type_ process-focusable) object) (check-water (_type_) object) (enemy-common-post (_type_) none) - (lerp-damage (_type_ float) float) - (scale-impact-vel-y! (_type_ vector vector float) vector) + (impact-velocity-to-hit-points (_type_ float) float) + (attack-direction-from-impact-vel (_type_ vector vector float) vector) (get-damage-from-attack (_type_ object event-message-block) float) - (enemy-method-63 (_type_ float) float) - (update-awareness! (_type_ process-focusable enemy-best-focus) enemy-aware) - (penetrate->next-state (_type_ process event-message-block float) symbol) + (apply-incoming-hitpoint-mods (_type_ float) float) + (get-awareness-of-proc (_type_ process-focusable enemy-best-focus) enemy-aware) + (msg-for-incoming-attack (_type_ process event-message-block float) symbol) (get-penetrated-by (_type_) penetrate) (coin-flip? (_type_) symbol) - (get-enemy-aware (_type_ enemy-aware) enemy-aware) - (enemy-method-69 (_type_) none) - (enemy-method-70 (_type_ process-focusable enemy-aware) none) + (modify-awareness (_type_ enemy-aware) enemy-aware) + (focus-on-attacker! (_type_) none) + (set-focus! (_type_ process-focusable enemy-aware) none) (go-dormant (_type_) object) (go-dormant-aware (_type_) object) (go-idle (_type_) object) - (go-ambush-delay (_type_) object) + (go-ambush (_type_) object) (go-stare (_type_) object) (go-stare2 (_type_) object) (go-directed (_type_) object) (go-hostile (_type_) object) (go-flee (_type_) object) - (go-best-state (_type_) object) + (go-state-for-focused (_type_) object) (go-die (_type_) object) (event-handler (_type_ process int symbol event-message-block) object :behavior enemy) (enemy-touch-handler (_type_ process event-message-block) object) - (send-attack-on-jump-or-knocked (_type_ process event-message-block) object) + (enemy-touched-handler (_type_ process event-message-block) object) (knocked-anim (_type_ enemy-knocked-info) symbol) (knocked-land-anim (_type_ enemy-knocked-info) symbol) (knocked-anim-handler (_type_ int enemy-knocked-info) symbol) - (enemy-method-88 (_type_ enemy-knocked-info) symbol) - (within-gspot-range? (_type_) symbol) - (enemy-method-90 (_type_ ragdoll-proc) none) - (enemy-method-91 (_type_ enemy-jump-info) object) + (done-being-knocked? (_type_ enemy-knocked-info) symbol) + (invalid-height? (_type_) symbol) + (copy-ragdoll-orientation-to-root (_type_ ragdoll-proc) none) + (check-jump-blocked? (_type_ enemy-jump-info) object) (init-jump-info! (_type_ enemy-jump-info) none) - (setup-jump! (_type_ enemy-jump-info) none) + (setup-jump-trajectory! (_type_ enemy-jump-info) none) (move-to-gspot! (_type_) float) - (on-ground? (_type_ enemy-jump-info) symbol) + (landed-jump-yet? (_type_ enemy-jump-info) symbol) (jump-in-air-anim (_type_ enemy-jump-info) symbol) (jump-land-anim (_type_ enemy-jump-info) symbol) (jump-wind-up-anim (_type_ enemy-jump-info) symbol) - (jump-anim-handler (_type_ int enemy-jump-info) symbol) - (in-jump-handler (_type_ int enemy-jump-info) none) - (enemy-method-101 (_type_ int enemy-jump-info) none) - (go-directed2 (_type_) object) - (enemy-method-103 (_type_ vector float) symbol) - (enemy-method-104 (_type_ vector float) symbol) - (enemy-method-105 (_type_ float symbol) symbol) + (jump-anim-handler (_type_ jump-stage enemy-jump-info) symbol) + (move-along-ballistic-trajectory-for-jump (_type_ jump-stage enemy-jump-info) none) + (adjust-heading-for-jump (_type_ jump-stage enemy-jump-info) none) + (go-next-state-auto (_type_) object) + (heading-matches-direction? (_type_ vector float) symbol) + (pointing-toward? (_type_ vector float) symbol) + (pointing-toward-focus? (_type_ float symbol) symbol) (find-best-focus (_type_) process) - (is-pfoc-in-mesh? (_type_ process-focusable vector) symbol) - (enemy-method-108 (_type_ process-focusable) symbol) - (enemy-method-109 (_type_) symbol) - (send-attack (_type_ process touching-shapes-entry uint) symbol) + (can-become-hostile-to? (_type_ process-focusable vector) symbol) + (should-flee-from? (_type_ process-focusable) symbol) + (out-of-bounds? (_type_) symbol) + (send-attack-from-tshape (_type_ process touching-shapes-entry uint) symbol) (on-attack (_type_ process-focusable) none) - (get-incoming-attack! (_type_ process-drawable event-message-block penetrate attack-info touching-shapes-entry) none) + (handle-incoming-attack! (_type_ process-drawable event-message-block penetrate attack-info touching-shapes-entry) none) (get-focus! (_type_) process-focusable) - (send-attack-to-all-tshapes (_type_ process-focusable event-message-block) int) + (find-and-damage-attackers (_type_ process-focusable event-message-block) int) (set-look-at-mode! (_type_ int) none) (stop-look-at! (_type_) none) (apply-friction (_type_) none) - (init-enemy-info! (_type_ enemy-info) none) - (init-enemy-defaults! (_type_ enemy-info) none) + (set-enemy-info! (_type_ enemy-info) none) + (setup-enemy! (_type_ enemy-info) none) (init-enemy-collision! (_type_) none) (init-enemy! (_type_) none) - (go-idle2 (_type_) object) - (enemy-method-123 (_type_) symbol) + (go-fallback-init (_type_) object) + (allow-ragdoll? (_type_) symbol) (disable-ragdoll (_type_) none) (ragdoll-settled? (_type_) object) (ragdoll-spawn! (_type_ symbol symbol) vector) @@ -506,28 +506,28 @@ (rnd-float (_type_) float) (rnd-float-range (_type_ float float) float) (rnd-int (_type_ int) int) - (enemy-method-131 (_type_ int int) int) - (set-reaction-time! (_type_ time-frame time-frame) time-frame) + (rnd-int-excluding-masked (_type_ int int) int) + (rnd-time-frame (_type_ time-frame time-frame) time-frame) (rnd-chance? (_type_ float) symbol) - (enemy-method-134 (_type_ float) symbol) + (rnd-chance-for-idle? (_type_ float) symbol) (enemy-method-135 (_type_) none) - (set-ground-pat! (_type_ collide-query collide-spec float float float process) pat-surface) + (find-ground-and-set-pat! (_type_ collide-query collide-spec float float float process) pat-surface) (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol) - (try-locate-ground (_type_ meters meters symbol collide-spec) symbol) + (move-to-ground (_type_ meters meters symbol collide-spec) symbol) (move-above-ground! (_type_ vector move-above-ground-params) none) (update-focus (_type_) process) - (enemy-method-141 (_type_ float) symbol) + (check-awareness-trigger (_type_ float) symbol) (penetrate->knocked-type (_type_ penetrate) knocked-type) (on-dying (_type_) none) (falling? (_type_) symbol) (find-offending-pfoc (_type_ process attack-info) process-focusable) (play-damage-sound (_type_ int) sound-id) - (check-victory (_type_) none) + (clear-stale-victory (_type_) none) (go-gun-dark-2-stretch (_type_) object) (have-more-than-10-joints? (_type_) object) - (enemy-method-150 (_type_) symbol) + (can-be-nuked? (_type_) symbol) (should-move-to-ground? (_type_) symbol) - (enemy-method-152 (_type_) float) + (gem-chance (_type_) float) (get-gem-pool-idx (_type_) int) (mark-as-dead (_type_) none) ) @@ -720,21 +720,23 @@ ) ;; definition for method 12 of type enemy-focus -(defmethod try-update-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) - (let* ((t9-0 (method-of-type focus try-update-focus)) +(defmethod focus-on! ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) + "Make this enemy focus on the process-focusable. If already focused, update awareness." + (let* ((t9-0 (method-of-type focus focus-on!)) (s3-0 (t9-0 this arg0)) ) (when (not s3-0) (logclear! (-> this flags) (enemy-flag look-at-focus)) - (set! (-> this aware) (get-enemy-aware arg1 (update-awareness! arg1 arg0 (the-as enemy-best-focus #f)))) + (set! (-> this aware) (modify-awareness arg1 (get-awareness-of-proc arg1 arg0 (the-as enemy-best-focus #f)))) ) s3-0 ) ) ;; definition for method 13 of type enemy-focus -(defmethod enemy-focus-method-13 ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) - (let* ((t9-0 (method-of-type focus try-update-focus)) +(defmethod focus-on-with-awareness! ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) + "Focus on the process-focusable, updating the aware." + (let* ((t9-0 (method-of-type focus focus-on!)) (v0-0 (t9-0 this arg0)) ) (set! (-> this aware) arg1) @@ -752,7 +754,7 @@ (let ((t9-0 (method-of-type focus clear-focused))) (t9-0 this) ) - (set! (-> this aware) (enemy-aware ea0)) + (set! (-> this aware) (enemy-aware unaware)) (logclear! (-> this flags) (enemy-flag look-at-focus)) (none) ) diff --git a/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc index 34a0740225a..fb6c4ca3196 100644 --- a/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc @@ -30,32 +30,38 @@ ;; definition for method 128 of type enemy (defmethod rnd-float ((this enemy)) + "Get a random number from 0 to 1" (rand-vu) ) ;; definition for method 129 of type enemy (defmethod rnd-float-range ((this enemy) (arg0 float) (arg1 float)) + "Get a random float in the range" (+ arg0 (* (rand-vu) (- arg1 arg0))) ) ;; definition for method 130 of type enemy (defmethod rnd-int ((this enemy) (arg0 int)) + "Get a random int from to to the specified int" (the int (* (rand-vu) (the float arg0))) ) ;; definition for method 132 of type enemy -(defmethod set-reaction-time! ((this enemy) (arg0 time-frame) (arg1 time-frame)) +(defmethod rnd-time-frame ((this enemy) (arg0 time-frame) (arg1 time-frame)) + "Get a random time frame." (+ arg0 (the int (* (rand-vu) (the float (+ (- 1 arg0) arg1))))) ) ;; definition for method 133 of type enemy (defmethod rnd-chance? ((this enemy) (arg0 float)) + "Returns true with the given probability." (>= arg0 (rand-vu)) ) ;; definition for method 131 of type enemy ;; WARN: new jak 2 until loop case, check carefully -(defmethod enemy-method-131 ((this enemy) (arg0 int) (arg1 int)) +(defmethod rnd-int-excluding-masked ((this enemy) (arg0 int) (arg1 int)) + "Get a random int in the range. Exclude a value n by setting the n-th bit of the mask." (let ((v1-0 0) (s5-0 0) ) @@ -95,7 +101,9 @@ ) ;; definition for method 134 of type enemy -(defmethod enemy-method-134 ((this enemy) (arg0 float)) +(defmethod rnd-chance-for-idle? ((this enemy) (arg0 float)) + "Like rnd-chance, but is more likely to return true when the game is close to not fitting in frame rate. + This makes enemies start idling more if the game isn't running fast enough." (let* ((v1-5 (-> *display* frames (-> *display* last-screen) run-time)) (f1-2 (fmax 0.0 (fmin 1.0 (* 0.001 (+ -7000.0 (the float v1-5)))))) ) @@ -105,6 +113,7 @@ ;; definition for method 67 of type enemy (defmethod coin-flip? ((this enemy)) + "Return #t half the time, #f the other." (zero? (rnd-int this 2)) ) @@ -135,28 +144,30 @@ ) ;; definition for method 57 of type enemy -(defmethod can-collide-with-focus? ((this enemy) (arg0 process-focusable)) +(defmethod can-focus-on? ((this enemy) (arg0 process-focusable)) + "Check that this enemy can focus on the given focusable. + This reuses the collide bitmask, but isn't actually a collision." (and arg0 (!= this arg0) (collide-spec-match? (-> this focus) arg0)) ) ;; definition for method 20 of type enemy -;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this enemy)) +(defmethod get-search-info-flag ((this enemy)) + "Get search-info-flag for this process." (let ((v1-0 (-> this enemy-flags)) - (v0-0 0) + (flag (search-info-flag)) ) (when (and (!= (-> this hit-points) 0.0) (logtest? (-> this enemy-flags) (enemy-flag vulnerable)) (logtest? (enemy-flag trackable) (-> this enemy-flags)) ) (if (logtest? (process-mask enemy) (-> this mask)) - (set! v0-0 (logior v0-0 16)) + (set! flag (logior flag (search-info-flag enemy))) ) (if (logtest? v1-0 (enemy-flag attackable)) - (set! v0-0 (logior v0-0 8)) + (set! flag (logior flag (search-info-flag attackable))) ) ) - (the-as search-info-flag v0-0) + flag ) ) @@ -189,12 +200,14 @@ ;; definition for method 66 of type enemy (defmethod get-penetrated-by ((this enemy)) + "Figure out the penetrated-by mask for this process." (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (the int (-> this hit-points))) ) ;; definition for method 25 of type enemy ;; WARN: Return type mismatch float vs meters. (defmethod get-water-height ((this enemy)) + "Get the height of the water that we're in." (the-as meters (-> this water-surface-height)) ) @@ -202,6 +215,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch enemy-flag vs object. (defmethod check-water ((this enemy)) + "Respond to possibly being in water." (let ((s4-0 (-> this root))) (when (>= (-> this water-max-height) (-> s4-0 trans y)) (let ((s5-0 (new 'stack-no-clear 'water-info))) @@ -211,15 +225,15 @@ (set! (-> this water-surface-height) (-> s5-0 trans y)) (when (not (focus-test? this touch-water under-water)) (let ((v1-9 (new 'stack-no-clear 'vector))) - (set! (-> v1-9 quad) (-> this root trans quad)) + (vector-copy! v1-9 (-> this root trans)) (set! (-> v1-9 y) (+ 409.6 (-> s5-0 trans y))) (cond ((logtest? (-> *part-group-id-table* 192 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-9 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-9) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 192)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-9 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-9) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 192)) ) ) @@ -262,6 +276,7 @@ ;; definition for method 59 of type enemy ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this enemy)) + "Common implementation of post. Runs ja-post." (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this last-draw-time)) ) @@ -300,7 +315,7 @@ ) ) (if (logtest? (-> this enemy-flags) (enemy-flag victory)) - (check-victory this) + (clear-stale-victory this) ) (if (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags)) (check-water this) @@ -315,7 +330,8 @@ ;; definition for method 147 of type enemy ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod check-victory ((this enemy)) +(defmethod clear-stale-victory ((this enemy)) + "Remove victory flag if needed." (if (or (time-elapsed? (-> this hit-focus-time) (seconds 2)) (and (handle->process (-> this focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) @@ -330,11 +346,11 @@ ) ;; definition for function get-penetrate-using-from-attack-event -;; WARN: Return type mismatch int vs penetrate. (defun get-penetrate-using-from-attack-event ((arg0 process-drawable) (arg1 event-message-block)) + "Given an attack event to an enemy, return the penetrate that should be applied to the enemy" (let ((v1-0 (the-as object (-> arg1 param 1)))) (if (logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-0) mask)) - (return (the-as penetrate (-> (the-as attack-info v1-0) penetrate-using))) + (return (-> (the-as attack-info v1-0) penetrate-using)) ) ) (let* ((gp-0 arg0) @@ -345,25 +361,24 @@ ) (when v1-3 (let* ((gp-1 (-> v1-3 root)) - (v1-4 (if (type? gp-1 collide-shape) + (v1-4 (if (the-as penetrate (type? gp-1 collide-shape)) gp-1 ) ) ) (if v1-4 - (return - (the-as penetrate (logior (-> (the-as collide-shape v1-4) penetrate-using) (penetrate generic-attack))) - ) + (return (logior (-> (the-as collide-shape v1-4) penetrate-using) (penetrate generic-attack))) ) ) ) ) - (the-as penetrate 2) + (penetrate generic-attack) ) ;; definition for method 113 of type enemy ;; WARN: Return type mismatch process vs process-focusable. (defmethod get-focus! ((this enemy)) + "If we're focusing on something alive, return it." (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 (not (and v0-0 @@ -379,17 +394,19 @@ ;; definition for method 70 of type enemy ;; WARN: Return type mismatch symbol vs none. -(defmethod enemy-method-70 ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod set-focus! ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) + "Change our focus to the given process. Optionally, specify awareness." (if arg1 - (enemy-focus-method-13 (-> this focus) arg0 arg1) - (try-update-focus (-> this focus) arg0 this) + (focus-on-with-awareness! (-> this focus) arg0 arg1) + (focus-on! (-> this focus) arg0 this) ) (none) ) ;; definition for method 69 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-69 ((this enemy)) +(defmethod focus-on-attacker! ((this enemy)) + "If possible, update this enemies focus to the attacker." (when (not (logtest? (enemy-flag lock-focus) (-> this enemy-flags))) (let* ((s4-0 (handle->process (-> this incoming attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) @@ -397,8 +414,8 @@ ) ) ) - (when (can-collide-with-focus? this (the-as process-focusable s5-0)) - (enemy-method-70 this (the-as process-focusable s5-0) (the-as enemy-aware #f)) + (when (can-focus-on? this (the-as process-focusable s5-0)) + (set-focus! this (the-as process-focusable s5-0) (the-as enemy-aware #f)) (logior! (-> this focus flags) (enemy-flag look-at-focus)) ) ) @@ -408,7 +425,10 @@ ) ;; definition for method 114 of type enemy -(defmethod send-attack-to-all-tshapes ((this enemy) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this enemy) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when (and s4-0 (and (logtest? (-> this incoming penetrate-using) (penetrate board)) @@ -421,7 +441,7 @@ (get-touched-prim s3-0 (-> this root) s4-0) (when (logtest? (-> s2-0 prim-core action) (collide-action solid semi-solid deadly)) (let* ((a0-5 this) - (t9-2 (method-of-object a0-5 send-attack)) + (t9-2 (method-of-object a0-5 send-attack-from-tshape)) (a1-3 arg0) (a2-3 s4-0) (v1-13 *game-info*) @@ -447,6 +467,7 @@ ;; definition for method 71 of type enemy (defmethod go-dormant ((this enemy)) + "Go to the dormant state. This disables drawing/processing/collision, and runs no logic." (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) @@ -459,6 +480,8 @@ ;; definition for method 72 of type enemy (defmethod go-dormant-aware ((this enemy)) + "Go to the dormat aware state. + Similar to dormant, drawing/collision are disabled, but enemies can exit dormant-aware." (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) @@ -471,6 +494,7 @@ ;; definition for method 73 of type enemy (defmethod go-idle ((this enemy)) + "Go to an idle state." (go (method-of-object this idle)) ) @@ -486,28 +510,33 @@ ;; definition for method 78 of type enemy (defmethod go-hostile ((this enemy)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this hostile)) ) ;; definition for method 149 of type enemy (defmethod have-more-than-10-joints? ((this enemy)) + "Does what it says, unused" (and (nonzero? (-> this node-list)) (-> this node-list) (< 10 (-> this node-list length))) ) ;; definition for method 150 of type enemy -(defmethod enemy-method-150 ((this enemy)) +(defmethod can-be-nuked? ((this enemy)) + "Can this enemy be instantly destroyed by the nuke?" #t ) ;; definition for method 148 of type enemy (defmethod go-gun-dark-2-stretch ((this enemy)) + "Go to the gun-dark-2-stretch state." (if (not (and (-> this next-state) (= (-> this next-state name) 'gun-dark-2-stretch))) (go (method-of-object this gun-dark-2-stretch)) ) ) ;; definition for method 74 of type enemy -(defmethod go-ambush-delay ((this enemy)) +(defmethod go-ambush ((this enemy)) + "May go to ambush-delay first, if set in the res-lump." (if (< 0.0 (res-lump-float (-> this entity) 'ambush-delay)) (go (method-of-object this ambush-delay)) (go (method-of-object this ambush)) @@ -516,19 +545,22 @@ ;; definition for method 79 of type enemy (defmethod go-flee ((this enemy)) + "Go to the flee state, running away." (go (method-of-object this flee)) ) ;; definition for method 77 of type enemy (defmethod go-directed ((this enemy)) + "Go to the directed state which assumes that something else will control the enemy." (go (method-of-object this directed)) ) ;; definition for method 80 of type enemy -(defmethod go-best-state ((this enemy)) +(defmethod go-state-for-focused ((this enemy)) + "Go to the appropriate state for the current awareness of the focused process." (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware ea3)) (get-focus! this)) + ((and (= s5-0 (enemy-aware hostile)) (get-focus! this)) (go-hostile this) ) ((<= (the-as int s5-0) 0) @@ -537,7 +569,7 @@ ((>= 1 (the-as int s5-0)) (go (method-of-object this active)) ) - ((= s5-0 (enemy-aware ea4)) + ((= s5-0 (enemy-aware flee)) (go-flee this) ) (else @@ -548,15 +580,17 @@ ) ;; definition for method 102 of type enemy -(defmethod go-directed2 ((this enemy)) +(defmethod go-next-state-auto ((this enemy)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (if (logtest? (enemy-flag directed) (-> this enemy-flags)) (go-directed this) - (go-best-state this) + (go-state-for-focused this) ) ) ;; definition for method 81 of type enemy (defmethod go-die ((this enemy)) + "Go to the die state." (if (-> this enemy-info use-die-falling) (go (method-of-object this die-falling)) (go (method-of-object this die)) @@ -566,6 +600,7 @@ ;; definition for method 146 of type enemy ;; INFO: Used lq/sq (defmethod play-damage-sound ((this enemy) (arg0 int)) + "Pick and play the damage/death sound." (let ((name (static-sound-name ""))) (let ((v1-0 arg0)) (cond @@ -588,11 +623,12 @@ ;; definition for method 103 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-103 ((this enemy) (arg0 vector) (arg1 float)) +(defmethod heading-matches-direction? ((this enemy) (arg0 vector) (arg1 float)) + "Does this enemy's heading match the given heading? Threshold in degrees." (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (set! (-> s5-0 y) 0.0) @@ -602,14 +638,16 @@ ) ;; definition for method 104 of type enemy -(defmethod enemy-method-104 ((this enemy) (arg0 vector) (arg1 float)) +(defmethod pointing-toward? ((this enemy) (arg0 vector) (arg1 float)) + "Is this enemy pointing toward the given point? Threshold in degrees." (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) - (enemy-method-103 this v1-1 arg1) + (heading-matches-direction? this v1-1 arg1) ) ) ;; definition for method 105 of type enemy -(defmethod enemy-method-105 ((this enemy) (arg0 float) (arg1 symbol)) +(defmethod pointing-toward-focus? ((this enemy) (arg0 float) (arg1 symbol)) + "Is this enemy pointing toward its focused process?" (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 @@ -617,7 +655,7 @@ (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) ) ) - (enemy-method-103 this s4-1 arg0) + (heading-matches-direction? this s4-1 arg0) ) ) (else @@ -628,7 +666,8 @@ ) ;; definition for method 110 of type enemy -(defmethod send-attack ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (let ((a0-1 (-> this enemy-info attack-damage))) (if (and (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (= a0-1 1)) (set! a0-1 2) @@ -661,22 +700,23 @@ ;; definition for method 111 of type enemy ;; WARN: Return type mismatch enemy-flag vs none. (defmethod on-attack ((this enemy) (arg0 process-focusable)) + "Handler after this enemy attacks something. By default focuses on the attacked, but could be overriden." (when (logtest? (process-mask target bot) (-> arg0 mask)) (set! (-> this root penetrated-by) (the-as penetrate -1)) - (reset-penetrate! this) + (reset-penetrate-later! this) ) (let ((s5-0 (if (type? arg0 process-focusable) arg0 ) ) ) - (when (can-collide-with-focus? this s5-0) + (when (can-focus-on? this s5-0) (let ((v1-10 (handle->process (-> this focus handle)))) (when (or (= s5-0 v1-10) (and (not (logtest? (enemy-flag lock-focus) (-> this enemy-flags))) (or (not v1-10) (not (logtest? (-> this focus flags) (enemy-flag look-at-focus)))) ) ) - (enemy-method-70 this s5-0 (the-as enemy-aware #f)) + (set-focus! this s5-0 (the-as enemy-aware #f)) (set-time! (-> this hit-focus-time)) (logior! (-> this enemy-flags) (enemy-flag victory)) ) @@ -688,7 +728,8 @@ ;; definition for method 53 of type enemy ;; WARN: Return type mismatch time-frame vs none. -(defmethod reset-penetrate! ((this enemy)) +(defmethod reset-penetrate-later! ((this enemy)) + "After a little bit, reset the penetrate flags back to default." (logior! (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) (set-time! (-> this auto-reset-penetrate-time)) (none) @@ -697,7 +738,8 @@ ;; definition for method 54 of type enemy ;; INFO: Used lq/sq (defmethod get-knockback-dir! ((this enemy) (arg0 vector)) - (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + "Compute the knockback direction for an incoming attack." + (vector-copy! arg0 (-> this incoming attack-direction)) (let ((v1-1 arg0)) (when (= (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))) 0.0) (vector-z-quaternion! arg0 (-> this root quat)) @@ -709,47 +751,47 @@ ) ;; definition for method 142 of type enemy -;; WARN: Return type mismatch int vs knocked-type. (defmethod penetrate->knocked-type ((this enemy) (arg0 penetrate)) - (the-as knocked-type (cond - ((logtest? arg0 (penetrate vehicle)) - 7 - ) - ((logtest? (penetrate jak-blue-shot) arg0) - 6 - ) - ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) - 4 - ) - ((logtest? (penetrate jak-red-shot) arg0) - 5 - ) - ((logtest? (penetrate dark-bomb dark-smack) arg0) - 3 - ) - ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) - 2 - ) - ((logtest? arg0 (penetrate mech-punch)) - 1 - ) - (else - 0 - ) - ) - ) + "Based on the penetrate of an attacker, pick the knocked-type." + (cond + ((logtest? arg0 (penetrate vehicle)) + (knocked-type vehicle) + ) + ((logtest? (penetrate jak-blue-shot) arg0) + (knocked-type blue-shot) + ) + ((logtest? (penetrate jak-yellow-shot enemy-yellow-shot) arg0) + (knocked-type yellow-shot) + ) + ((logtest? (penetrate jak-red-shot) arg0) + (knocked-type red-shot) + ) + ((logtest? (penetrate dark-bomb dark-smack) arg0) + (knocked-type dark-shot) + ) + ((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0) + (knocked-type explode-or-darkjak) + ) + ((logtest? arg0 (penetrate mech-punch)) + (knocked-type mech-punch) + ) + (else + (knocked-type none) + ) + ) ) ;; definition for method 112 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod get-incoming-attack! ((this enemy) - (arg0 process-drawable) - (arg1 event-message-block) - (arg2 penetrate) - (arg3 attack-info) - (arg4 touching-shapes-entry) - ) +(defmethod handle-incoming-attack! ((this enemy) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + "Set up this enemy to handle an incoming attack event." (set! (-> this incoming penetrate-using) arg2) (set! (-> this incoming attack-id) (-> arg3 id)) (let ((v1-3 (if (logtest? (attack-mask knock) (-> arg3 mask)) @@ -776,13 +818,13 @@ ) (cond ((= v1-3 (knocked-type vehicle)) - (set! (-> this incoming attack-direction quad) (-> arg3 vector quad)) + (vector-copy! (-> this incoming attack-direction) (-> arg3 vector)) ) (else (let ((s2-0 (new 'stack-no-clear 'attack-info))) (attack-info-method-9 arg3 s2-0 arg0 this) - (set! (-> this incoming attacker-pos quad) (-> s2-0 intersection quad)) - (set! (-> this incoming attack-direction quad) (-> s2-0 attacker-velocity quad)) + (vector-copy! (-> this incoming attacker-pos) (-> s2-0 intersection)) + (vector-copy! (-> this incoming attack-direction) (-> s2-0 attacker-velocity)) ) ) ) @@ -806,6 +848,7 @@ ;; definition for method 115 of type enemy ;; WARN: Return type mismatch int vs none. (defmethod set-look-at-mode! ((this enemy) (arg0 int)) + "Pick between 1: look at the focus, or 2: look at where you're going." (case arg0 ((1) (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) @@ -826,6 +869,7 @@ ;; definition for method 116 of type enemy ;; WARN: Return type mismatch int vs none. (defmethod stop-look-at! ((this enemy)) + "Stop looking at something. Disables neck joint mod." (when (nonzero? (-> this neck)) (logclear! (-> this enemy-flags) (enemy-flag look-at-focus look-at-move-dest)) (shut-down (-> this neck)) @@ -835,7 +879,10 @@ ) ;; definition for method 136 of type enemy -(defmethod set-ground-pat! ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) +(defmethod find-ground-and-set-pat! ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) + "Figure out what ground we're standing on and update the ground-pat. + Usually this will be done automatically by the collision system. + This method should be called after manually repositioning an enemy." (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) (let ((v0-1 (-> arg0 best-other-tri pat))) (set! (-> this root ground-pat) v0-1) @@ -846,28 +893,30 @@ ;; definition for method 137 of type enemy (defmethod enemy-above-ground? ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) + "Is this enemy above the ground?" (above-ground? (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) ) ;; definition for method 138 of type enemy ;; INFO: Used lq/sq -(defmethod try-locate-ground ((this enemy) (arg0 meters) (arg1 meters) (arg2 symbol) (arg3 collide-spec)) +(defmethod move-to-ground ((this enemy) (arg0 meters) (arg1 meters) (arg2 symbol) (arg3 collide-spec)) + "Snap the enemy to the ground below." (let ((s4-0 (new 'stack-no-clear 'collide-query))) (cond - ((set-ground-pat! this s4-0 arg3 arg0 arg1 1024.0 (the-as process #f)) + ((find-ground-and-set-pat! this s4-0 arg3 arg0 arg1 1024.0 (the-as process #f)) (let ((s5-1 (-> this root))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this root trans)) (set! (-> s3-0 y) (-> s4-0 best-other-tri intersect y)) (move-to-point! s5-1 s3-0) (let ((a0-3 (-> s4-0 best-other-tri normal)) (v1-8 (-> s4-0 best-other-tri pat)) ) - (set! (-> s5-1 ground-touch-point quad) (-> s3-0 quad)) - (set! (-> s5-1 poly-normal quad) (-> a0-3 quad)) - (set! (-> s5-1 surface-normal quad) (-> a0-3 quad)) - (set! (-> s5-1 local-normal quad) (-> a0-3 quad)) - (set! (-> s5-1 ground-poly-normal quad) (-> a0-3 quad)) + (vector-copy! (-> s5-1 ground-touch-point) s3-0) + (vector-copy! (-> s5-1 poly-normal) a0-3) + (vector-copy! (-> s5-1 surface-normal) a0-3) + (vector-copy! (-> s5-1 local-normal) a0-3) + (vector-copy! (-> s5-1 ground-poly-normal) a0-3) (set! (-> s5-1 poly-pat) v1-8) (set! (-> s5-1 cur-pat) v1-8) (set! (-> s5-1 ground-pat) v1-8) @@ -898,9 +947,9 @@ ) (when (not (logtest? (-> v1-11 root-prim prim-core action) (collide-action no-normal-reset))) (let ((a0-12 (-> v1-11 dynam gravity-normal))) - (set! (-> v1-11 local-normal quad) (-> a0-12 quad)) - (set! (-> v1-11 surface-normal quad) (-> a0-12 quad)) - (set! (-> v1-11 poly-normal quad) (-> a0-12 quad)) + (vector-copy! (-> v1-11 local-normal) a0-12) + (vector-copy! (-> v1-11 surface-normal) a0-12) + (vector-copy! (-> v1-11 poly-normal) a0-12) ) (set! (-> v1-11 coverage) 0.0) (set! (-> v1-11 touch-angle) 0.0) @@ -919,20 +968,29 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod move-above-ground! ((this enemy) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) - (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) - (set! (-> arg1 old-gspot-normal quad) (-> gp-0 gspot-normal quad)) + (vector-copy! (-> arg1 old-gspot-pos) (-> gp-0 gspot-pos)) + (vector-copy! (-> arg1 old-gspot-normal) (-> gp-0 gspot-normal)) (set! (-> gp-0 trans-old-old-old quad) (-> gp-0 trans-old-old quad)) (set! (-> gp-0 trans-old-old quad) (-> gp-0 trans-old quad)) (set! (-> gp-0 trans-old quad) (-> gp-0 trans quad)) (set! (-> gp-0 prev-status) (-> gp-0 status)) (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) - (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) + (vector-copy! (-> arg1 new-pos) (-> gp-0 trans)) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (cond - ((set-ground-pat! this s2-0 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0 (the-as process #f)) + ((find-ground-and-set-pat! + this + s2-0 + (-> arg1 gnd-collide-with) + (-> arg1 popup) + 81920.0 + 1024.0 + (the-as process #f) + ) (when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y)) (set! (-> arg1 on-ground?) #t) (set! (-> arg1 pat) (-> s2-0 best-other-tri pat)) @@ -948,7 +1006,7 @@ ) ) ) - (set! (-> gp-0 trans quad) (-> gp-0 trans-old quad)) + (vector-copy! (-> gp-0 trans) (-> gp-0 trans-old)) (move-to-point! gp-0 (-> arg1 new-pos)) (when (logtest? (logand (-> arg1 overlaps-params collide-with-filter) (collide-spec hit-by-player-list hit-by-others-list player-list) @@ -959,8 +1017,8 @@ (when (-> arg1 dont-move-if-overlaps?) (set! (-> arg1 do-move?) #f) (move-to-point! gp-0 (-> gp-0 trans-old)) - (set! (-> gp-0 gspot-pos quad) (-> arg1 old-gspot-pos quad)) - (set! (-> gp-0 gspot-normal quad) (-> arg1 old-gspot-normal quad)) + (vector-copy! (-> gp-0 gspot-pos) (-> arg1 old-gspot-pos)) + (vector-copy! (-> gp-0 gspot-normal) (-> arg1 old-gspot-normal)) ) ) ) @@ -971,11 +1029,11 @@ (a0-21 (-> gp-0 gspot-normal)) (v1-39 (-> arg1 pat)) ) - (set! (-> gp-0 ground-touch-point quad) (-> a1-6 quad)) - (set! (-> gp-0 poly-normal quad) (-> a0-21 quad)) - (set! (-> gp-0 surface-normal quad) (-> a0-21 quad)) - (set! (-> gp-0 local-normal quad) (-> a0-21 quad)) - (set! (-> gp-0 ground-poly-normal quad) (-> a0-21 quad)) + (vector-copy! (-> gp-0 ground-touch-point) a1-6) + (vector-copy! (-> gp-0 poly-normal) a0-21) + (vector-copy! (-> gp-0 surface-normal) a0-21) + (vector-copy! (-> gp-0 local-normal) a0-21) + (vector-copy! (-> gp-0 ground-poly-normal) a0-21) (set! (-> gp-0 poly-pat) v1-39) (set! (-> gp-0 cur-pat) v1-39) (set! (-> gp-0 ground-pat) v1-39) @@ -1002,9 +1060,9 @@ ) (when (not (logtest? (-> gp-0 root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-49 (-> gp-0 dynam gravity-normal))) - (set! (-> gp-0 local-normal quad) (-> v1-49 quad)) - (set! (-> gp-0 surface-normal quad) (-> v1-49 quad)) - (set! (-> gp-0 poly-normal quad) (-> v1-49 quad)) + (vector-copy! (-> gp-0 local-normal) v1-49) + (vector-copy! (-> gp-0 surface-normal) v1-49) + (vector-copy! (-> gp-0 poly-normal) v1-49) ) (set! (-> gp-0 coverage) 0.0) (set! (-> gp-0 touch-angle) 0.0) @@ -1020,6 +1078,7 @@ ;; definition for method 117 of type enemy ;; WARN: Return type mismatch int vs none. (defmethod apply-friction ((this enemy)) + "Slow down the enemy due to friction with the ground." (let ((v1-0 (-> this root))) (when (logtest? (-> v1-0 status) (collide-status touch-surface)) (let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> this enemy-info friction))))))) @@ -1035,6 +1094,7 @@ ;; definition for method 120 of type enemy ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this enemy)) + "Typical place to construct collision shapes" 0 (none) ) @@ -1042,18 +1102,21 @@ ;; definition for method 121 of type enemy ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this enemy)) + "Typical place for shared init code. Runs from entity or process style init." 0 (none) ) ;; definition for method 122 of type enemy -(defmethod go-idle2 ((this enemy)) +(defmethod go-fallback-init ((this enemy)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this idle)) ) ;; definition for method 118 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-info! ((this enemy) (arg0 enemy-info)) +(defmethod set-enemy-info! ((this enemy) (arg0 enemy-info)) + "Set the enemy-info" (set! (-> this enemy-info) arg0) (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) (set! (-> this neck) @@ -1073,7 +1136,8 @@ ;; definition for method 119 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-defaults! ((this enemy) (arg0 enemy-info)) +(defmethod setup-enemy! ((this enemy) (arg0 enemy-info)) + "Initialize the enemy by setting all the enemy-specific fields." (local-vars (sv-16 res-tag)) (when (coin-flip? this) (let ((a0-2 (-> this node-list data 2))) @@ -1086,7 +1150,7 @@ (logior! (-> this mask) (process-mask enemy)) (logior! (-> this mask) (process-mask actor-pause)) (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) - (init-enemy-info! this arg0) + (set-enemy-info! this arg0) (set! (-> this ragdoll-proc) (the-as handle #f)) (let ((a1-2 (-> this enemy-info idle-anim-script))) (if a1-2 @@ -1169,7 +1233,7 @@ ) (set! (-> this penetrate-flinch) (-> arg0 penetrate-flinch)) (set! (-> this penetrate-knocked) (-> arg0 penetrate-knocked)) - (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.6))) + (set! (-> this reaction-time) (rnd-time-frame this (seconds 0.1) (seconds 0.6))) (let* ((v1-77 (-> this enemy-flags)) (a0-28 (-> this fact enemy-options)) (v1-78 @@ -1190,7 +1254,7 @@ (not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) ) - (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) ) (if (zero? (-> this draw light-index)) (set! (-> this draw light-index) (the-as uint 10)) @@ -1200,7 +1264,8 @@ ) ;; definition for method 152 of type enemy -(defmethod enemy-method-152 ((this enemy)) +(defmethod gem-chance ((this enemy)) + "The chance of this enemy having a gem." 1.0 ) @@ -1211,6 +1276,7 @@ ;; definition for function enemy-setup-gem (defbehavior enemy-setup-gem enemy () + "Determine if the enemy should have a gem and set drawing masks/particles as needed." (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag has-gem)))) (when (> (-> self enemy-info gem-joint) 0) (let ((gp-0 (get-gem-pool-idx self))) @@ -1222,7 +1288,7 @@ (and (nonzero? gp-0) (let* ((v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-15 (the-as number (logior #x3f800000 v1-14))) ) - (< (+ -1.0 (the-as float v1-15)) (enemy-method-152 self)) + (< (+ -1.0 (the-as float v1-15)) (gem-chance self)) ) ) ) @@ -1253,6 +1319,7 @@ ;; definition for function enemy-init-by-other ;; INFO: Used lq/sq (defbehavior enemy-init-by-other enemy ((arg0 process-drawable) (arg1 enemy-init-by-other-params)) + "Function to initialize an enemy from a parent process." (let ((a1-1 (-> arg1 entity))) (if a1-1 (process-entity-set! self a1-1) @@ -1274,7 +1341,7 @@ ) ) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg1 trans quad)) + (vector-copy! (-> self root trans) (-> arg1 trans)) (quaternion-copy! (-> self root quat) (-> arg1 quat)) (vector-identity! (-> self root scale)) (init-enemy! self) @@ -1295,10 +1362,10 @@ (go-dormant-aware self) ) ((logtest? (enemy-option ambush) (-> self fact enemy-options)) - (go-ambush-delay self) + (go-ambush self) ) (else - (go-idle2 self) + (go-fallback-init self) ) ) ) @@ -1306,6 +1373,7 @@ ;; definition for method 11 of type enemy (defmethod init-from-entity! ((this enemy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((a1-2 (res-lump-struct arg0 'art-level symbol))) (when a1-2 (let ((a0-3 (level-get *level* a1-2))) @@ -1335,19 +1403,21 @@ (go-dormant-aware this) ) (else - (go-idle2 this) + (go-fallback-init this) ) ) ) ) ;; definition for method 107 of type enemy -(defmethod is-pfoc-in-mesh? ((this enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this enemy) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." #t ) ;; definition for method 108 of type enemy -(defmethod enemy-method-108 ((this enemy) (arg0 process-focusable)) +(defmethod should-flee-from? ((this enemy) (arg0 process-focusable)) + "Return if this enemy should flee from the process." #f ) @@ -1358,13 +1428,14 @@ (let ((t9-0 (method-of-type focus reset-to-collide-spec))) (t9-0 this arg0) ) - (set! (-> this aware) (enemy-aware ea0)) + (set! (-> this aware) (enemy-aware unaware)) 0 (none) ) ;; definition for method 140 of type enemy (defmethod update-focus ((this enemy)) + "Potentially update the focus, if there is something better to focus on." (let ((gp-0 (-> this focus))) (let ((a1-0 (handle->process (-> gp-0 handle)))) (when a1-0 @@ -1378,9 +1449,11 @@ (find-best-focus this) (return (the-as process #f)) ) - (let ((v1-14 - (get-enemy-aware this (update-awareness! this (the-as process-focusable a1-0) (the-as enemy-best-focus #f))) - ) + (let ((v1-14 (modify-awareness + this + (get-awareness-of-proc this (the-as process-focusable a1-0) (the-as enemy-best-focus #f)) + ) + ) ) (set! (-> gp-0 aware) v1-14) (if (>= 1 (the-as int v1-14)) @@ -1407,12 +1480,13 @@ ;; definition for method 106 of type enemy (defmethod find-best-focus ((this enemy)) + "Search for the best thing to focus on." (let ((s4-0 (-> this focus collide-with)) (gp-0 (new 'stack-no-clear 'enemy-best-focus)) ) (set! (-> gp-0 proc) #f) (set! (-> gp-0 rating) 409600000.0) - (set! (-> gp-0 aware) (enemy-aware ea0)) + (set! (-> gp-0 aware) (enemy-aware unaware)) (when (logtest? s4-0 (collide-spec player-list)) (let ((v1-4 (-> *collide-player-list* alive-list next0))) *collide-player-list* @@ -1430,7 +1504,7 @@ (and a1-1 (not (logtest? (-> (the-as process-focusable a1-1) focus-status) (focus-status disable dead)))) (!= this a1-1) ) - (update-awareness! this (the-as process-focusable a1-1) gp-0) + (get-awareness-of-proc this (the-as process-focusable a1-1) gp-0) ) ) ) @@ -1460,7 +1534,7 @@ (and a1-3 (not (logtest? (-> (the-as process-focusable a1-3) focus-status) (focus-status disable dead)))) (!= this a1-3) ) - (update-awareness! this (the-as process-focusable a1-3) gp-0) + (get-awareness-of-proc this (the-as process-focusable a1-3) gp-0) ) ) ) @@ -1489,7 +1563,7 @@ (and a1-5 (not (logtest? (-> (the-as process-focusable a1-5) focus-status) (focus-status disable dead)))) (!= this a1-5) ) - (update-awareness! this (the-as process-focusable a1-5) gp-0) + (get-awareness-of-proc this (the-as process-focusable a1-5) gp-0) ) ) ) @@ -1504,7 +1578,7 @@ ) (let ((s4-1 (-> gp-0 proc))) (when s4-1 - (enemy-method-70 this (the-as process-focusable s4-1) (get-enemy-aware this (-> gp-0 aware))) + (set-focus! this (the-as process-focusable s4-1) (modify-awareness this (-> gp-0 aware))) s4-1 ) ) @@ -1513,7 +1587,8 @@ ;; definition for method 64 of type enemy ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-awareness! ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod get-awareness-of-proc ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) + "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (let ((f30-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans))) (s3-1 #f) (s2-0 #f) @@ -1521,7 +1596,7 @@ (cond ((< f30-0 (-> this enemy-info proximity-notice-distance)) (set! s3-1 #t) - (set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f))) + (set! s2-0 (can-become-hostile-to? this arg0 (the-as vector #f))) ) (else (let ((f0-1 (the-as float (-> this enemy-info notice-distance)))) @@ -1529,7 +1604,7 @@ (set! f0-1 (+ (the-as meters f0-1) (-> this enemy-info notice-distance-delta))) ) (when (or (< f30-0 f0-1) (not (logtest? (-> this enemy-flags) (enemy-flag use-notice-distance)))) - (set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f))) + (set! s2-0 (can-become-hostile-to? this arg0 (the-as vector #f))) (if s2-0 (set! s3-1 #t) ) @@ -1540,22 +1615,22 @@ (let ((aware (cond (s3-1 (cond - ((enemy-method-108 this arg0) - (the-as enemy-aware (enemy-aware ea4)) + ((should-flee-from? this arg0) + (the-as enemy-aware (enemy-aware flee)) ) (s2-0 - (the-as enemy-aware (enemy-aware ea3)) + (the-as enemy-aware (enemy-aware hostile)) ) (else - (the-as enemy-aware (enemy-aware ea2)) + (the-as enemy-aware (enemy-aware aware2)) ) ) ) ((< f30-0 (-> this fact idle-distance)) - (the-as enemy-aware (enemy-aware ea1)) + (the-as enemy-aware (enemy-aware aware1)) ) (else - (the-as enemy-aware (enemy-aware ea0)) + (the-as enemy-aware (enemy-aware unaware)) ) ) ) @@ -1563,13 +1638,13 @@ (when (and (> (the-as int aware) 0) (logtest? (enemy-flag use-trigger) (-> this enemy-flags))) (cond ((logtest? (enemy-option idle-til-trigger) (-> this fact enemy-options)) - (if (not (enemy-method-141 this f30-0)) - (set! aware (enemy-aware ea0)) + (if (not (check-awareness-trigger this f30-0)) + (set! aware (enemy-aware unaware)) ) ) (else - (if (and (< 1 (the-as int aware)) (not (enemy-method-141 this f30-0))) - (set! aware (enemy-aware ea1)) + (if (and (< 1 (the-as int aware)) (not (check-awareness-trigger this f30-0))) + (set! aware (enemy-aware aware1)) ) ) ) @@ -1587,7 +1662,8 @@ ) ;; definition for method 141 of type enemy -(defmethod enemy-method-141 ((this enemy) (arg0 float)) +(defmethod check-awareness-trigger ((this enemy) (arg0 float)) + "Check triggering logic for awareness to see if this enemy can become aware yet." (let* ((v1-0 (-> this fact)) (a2-0 (-> v1-0 trig-mask-count)) (a3-0 (-> v1-0 trig-mask)) @@ -1621,8 +1697,8 @@ ) ;; definition for method 68 of type enemy -;; WARN: Return type mismatch int vs enemy-aware. -(defmethod get-enemy-aware ((this enemy) (arg0 enemy-aware)) +(defmethod modify-awareness ((this enemy) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." (let ((v1-1 (< 1 (the-as int arg0)))) (cond (v1-1 @@ -1640,24 +1716,24 @@ (logclear! (-> this enemy-flags) (enemy-flag notice)) ) ) - (the-as enemy-aware (cond - (v1-1 - (the-as int arg0) - ) - ((or (= arg0 (enemy-aware ea0)) (time-elapsed? (-> this last-draw-time) (seconds 2))) - 0 - ) - (else - 1 - ) - ) - ) + (cond + (v1-1 + arg0 + ) + ((or (= arg0 (enemy-aware unaware)) (time-elapsed? (-> this last-draw-time) (seconds 2))) + (enemy-aware unaware) + ) + (else + (enemy-aware aware1) + ) + ) ) ) ;; definition for method 82 of type enemy ;; INFO: Used lq/sq (defmethod event-handler ((this enemy) (proc process) (argc int) (msg symbol) (block event-message-block)) + "Commmon handler for events." (local-vars (s5-6 rgbaf) (sv-640 event-message-block) (sv-656 process) (sv-672 event-message-block)) (cond ((= msg 'go-gun-dark-2-stretch) @@ -1713,7 +1789,7 @@ ) ) ) - (send-attack-on-jump-or-knocked this proc block) + (enemy-touched-handler this proc block) ) ((= msg 'attack-invinc) (case (-> (the-as attack-info (-> block param 1)) mode) @@ -1730,7 +1806,7 @@ ((= msg 'attack-no-avoid) (let* ((s2-0 (-> block param 1)) (s3-4 this) - (s1-0 (method-of-object s3-4 get-incoming-attack!)) + (s1-0 (method-of-object s3-4 handle-incoming-attack!)) (s0-0 proc) ) (set! sv-640 block) @@ -1747,7 +1823,7 @@ ) ) ) - (damage-enemy! this proc block) + (damage-enemy-from-attack! this proc block) ) ((= msg 'attack) (let ((s2-1 (the-as object (-> block param 1)))) @@ -1757,7 +1833,7 @@ (not (logtest? (-> this focus-status) (focus-status grabbed))) ) (let* ((s1-1 this) - (s0-1 (method-of-object s1-1 get-incoming-attack!)) + (s0-1 (method-of-object s1-1 handle-incoming-attack!)) ) (set! sv-656 proc) (set! sv-672 block) @@ -1777,12 +1853,12 @@ (send-event (ppointer->process (-> this parent)) 'child-hit) (let ((f0-1 0.0)) (if (not *debug-unkillable*) - (set! f0-1 (damage-enemy! this proc block)) + (set! f0-1 (damage-enemy-from-attack! this proc block)) ) - (let ((s2-2 (penetrate->next-state this proc block f0-1))) + (let ((s2-2 (msg-for-incoming-attack this proc block f0-1))) (when s2-2 (logclear! (-> this enemy-flags) (enemy-flag use-trigger)) - (send-attack-to-all-tshapes this (the-as process-focusable proc) block) + (find-and-damage-attackers this (the-as process-focusable proc) block) (let ((a1-17 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-17 from) (process->ppointer proc)) (set! (-> a1-17 num-params) argc) @@ -1843,7 +1919,7 @@ (set! (-> s5-1 attacker) (the-as handle v1-85)) ) (logior! (-> s5-1 mask) (attack-mask attacker)) - (let ((v1-89 (scale-impact-vel-y! + (let ((v1-89 (attack-direction-from-impact-vel this (new 'stack-no-clear 'vector) (vector-negate! (new 'stack-no-clear 'vector) (-> (the-as rigid-body-impact s4-1) velocity)) @@ -1851,14 +1927,14 @@ ) ) ) - (set! (-> s5-1 attacker-velocity quad) (-> v1-89 quad)) - (set! (-> s5-1 vector quad) (-> v1-89 quad)) + (vector-copy! (-> s5-1 attacker-velocity) v1-89) + (vector-copy! (-> s5-1 vector) v1-89) ) (logior! (-> s5-1 mask) (attack-mask attacker-velocity)) (logior! (-> s5-1 mask) (attack-mask vector)) - (set! (-> s5-1 intersection quad) (-> (the-as rigid-body-impact s4-1) point quad)) + (vector-copy! (-> s5-1 intersection) (-> (the-as rigid-body-impact s4-1) point)) (logior! (-> s5-1 mask) (attack-mask intersection)) - (set! (-> s5-1 damage) (lerp-damage this f30-1)) + (set! (-> s5-1 damage) (impact-velocity-to-hit-points this f30-1)) (logior! (-> s5-1 mask) (attack-mask damage)) (when (< 0.0 (-> s5-1 damage)) (format @@ -1889,7 +1965,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action proc) (send-event proc 'get-attack-count 1) @@ -1908,7 +1984,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action proc) (send-event proc 'get-attack-count 1) @@ -1933,7 +2009,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action proc) (send-event proc 'get-attack-count 1) @@ -1955,7 +2031,7 @@ (cond (v1-202 (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) - (go-ambush-delay this) + (go-ambush this) (go-hostile this) ) ) @@ -1964,7 +2040,7 @@ ) ) (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) - (go-ambush-delay this) + (go-ambush this) (go (method-of-object this notice)) ) ) @@ -1980,8 +2056,8 @@ ) (logclear! (-> this enemy-flags) (enemy-flag directed directed-ready use-trigger)) (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) - (go-ambush-delay this) - (go-best-state this) + (go-ambush this) + (go-state-for-focused this) ) #t ) @@ -1993,7 +2069,7 @@ ) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this jump-why) (-> block param 0)) - (set! (-> this event-param-point quad) (-> (the-as vector (-> block param 1)) quad)) + (vector-copy! (-> this event-param-point) (the-as vector (-> block param 1))) (go (method-of-object this jump)) ) ) @@ -2047,7 +2123,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (go-die this) ) @@ -2139,14 +2215,17 @@ ) ;; definition for method 60 of type enemy -(defmethod lerp-damage ((this enemy) (arg0 float)) +(defmethod impact-velocity-to-hit-points ((this enemy) (arg0 float)) + "Given an impact velocity, compute hit points." (lerp-scale 0.0 (-> this enemy-info default-hit-points) arg0 20480.0 122880.0) ) ;; definition for method 61 of type enemy ;; INFO: Used lq/sq -(defmethod scale-impact-vel-y! ((this enemy) (arg0 vector) (arg1 vector) (arg2 float)) - (set! (-> arg0 quad) (-> arg1 quad)) +(defmethod attack-direction-from-impact-vel ((this enemy) (arg0 vector) (arg1 vector) (arg2 float)) + "Compute the direction of an attack given an impact velocity. + This reduces the vertical component, probably to avoid sending the enemy into the air too much." + (vector-copy! arg0 arg1) (vector-normalize! arg0 arg2) (set! (-> arg0 y) (lerp-scale (-> this enemy-info knocked-hard-vy-lo) @@ -2162,6 +2241,7 @@ ;; definition for method 62 of type enemy (defmethod get-damage-from-attack ((this enemy) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let ((v1-0 (the-as object (-> arg1 param 1)))) (if (logtest? (attack-mask damage) (-> (the-as attack-info v1-0) mask)) (-> (the-as attack-info v1-0) damage) @@ -2171,7 +2251,10 @@ ) ;; definition for method 63 of type enemy -(defmethod enemy-method-63 ((this enemy) (arg0 float)) +(defmethod apply-incoming-hitpoint-mods ((this enemy) (arg0 float)) + "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (let ((f0-1 (fmax 0.0 (fmin arg0 (-> this hit-points))))) (cond ((and (= (-> this incoming knocked-type) (knocked-type blue-shot)) (= f0-1 (-> this hit-points)) (< 0.0 f0-1)) @@ -2196,13 +2279,14 @@ ) ;; definition for method 65 of type enemy -(defmethod penetrate->next-state ((this enemy) (arg0 process) (arg1 event-message-block) (arg2 float)) +(defmethod msg-for-incoming-attack ((this enemy) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." (let ((gp-0 (-> this incoming penetrate-using))) (cond ((and (logtest? (penetrate jak-dark-blackhole) gp-0) #t) 'go-gun-dark-2-stretch ) - ((and (logtest? (penetrate jak-dark-nuke) (-> this incoming penetrate-using)) (enemy-method-150 this)) + ((and (logtest? (penetrate jak-dark-nuke) (-> this incoming penetrate-using)) (can-be-nuked? this)) 'go-gun-dark-3-nuke ) ((logtest? gp-0 (-> this penetrate-flinch)) @@ -2219,9 +2303,10 @@ ) ;; definition for method 52 of type enemy -(defmethod damage-enemy! ((this enemy) (arg0 object) (arg1 event-message-block)) +(defmethod damage-enemy-from-attack! ((this enemy) (arg0 object) (arg1 event-message-block)) + "Given an attack message, apply damage." (let* ((f0-0 (get-damage-from-attack this arg0 arg1)) - (f30-0 (enemy-method-63 this f0-0)) + (f30-0 (apply-incoming-hitpoint-mods this f0-0)) ) (set! (-> this hit-points) (- (-> this hit-points) f30-0)) (if (not (logtest? (-> this enemy-flags) (enemy-flag auto-reset-penetrate))) @@ -2233,11 +2318,15 @@ ;; definition for method 145 of type enemy (defmethod find-offending-pfoc ((this enemy) (arg0 process) (arg1 attack-info)) + "Figure out the attacker process from the attack message sender and attack-info. + This is to handle cases where the attacker process is a non-focusable subprocess, + or the attacker is driving a vehicle." (find-offending-process-focusable arg0 arg1) ) ;; definition for method 83 of type enemy (defmethod enemy-touch-handler ((this enemy) (arg0 process) (arg1 event-message-block)) + "General handler for an event when a process intentionally sends a touch event." (let* ((s4-0 (-> arg1 param 0)) (s2-0 arg0) (s3-0 (if (type? s2-0 process-focusable) @@ -2269,7 +2358,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s4-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s4-0) a3-2) ) ) ((and ((method-of-type touching-shapes-entry prims-touching-action?) @@ -2294,7 +2383,8 @@ ;; definition for method 84 of type enemy ;; WARN: Return type mismatch symbol vs object. -(defmethod send-attack-on-jump-or-knocked ((this enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this enemy) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (let ((s4-0 (-> arg1 param 0))) (when s4-0 (when (or (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -2321,7 +2411,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s4-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s4-0) a3-2) ) ) ) @@ -2331,12 +2421,14 @@ ;; definition for function enemy-event-handler (defbehavior enemy-event-handler enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Default event handler for enemy." (event-handler self arg0 arg1 arg2 arg3) ) ;; definition for function enemy-simple-post ;; WARN: Return type mismatch int vs none. (defbehavior enemy-simple-post enemy () + "Default post for enemy." (enemy-common-post self) (update-transforms (-> self root)) 0 @@ -2346,10 +2438,12 @@ ;; definition for function enemy-falling-post ;; INFO: Used lq/sq (defbehavior enemy-falling-post enemy () + "Post function that simply makes the enemy go down. + Collision is enabled, so enemy will bounce off of walls or similar." (let ((gp-0 (-> self root))) (cond ((focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) ) (else (let ((a1-1 (new-stack-vector0))) @@ -2372,7 +2466,8 @@ ) ;; definition for method 51 of type enemy -(defmethod accelerate-fall! ((this enemy) (arg0 vector)) +(defmethod adjust-transv-under-water! ((this enemy) (arg0 vector)) + "Modify the velocity as needed if the enemy is underwater." (let* ((f2-0 0.8) (f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 f2-0))))) ) @@ -2385,15 +2480,17 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior enemy-die-falling-post enemy () + "Post function that causes the enemy to go down until it hits the ground. + Doesn't use full collision system - enemy will stop moving as soon as it hits any ground." (let ((gp-0 (-> self root))) (if (focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 (new-stack-vector0) 0.0)) ) (let ((s4-1 (new 'stack-no-clear 'collide-query)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> gp-0 trans quad)) + (vector-copy! s5-1 (-> gp-0 trans)) (vector-v++! s5-1 (-> gp-0 transv)) (when (find-ground gp-0 @@ -2419,29 +2516,32 @@ ;; definition for method 91 of type enemy ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-91 ((this enemy) (arg0 enemy-jump-info)) +(defmethod check-jump-blocked? ((this enemy) (arg0 enemy-jump-info)) + "Is this jump blocked by something?" #f ) ;; definition for method 92 of type enemy ;; INFO: Used lq/sq (defmethod init-jump-info! ((this enemy) (arg0 enemy-jump-info)) + "Populate an enemy-jump-info for jumping to this enemy's event-param-point" (set! (-> arg0 flags) (enemy-jump-flags ejf0)) (set! (-> arg0 anim-speed) (rnd-float-range this 0.9 1.1)) (set! (-> arg0 hang-time) 0) - (set! (-> arg0 dest-pos quad) (-> this event-param-point quad)) - (set! (-> arg0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> arg0 dest-pos) (-> this event-param-point)) + (vector-copy! (-> arg0 start-pos) (-> this root trans)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (if (enemy-above-ground? this s4-0 (-> arg0 dest-pos) (-> this gnd-collide-with) 8192.0 81920.0 1024.0) (set! (-> arg0 dest-pos y) (-> s4-0 best-other-tri intersect y)) ) ) - (setup-jump! this arg0) + (setup-jump-trajectory! this arg0) (none) ) ;; definition for method 93 of type enemy -(defmethod setup-jump! ((this enemy) (arg0 enemy-jump-info)) +(defmethod setup-jump-trajectory! ((this enemy) (arg0 enemy-jump-info)) + "Compute jump trajectory." (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) (f0-2 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) ) @@ -2451,7 +2551,8 @@ ) ;; definition for method 95 of type enemy -(defmethod on-ground? ((this enemy) (arg0 enemy-jump-info)) +(defmethod landed-jump-yet? ((this enemy) (arg0 enemy-jump-info)) + "Is this on, or close to, the ground?" (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-1 (new 'stack-no-clear 'collide-query))) @@ -2464,6 +2565,7 @@ ;; definition for method 94 of type enemy (defmethod move-to-gspot! ((this enemy)) + "Snap the enemy down onto the cached ground spot (gspot)." (let* ((v1-0 (-> this root)) (f0-0 (-> v1-0 gspot-pos y)) ) @@ -2476,16 +2578,18 @@ ;; definition for method 101 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-101 ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod adjust-heading-for-jump ((this enemy) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Can be overriden. Yaw the enemy in response to an ongoing jump." 0 (none) ) ;; definition for method 100 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod in-jump-handler ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod move-along-ballistic-trajectory-for-jump ((this enemy) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Adjust trans, transv for the jump, if we're airborne." (case arg0 - ((2 3) + (((jump-stage takeoff) (jump-stage in-air)) (let ((f30-0 (the float (-> arg1 hang-time)))) (let ((a1-3 (compute-trans-at-time (-> arg1 traj) f30-0 (new 'stack-no-clear 'vector)))) (move-to-point! (-> this root) a1-3) @@ -2503,6 +2607,7 @@ ;; definition for method 98 of type enemy (defmethod jump-wind-up-anim ((this enemy) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -2522,6 +2627,7 @@ ;; definition for method 96 of type enemy (defmethod jump-in-air-anim ((this enemy) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) (let ((v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -2554,6 +2660,7 @@ ;; definition for method 97 of type enemy (defmethod jump-land-anim ((this enemy) (arg0 enemy-jump-info)) + "Play the landing anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -2572,65 +2679,66 @@ ) ;; definition for method 99 of type enemy -(defmethod jump-anim-handler ((this enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this enemy) (arg0 jump-stage) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) - (let ((v1-0 arg0)) - (cond - ((zero? v1-0) - (not (jump-wind-up-anim this arg1)) - ) - ((= v1-0 1) - (set! s5-0 (ja-done? 0)) - (let ((a0-4 (-> this skel root-channel 0))) - (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) - (set! (-> a0-4 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 - ) - ((= v1-0 2) - (jump-in-air-anim this arg1) - #f - ) - ((= v1-0 3) - (set! s5-0 (ja-done? 0)) - (let ((a0-9 (-> this skel root-channel 0))) - (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) - (set! (-> a0-9 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 + (case arg0 + (((jump-stage init)) + (not (jump-wind-up-anim this arg1)) + ) + (((jump-stage winding-up)) + (set! s5-0 (ja-done? 0)) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) - ((= v1-0 4) - (not (jump-land-anim this arg1)) + (ja-blend-eval) + s5-0 + ) + (((jump-stage takeoff)) + (jump-in-air-anim this arg1) + #f + ) + (((jump-stage in-air)) + (set! s5-0 (ja-done? 0)) + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) + (set! (-> a0-9 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) ) - ((= v1-0 5) - (set! s5-0 (ja-done? 0)) - (let ((a0-14 (-> this skel root-channel 0))) - (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group frames num-frames) -1))) - (set! (-> a0-14 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 + (ja-blend-eval) + s5-0 + ) + (((jump-stage touchdown)) + (not (jump-land-anim this arg1)) + ) + (((jump-stage landing)) + (set! s5-0 (ja-done? 0)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group frames num-frames) -1))) + (set! (-> a0-14 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) ) - (else - #t - ) + (ja-blend-eval) + s5-0 + ) + (else + #t ) ) ) ;; definition for method 109 of type enemy -(defmethod enemy-method-109 ((this enemy)) +(defmethod out-of-bounds? ((this enemy)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." #f ) ;; definition for method 50 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this enemy) (arg0 int)) +(defmethod update-collision-action ((this enemy) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" 0 (none) ) @@ -2648,6 +2756,7 @@ ;; definition for method 56 of type enemy ;; INFO: Used lq/sq (defmethod knocked-handler ((this enemy) (arg0 vector)) + "Called when this enemy is knocked." (local-vars (v0-22 number)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2788,6 +2897,7 @@ ;; definition for method 55 of type enemy ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this enemy)) + "Get the yaw angle for the current knock." (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) @@ -2837,6 +2947,7 @@ ;; definition for method 85 of type enemy (defmethod knocked-anim ((this enemy) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-anim))) (a0-4 (-> this skel root-channel 0)) @@ -2852,6 +2963,7 @@ ;; definition for method 86 of type enemy (defmethod knocked-land-anim ((this enemy) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -2865,7 +2977,8 @@ ) ;; definition for method 88 of type enemy -(defmethod enemy-method-88 ((this enemy) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this enemy) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" (let ((gp-0 (-> this root))) (or (>= (-> arg0 on-surface-count) 3) (and (logtest? (-> gp-0 status) (collide-status on-ground)) (>= 16384.0 (-> gp-0 transv y))) @@ -2882,7 +2995,8 @@ ) ;; definition for method 89 of type enemy -(defmethod within-gspot-range? ((this enemy)) +(defmethod invalid-height? ((this enemy)) + "Return #t if the enemy is too high in the air, or below the ground." (let ((gp-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) ) @@ -2909,7 +3023,10 @@ ;; definition for method 90 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-90 ((this enemy) (arg0 ragdoll-proc)) +(defmethod copy-ragdoll-orientation-to-root ((this enemy) (arg0 ragdoll-proc)) + "Apply rotational offset from ragdolling back to the enemy. + Used when disabling a ragdoll to update the enemy + orientation to match the end of ragdoll orientation." (let* ((s4-0 (-> arg0 ragdoll)) (s2-0 (-> s4-0 ragdoll-joints)) (s1-0 @@ -2934,6 +3051,7 @@ ;; definition for method 87 of type enemy (defmethod knocked-anim-handler ((this enemy) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond @@ -2980,16 +3098,18 @@ ) ;; definition for method 123 of type enemy -(defmethod enemy-method-123 ((this enemy)) +(defmethod allow-ragdoll? ((this enemy)) + "Can this enemy ragdoll now?" #t ) ;; definition for method 126 of type enemy ;; INFO: Used lq/sq (defmethod ragdoll-spawn! ((this enemy) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." (local-vars (s2-0 process)) (with-pp - (when (and (enemy-method-123 this) (-> this enemy-info ragdoll-info)) + (when (and (allow-ragdoll? this) (-> this enemy-info ragdoll-info)) (let ((s3-0 (handle->process (-> this ragdoll-proc)))) (cond (s3-0 @@ -3043,7 +3163,7 @@ ) (vector-float*! s1-0 s1-0 (/ 1.0 (-> pp clock time-adjust-ratio))) (let ((v0-1 (-> (the-as ragdoll-proc s2-0) ragdoll ragdoll-joints 0 velocity))) - (set! (-> v0-1 quad) (-> s1-0 quad)) + (vector-copy! v0-1 s1-0) v0-1 ) ) @@ -3055,7 +3175,8 @@ ;; definition for method 127 of type enemy ;; WARN: Return type mismatch int vs none. (defmethod deactivate-ragdoll! ((this enemy)) - (when (and (enemy-method-123 this) (-> this enemy-info ragdoll-info)) + "Deactivate the ragdoll process." + (when (and (allow-ragdoll? this) (-> this enemy-info ragdoll-info)) (let ((a0-3 (handle->process (-> this ragdoll-proc)))) (when a0-3 (when (and (-> this draw) (-> this draw shadow-ctrl)) @@ -3073,7 +3194,9 @@ ) ;; definition for method 125 of type enemy +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this enemy)) + "Has the ragdoll stopped moving?" (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (or (not s5-0) (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) @@ -3094,7 +3217,7 @@ ) (< (cos (* f1-2 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) ) - (and (not (enemy-method-109 this)) (not (within-gspot-range? this))) + (and (not (out-of-bounds? this)) (not (invalid-height? this))) ) ) ) @@ -3106,11 +3229,12 @@ ;; definition for method 124 of type enemy ;; WARN: Return type mismatch int vs none. (defmethod disable-ragdoll ((this enemy)) + "Smoothly disable the ragdoll and transition back to normal control." (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (when s5-0 (disable-for-duration (the-as ragdoll-proc s5-0) (-> this enemy-info ragdoll-blend-out-time)) (logclear! (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-flags) (ragdoll-flag rf9)) - (enemy-method-90 this (the-as ragdoll-proc s5-0)) + (copy-ragdoll-orientation-to-root this (the-as ragdoll-proc s5-0)) ) ) 0 @@ -3119,5 +3243,6 @@ ;; definition for method 151 of type enemy (defmethod should-move-to-ground? ((this enemy)) + "Should this enemy be moved to the ground while moving?" (-> this enemy-info move-to-ground) ) diff --git a/test/decompiler/reference/jak3/engine/ambient/ambient-h_REF.gc b/test/decompiler/reference/jak3/engine/ambient/ambient-h_REF.gc index 4ddfc416b56..bfb3e95c488 100644 --- a/test/decompiler/reference/jak3/engine/ambient/ambient-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ambient/ambient-h_REF.gc @@ -3,7 +3,12 @@ ;; definition of type talker-speech-class (deftype talker-speech-class (structure) - "Contains metadata about a voice line or hint text being played/displayed." + "Contains metadata about a voice line or hint text being played/displayed. +In the talker state, there's a pos-state and neg-state. +Calling yes-play! adjusts the pos-state and no-play! adjusts the neg-state. +Playback is only allowed if the pos-state is less than or equal to pos +and neg-state is greater than or equal to neg. +" ((name string) (channel gui-channel) (flags talker-flags) @@ -18,11 +23,11 @@ ) :pack-me (:methods - (talker-speech-class-method-9 (_type_) symbol) - (play-communicator-speech! (_type_) none) - (talker-speech-class-method-11 (_type_) none) - (talker-speech-class-method-12 (_type_ int) none) - (talker-speech-class-method-13 (_type_ int) none) + (should-play? (_type_) symbol) + (mark-played! (_type_) none) + (reset-state! (_type_) none) + (yes-play! (_type_ int) none) + (no-play! (_type_ int) none) ) ) @@ -106,7 +111,7 @@ (new 'static 'talker-speech-class :name "DSbop002" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1 :text-duration (seconds 5) :neg #x1 @@ -117,7 +122,7 @@ (new 'static 'talker-speech-class :name "DSbop004" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :text-duration (seconds 5) :neg #x1 @@ -128,7 +133,7 @@ (new 'static 'talker-speech-class :name "DSbop008" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :text-duration (seconds 5) :neg #x1 @@ -139,7 +144,7 @@ (new 'static 'talker-speech-class :name "DSbop010" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :text-duration (seconds 5) :neg #x1 @@ -150,7 +155,7 @@ (new 'static 'talker-speech-class :name "DSbop011" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5 :neg #x1 :on-close #f @@ -159,7 +164,7 @@ (new 'static 'talker-speech-class :name "DSbop016" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x6 :text-duration (seconds 5) :neg #x1 @@ -170,7 +175,7 @@ (new 'static 'talker-speech-class :name "DSbop017" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x7 :neg #x1 :on-close #f @@ -179,7 +184,7 @@ (new 'static 'talker-speech-class :name "ds020" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x8 :text-duration (seconds 5) :neg #x1 @@ -190,7 +195,7 @@ (new 'static 'talker-speech-class :name "ds043" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x9 :text-duration (seconds 1) :neg #x1 @@ -201,7 +206,7 @@ (new 'static 'talker-speech-class :name "ds043m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #xa :text-duration (seconds 1) :neg #x1 @@ -212,7 +217,7 @@ (new 'static 'talker-speech-class :name "ds046" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #xb :text-duration (seconds 1) :neg #x1 @@ -223,7 +228,7 @@ (new 'static 'talker-speech-class :name "ds046m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #xc :text-duration (seconds 1) :neg #x1 @@ -234,7 +239,7 @@ (new 'static 'talker-speech-class :name "dax101" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xd :neg #x1 :on-close #f @@ -243,7 +248,7 @@ (new 'static 'talker-speech-class :name "dax102" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xe :neg #x1 :on-close #f @@ -252,7 +257,7 @@ (new 'static 'talker-speech-class :name "dax103" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #xf :text-duration (seconds 1) :neg #x1 @@ -263,7 +268,7 @@ (new 'static 'talker-speech-class :name "dax104" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x10 :text-duration (seconds 1) :neg #x1 @@ -274,7 +279,7 @@ (new 'static 'talker-speech-class :name "dax105" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x11 :text-duration (seconds 1) :neg #x1 @@ -285,7 +290,7 @@ (new 'static 'talker-speech-class :name "dax106" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x12 :text-duration (seconds 1) :neg #x1 @@ -296,7 +301,7 @@ (new 'static 'talker-speech-class :name "dax107" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x13 :neg #x1 :on-close #f @@ -305,7 +310,7 @@ (new 'static 'talker-speech-class :name "dax108" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x14 :text-duration (seconds 1) :neg #x1 @@ -316,7 +321,7 @@ (new 'static 'talker-speech-class :name "dax109" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x15 :text-duration (seconds 1) :neg #x1 @@ -327,7 +332,7 @@ (new 'static 'talker-speech-class :name "dax110" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16 :neg #x1 :on-close #f @@ -336,7 +341,7 @@ (new 'static 'talker-speech-class :name "dax111" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x17 :text-duration (seconds 1) :neg #x1 @@ -347,7 +352,7 @@ (new 'static 'talker-speech-class :name "dax112" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x18 :text-duration (seconds 1) :neg #x1 @@ -410,7 +415,7 @@ (new 'static 'talker-speech-class :name "demo001" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #x1f :text-duration (seconds 5) :neg #x1 @@ -421,7 +426,7 @@ (new 'static 'talker-speech-class :name "demo002" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x20 :text-duration (seconds 5) :neg #x1 @@ -431,7 +436,7 @@ (new 'static 'talker-speech-class :name "demo003" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x21 :text-duration (seconds 8) :neg #x1 @@ -441,7 +446,7 @@ (new 'static 'talker-speech-class :name "demo004" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x22 :text-duration (seconds 8) :neg #x1 @@ -451,7 +456,7 @@ (new 'static 'talker-speech-class :name "demo005" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x23 :text-duration (seconds 8) :neg #x1 @@ -461,7 +466,7 @@ (new 'static 'talker-speech-class :name "sam001" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x24 :neg #x1 :on-close #f @@ -470,7 +475,7 @@ (new 'static 'talker-speech-class :name "ds162" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x25 :neg #x1 :on-close #f @@ -479,7 +484,7 @@ (new 'static 'talker-speech-class :name "sksp0002" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x26 :neg #x1 :on-close #f @@ -488,7 +493,7 @@ (new 'static 'talker-speech-class :name "sksp0005" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x27 :neg #x1 :on-close #f @@ -497,7 +502,7 @@ (new 'static 'talker-speech-class :name "sksp0004" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x28 :neg #x1 :on-close #f @@ -506,7 +511,7 @@ (new 'static 'talker-speech-class :name "sksp009b" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x29 :neg #x1 :on-close #f @@ -515,7 +520,7 @@ (new 'static 'talker-speech-class :name "sksp0006" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2a :neg #x1 :on-close #f @@ -524,7 +529,7 @@ (new 'static 'talker-speech-class :name "sksp009c" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2b :neg #x1 :on-close #f @@ -533,7 +538,7 @@ (new 'static 'talker-speech-class :name "sksp0035" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2c :neg #x1 :on-close #f @@ -542,7 +547,7 @@ (new 'static 'talker-speech-class :name "sksp009d" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2d :neg #x1 :on-close #f @@ -551,7 +556,7 @@ (new 'static 'talker-speech-class :name "sksp009e" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2e :neg #x1 :on-close #f @@ -560,7 +565,7 @@ (new 'static 'talker-speech-class :name "sksp0072" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2f :neg #x1 :on-close #f @@ -618,7 +623,7 @@ (new 'static 'talker-speech-class :name "str001" :channel (gui-channel message) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x36 :text-duration (seconds 3) :neg #x1 @@ -648,7 +653,7 @@ (new 'static 'talker-speech-class :name "intro01" :channel (gui-channel notice) - :flags (talker-flags tf5) + :flags (talker-flags fade-in) :speech #x39 :text-duration (seconds 3.5) :neg #x1 @@ -659,7 +664,7 @@ (new 'static 'talker-speech-class :name "intro01e" :channel (gui-channel notice) - :flags (talker-flags tf5) + :flags (talker-flags fade-in) :speech #x3a :text-duration (seconds 3.5) :neg #x1 @@ -670,7 +675,7 @@ (new 'static 'talker-speech-class :name "intro01j" :channel (gui-channel notice) - :flags (talker-flags tf5) + :flags (talker-flags fade-in) :speech #x3b :text-duration (seconds 3.5) :neg #x1 @@ -681,7 +686,7 @@ (new 'static 'talker-speech-class :name "intro01k" :channel (gui-channel notice) - :flags (talker-flags tf5) + :flags (talker-flags fade-in) :speech #x3c :text-duration (seconds 3.5) :neg #x1 @@ -702,7 +707,7 @@ (new 'static 'talker-speech-class :name "peck002" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3e :delay (seconds 2) :neg #x1 @@ -712,7 +717,7 @@ (new 'static 'talker-speech-class :name "peck004" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x3f :neg #x1 :on-close #f @@ -721,7 +726,7 @@ (new 'static 'talker-speech-class :name "sam007" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3 tf8) + :flags (talker-flags play-only-once auto-save-once-on-exit long-timeout) :speech #x40 :neg #x1 :on-close #f @@ -730,7 +735,7 @@ (new 'static 'talker-speech-class :name "klev001" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x41 :delay (seconds 2) :neg #x1 @@ -740,7 +745,7 @@ (new 'static 'talker-speech-class :name "dax118" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x42 :text-duration (seconds 1) :neg #x1 @@ -750,7 +755,7 @@ (new 'static 'talker-speech-class :name "peck135" :channel (gui-channel pecker) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x43 :neg #x1 :on-close #f @@ -759,7 +764,7 @@ (new 'static 'talker-speech-class :name "peck114" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x44 :text-duration (seconds 1) :neg #x1 @@ -770,7 +775,7 @@ (new 'static 'talker-speech-class :name "peck115" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x45 :text-duration (seconds 1) :neg #x1 @@ -781,7 +786,7 @@ (new 'static 'talker-speech-class :name "peck129" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x46 :text-duration (seconds 1) :neg #x1 @@ -792,7 +797,7 @@ (new 'static 'talker-speech-class :name "peck122" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x47 :text-duration (seconds 1) :neg #x1 @@ -803,7 +808,7 @@ (new 'static 'talker-speech-class :name "peck119" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x48 :text-duration (seconds 1) :neg #x1 @@ -814,7 +819,7 @@ (new 'static 'talker-speech-class :name "peck124" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x49 :text-duration (seconds 1) :neg #x1 @@ -825,7 +830,7 @@ (new 'static 'talker-speech-class :name "peck141" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x4a :text-duration (seconds 1) :neg #x1 @@ -836,7 +841,7 @@ (new 'static 'talker-speech-class :name "peck141m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #x4b :text-duration (seconds 1) :neg #x1 @@ -847,7 +852,7 @@ (new 'static 'talker-speech-class :name "peck131" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x4c :text-duration (seconds 1) :neg #x1 @@ -858,7 +863,7 @@ (new 'static 'talker-speech-class :name "peck131m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #x4d :text-duration (seconds 1) :neg #x1 @@ -869,7 +874,7 @@ (new 'static 'talker-speech-class :name "peck126" :channel (gui-channel pecker) - :flags (talker-flags tf0 tf4) + :flags (talker-flags play-only-once only-play-in-region) :speech #x4e :text-duration (seconds 1) :neg #x1 @@ -880,7 +885,7 @@ (new 'static 'talker-speech-class :name "peck126m" :channel (gui-channel message) - :flags (talker-flags tf4) + :flags (talker-flags only-play-in-region) :speech #x4f :text-duration (seconds 1) :neg #x1 @@ -891,7 +896,7 @@ (new 'static 'talker-speech-class :name "dax126" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x50 :text-duration (seconds 1) :neg #x1 @@ -901,7 +906,7 @@ (new 'static 'talker-speech-class :name "gun-fire" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x51 :text-duration (seconds 5) :neg #x1 @@ -912,7 +917,7 @@ (new 'static 'talker-speech-class :name "klev002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x52 :neg #x1 :on-close #f @@ -921,7 +926,7 @@ (new 'static 'talker-speech-class :name "ash001" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x53 :neg #x1 :on-close #f @@ -950,7 +955,7 @@ (new 'static 'talker-speech-class :name "leaper02" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x56 :text-duration (seconds 5) :neg #x1 @@ -1021,7 +1026,7 @@ (new 'static 'talker-speech-class :name "sig001" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf8) + :flags (talker-flags play-only-once long-timeout) :speech #x5d :neg #x1 :on-close #f @@ -1030,7 +1035,7 @@ (new 'static 'talker-speech-class :name "torn002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x5e :delay (seconds 2) :neg #x1 @@ -1040,7 +1045,7 @@ (new 'static 'talker-speech-class :name "dax133" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5f :text-duration (seconds 5) :neg #x1 @@ -1051,7 +1056,7 @@ (new 'static 'talker-speech-class :name "mine001" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x60 :text-duration (seconds 3) :neg #x1 @@ -1062,7 +1067,7 @@ (new 'static 'talker-speech-class :name "klev004" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x61 :neg #x1 :on-close '(kiosk-complete) @@ -1071,7 +1076,7 @@ (new 'static 'talker-speech-class :name "gun001" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x62 :text-duration (seconds 5) :neg #x1 @@ -1082,7 +1087,7 @@ (new 'static 'talker-speech-class :name "dam003" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x63 :neg #x1 :on-close '(kiosk-complete) @@ -1109,7 +1114,7 @@ (new 'static 'talker-speech-class :name "sam003" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x66 :neg #x1 :on-close #f @@ -1118,7 +1123,7 @@ (new 'static 'talker-speech-class :name "keir002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf8) + :flags (talker-flags play-only-once long-timeout) :speech #x67 :neg #x1 :on-close #f @@ -1127,7 +1132,7 @@ (new 'static 'talker-speech-class :name "sam002" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x68 :neg #x1 :on-close #f @@ -1136,7 +1141,7 @@ (new 'static 'talker-speech-class :name "for001" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x69 :text-duration (seconds 5) :neg #x1 @@ -1147,7 +1152,7 @@ (new 'static 'talker-speech-class :name "keir004" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf8) + :flags (talker-flags play-only-once long-timeout) :speech #x6a :delay (seconds 8) :neg #x1 @@ -1157,7 +1162,7 @@ (new 'static 'talker-speech-class :name "sam006" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x6b :delay (seconds 5) :neg #x1 @@ -1167,7 +1172,7 @@ (new 'static 'talker-speech-class :name "powup001" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x6c :text-duration (seconds 5) :delay (seconds 1) @@ -1179,7 +1184,7 @@ (new 'static 'talker-speech-class :name "powup002" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x6d :text-duration (seconds 5) :delay (seconds 1) @@ -1191,7 +1196,7 @@ (new 'static 'talker-speech-class :name "powup003" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x6e :text-duration (seconds 5) :delay (seconds 1) @@ -1203,7 +1208,7 @@ (new 'static 'talker-speech-class :name "powup004" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x6f :text-duration (seconds 5) :delay (seconds 1) @@ -1215,7 +1220,7 @@ (new 'static 'talker-speech-class :name "powup005" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x70 :text-duration (seconds 5) :delay (seconds 1) @@ -1227,7 +1232,7 @@ (new 'static 'talker-speech-class :name "powup006" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x71 :text-duration (seconds 5) :delay (seconds 1) @@ -1239,7 +1244,7 @@ (new 'static 'talker-speech-class :name "powup007" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x72 :text-duration (seconds 5) :delay (seconds 1) @@ -1251,7 +1256,7 @@ (new 'static 'talker-speech-class :name "powup008" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x73 :text-duration (seconds 5) :delay (seconds 1) @@ -1263,7 +1268,7 @@ (new 'static 'talker-speech-class :name "powup009" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x74 :text-duration (seconds 5) :delay (seconds 1) @@ -1275,7 +1280,7 @@ (new 'static 'talker-speech-class :name "powup010" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x75 :text-duration (seconds 5) :delay (seconds 1) @@ -1287,7 +1292,7 @@ (new 'static 'talker-speech-class :name "powup011" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x76 :text-duration (seconds 5) :delay (seconds 1) @@ -1299,7 +1304,7 @@ (new 'static 'talker-speech-class :name "powup012" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x77 :text-duration (seconds 5) :delay (seconds 1) @@ -1311,7 +1316,7 @@ (new 'static 'talker-speech-class :name "powup013" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x78 :text-duration (seconds 5) :delay (seconds 1) @@ -1323,7 +1328,7 @@ (new 'static 'talker-speech-class :name "powup014" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x79 :text-duration (seconds 5) :delay (seconds 1) @@ -1335,7 +1340,7 @@ (new 'static 'talker-speech-class :name "powup015" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7a :text-duration (seconds 5) :delay (seconds 1) @@ -1347,7 +1352,7 @@ (new 'static 'talker-speech-class :name "powup016" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7b :text-duration (seconds 5) :delay (seconds 1) @@ -1359,7 +1364,7 @@ (new 'static 'talker-speech-class :name "powup017" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7c :text-duration (seconds 5) :delay (seconds 1) @@ -1371,7 +1376,7 @@ (new 'static 'talker-speech-class :name "powup018" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7d :text-duration (seconds 5) :delay (seconds 1) @@ -1383,7 +1388,7 @@ (new 'static 'talker-speech-class :name "powup019" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7e :text-duration (seconds 5) :delay (seconds 1) @@ -1395,7 +1400,7 @@ (new 'static 'talker-speech-class :name "powup020" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x7f :text-duration (seconds 5) :delay (seconds 1) @@ -1407,7 +1412,7 @@ (new 'static 'talker-speech-class :name "powup021" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x80 :text-duration (seconds 5) :delay (seconds 1) @@ -1419,7 +1424,7 @@ (new 'static 'talker-speech-class :name "powup022" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x81 :text-duration (seconds 5) :delay (seconds 1) @@ -1431,7 +1436,7 @@ (new 'static 'talker-speech-class :name "powup023" :channel (gui-channel alert) - :flags (talker-flags tf1 tf3 tf6) + :flags (talker-flags reduce-volume auto-save-once-on-exit slide-in) :speech #x82 :text-duration (seconds 5) :delay (seconds 1) @@ -1443,7 +1448,7 @@ (new 'static 'talker-speech-class :name "powup024" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x83 :text-duration (seconds 5) :delay (seconds 1) @@ -1455,7 +1460,7 @@ (new 'static 'talker-speech-class :name "powup025" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x84 :text-duration (seconds 5) :delay (seconds 1) @@ -1467,7 +1472,7 @@ (new 'static 'talker-speech-class :name "powup026" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x85 :text-duration (seconds 5) :delay (seconds 1) @@ -1490,7 +1495,7 @@ (new 'static 'talker-speech-class :name "powup028" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x87 :text-duration (seconds 5) :delay (seconds 1) @@ -1502,7 +1507,7 @@ (new 'static 'talker-speech-class :name "powup029" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x88 :text-duration (seconds 5) :delay (seconds 1) @@ -1514,7 +1519,7 @@ (new 'static 'talker-speech-class :name "powup030" :channel (gui-channel alert) - :flags (talker-flags tf1 tf6) + :flags (talker-flags reduce-volume slide-in) :speech #x89 :text-duration (seconds 5) :delay (seconds 1) @@ -1526,7 +1531,7 @@ (new 'static 'talker-speech-class :name "powup031" :channel (gui-channel alert) - :flags (talker-flags tf0 tf1 tf6) + :flags (talker-flags play-only-once reduce-volume slide-in) :speech #x8a :text-duration (seconds 10) :delay (seconds 1) @@ -1548,7 +1553,7 @@ (new 'static 'talker-speech-class :name "torn001" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf2) + :flags (talker-flags play-only-once auto-save-on-each-start) :speech #x8c :neg #x1 :on-close #f @@ -1557,7 +1562,7 @@ (new 'static 'talker-speech-class :name "jak112" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x8d :neg #x1 :on-close #f @@ -1566,7 +1571,7 @@ (new 'static 'talker-speech-class :name "torn008" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x8e :neg #x1 :on-close #f @@ -1739,7 +1744,7 @@ (new 'static 'talker-speech-class :name "ash004" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xa2 :delay (seconds 2) :neg #x1 @@ -1765,7 +1770,7 @@ (new 'static 'talker-speech-class :name "dam004" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xa5 :neg #x1 :on-close #f @@ -1814,7 +1819,7 @@ (new 'static 'talker-speech-class :name "dax586" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xab :neg #x1 :on-close #f @@ -1831,7 +1836,7 @@ (new 'static 'talker-speech-class :name "seem003" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3 tf8) + :flags (talker-flags play-only-once auto-save-once-on-exit long-timeout) :speech #xad :neg #x1 :on-close #f @@ -1904,7 +1909,7 @@ (new 'static 'talker-speech-class :name "seem002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3 tf8) + :flags (talker-flags play-only-once auto-save-once-on-exit long-timeout) :speech #xb6 :neg #x1 :on-close #f @@ -1913,7 +1918,7 @@ (new 'static 'talker-speech-class :name "darkjak1" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xb7 :text-duration (seconds 5) :neg #x1 @@ -1924,7 +1929,7 @@ (new 'static 'talker-speech-class :name "bb10win" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #xb8 :neg #x1 :on-close #f @@ -2309,7 +2314,7 @@ (new 'static 'talker-speech-class :name "light001" :channel (gui-channel alert) - :flags (talker-flags tf0 tf6) + :flags (talker-flags play-only-once slide-in) :speech #xe8 :text-duration (seconds 5) :delay (seconds 1) @@ -2321,7 +2326,7 @@ (new 'static 'talker-speech-class :name "light002" :channel (gui-channel alert) - :flags (talker-flags tf0 tf6) + :flags (talker-flags play-only-once slide-in) :speech #xe9 :text-duration (seconds 5) :delay (seconds 1) @@ -2333,7 +2338,7 @@ (new 'static 'talker-speech-class :name "keir003" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #xea :neg #x1 :on-close #f @@ -2342,7 +2347,7 @@ (new 'static 'talker-speech-class :name "ash002" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xeb :neg #x1 :on-close #f @@ -3063,7 +3068,7 @@ (new 'static 'talker-speech-class :name "tor062" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x145 :neg #x1 :on-close #f @@ -3152,7 +3157,7 @@ (new 'static 'talker-speech-class :name "ash132" :channel (gui-channel voicebox) - :flags (talker-flags tf3) + :flags (talker-flags auto-save-once-on-exit) :speech #x150 :neg #x1 :on-close #f @@ -3249,7 +3254,7 @@ (new 'static 'talker-speech-class :name "teach-pickup" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15c :text-duration (seconds 5) :neg #x1 @@ -3260,7 +3265,7 @@ (new 'static 'talker-speech-class :name "teach-place" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15d :text-duration (seconds 5) :neg #x1 @@ -3271,7 +3276,7 @@ (new 'static 'talker-speech-class :name "teach-shield" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15e :text-duration (seconds 5) :neg #x1 @@ -3312,7 +3317,7 @@ (new 'static 'talker-speech-class :name "redhint1" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x162 :text-duration (seconds 5) :neg #x1 @@ -3323,7 +3328,7 @@ (new 'static 'talker-speech-class :name "redhint2" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x163 :text-duration (seconds 5) :neg #x1 @@ -3334,7 +3339,7 @@ (new 'static 'talker-speech-class :name "dax619" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x164 :neg #x1 :on-close #f @@ -3343,7 +3348,7 @@ (new 'static 'talker-speech-class :name "dax613" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x165 :neg #x1 :on-close #f @@ -3352,7 +3357,7 @@ (new 'static 'talker-speech-class :name "dax615" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x166 :neg #x1 :on-close #f @@ -3361,7 +3366,7 @@ (new 'static 'talker-speech-class :name "dax624" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x167 :neg #x1 :on-close #f @@ -3370,7 +3375,7 @@ (new 'static 'talker-speech-class :name "dax623" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x168 :neg #x1 :on-close #f @@ -3379,7 +3384,7 @@ (new 'static 'talker-speech-class :name "dax622" :channel (gui-channel daxter) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x169 :neg #x1 :on-close #f @@ -3388,7 +3393,7 @@ (new 'static 'talker-speech-class :name "hellcat-fire" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16a :text-duration (seconds 5) :neg #x1 @@ -3399,7 +3404,7 @@ (new 'static 'talker-speech-class :name "seem005" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3 tf8) + :flags (talker-flags play-only-once auto-save-once-on-exit long-timeout) :speech #x16b :neg #x1 :on-close #f @@ -3408,7 +3413,7 @@ (new 'static 'talker-speech-class :name "yellow3hint" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16c :text-duration (seconds 5) :neg #x1 diff --git a/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc index 71838865145..f2c6768bf19 100644 --- a/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak3/engine/ambient/ambient_REF.gc @@ -126,40 +126,43 @@ ) ;; definition for method 9 of type talker-speech-class -(defmethod talker-speech-class-method-9 ((this talker-speech-class)) - (and (>= (-> *game-info* unknown-arr4 (* (-> this speech) 2)) (-> this pos)) - (>= (-> this neg) (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) +(defmethod should-play? ((this talker-speech-class)) + "Return if the talker is in a state where it should play." + (and (>= (-> *game-info* talker-state (* (-> this speech) 2)) (-> this pos)) + (>= (-> this neg) (-> *game-info* talker-state (+ (* (-> this speech) 2) 1))) ) ) ;; definition for method 10 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod play-communicator-speech! ((this talker-speech-class)) - (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) +(defmethod mark-played! ((this talker-speech-class)) + "Mark something as played by making its state UINT16_MAX" + (set! (-> *game-info* talker-state (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) 0 (none) ) ;; definition for method 11 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-11 ((this talker-speech-class)) - (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) (the-as uint 0)) +(defmethod reset-state! ((this talker-speech-class)) + "Reset the state of this talker to 0 (the initial value)" + (set! (-> *game-info* talker-state (+ (* (-> this speech) 2) 1)) (the-as uint 0)) 0 (none) ) ;; definition for method 12 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-12 ((this talker-speech-class) (arg0 int)) +(defmethod yes-play! ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) - (set! (-> *game-info* unknown-arr4 (* (-> this speech) 2)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (* (-> this speech) 2))) #xfff0 arg0)) + (set! (-> *game-info* talker-state (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* talker-state (* (-> this speech) 2))) #xfff0 arg0)) ) - (set! (-> *game-info* unknown-arr4 (* (-> this speech) 2)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (* (-> this speech) 2))) 0 (- arg0))) + (set! (-> *game-info* talker-state (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* talker-state (* (-> this speech) 2))) 0 (- arg0))) ) ) - (if (talker-speech-class-method-9 this) + (if (should-play? this) (talker-spawn-func this *entity-pool* (target-pos 0) (the-as region #f)) ) 0 @@ -168,13 +171,13 @@ ;; definition for method 13 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-13 ((this talker-speech-class) (arg0 int)) +(defmethod no-play! ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) - (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) + (set! (-> *game-info* talker-state (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* talker-state (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) ) - (set! (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-arr4 (+ (* (-> this speech) 2) 1))) 0 (- arg0))) + (set! (-> *game-info* talker-state (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* talker-state (+ (* (-> this speech) 2) 1))) 0 (- arg0))) ) ) 0 @@ -185,16 +188,16 @@ ;; WARN: Return type mismatch int vs sound-id. (defun talker-spawn-func ((arg0 talker-speech-class) (arg1 process-tree) (arg2 vector) (arg3 region)) (local-vars (s2-0 int)) - (when (or (not arg0) (zero? (-> arg0 speech)) (not (talker-speech-class-method-9 arg0))) + (when (or (not arg0) (zero? (-> arg0 speech)) (not (should-play? arg0))) (set! s2-0 0) (goto cfg-27) ) (if (and (or (not (-> *setting-control* user-current play-hints)) (= (-> *setting-control* user-current dialog-volume) 0.0) ) - (logtest? (-> arg0 flags) (talker-flags tf0)) + (logtest? (-> arg0 flags) (talker-flags play-only-once)) ) - (play-communicator-speech! arg0) + (mark-played! arg0) ) (set! s2-0 (the-as int (lookup-gui-connection-id *gui-control* (-> arg0 name) (-> arg0 channel) (gui-action none))) @@ -230,7 +233,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior talker-init talker ((arg0 talker-speech-class) (arg1 vector) (arg2 region)) - (set! (-> self trans quad) (-> arg1 quad)) + (vector-copy! (-> self trans) arg1) (let ((v1-2 (shr (the-as int (-> arg0 channel)) 4))) (when (not (or (or (= v1-2 4) (= v1-2 5)) (or (not (-> *setting-control* user-current play-hints)) @@ -281,7 +284,7 @@ (set! (-> self voicebox) (the-as handle #f)) (set! (-> self save?) #f) (set! (-> self grab?) #f) - (if (logtest? (-> self message flags) (talker-flags tf5 tf6)) + (if (logtest? (-> self message flags) (talker-flags fade-in slide-in)) (set! (-> self interp) 0.0) (set! (-> self interp) 1.0) ) @@ -312,7 +315,7 @@ (case (-> this message channel) (((gui-channel notice)) (cond - ((logtest? (-> this message flags) (talker-flags tf7)) + ((logtest? (-> this message flags) (talker-flags bigger-font)) (let ((v1-9 gp-0) (a1-1 36) (a0-4 140) @@ -344,11 +347,11 @@ (set! (-> v1-15 height) (the float 140)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) - (if (logtest? (-> this message flags) (talker-flags tf5)) + (if (logtest? (-> this message flags) (talker-flags fade-in)) (set! (-> gp-0 alpha) (-> this interp)) (set! (-> gp-0 alpha) 1.0) ) - (when (logtest? (-> this message flags) (talker-flags tf6)) + (when (logtest? (-> this message flags) (talker-flags slide-in)) (let ((s4-0 gp-0) (s3-0 36) (v1-27 (the int (lerp-scale 400.0 f0-0 (-> this interp) 0.0 1.0))) @@ -402,7 +405,7 @@ (suspend-for (the-as time-frame (-> self message delay)) ) (while (or (not (time-elapsed? (-> self start-time) (the-as time-frame (+ (-> self message delay) 300)))) - (and (logtest? (-> self message flags) (talker-flags tf8)) + (and (logtest? (-> self message flags) (talker-flags long-timeout)) (not (time-elapsed? (-> self start-time) (seconds 180))) ) ) @@ -429,8 +432,8 @@ :virtual #t :enter (behavior () (set-time! (-> self state-time)) - (if (logtest? (-> self message flags) (talker-flags tf0)) - (play-communicator-speech! (-> self message)) + (if (logtest? (-> self message flags) (talker-flags play-only-once)) + (mark-played! (-> self message)) ) (set-setting! 'hint (process->ppointer self) 0.0 0) (set-setting! 'speech-control #f 0.0 0) @@ -446,12 +449,12 @@ (the-as process #f) ) ) - (when (and (nonzero? (-> self voice-id)) (logtest? (-> self message flags) (talker-flags tf1))) + (when (and (nonzero? (-> self voice-id)) (logtest? (-> self message flags) (talker-flags reduce-volume))) (add-setting! 'music-volume 'rel 0.25 0) (add-setting! 'sfx-volume 'rel 0.75 0) (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-talker) 0) ) - (if (logtest? (-> self message flags) (talker-flags tf2)) + (if (logtest? (-> self message flags) (talker-flags auto-save-on-each-start)) (auto-save-user) ) (apply-settings *setting-control*) @@ -475,7 +478,7 @@ ) ) ) - (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) + (when (and (logtest? (-> self message flags) (talker-flags auto-save-once-on-exit)) (not (-> self save?))) (set! (-> self save?) #t) (auto-save-user) ) @@ -536,7 +539,7 @@ (and (nonzero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (or (not (time-elapsed? (-> self state-time) (the-as time-frame (-> self message text-duration)))) - (and (logtest? (-> self message flags) (talker-flags tf4)) + (and (logtest? (-> self message flags) (talker-flags only-play-in-region)) (-> self region) (point-in-region-debug! (-> self region) (target-pos 0)) ) @@ -560,7 +563,7 @@ (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (not (paused?)) ) - (if (logtest? (-> self message flags) (talker-flags tf5)) + (if (logtest? (-> self message flags) (talker-flags fade-in)) (seek! (-> self interp) 1.0 (* 0.5 (seconds-per-frame))) (seek! (-> self interp) 1.0 (* 4.0 (seconds-per-frame))) ) @@ -569,9 +572,9 @@ (suspend) ) ) - (when (and (nonzero? (-> self message-id)) (logtest? (-> self message flags) (talker-flags tf5 tf6))) + (when (and (nonzero? (-> self message-id)) (logtest? (-> self message flags) (talker-flags fade-in slide-in))) (while (!= (-> self interp) 0.0) - (if (logtest? (-> self message flags) (talker-flags tf5)) + (if (logtest? (-> self message flags) (talker-flags fade-in)) (seek! (-> self interp) 0.0 (* 0.5 (seconds-per-frame))) (seek! (-> self interp) 0.0 (* 4.0 (seconds-per-frame))) ) @@ -581,7 +584,7 @@ (suspend) ) ) - (when (and (logtest? (-> self message flags) (talker-flags tf3)) (not (-> self save?))) + (when (and (logtest? (-> self message flags) (talker-flags auto-save-once-on-exit)) (not (-> self save?))) (suspend-for (seconds 1) ) (set! (-> self save?) #t) diff --git a/test/decompiler/reference/jak3/engine/anim/aligner_REF.gc b/test/decompiler/reference/jak3/engine/anim/aligner_REF.gc index 31415136919..928ed37eaa2 100644 --- a/test/decompiler/reference/jak3/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/aligner_REF.gc @@ -60,7 +60,7 @@ ) (mem-copy! (the-as pointer (-> this transform 1)) (the-as pointer (-> this transform)) 48) (quaternion-copy! (the-as quaternion (-> this transform 1 rot)) (-> this align quat)) - (set! (-> this transform 1 scale quad) (-> this align scale quad)) + (vector-copy! (-> this transform 1 scale) (-> this align scale)) (let* ((a2-5 (-> this matrix 1)) (a3-0 (-> this matrix)) (v1-21 (-> a3-0 0 rvec quad)) diff --git a/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc b/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc index d8bea7cb2e1..ffabed752bd 100644 --- a/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc @@ -133,7 +133,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (when a2-0 - (set! (-> gp-0 quad) (-> self sphere quad)) + (vector-copy! gp-0 (-> self sphere)) (set! (-> gp-0 w) 1.0) (vector-matrix*! gp-0 gp-0 (-> (the-as process-drawable a2-0) node-list data v1-5 bone transform)) (let ((v1-9 (-> self root))) @@ -247,7 +247,7 @@ (let ((s5-1 (-> self root))) (set! (-> s5-1 nav-radius) (-> self sphere r)) (set! (-> s5-1 root-prim local-sphere w) (-> self sphere r)) - (set! (-> s5-1 trans quad) (-> self sphere quad)) + (vector-copy! (-> s5-1 trans) (-> self sphere)) (set! (-> s5-1 trans w) 1.0) (vector-identity! (-> s5-1 scale)) (quaternion-identity! (-> s5-1 quat)) diff --git a/test/decompiler/reference/jak3/engine/anim/joint-exploder_REF.gc b/test/decompiler/reference/jak3/engine/anim/joint-exploder_REF.gc index 4c96e6501aa..a176e153045 100644 --- a/test/decompiler/reference/jak3/engine/anim/joint-exploder_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/joint-exploder_REF.gc @@ -299,17 +299,13 @@ ) ) ) - (let ((s4-2 (new 'stack-no-clear 'matrix))) - (set! (-> s4-2 rvec quad) (the-as uint128 0)) - (set! (-> s4-2 uvec quad) (the-as uint128 0)) - (set! (-> s4-2 fvec quad) (the-as uint128 0)) - (set! (-> s4-2 trans quad) (the-as uint128 0)) - (let ((f30-0 (-> arg0 bounds w))) - (matrix-4x4-inverse! s4-2 (-> arg1 data 0 bone transform)) - (set! (-> arg0 bounds w) 1.0) - (vector-matrix*! (-> arg0 bounds) (-> arg0 bounds) s4-2) - (set! (-> arg0 bounds w) f30-0) - ) + (let ((s4-2 (new-stack-matrix0)) + (f30-0 (-> arg0 bounds w)) + ) + (matrix-4x4-inverse! s4-2 (-> arg1 data 0 bone transform)) + (set! (-> arg0 bounds w) 1.0) + (vector-matrix*! (-> arg0 bounds) (-> arg0 bounds) s4-2) + (set! (-> arg0 bounds w) f30-0) ) 0 (none) @@ -325,7 +321,7 @@ (set! (-> v1-2 mat rvec quad) (the-as uint128 0)) (set! (-> v1-2 mat uvec quad) (the-as uint128 0)) (set! (-> v1-2 mat fvec quad) (the-as uint128 0)) - (set! (-> v1-2 mat trans quad) (-> this root trans quad)) + (vector-copy! (-> v1-2 mat trans) (-> this root trans)) ) v0-0 ) @@ -390,7 +386,7 @@ (else (set! (-> arg0 bbox-valid?) #t) (set! (-> arg0 bbox min quad) (-> a1-1 quad)) - (set! (-> arg0 bbox max quad) (-> a1-1 quad)) + (vector-copy! (-> arg0 bbox max) a1-1) ) ) ) @@ -536,8 +532,8 @@ (let ((s1-0 (new 'stack-no-clear 'bounding-box)) (s0-0 (-> arg0 bbox-valid?)) ) - (set! (-> s1-0 min quad) (-> arg0 bbox min quad)) - (set! (-> s1-0 max quad) (-> arg0 bbox max quad)) + (vector-copy! (-> s1-0 min) (-> arg0 bbox min)) + (vector-copy! (-> s1-0 max) (-> arg0 bbox max)) (update-bbox-for-joint this arg0 sv-80) (let* ((v1-7 arg1) (v1-8 (cond @@ -562,7 +558,7 @@ (update-bbox-for-joint this (the-as joint-exploder-list sv-64) sv-80) (set! (-> arg0 bbox-valid?) s0-0) (set! (-> arg0 bbox min quad) (-> s1-0 min quad)) - (set! (-> arg0 bbox max quad) (-> s1-0 max quad)) + (vector-copy! (-> arg0 bbox max) (-> s1-0 max)) s2-0 ) (else @@ -628,7 +624,7 @@ (let* ((s2-0 (-> s4-0 joint s3-0)) (s1-0 (-> s2-0 mat trans)) ) - (set! (-> s2-0 prev-pos quad) (-> s1-0 quad)) + (vector-copy! (-> s2-0 prev-pos) s1-0) (+! (-> s2-0 transv y) f30-0) (when (< 0.0 (-> this tuning friction)) (.lvf vf1 (&-> (-> s2-0 transv) quad)) @@ -693,7 +689,7 @@ (s2-0 (new 'stack-no-clear 'collide-query)) ) (vector-! (-> s2-0 move-dist) s3-0 (-> s4-1 prev-pos)) - (set! (-> s2-0 start-pos quad) (-> s4-1 prev-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s4-1 prev-pos)) (let ((v1-11 s2-0)) (set! (-> v1-11 radius) 40.96) (set! (-> v1-11 collide-with) (-> this static-params collide-spec)) @@ -705,7 +701,7 @@ (set! (-> v1-11 action-mask) (collide-action solid)) ) (when (>= (probe-using-line-sphere *collide-cache* s2-0) 0.0) - (set! (-> s3-0 quad) (-> s2-0 best-other-tri intersect quad)) + (vector-copy! s3-0 (-> s2-0 best-other-tri intersect)) (let* ((v1-16 (-> s4-1 transv)) (f28-0 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z))))) ) @@ -777,8 +773,8 @@ ) (let ((gp-1 (new 'stack-no-clear 'bounding-box))) (let ((v1-31 (-> self root trans))) - (set! (-> gp-1 min quad) (-> v1-31 quad)) - (set! (-> gp-1 max quad) (-> v1-31 quad)) + (vector-copy! (-> gp-1 min) v1-31) + (vector-copy! (-> gp-1 max) v1-31) ) (dotimes (s5-1 (the-as int (+ (-> self tuning max-probes) 1))) (let ((s4-0 (-> self lists data s5-1))) @@ -825,32 +821,14 @@ (if (zero? a0-6) (set! a0-6 (-> v1-2 joint-index)) ) - (let* ((a3-0 (-> this parent 0 node-list data a0-6 bone transform)) - (a2-0 (-> s3-0 mat)) - (v1-9 (-> a3-0 rvec quad)) - (a0-8 (-> a3-0 uvec quad)) - (a1-4 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-9) - (set! (-> a2-0 uvec quad) a0-8) - (set! (-> a2-0 fvec quad) a1-4) - (set! (-> a2-0 trans quad) a3-1) + (let ((a3-0 (-> this parent 0 node-list data a0-6 bone transform))) + (matrix-copy! (-> s3-0 mat) a3-0) ) (matrix-identity! (-> s3-0 rmat)) ) (else - (let* ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform)) - (a2-1 (-> s3-0 mat)) - (v1-15 (-> a3-2 rvec quad)) - (a0-11 (-> a3-2 uvec quad)) - (a1-5 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-15) - (set! (-> a2-1 uvec quad) a0-11) - (set! (-> a2-1 fvec quad) a1-5) - (set! (-> a2-1 trans quad) a3-3) + (let ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform))) + (matrix-copy! (-> s3-0 mat) a3-2) ) (matrix-identity! (-> s3-0 rmat)) ) @@ -900,8 +878,8 @@ (set! (-> v1-33 head) 0) (let ((s5-1 (-> v1-33 bbox))) (let ((v1-34 (-> gp-0 joint 0 mat trans))) - (set! (-> s5-1 min quad) (-> v1-34 quad)) - (set! (-> s5-1 max quad) (-> v1-34 quad)) + (vector-copy! (-> s5-1 min) v1-34) + (vector-copy! (-> s5-1 max) v1-34) ) (dotimes (s4-1 (-> gp-0 num-joints)) (add-point! s5-1 (the-as vector (+ (the-as uint (-> gp-0 joint 0 mat trans)) (* 240 s4-1)))) @@ -948,9 +926,9 @@ (set! (-> v1-8 0 probeless?) #t) ) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> self parent 0 root trans quad)) + (vector-copy! (-> self root trans) (-> self parent 0 root trans)) (quaternion-copy! (-> self root quat) (-> self parent 0 root quat)) - (set! (-> self root scale quad) (-> self parent 0 root scale quad)) + (vector-copy! (-> self root scale) (-> self parent 0 root scale)) (when (-> arg3 art-level) (let ((a1-8 (entity-actor-from-level-name (-> arg3 art-level)))) (if a1-8 @@ -1008,7 +986,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/anim/joint-mod-h_REF.gc b/test/decompiler/reference/jak3/engine/anim/joint-mod-h_REF.gc index 81db6e35a3f..37eeb4946d4 100644 --- a/test/decompiler/reference/jak3/engine/anim/joint-mod-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/joint-mod-h_REF.gc @@ -206,7 +206,7 @@ This is used to make jak look toward an enemy, for example." (defmethod new joint-mod-spinner ((allocation symbol) (type-to-make type) (proc process-drawable) (bone-idx int) (axis vector) (rate float)) "Create and attach a joint-mod-spinner to a joint." (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> v0-0 spin-axis quad) (-> axis quad)) + (vector-copy! (-> v0-0 spin-axis) axis) (set! (-> v0-0 spin-rate) rate) (set! (-> v0-0 enable) #t) (set! (-> v0-0 angle) 0.0) @@ -381,7 +381,7 @@ This is used to make jak look toward an enemy, for example." (cspace<-parented-transformq-joint! bone-cspace joint-transform) (let ((s4-0 (vector<-cspace2! (new 'stack-no-clear 'vector) bone-cspace))) (quaternion*! (-> joint-transform quat) (-> joint-transform quat) (-> s3-0 rotation)) - (set! (-> joint-transform trans quad) (-> s4-0 quad)) + (vector-copy! (-> joint-transform trans) s4-0) ) ) (cspace<-transformq! bone-cspace joint-transform) @@ -435,7 +435,7 @@ This is used to make jak look toward an enemy, for example." (set! (-> v1-0 transform quat quad) (-> joint-transform quat quad)) ) (if (not (logtest? (-> v1-0 flags) (joint-mod-base-flags scale))) - (set! (-> v1-0 transform scale quad) (-> joint-transform scale quad)) + (vector-copy! (-> v1-0 transform scale) (-> joint-transform scale)) ) (cspace<-parented-transformq-joint! bone-cspace (-> v1-0 transform)) ) @@ -619,8 +619,8 @@ The translation is kept from the result of the normal parented value." (cspace<-parented-transformq-joint! bone-cspace joint-transform) (matrix<-transformq! gp-0 (-> s4-0 transform)) (set! (-> bone-cspace bone transform rvec quad) (-> gp-0 rvec quad)) - (set! (-> bone-cspace bone transform uvec quad) (-> gp-0 uvec quad)) - (set! (-> bone-cspace bone transform fvec quad) (-> gp-0 fvec quad)) + (vector-copy! (-> bone-cspace bone transform uvec) (-> gp-0 uvec)) + (vector-copy! (-> bone-cspace bone transform fvec) (-> gp-0 fvec)) ) (none) ) diff --git a/test/decompiler/reference/jak3/engine/anim/joint-mod_REF.gc b/test/decompiler/reference/jak3/engine/anim/joint-mod_REF.gc index 39a418c040a..441aabd7bf8 100644 --- a/test/decompiler/reference/jak3/engine/anim/joint-mod_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/joint-mod_REF.gc @@ -53,34 +53,12 @@ (new 'stack-no-clear 'matrix) (let ((s3-0 (new 'stack-no-clear 'vector))) (matrix->trans s5-0 s3-0) - (set! (-> s5-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s5-0 trans) s3-0) (matrix->trans s4-1 s3-0) - (set! (-> s4-1 trans quad) (-> s3-0 quad)) - ) - (let* ((a2-0 (-> gp-0 shoulder-matrix-no-ik)) - (a3-0 s5-0) - (v1-22 (-> a3-0 rvec quad)) - (a0-7 (-> a3-0 uvec quad)) - (a1-3 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-22) - (set! (-> a2-0 uvec quad) a0-7) - (set! (-> a2-0 fvec quad) a1-3) - (set! (-> a2-0 trans quad) a3-1) - ) - (let* ((a2-1 (-> gp-0 elbow-matrix-no-ik)) - (a3-2 s4-1) - (v1-23 (-> a3-2 rvec quad)) - (a0-8 (-> a3-2 uvec quad)) - (a1-4 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-23) - (set! (-> a2-1 uvec quad) a0-8) - (set! (-> a2-1 fvec quad) a1-4) - (set! (-> a2-1 trans quad) a3-3) + (vector-copy! (-> s4-1 trans) s3-0) ) + (matrix-copy! (-> gp-0 shoulder-matrix-no-ik) s5-0) + (matrix-copy! (-> gp-0 elbow-matrix-no-ik) s4-1) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! sv-784 (new 'stack-no-clear 'vector)) (let ((s0-0 (new 'stack-no-clear 'vector)) @@ -89,8 +67,8 @@ ) 0.0 0.0 - (set! (-> s2-0 quad) (-> s5-0 trans quad)) - (set! (-> sv-784 quad) (-> s4-1 trans quad)) + (vector-copy! s2-0 (-> s5-0 trans)) + (vector-copy! sv-784 (-> s4-1 trans)) (let ((a1-5 s0-0)) (let ((v1-27 sv-784)) (let ((a0-13 (-> s4-1 uvec))) @@ -109,7 +87,7 @@ (if (-> gp-0 callback) ((-> gp-0 callback) gp-0 s5-0 s4-1 s0-0) ) - (set! (-> s1-0 quad) (-> gp-0 handle-pos quad)) + (vector-copy! s1-0 (-> gp-0 handle-pos)) (let ((f30-0 (vector-vector-distance s2-0 sv-784)) (f0-12 (vector-vector-distance sv-784 s0-0)) ) @@ -240,7 +218,7 @@ ) (set! (-> gp-1 rvec quad) (-> s4-1 trans quad)) (matrix*! s4-1 s4-1 a2-20) - (set! (-> s4-1 trans quad) (-> gp-1 rvec quad)) + (vector-copy! (-> s4-1 trans) (-> gp-1 rvec)) ) (let ((s3-2 (quaternion->matrix (new 'stack-no-clear 'matrix) sv-372)) (a2-21 (matrix-4x4-inverse! (new 'stack-no-clear 'matrix) s5-0)) @@ -249,7 +227,7 @@ (set! (-> gp-2 rvec quad) (-> s5-0 trans quad)) (matrix*! s4-1 s4-1 a2-21) (matrix*! s5-0 s5-0 s3-2) - (set! (-> s5-0 trans quad) (-> gp-2 rvec quad)) + (vector-copy! (-> s5-0 trans) (-> gp-2 rvec)) ) (matrix*! s4-1 s4-1 s5-0) ) @@ -283,7 +261,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod set-ik-target! ((this joint-mod-ik) (pos vector)) - (set! (-> this handle-pos quad) (-> pos quad)) + (vector-copy! (-> this handle-pos) pos) 0 (none) ) @@ -500,13 +478,13 @@ (f30-1 (lerp-scale 0.0 1.0 f0-4 0.85 1.0)) ) (vector-deg-slerp (-> s5-0 twist) (-> s5-0 twist) s4-0 0.3) - (set! (-> s4-0 quad) (-> s5-0 twist quad)) + (vector-copy! s4-0 (-> s5-0 twist)) (seek! (-> s5-0 blend) (-> s5-0 flex-blend) (* 4.0 (seconds-per-frame))) (let ((s3-1 (matrix->scale gp-0 (new 'stack-no-clear 'vector)))) (let ((s2-0 (matrix->quat gp-0 (new 'stack-no-clear 'quaternion))) (s0-0 (matrix->trans gp-0 (new 'stack-no-clear 'vector))) ) - (set! (-> gp-0 uvec quad) (-> s5-0 twist-max quad)) + (vector-copy! (-> gp-0 uvec) (-> s5-0 twist-max)) (vector-cross! (-> gp-0 fvec) (-> gp-0 rvec) (-> gp-0 uvec)) (vector-cross! (-> gp-0 rvec) (-> gp-0 uvec) (-> gp-0 fvec)) (set! (-> gp-0 rvec w) 0.0) @@ -686,13 +664,13 @@ (defmethod trs-set! ((this joint-mod) (trans vector) (quat quaternion) (scale vector)) "Set translation, quaternion, scale. A value of #f will skip the set." (if trans - (set! (-> this trans quad) (-> trans quad)) + (vector-copy! (-> this trans) trans) ) (if quat (quaternion-copy! (-> this quat) quat) ) (if scale - (set! (-> this scale quad) (-> scale quad)) + (vector-copy! (-> this scale) scale) ) 0 (none) @@ -708,7 +686,7 @@ ) (let ((f0-0 (vector-vector-distance (-> this process root trans) pos))) (set! (-> this shutting-down?) #f) - (set! (-> this target quad) (-> pos quad)) + (vector-copy! (-> this target) pos) (if (< f0-0 (-> this max-dist)) (set! (-> this blend) 1.0) (set! (-> this blend) 0.0) @@ -768,7 +746,7 @@ (if (= (-> this mode) (joint-mod-mode reset)) (mode-set! this (joint-mod-mode look-at)) ) - (set! (-> this target quad) (-> target quad)) + (vector-copy! (-> this target) target) (set! (-> this blend) 1.0) (set! (-> this shutting-down?) #f) ) @@ -1156,13 +1134,13 @@ "Callback for set joint mod." (let ((s4-0 (the-as joint-mod (-> arg0 param1)))) (if (not (logtest? (-> s4-0 track-mode) (track-mode no-trans))) - (set! (-> arg1 trans quad) (-> s4-0 trans quad)) + (vector-copy! (-> arg1 trans) (-> s4-0 trans)) ) (if (not (logtest? (-> s4-0 track-mode) (track-mode no-rotate))) (quaternion-copy! (-> arg1 quat) (-> s4-0 quat)) ) (if (not (logtest? (-> s4-0 track-mode) (track-mode no-scale))) - (set! (-> arg1 scale quad) (-> s4-0 scale quad)) + (vector-copy! (-> arg1 scale) (-> s4-0 scale)) ) ) (cspace<-parented-transformq-joint! arg0 arg1) @@ -1185,10 +1163,10 @@ ) (cond ((logtest? (-> s5-0 track-mode) (track-mode no-scale)) - (set! (-> s3-0 quad) (-> arg1 scale quad)) + (vector-copy! s3-0 (-> arg1 scale)) ) ((>= (-> s5-0 flex-blend) 1.0) - (set! (-> s3-0 quad) (-> s5-0 scale quad)) + (vector-copy! s3-0 (-> s5-0 scale)) ) (else (vector-lerp! s3-0 (-> arg1 scale) (-> s5-0 scale) (-> s5-0 flex-blend)) @@ -1202,7 +1180,7 @@ ) (else (let ((v1-15 (new 'stack-no-clear 'vector))) - (set! (-> v1-15 quad) (-> arg1 scale quad)) + (vector-copy! v1-15 (-> arg1 scale)) (set! (-> v1-15 x) (/ 1.0 (-> v1-15 x))) (set! (-> v1-15 y) (/ 1.0 (-> v1-15 y))) (set! (-> v1-15 z) (/ 1.0 (-> v1-15 z))) @@ -1240,10 +1218,10 @@ (set! (-> arg0 bone transform fvec w) 0.0) (cond ((logtest? (-> s5-0 track-mode) (track-mode no-trans)) - (set! (-> arg0 bone transform trans quad) (-> s4-0 quad)) + (vector-copy! (-> arg0 bone transform trans) s4-0) ) ((>= (-> s5-0 flex-blend) 1.0) - (set! (-> arg0 bone transform trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> arg0 bone transform trans) (-> s5-0 trans)) (set! (-> arg0 bone transform trans w) 1.0) ) (else @@ -1374,7 +1352,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-target! ((this joint-mod-polar-look-at) (pos vector)) "Update the target position." - (set! (-> this target quad) (-> pos quad)) + (vector-copy! (-> this target) pos) 0 (none) ) @@ -1506,7 +1484,7 @@ (if (logtest? (-> s5-0 flags) (joint-mod-polar-flags negate-up)) (vector-negate! (-> s4-1 uvec) (-> s4-1 uvec)) ) - (set! (-> s4-1 fvec quad) (-> s3-0 quad)) + (vector-copy! (-> s4-1 fvec) s3-0) (set-vector! (-> s4-1 trans) 0.0 0.0 0.0 1.0) (matrix-transpose! s4-1 s4-1) (set-vector! (-> s4-1 trans) 0.0 0.0 0.0 1.0) @@ -1602,7 +1580,7 @@ (matrix-remove-z-rot (-> arg0 bone transform) a1-25) ) ) - (set! (-> arg0 bone transform trans quad) (-> s3-1 quad)) + (vector-copy! (-> arg0 bone transform trans) s3-1) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/anim/joint_REF.gc b/test/decompiler/reference/jak3/engine/anim/joint_REF.gc index c7d4f26bb4a..5cca7290886 100644 --- a/test/decompiler/reference/jak3/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/joint_REF.gc @@ -1101,17 +1101,7 @@ ) (cond ((= (the float (the int f0-1)) f0-1) - (let* ((mat (matrix-from-joint-anim-frame (-> jacc frames) joint-num (the int frame-num))) - (v1-7 (-> mat rvec quad)) - (a0-3 (-> mat uvec quad)) - (a1-3 (-> mat fvec quad)) - (a2-4 (-> mat trans quad)) - ) - (set! (-> dest-mat rvec quad) v1-7) - (set! (-> dest-mat uvec quad) a0-3) - (set! (-> dest-mat fvec quad) a1-3) - (set! (-> dest-mat trans quad) a2-4) - ) + (matrix-copy! dest-mat (matrix-from-joint-anim-frame (-> jacc frames) joint-num (the int frame-num))) dest-mat ) (else @@ -1166,18 +1156,7 @@ ) ((and (= mode 'no-push) (= v1-3 (joint-control-command stack))) (set! (-> mat-stack top) (- (-> mat-stack top) (the-as uint s1-0))) - (let* ((v1-9 (- (-> mat-stack top) (the-as uint s1-0))) - (a3-1 (-> mat-stack top)) - (a0-8 (-> a3-1 rvec quad)) - (a1-6 (-> a3-1 uvec quad)) - (a2-2 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-9 rvec quad) a0-8) - (set! (-> v1-9 uvec quad) a1-6) - (set! (-> v1-9 fvec quad) a2-2) - (set! (-> v1-9 trans quad) a3-2) - ) + (matrix-copy! (- (-> mat-stack top) (the-as uint s1-0)) (-> mat-stack top)) ) ((and (= mode 'no-push) (= v1-3 (joint-control-command float))) ) @@ -1233,38 +1212,14 @@ ;; INFO: Used lq/sq (defun cspace<-cspace! ((dst cspace) (src cspace)) "Set one cspace's bone from another" - (let ((v0-0 (-> dst bone transform))) - (let* ((a2-0 (-> src bone transform)) - (v1-2 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> v0-0 rvec quad) v1-2) - (set! (-> v0-0 uvec quad) a0-1) - (set! (-> v0-0 fvec quad) a1-1) - (set! (-> v0-0 trans quad) a2-1) - ) - v0-0 - ) + (matrix-copy! (-> dst bone transform) (-> src bone transform)) ) ;; definition for function cspace<-cspace-normalized! ;; INFO: Used lq/sq (defun cspace<-cspace-normalized! ((dst cspace) (src cspace)) "Set one cspace's bone from another, and normalize the rows of the matrix." - (let ((gp-0 (-> dst bone transform))) - (let* ((a2-0 (-> src bone transform)) - (v1-2 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-2) - (set! (-> gp-0 uvec quad) a0-1) - (set! (-> gp-0 fvec quad) a1-1) - (set! (-> gp-0 trans quad) a2-1) - ) + (let ((gp-0 (matrix-copy! (-> dst bone transform) (-> src bone transform)))) (vector-normalize! (-> gp-0 rvec) 1.0) (vector-normalize! (-> gp-0 uvec) 1.0) (vector-normalize! (-> gp-0 fvec) 1.0) @@ -1276,20 +1231,7 @@ ;; INFO: Used lq/sq (defun cspace<-parent-joint! ((dst cspace) (proc (pointer process-drawable)) (parent-idx int)) "Set one cspace's bone to another from the given process-drawable" - (let ((v0-0 (-> dst bone transform))) - (let* ((a2-1 (-> proc 0 node-list data parent-idx bone transform)) - (v1-5 (-> a2-1 rvec quad)) - (a0-2 (-> a2-1 uvec quad)) - (a1-1 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> v0-0 rvec quad) v1-5) - (set! (-> v0-0 uvec quad) a0-2) - (set! (-> v0-0 fvec quad) a1-1) - (set! (-> v0-0 trans quad) a2-2) - ) - v0-0 - ) + (matrix-copy! (-> dst bone transform) (-> proc 0 node-list data parent-idx bone transform)) ) ;; definition for function cspace<-rot-yxy! @@ -1352,20 +1294,8 @@ ;; INFO: Used lq/sq (defun cspace<-matrix-no-push-joint! ((dst cspace) (jc joint-control)) "Compute animated matrix, using the special 'no-push mode." - (let ((v1-2 (matrix-from-control! (the-as matrix-stack (+ 64 #x70000000)) (-> dst joint) jc 'no-push)) - (v0-1 (-> dst bone transform)) - ) - (let ((a0-4 (-> v1-2 rvec quad)) - (a1-2 (-> v1-2 uvec quad)) - (a2-1 (-> v1-2 fvec quad)) - (v1-3 (-> v1-2 trans quad)) - ) - (set! (-> v0-1 rvec quad) a0-4) - (set! (-> v0-1 uvec quad) a1-2) - (set! (-> v0-1 fvec quad) a2-1) - (set! (-> v0-1 trans quad) v1-3) - ) - v0-1 + (let ((v1-2 (matrix-from-control! (the-as matrix-stack (+ 64 #x70000000)) (-> dst joint) jc 'no-push))) + (matrix-copy! (-> dst bone transform) v1-2) ) ) @@ -1373,20 +1303,7 @@ ;; INFO: Used lq/sq (defun cspace<-matrix-joint! ((dst cspace) (src matrix)) "Set the cspace from a matrix." - (let ((v0-0 (-> dst bone transform))) - (let* ((a2-0 src) - (v1-1 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> v0-0 rvec quad) v1-1) - (set! (-> v0-0 uvec quad) a0-1) - (set! (-> v0-0 fvec quad) a1-1) - (set! (-> v0-0 trans quad) a2-1) - ) - v0-0 - ) + (matrix-copy! (-> dst bone transform) src) ) ;; definition for function cspace<-parented-matrix-joint! diff --git a/test/decompiler/reference/jak3/engine/camera/cam-combiner_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-combiner_REF.gc index 969239c0811..b745d39bb3e 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-combiner_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-combiner_REF.gc @@ -45,11 +45,7 @@ 0.0 (let ((s4-0 (new-stack-vector0))) 0.0 - (let ((s3-0 (new 'stack-no-clear 'matrix))) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) + (let ((s3-0 (new-stack-matrix0))) (vector-! (-> s2-0 0) (the-as vector (-> sv-144 inv-mat)) (the-as vector (-> gp-0 inv-mat))) (vector-! (-> s2-0 1) (-> sv-144 inv-mat uvec) (-> gp-0 inv-mat uvec)) (vector-! (-> s2-0 2) (-> sv-144 inv-mat fvec) (-> gp-0 inv-mat fvec)) @@ -117,7 +113,7 @@ (logxor! (-> *camera* master-options) (cam-master-options-u32 FLIP_COMBINER)) ) ) - (set! (-> self flip-control-axis quad) (-> s4-0 quad)) + (vector-copy! (-> self flip-control-axis) s4-0) (when (logtest? (-> *camera* master-options) (cam-master-options-u32 FLIP_COMBINER)) (set! f30-0 (- 65536.0 f30-0)) (vector-negate! s4-0 s4-0) @@ -249,8 +245,8 @@ (set! (-> self tracking no-follow) (-> (the-as camera-slave gp-3) tracking no-follow)) (copy-to (-> self tracking tilt-adjust) (the-as cam-float-seeker (+ (the-as uint gp-3) 320))) (copy-to (-> self tracking underwater-blend) (the-as cam-float-seeker (+ (the-as uint gp-3) 368))) - (set! (-> self tracking follow-off quad) (-> (the-as camera-slave gp-3) tracking follow-off quad)) - (set! (-> self tracking follow-pt quad) (-> (the-as camera-slave gp-3) tracking follow-pt quad)) + (vector-copy! (-> self tracking follow-off) (-> (the-as camera-slave gp-3) tracking follow-off)) + (vector-copy! (-> self tracking follow-pt) (-> (the-as camera-slave gp-3) tracking follow-pt)) (let* ((a2-23 (-> self tracking)) (a3-7 (-> (the-as camera-slave gp-3) tracking)) (v1-37 (-> a3-7 inv-mat rvec quad)) @@ -264,7 +260,7 @@ (set! (-> a2-23 inv-mat trans quad) a3-8) ) (copy-to (-> self tracking point-of-interest-blend) (the-as cam-float-seeker (+ (the-as uint gp-3) 344))) - (set! (-> self tracking looking-at quad) (-> (the-as camera-slave gp-3) tracking looking-at quad)) + (vector-copy! (-> self tracking looking-at) (-> (the-as camera-slave gp-3) tracking looking-at)) (set! v0-0 (-> self tracking looking-interesting)) (set! (-> (the-as vector v0-0) quad) (-> (the-as camera-slave gp-3) tracking looking-interesting quad)) ) @@ -288,7 +284,7 @@ (f30-0 (parameter-ease-sin-clamp (-> self interp-val))) (gp-0 (new-stack-vector0)) ) - (set! (-> gp-0 quad) (-> self trans quad)) + (vector-copy! gp-0 (-> self trans)) (when s5-0 (cond ((< (-> self interp-val) 1.0) @@ -404,30 +400,22 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior cam-combiner-init camera-combiner () + (local-vars (v1-6 matrix)) (stack-size-set! (-> self main-thread) 512) (vector-reset! (-> self trans)) (matrix-identity! (-> self inv-camera-rot)) - (cond - (*math-camera* - (set! (-> self fov) (-> *math-camera* fov)) - (set! (-> self trans quad) (-> *math-camera* trans quad)) - (let* ((v1-6 (-> self inv-camera-rot)) - (a3-0 (-> *math-camera* inv-camera-rot)) - (a0-6 (-> a3-0 rvec quad)) - (a1-1 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-6 rvec quad) a0-6) - (set! (-> v1-6 uvec quad) a1-1) - (set! (-> v1-6 fvec quad) a2-0) - (set! (-> v1-6 trans quad) a3-1) + (set! v1-6 (cond + (*math-camera* + (set! (-> self fov) (-> *math-camera* fov)) + (vector-copy! (-> self trans) (-> *math-camera* trans)) + (matrix-copy! (-> self inv-camera-rot) (-> *math-camera* inv-camera-rot)) + ) + (else + (set! (-> self fov) 11650.845) + v1-6 + ) + ) ) - ) - (else - (set! (-> self fov) 11650.845) - ) - ) (set! (-> self interp-val) 1.0) (set! (-> self interp-step) 0.125) (set! (-> self tracking-status) (the-as uint 0)) @@ -445,7 +433,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/camera/cam-interface_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-interface_REF.gc index df5cf241da6..7008b127ca9 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-interface_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-interface_REF.gc @@ -83,7 +83,7 @@ ;; WARN: Return type mismatch object vs symbol. (defbehavior camera-teleport-to-entity process ((arg0 entity-actor)) (let ((gp-0 (new 'stack 'transformq))) - (set! (-> gp-0 trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> gp-0 trans) (-> arg0 extra trans)) (quaternion-copy! (-> gp-0 quat) (-> arg0 quat)) (vector-identity! (-> gp-0 scale)) (the-as symbol (send-event *camera* 'teleport-to-transformq gp-0)) @@ -118,7 +118,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc index e98d2f6c1b1..0d72e86e47f 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc @@ -378,7 +378,7 @@ (set! sv-164 (the-as float 0.0)) (set! sv-168 0) (set! sv-176 (new-stack-vector0)) - (set! (-> sv-160 quad) (-> sv-240 quad)) + (vector-copy! sv-160 sv-240) (set! sv-288 0) (while (< sv-288 (the-as int (-> sv-16 elt-count))) (when (and (!= sv-288 s1-0) (!= sv-288 sv-272)) @@ -388,7 +388,7 @@ ) ((zero? sv-168) (vector+float*! sv-160 sv-160 sv-208 f0-8) - (set! (-> sv-176 quad) (-> s3-0 sv-288 quad)) + (vector-copy! sv-176 (-> s3-0 sv-288)) (set! sv-164 (the-as float 8192000.0)) (set! sv-168 1) ) @@ -402,7 +402,7 @@ ) (else (vector+float*! sv-160 sv-160 sv-208 f0-8) - (set! (-> sv-176 quad) (-> s3-0 sv-288 quad)) + (vector-copy! sv-176 (-> s3-0 sv-288)) (set! sv-168 (+ sv-168 1)) (if (< (fabs f0-8) (fabs sv-164)) (set! sv-164 (- sv-164 f0-8)) @@ -433,8 +433,8 @@ (format 0 "ERROR : camera editing out of volume points~%") ) (else - (set! (-> *volume-point* data *volume-point-current* quad) (-> sv-160 quad)) - (set! (-> *volume-point* data (+ *volume-point-current* 1) quad) (-> sv-240 quad)) + (vector-copy! (-> *volume-point* data *volume-point-current*) sv-160) + (vector-copy! (-> *volume-point* data (+ *volume-point-current* 1)) sv-240) (set! *volume-point-current* (+ *volume-point-current* 2)) (+! (-> s2-0 point-count) 2) ) @@ -458,8 +458,8 @@ (format 0 "ERROR : camera editing out of volume normals~%") ) (else - (set! (-> *volume-normal* data *volume-normal-current* quad) (-> s0-0 quad)) - (set! (-> *volume-normal* data (+ *volume-normal-current* 1) quad) (-> s3-0 s1-0 quad)) + (vector-copy! (-> *volume-normal* data *volume-normal-current*) s0-0) + (vector-copy! (-> *volume-normal* data (+ *volume-normal-current* 1)) (-> s3-0 s1-0)) (set! *volume-normal-current* (+ *volume-normal-current* 2)) (set! (-> s2-0 normal-count) (+ (-> s2-0 normal-count) 2)) ) @@ -594,7 +594,7 @@ (arg0 s3-0 (-> arg1 from) (-> arg1 to) 0.0 (-> arg1 axis) 65536.0) (vector+! s3-0 s3-0 (-> arg1 origin)) (dotimes (s2-0 10) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) (arg0 s3-0 (-> arg1 from) (-> arg1 to) (* 0.1 (+ 1.0 (the float s2-0))) (-> arg1 axis) 65536.0) (vector+! s3-0 s3-0 (-> arg1 origin)) (camera-line s3-0 s5-0 (-> arg1 color)) @@ -617,7 +617,7 @@ (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) 0.0) (vector+! s3-0 s3-0 (-> arg1 origin)) (dotimes (s2-0 10) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (* 182.04445 (* 18.0 (+ 1.0 (the float s2-0))))) (vector+! s3-0 s3-0 (-> arg1 origin)) (camera-line s3-0 s5-0 (-> arg1 color)) @@ -638,18 +638,14 @@ (if (not arg0) (return #f) ) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (let ((s4-0 (new-stack-vector0))) - (when (and (cam-slave-get-vector-with-offset arg0 s4-0 'trans) - (or (!= *camera-layout-blink* 'camera) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) - ) - (cam-slave-get-rot arg0 s5-0) - (camera-fov-frame s5-0 s4-0 (* 0.5 (cam-slave-get-fov arg0)) 0.75 1.0 (new 'static 'vector4w :z #xff :w #x80)) + (let ((s5-0 (new-stack-matrix0)) + (s4-0 (new-stack-vector0)) ) + (when (and (cam-slave-get-vector-with-offset arg0 s4-0 'trans) + (or (!= *camera-layout-blink* 'camera) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cam-slave-get-rot arg0 s5-0) + (camera-fov-frame s5-0 s4-0 (* 0.5 (cam-slave-get-fov arg0)) 0.75 1.0 (new 'static 'vector4w :z #xff :w #x80)) ) ) (let ((s5-1 (new-stack-vector0))) @@ -707,28 +703,27 @@ (vector-! s4-1 s4-1 s5-4) ) (else - (set! (-> s4-1 quad) - (-> (the-as - vector - ((method-of-type res-lump get-property-struct) - arg0 - 'spline-offset - 'interp - -1000000000.0 - s4-1 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - quad - ) - ) + (vector-copy! + s4-1 + (the-as + vector + ((method-of-type res-lump get-property-struct) + arg0 + 'spline-offset + 'interp + -1000000000.0 + s4-1 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) ) ) (curve-get-pos! s5-4 0.0 s3-1) (vector+! s5-4 s5-4 s4-1) (dotimes (s1-1 8) - (set! (-> s2-0 quad) (-> s5-4 quad)) + (vector-copy! s2-0 s5-4) (curve-get-pos! s5-4 (* 0.125 (the float (+ s1-1 1))) s3-1) (vector+! s5-4 s5-4 s4-1) (camera-line s2-0 s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80)) @@ -771,7 +766,7 @@ (curve-get-pos! s5-5 0.0 s3-2) (vector+! s5-5 s5-5 s4-2) (dotimes (s1-3 8) - (set! (-> s2-1 quad) (-> s5-5 quad)) + (vector-copy! s2-1 s5-5) (curve-get-pos! s5-5 (* 0.125 (the float (+ s1-3 1))) s3-2) (vector+! s5-5 s5-5 s4-2) (camera-line s2-1 s5-5 (new 'static 'vector4w :z #xff :w #x80)) @@ -960,11 +955,7 @@ ) ) ) - (let ((s5-1 (new 'stack-no-clear 'matrix))) - (set! (-> s5-1 rvec quad) (the-as uint128 0)) - (set! (-> s5-1 uvec quad) (the-as uint128 0)) - (set! (-> s5-1 fvec quad) (the-as uint128 0)) - (set! (-> s5-1 trans quad) (the-as uint128 0)) + (let ((s5-1 (new-stack-matrix0))) (let ((a2-8 (new-stack-vector0))) (set! (-> a2-8 y) -1.0) (forward-down-nopitch->inv-matrix s5-1 (-> *math-camera* inv-camera-rot fvec) a2-8) @@ -1219,7 +1210,7 @@ (defbehavior clmf-look-through cam-layout () (set! (-> *camera-other-fov* data) (cam-slave-get-fov (-> self cam-entity))) (cam-slave-get-vector-with-offset (the-as entity-actor (-> self cam-entity)) *camera-other-trans* 'trans) - (set! (-> *camera-other-root* quad) (-> *camera-other-trans* quad)) + (vector-copy! *camera-other-root* *camera-other-trans*) (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) *camera-other-matrix*) (set! *camera-look-through-other* 10) (set-setting! 'master-options 'set 0.0 32) @@ -1287,7 +1278,7 @@ (if arg0 (format #t "setup trans ~M ~M ~M (maya)~%" (-> s1-0 x) (-> s1-0 y) (-> s1-0 z)) ) - (set! (-> s3-1 quad) (-> s1-0 quad)) + (vector-copy! s3-1 s1-0) (when (the-as vector s5-1) (if arg0 (format @@ -1356,7 +1347,7 @@ (when s2-0 (if s5-1 (vector+! s4-1 s2-0 s5-1) - (set! (-> s4-1 quad) (-> s2-0 quad)) + (vector-copy! s4-1 s2-0) ) (if arg0 (format #t "setup pivot ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) @@ -1404,7 +1395,7 @@ (when s2-0 (if s5-1 (vector+! s4-1 s2-0 s5-1) - (set! (-> s4-1 quad) (-> s2-0 quad)) + (vector-copy! s4-1 s2-0) ) (if arg0 (format #t "setup align ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) @@ -1452,7 +1443,7 @@ (when s2-0 (if s5-1 (vector+! s4-1 s2-0 s5-1) - (set! (-> s4-1 quad) (-> s2-0 quad)) + (vector-copy! s4-1 s2-0) ) (if arg0 (format #t "setup interesting ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) diff --git a/test/decompiler/reference/jak3/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-master_REF.gc index d86d6d63278..ba409d6c0ef 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-master_REF.gc @@ -32,20 +32,20 @@ (set! (-> self tpos-old y) (lerp (-> self tpos-old y) (-> v1-5 y) (* 3.0 (seconds-per-frame)))) (set! (-> self tpos-old y) (lerp (-> self tpos-old y) (-> v1-5 y) (* 8.0 (seconds-per-frame)))) ) - (set! (-> self tpos-curr quad) (-> self tpos-old quad)) - (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) + (vector-copy! (-> self tpos-curr) (-> self tpos-old)) + (vector-copy! (-> self tpos-old-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-curr-adj) (-> self tpos-old)) (let ((v0-0 (the-as object (-> self tpos-tgt)))) (set! (-> (the-as vector v0-0) quad) (-> self tpos-old quad)) v0-0 ) ) (else - (set! (-> self tpos-old quad) (-> v1-5 quad)) - (set! (-> self tpos-curr quad) (-> self tpos-old quad)) - (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) + (vector-copy! (-> self tpos-old) v1-5) + (vector-copy! (-> self tpos-curr) (-> self tpos-old)) + (vector-copy! (-> self tpos-old-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-curr-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-tgt) (-> self tpos-old)) (set! (-> self upspeed) 0.0) ) ) @@ -60,11 +60,11 @@ (defbehavior reset-target-tracking camera-master () (let ((gp-0 (handle->process (-> self focus handle)))) (when gp-0 - (set! (-> self tpos-old quad) (-> (get-trans (the-as process-focusable gp-0) 4) quad)) - (set! (-> self tpos-curr quad) (-> self tpos-old quad)) - (set! (-> self tpos-old-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-curr-adj quad) (-> self tpos-old quad)) - (set! (-> self tpos-tgt quad) (-> self tpos-old quad)) + (vector-copy! (-> self tpos-old) (get-trans (the-as process-focusable gp-0) 4)) + (vector-copy! (-> self tpos-curr) (-> self tpos-old)) + (vector-copy! (-> self tpos-old-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-curr-adj) (-> self tpos-old)) + (vector-copy! (-> self tpos-tgt) (-> self tpos-old)) (quaternion->matrix (-> self tgt-rot-mat) (get-quat (the-as process-focusable gp-0) 2)) (quaternion->matrix (-> self tgt-face-mat) (get-quat (the-as process-focusable gp-0) 1)) (vector-reset! (-> self pitch-off)) @@ -115,7 +115,7 @@ (let ((gp-0 (handle->process (-> self focus handle)))) (cond ((and *target* (not gp-0)) - (try-update-focus (-> self focus) *target*) + (focus-on! (-> self focus) *target*) (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) (reset-target-tracking) ) @@ -154,8 +154,8 @@ (+! (-> self under-water) -1) ) ) - (set! (-> self tpos-old quad) (-> self tpos-curr quad)) - (set! (-> self tpos-old-adj quad) (-> self tpos-curr-adj quad)) + (vector-copy! (-> self tpos-old) (-> self tpos-curr)) + (vector-copy! (-> self tpos-old-adj) (-> self tpos-curr-adj)) (quaternion->matrix (-> self tgt-rot-mat) (get-quat (the-as process-focusable gp-0) 2)) (quaternion->matrix (-> self tgt-face-mat) (get-quat (the-as process-focusable gp-0) 1)) (cond @@ -183,7 +183,7 @@ (+! (-> self ease-t) (-> self ease-step)) ) (else - (set! (-> self tpos-curr quad) (-> (get-trans (the-as process-focusable gp-0) 4) quad)) + (vector-copy! (-> self tpos-curr) (get-trans (the-as process-focusable gp-0) 4)) ) ) (when (focus-test? (the-as process-focusable gp-0) edge-grab) @@ -278,7 +278,7 @@ ) ) ) - (set! (-> self tpos-tgt quad) (-> self tpos-curr quad)) + (vector-copy! (-> self tpos-tgt) (-> self tpos-curr)) (vector-! s5-7 (-> self tpos-curr-adj) (-> self tpos-curr)) (let* ((f0-38 (vector-dot s5-7 (-> self local-down))) (f0-39 (cond @@ -652,7 +652,7 @@ (deactivate (-> self slave 0)) (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) - (set! (-> *camera-combiner* trans quad) (-> (the-as matrix gp-1) rvec quad)) + (vector-copy! (-> *camera-combiner* trans) (-> (the-as matrix gp-1) rvec)) (quaternion->matrix (-> *camera-combiner* inv-camera-rot) (the-as quaternion (+ (the-as uint gp-1) 16))) ) (send-event self 'teleport) @@ -666,7 +666,7 @@ (deactivate (-> self slave 0)) (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) - (set! (-> *camera-combiner* trans quad) (-> *camera-other-trans* quad)) + (vector-copy! (-> *camera-combiner* trans) *camera-other-trans*) (vector-! gp-2 (-> self tpos-curr-adj) *camera-other-trans*) (vector-normalize! gp-2 1.0) (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-2 (new 'static 'vector :y -1.0)) @@ -683,7 +683,7 @@ (deactivate (-> self slave 0)) (set! (-> self slave) (the-as (pointer camera-slave) #f)) ) - (set! (-> *camera-combiner* trans quad) (-> (the-as vector s5-0) quad)) + (vector-copy! (-> *camera-combiner* trans) (the-as vector s5-0)) (vector-! gp-3 (-> self tpos-curr-adj) (the-as vector s5-0)) (vector-normalize! gp-3 1.0) (forward-down->inv-matrix (-> *camera-combiner* inv-camera-rot) gp-3 (new 'static 'vector :y -1.0)) @@ -700,7 +700,7 @@ (logclear! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) ) (else - (try-update-focus (-> self focus) (the-as process-focusable a1-15)) + (focus-on! (-> self focus) (the-as process-focusable a1-15)) (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) (reset-target-tracking) ) @@ -844,7 +844,7 @@ (if (< (the-as float (-> block param 0)) (-> self ease-t)) (set! (-> self ease-t) (the-as float (-> block param 0))) ) - (set! (-> self ease-to quad) (-> (the-as vector (-> block param 1)) quad)) + (vector-copy! (-> self ease-to) (the-as vector (-> block param 1))) (logior! (-> self master-options) (cam-master-options-u32 HAVE_EASE_TO_POS)) ) ) @@ -1090,7 +1090,7 @@ ;; INFO: Used lq/sq (defmethod camera-master-method-15 ((this camera-master) (arg0 vector)) (if (and (-> this slave) (-> this slave 0 next-state) (= (-> this slave 0 next-state name) 'cam-string)) - (set! (-> arg0 quad) (-> this slave 0 view-flat quad)) + (vector-copy! arg0 (-> this slave 0 view-flat)) (vector-reset! arg0) ) arg0 diff --git a/test/decompiler/reference/jak3/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-states-dbg_REF.gc index 4029cb9dcb1..0aca5229a40 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-states-dbg_REF.gc @@ -70,11 +70,7 @@ ) ) (let ((s4-0 (new-stack-vector0))) - (let ((s3-0 (new 'stack-no-clear 'matrix))) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) + (let ((s3-0 (new-stack-matrix0))) (matrix-axis-angle! s3-0 (the-as vector (-> self tracking)) (- (-> s5-0 x))) (vector-matrix*! s4-0 (-> self tracking inv-mat fvec) s3-0) (matrix-axis-angle! s3-0 (-> *camera* local-down) (- (-> s5-0 y))) diff --git a/test/decompiler/reference/jak3/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-states_REF.gc index ce2a1aaf1d3..f67e0a18aa1 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-states_REF.gc @@ -40,7 +40,7 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 @@ -68,7 +68,7 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 @@ -79,7 +79,7 @@ (when (not (paused?)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> self fov) (-> *camera* slave 0 fov)) - (set! (-> self trans quad) (-> self saved-pt quad)) + (vector-copy! (-> self trans) (-> self saved-pt)) (cam-curve-pos (-> self trans) gp-0 (the-as curve #f) #f) (when (!= (-> gp-0 w) 0.0) (vector-normalize! gp-0 1.0) @@ -274,9 +274,9 @@ (set! s4-0 (cond ((and (< (vector-vector-distance s2-0 gp-0) 40960.0) (< (cos 3640.889) (vector-dot s5-0 s3-0))) - (set! (-> self trans quad) (-> s2-0 quad)) + (vector-copy! (-> self trans) s2-0) (vector-negate! (the-as vector (-> self tracking)) (-> s0-0 rvec)) - (set! (-> self tracking inv-mat uvec quad) (-> s0-0 uvec quad)) + (vector-copy! (-> self tracking inv-mat uvec) (-> s0-0 uvec)) (vector-negate! (-> self tracking inv-mat fvec) (-> s0-0 fvec)) (set! (-> self fov) (* 2.0 (atan (/ 12.700255 (* 20.3 (-> s1-0 x))) 1.0))) (vector-float*! (the-as vector (-> self tracking)) (the-as vector (-> self tracking)) (/ 1.0 (-> s1-0 x))) @@ -291,9 +291,9 @@ ) ) ) - (set! (-> gp-0 quad) (-> s2-0 quad)) + (vector-copy! gp-0 s2-0) ) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) ) ) (suspend) @@ -331,25 +331,14 @@ ) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (new 'stack-no-clear 'matrix))) - (let* ((v1-8 a2-0) - (t0-0 (-> (the-as process-drawable (-> *camera* settings pov-handle process 0)) - node-list - data - (-> *camera* settings pov-bone) - bone - transform - ) - ) - (a0-9 (-> t0-0 rvec quad)) - (a1-11 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-8 rvec quad) a0-9) - (set! (-> v1-8 uvec quad) a1-11) - (set! (-> v1-8 fvec quad) a3-0) - (set! (-> v1-8 trans quad) t0-1) - ) + (matrix-copy! a2-0 (-> (the-as process-drawable (-> *camera* settings pov-handle process 0)) + node-list + data + (-> *camera* settings pov-bone) + bone + transform + ) + ) (vector-reset! (-> a2-0 trans)) (vector-matrix*! gp-0 (-> *camera* settings pov-offset) a2-0) ) @@ -541,12 +530,8 @@ (until #f (when (not (paused?)) (let ((s4-0 (vector-reset! (new-stack-vector0))) - (s5-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new-stack-matrix0)) ) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) (let ((f30-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -256 (-> *cpad-list* cpads 0 leftx))) @@ -739,7 +724,7 @@ ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *camera* tpos-curr quad)) + (vector-copy! s4-0 (-> *camera* tpos-curr)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -803,7 +788,7 @@ (vector+! (-> self spline-offset) (-> self spline-offset) (the-as vector a0-8)) ) ) - (set! (-> self trans quad) (-> self saved-pt quad)) + (vector-copy! (-> self trans) (-> self saved-pt)) (cam-calc-follow! (-> self tracking) (-> self trans) #f) (set! (-> self spline-follow-dist) (cam-slave-get-float (-> self cam-entity) 'spline-follow-dist 0.0)) (cond @@ -861,7 +846,7 @@ (when (not (paused?)) (cam-calc-follow! (-> self tracking) (-> self trans) #t) (new 'stack 'curve) - (set! (-> self trans quad) (-> self saved-pt quad)) + (vector-copy! (-> self trans) (-> self saved-pt)) (cam-curve-pos (-> self trans) (the-as vector #f) (the-as curve #f) #t) ) (suspend) @@ -884,7 +869,7 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) ) @@ -949,9 +934,9 @@ (let ((a1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> self trans quad)) + (vector-copy! a1-0 (-> self trans)) (set! (-> a1-0 y) 0.0) - (set! (-> s5-0 quad) (-> self velocity quad)) + (vector-copy! s5-0 (-> self velocity)) (set! (-> s5-0 y) 0.0) (init gp-0 a1-0 81.92 (fmax 819.2 (vector-length s5-0)) 0.75) (set! (-> gp-0 vel quad) (-> s5-0 quad)) @@ -995,12 +980,8 @@ (f1-2 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 32.0 110.0 (* 8192.0 (seconds-per-frame))) ) - (s2-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new-stack-matrix0)) ) - (set! (-> s2-0 rvec quad) (the-as uint128 0)) - (set! (-> s2-0 uvec quad) (the-as uint128 0)) - (set! (-> s2-0 fvec quad) (the-as uint128 0)) - (set! (-> s2-0 trans quad) (the-as uint128 0)) (let ((v1-15 (new 'stack-no-clear 'vector))) 0.0 (if (-> *camera* settings flip-horizontal) @@ -1078,7 +1059,7 @@ (vector-matrix*! arg0 arg1 s4-0) ) (else - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (if (logtest? (-> self options) (cam-slave-options-u32 SHRINK_MAX_ANGLE)) (set! (-> self max-angle-curr) f28-0) ) @@ -1160,7 +1141,7 @@ ;; definition for function cam-circular-code ;; INFO: Used lq/sq (defbehavior cam-circular-code camera-slave () - (set! (-> self pivot-pt quad) (-> self saved-pt quad)) + (vector-copy! (-> self pivot-pt) (-> self saved-pt)) (cam-curve-pos (-> self pivot-pt) (the-as vector #f) (the-as curve #f) #f) (let ((a2-1 (new-stack-vector0)) (f0-0 182.04445) @@ -1208,7 +1189,7 @@ #f ) (('outro-done) - (set! (-> self trans quad) (-> *camera-combiner* trans quad)) + (vector-copy! (-> self trans) (-> *camera-combiner* trans)) (cam-circular-position #f) ) (else @@ -1224,7 +1205,7 @@ (let ((gp-0 (new-stack-vector0))) (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (set! (-> self view-off-param) 1.0) - (set! (-> self circular-follow quad) (-> *camera* tpos-curr-adj quad)) + (vector-copy! (-> self circular-follow) (-> *camera* tpos-curr-adj)) (set! (-> self max-angle-offset) 0.0) (cond ((-> self cam-entity) @@ -1280,7 +1261,7 @@ ) (else (set! (-> self spline-follow-dist) 0.0) - (set! (-> self pivot-pt quad) (-> self saved-pt quad)) + (vector-copy! (-> self pivot-pt) (-> self saved-pt)) (cam-curve-pos (-> self pivot-pt) (the-as vector #f) (the-as curve #f) #f) ) ) @@ -1289,8 +1270,8 @@ (vector-! (-> self pivot-pt) (-> *camera* tpos-curr-adj) (-> self trans)) (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) (set! (-> self pivot-rad) (vector-length (-> self pivot-pt))) - (set! (-> self pivot-pt quad) (-> self trans quad)) - (set! (-> self saved-pt quad) (-> self pivot-pt quad)) + (vector-copy! (-> self pivot-pt) (-> self trans)) + (vector-copy! (-> self saved-pt) (-> self pivot-pt)) ) (else (vector-! (-> self pivot-pt) (-> *camera* tpos-curr-adj) (-> self trans)) @@ -1298,7 +1279,7 @@ (vector-flatten! (-> self pivot-pt) (-> self pivot-pt) (-> *camera* local-down)) (set! (-> self pivot-rad) (vector-length (-> self pivot-pt))) (vector+! (-> self pivot-pt) (-> self trans) (-> self pivot-pt)) - (set! (-> self saved-pt quad) (-> self pivot-pt quad)) + (vector-copy! (-> self saved-pt) (-> self pivot-pt)) ) ) ) @@ -1401,18 +1382,18 @@ (set! (-> s5-0 z) (+ 1024.0 (-> *CAMERA-bank* default-string-min-z))) ) (vector--float*! s5-0 s5-0 (-> *camera* local-down) (-> *CAMERA-bank* default-string-min-y)) - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) (until #f (vector--float*! s4-0 arg0 (-> *camera* local-down) (-> *camera* settings target-height)) - (set! (-> s3-0 start-pos quad) (-> *camera* tpos-curr-adj quad)) - (set! (-> s3-0 move-dist quad) (-> arg0 quad)) + (vector-copy! (-> s3-0 start-pos) (-> *camera* tpos-curr-adj)) + (vector-copy! (-> s3-0 move-dist) arg0) (if (< (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) (return #t) ) (set! f30-0 (cond ((>= -32768.0 f30-0) (format #t "cam-string didn't find a spot~%") - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) (return #f) f30-0 ) @@ -1438,7 +1419,7 @@ (vector-flatten! (-> self view-flat) arg0 (-> *camera* local-down)) (set! (-> self min-z-override) (vector-length (-> self view-flat))) (vector+! (-> self desired-pos) arg0 (-> *camera* tpos-curr-adj)) - (set! (-> self string-trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self string-trans) (-> self desired-pos)) (tracking-spline-method-10 (-> self position-spline) (-> self desired-pos)) (vector-reset! (-> self velocity)) (let ((v0-2 (logclear (-> self options) (cam-slave-options-u32 GOTO_GOOD_POINT)))) @@ -1771,7 +1752,7 @@ (f30-0 2.0) ) 0.0 - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-! (-> s5-0 move-dist) arg1 arg0) (let ((v1-4 s5-0)) (set! (-> v1-4 radius) (-> *CAM_STRING-bank* los-coll-rad2)) @@ -1997,8 +1978,8 @@ (f26-0 (vector-length arg1)) (f30-0 (vector-normalize-ret-len! s4-0 1.0)) ) - (set! (-> s1-0 start-pos quad) (-> arg0 quad)) - (set! (-> s1-0 move-dist quad) (-> arg1 quad)) + (vector-copy! (-> s1-0 start-pos) arg0) + (vector-copy! (-> s1-0 move-dist) arg1) (let ((v1-5 s1-0)) (set! (-> v1-5 radius) (-> *CAM_STRING-bank* los-coll-rad)) (set! (-> v1-5 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -2138,18 +2119,19 @@ (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) ) (logior! (-> self options) (cam-slave-options-u32 GOTO_GOOD_POINT)) - (set! (-> self good-point quad) - (-> *camera* target-spline point (-> *camera* target-spline used-point) position quad) - ) - (set! (-> self los-last-pos quad) (-> self good-point quad)) + (vector-copy! + (-> self good-point) + (-> *camera* target-spline point (-> *camera* target-spline used-point) position) + ) + (vector-copy! (-> self los-last-pos) (-> self good-point)) (when *debug-segment* (let ((a1-22 (new 'stack-no-clear 'vector))) (vector-! a1-22 (-> self good-point) (-> self string-trans)) (cam-collision-record-save (-> self string-trans) a1-22 -3 'jump self) ) ) - (set! (-> self desired-pos quad) (-> self good-point quad)) - (set! (-> self string-trans quad) (-> self good-point quad)) + (vector-copy! (-> self desired-pos) (-> self good-point)) + (vector-copy! (-> self string-trans) (-> self good-point)) (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) (vector-reset! (-> self velocity)) @@ -2177,7 +2159,7 @@ (set! (-> self los-tgt-spline-pt-incarnation) (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) ) - (set! (-> self los-last-pos quad) (-> arg0 quad)) + (vector-copy! (-> self los-last-pos) arg0) ) ((begin (if *display-cam-los-debug* @@ -2219,16 +2201,16 @@ (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) ) (logior! (-> self options) (cam-slave-options-u32 GOTO_GOOD_POINT)) - (set! (-> self good-point quad) (-> *camera* target-spline point s2-2 position quad)) - (set! (-> self los-last-pos quad) (-> self good-point quad)) + (vector-copy! (-> self good-point) (-> *camera* target-spline point s2-2 position)) + (vector-copy! (-> self los-last-pos) (-> self good-point)) (when *debug-segment* (let ((a1-40 (new 'stack-no-clear 'vector))) (vector-! a1-40 (-> self good-point) (-> self string-trans)) (cam-collision-record-save (-> self string-trans) a1-40 -3 'jump self) ) ) - (set! (-> self desired-pos quad) (-> self good-point quad)) - (set! (-> self string-trans quad) (-> self good-point quad)) + (vector-copy! (-> self desired-pos) (-> self good-point)) + (vector-copy! (-> self string-trans) (-> self good-point)) (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) (vector-reset! (-> self velocity)) @@ -2246,7 +2228,7 @@ (set! (-> self los-tgt-spline-pt-incarnation) (-> *camera* target-spline point (-> self los-tgt-spline-pt) incarnation) ) - (set! (-> self los-last-pos quad) (-> arg0 quad)) + (vector-copy! (-> self los-last-pos) arg0) ) (else (if *display-cam-los-debug* @@ -2312,7 +2294,7 @@ (-> self good-point) (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 (-> self los-tgt-spline-pt)))) ) - (set! (-> self los-last-pos quad) (-> self good-point quad)) + (vector-copy! (-> self los-last-pos) (-> self good-point)) (when *display-cam-los-debug* (format 0 "going because u(~f) > 0 frame ~D~%" f30-2 (current-time)) (format *stdcon* " going because u(~f) > 0 frame ~D~%" f30-2 (current-time)) @@ -2726,152 +2708,146 @@ ) ) ) - (s4-0 (new 'stack-no-clear 'matrix)) + (s4-0 (new-stack-matrix0)) + (gp-3 (new-stack-vector0)) + (s5-3 (new-stack-vector0)) ) - (set! (-> s4-0 rvec quad) (the-as uint128 0)) - (set! (-> s4-0 uvec quad) (the-as uint128 0)) - (set! (-> s4-0 fvec quad) (the-as uint128 0)) - (set! (-> s4-0 trans quad) (the-as uint128 0)) - (let ((gp-3 (new-stack-vector0)) - (s5-3 (new-stack-vector0)) - ) - (if (-> *camera* settings flip-horizontal) - (set! f30-2 (- f30-2)) - ) - (if (or (logtest? (cam-slave-options-u32 BLOCK_RIGHT_STICK) (-> self options)) - (logtest? (-> *camera* settings master-options) (cam-master-options BLOCK_RIGHT_STICK)) + (if (-> *camera* settings flip-horizontal) + (set! f30-2 (- f30-2)) + ) + (if (or (logtest? (cam-slave-options-u32 BLOCK_RIGHT_STICK) (-> self options)) + (logtest? (-> *camera* settings master-options) (cam-master-options BLOCK_RIGHT_STICK)) + ) + (set! f30-2 0.0) + ) + (if (-> *setting-control* user-default camera-stick-dir) + (set! f30-2 (- f30-2)) + ) + (if (-> self have-phony-joystick) + (set! f30-2 (* 21845.334 (-> self phony-joystick-x) (seconds-per-frame))) + ) + (when (or (logtest? (cam-slave-options-u32 ALLOW_SHIFT_BUTTONS) (-> self options)) + (logtest? (-> *camera* settings master-options) (cam-master-options USE_L1_R1)) ) - (set! f30-2 0.0) - ) - (if (-> *setting-control* user-default camera-stick-dir) - (set! f30-2 (- f30-2)) - ) - (if (-> self have-phony-joystick) - (set! f30-2 (* 21845.334 (-> self phony-joystick-x) (seconds-per-frame))) - ) - (when (or (logtest? (cam-slave-options-u32 ALLOW_SHIFT_BUTTONS) (-> self options)) - (logtest? (-> *camera* settings master-options) (cam-master-options USE_L1_R1)) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? (-> *CAMERA-bank* joypad) r1) + (+! f30-2 (+ (* 10922.667 (seconds-per-frame)) + (analog-input + (the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 9)) + 0.0 + 32.0 + 230.0 + (* 21845.334 (seconds-per-frame)) + ) + ) ) - (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) - (if (cpad-hold? (-> *CAMERA-bank* joypad) r1) - (+! f30-2 (+ (* 10922.667 (seconds-per-frame)) - (analog-input - (the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 9)) - 0.0 - 32.0 - 230.0 - (* 21845.334 (seconds-per-frame)) - ) + ) + ) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? (-> *CAMERA-bank* joypad) l1) + (set! f30-2 (- f30-2 (+ (* 10922.667 (seconds-per-frame)) + (analog-input + (the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 8)) + 0.0 + 32.0 + 230.0 + (* 21845.334 (seconds-per-frame)) + ) + ) ) ) - ) - ) - (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) - (if (cpad-hold? (-> *CAMERA-bank* joypad) l1) - (set! f30-2 (- f30-2 (+ (* 10922.667 (seconds-per-frame)) - (analog-input - (the-as int (-> *cpad-list* cpads (-> *CAMERA-bank* joypad) abutton 8)) - 0.0 - 32.0 - 230.0 - (* 21845.334 (seconds-per-frame)) - ) - ) - ) - ) - ) - ) + ) ) - (cond - ((and (= (-> self los-state) (slave-los-state ccw)) (< 0.0 f30-2)) - (let ((f0-82 - (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) - ) + ) + (cond + ((and (= (-> self los-state) (slave-los-state ccw)) (< 0.0 f30-2)) + (let ((f0-82 + (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) ) - (set! f30-2 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-82)) (seconds-per-frame))) - ) + ) + (set! f30-2 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-82)) (seconds-per-frame))) ) - ((and (= (-> self los-state) (slave-los-state cw)) (< f30-2 0.0)) - (let ((f0-88 - (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) - ) + ) + ((and (= (-> self los-state) (slave-los-state cw)) (< f30-2 0.0)) + (let ((f0-88 + (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) ) - (set! f30-2 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-88)) (seconds-per-frame))) - ) + ) + (set! f30-2 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-88)) (seconds-per-frame))) ) - ) - (cond - ((!= f30-2 0.0) - (logior! (-> self options) (cam-slave-options-u32 PLAYER_MOVING_CAMERA)) - (matrix-axis-angle! s4-0 (-> *camera* local-down) f30-2) - (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) - (set! (-> self butt-timer) 0) - (set! (-> self butt-seek) #f) - (when (logtest? (cam-slave-options-u32 HAVE_BUTT_HANDLE) (-> self options)) - (kill-persister *setting-control* (the-as engine-pers 'butt-handle) 'butt-handle) - (logclear! (-> self options) (cam-slave-options-u32 HAVE_BUTT_HANDLE)) - ) + ) + ) + (cond + ((!= f30-2 0.0) + (logior! (-> self options) (cam-slave-options-u32 PLAYER_MOVING_CAMERA)) + (matrix-axis-angle! s4-0 (-> *camera* local-down) f30-2) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + (set! (-> self butt-timer) 0) + (set! (-> self butt-seek) #f) + (when (logtest? (cam-slave-options-u32 HAVE_BUTT_HANDLE) (-> self options)) + (kill-persister *setting-control* (the-as engine-pers 'butt-handle) 'butt-handle) + (logclear! (-> self options) (cam-slave-options-u32 HAVE_BUTT_HANDLE)) ) - ((or (logtest? (-> self options) (cam-slave-options-u32 BUTT_CAM)) - (let ((s3-0 (handle->process (-> *camera* settings butt-handle)))) - (if (type? s3-0 process-drawable) - s3-0 - ) - ) - ) - (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) - (let ((v1-303 (handle->process (-> *camera* settings butt-handle)))) - (cond - (v1-303 - (logior! (-> self options) (cam-slave-options-u32 HAVE_BUTT_HANDLE)) - (let* ((s3-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> (the-as process-drawable v1-303) root quat))) - (a2-18 (matrix-axis-angle! - (new 'stack-no-clear 'matrix) - (-> s3-1 uvec) - (+ 32768.0 (-> *camera* settings butt-angle)) - ) - ) - ) - (vector-matrix*! s5-3 (-> s3-1 fvec) a2-18) + ) + ((or (logtest? (-> self options) (cam-slave-options-u32 BUTT_CAM)) + (let ((s3-0 (handle->process (-> *camera* settings butt-handle)))) + (if (type? s3-0 process-drawable) + s3-0 ) - (vector-flatten! s5-3 s5-3 (-> *camera* local-down)) - ) - ((< (- (current-time) (-> self butt-timer)) 0) - (vector-flatten! s5-3 (-> self butt-vector) (-> *camera* local-down)) - ) - (else - (vector-flatten! s5-3 (-> *camera* tgt-rot-mat fvec) (-> *camera* local-down)) - ) ) ) - (vector-normalize! s5-3 -1.0) - (when (and (logtest? (cam-slave-options-u32 HAVE_BUTT_HANDLE) (-> self options)) - (< (cos 910.2222) (vector-dot gp-3 s5-3)) + (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) + (let ((v1-303 (handle->process (-> *camera* settings butt-handle)))) + (cond + (v1-303 + (logior! (-> self options) (cam-slave-options-u32 HAVE_BUTT_HANDLE)) + (let* ((s3-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> (the-as process-drawable v1-303) root quat))) + (a2-18 (matrix-axis-angle! + (new 'stack-no-clear 'matrix) + (-> s3-1 uvec) + (+ 32768.0 (-> *camera* settings butt-angle)) + ) + ) ) - (kill-persister *setting-control* (the-as engine-pers 'butt-handle) 'butt-handle) - (logclear! (-> self options) (cam-slave-options-u32 HAVE_BUTT_HANDLE)) + (vector-matrix*! s5-3 (-> s3-1 fvec) a2-18) + ) + (vector-flatten! s5-3 s5-3 (-> *camera* local-down)) + ) + ((< (- (current-time) (-> self butt-timer)) 0) + (vector-flatten! s5-3 (-> self butt-vector) (-> *camera* local-down)) + ) + (else + (vector-flatten! s5-3 (-> *camera* tgt-rot-mat fvec) (-> *camera* local-down)) + ) ) - (matrix-from-two-vectors-max-angle! s4-0 gp-3 s5-3 546.13336) - (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) ) - (else - (logclear! (-> self options) (cam-slave-options-u32 HAVE_BUTT_HANDLE)) - ) - ) - (when (logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) - (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) - (vector-flatten! s5-3 (-> *camera* tgt-rot-mat fvec) (-> *camera* local-down)) - (vector-normalize! s5-3 -1.0) - (let ((f0-97 (acos (vector-dot s5-3 gp-3)))) - (when (and (< (-> self max-angle-offset) f0-97) (< f0-97 32585.955)) - (matrix-from-two-vectors-max-angle! - s4-0 - gp-3 - s5-3 - (fmin 546.13336 (* 0.5 (- f0-97 (-> self max-angle-offset)))) - ) - (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + (vector-normalize! s5-3 -1.0) + (when (and (logtest? (cam-slave-options-u32 HAVE_BUTT_HANDLE) (-> self options)) + (< (cos 910.2222) (vector-dot gp-3 s5-3)) + ) + (kill-persister *setting-control* (the-as engine-pers 'butt-handle) 'butt-handle) + (logclear! (-> self options) (cam-slave-options-u32 HAVE_BUTT_HANDLE)) + ) + (matrix-from-two-vectors-max-angle! s4-0 gp-3 s5-3 546.13336) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) + ) + (else + (logclear! (-> self options) (cam-slave-options-u32 HAVE_BUTT_HANDLE)) + ) + ) + (when (logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) + (vector-normalize-copy! gp-3 (-> self view-flat) 1.0) + (vector-flatten! s5-3 (-> *camera* tgt-rot-mat fvec) (-> *camera* local-down)) + (vector-normalize! s5-3 -1.0) + (let ((f0-97 (acos (vector-dot s5-3 gp-3)))) + (when (and (< (-> self max-angle-offset) f0-97) (< f0-97 32585.955)) + (matrix-from-two-vectors-max-angle! + s4-0 + gp-3 + s5-3 + (fmin 546.13336 (* 0.5 (- f0-97 (-> self max-angle-offset)))) ) + (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) ) ) ) @@ -2918,7 +2894,7 @@ (-> *camera* settings target-height) ) (vector-! (-> s5-0 move-dist) (-> s5-0 move-dist) (-> self string-trans)) - (set! (-> s5-0 start-pos quad) (-> self string-trans quad)) + (vector-copy! (-> s5-0 start-pos) (-> self string-trans)) (let ((s4-0 s5-0)) (set! (-> s4-0 radius) 409.6) (set! (-> s4-0 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -3016,7 +2992,7 @@ (let ((f28-0 (cond ((logtest? (-> self options) (cam-slave-options-u32 COLLIDE)) - (set! (-> s5-1 start-pos quad) (-> self string-trans quad)) + (vector-copy! (-> s5-1 start-pos) (-> self string-trans)) (let ((s2-0 s5-1)) (set! (-> s2-0 radius) (-> *CAMERA-bank* collide-move-rad)) (set! (-> s2-0 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -3138,7 +3114,7 @@ ) ) (logclear! (-> self options) (cam-slave-options-u32 GOTO_GOOD_POINT)) - (set! (-> self desired-pos quad) (-> self good-point quad)) + (vector-copy! (-> self desired-pos) (-> self good-point)) (cam-string-move) (vector-! (-> self view-flat) (-> self string-trans) (-> *camera* tpos-curr-adj)) (vector-flatten! (-> self view-flat) (-> self view-flat) (-> *camera* local-down)) @@ -3221,8 +3197,8 @@ (the-as vector (when (not (or (-> self string-val-locked) (logtest? (cam-slave-options-u32 GUN_CAM) (-> self options)))) - (set! (-> self string-min-val quad) (-> *camera* string-min value quad)) - (set! (-> self string-max-val quad) (-> *camera* string-max value quad)) + (vector-copy! (-> self string-min-val) (-> *camera* string-min value)) + (vector-copy! (-> self string-max-val) (-> *camera* string-max value)) (set! (-> self slope-adjust target) 0.0) (when (-> *camera* settings cam-slope) (let ((gp-0 (the-as entity-camera (entity-by-name (-> *camera* settings cam-slope))))) @@ -3324,8 +3300,8 @@ (cond ((-> block param 0) (set! (-> self string-val-locked) (the-as basic #t)) - (set! (-> self string-min-val quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self string-max-val quad) (-> (the-as vector (-> block param 1)) quad)) + (vector-copy! (-> self string-min-val) (the-as vector (-> block param 0))) + (vector-copy! (-> self string-max-val) (the-as vector (-> block param 1))) (set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x))) (set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y))) (set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z))) @@ -3448,7 +3424,7 @@ (+ (-> *camera* settings target-height) (-> self view-off y)) ) (vector+! (-> self desired-pos) (-> self desired-pos) (-> *camera* tpos-curr-adj)) - (set! (-> self string-trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self string-trans) (-> self desired-pos)) (vector-reset! (-> self velocity)) (let ((gp-2 (new 'stack-no-clear 'collide-query))) (vector--float*! @@ -3503,7 +3479,7 @@ (+ (-> *camera* settings target-height) (-> self view-off y)) ) (vector+! (-> self desired-pos) (-> self desired-pos) (-> *camera* tpos-curr-adj)) - (set! (-> self string-trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self string-trans) (-> self desired-pos)) (vector-reset! (-> self velocity)) ) ) @@ -3511,8 +3487,8 @@ ) ) ) - (set! (-> self trans quad) (-> self string-trans quad)) - (set! (-> self los-last-pos quad) (-> self string-trans quad)) + (vector-copy! (-> self trans) (-> self string-trans)) + (vector-copy! (-> self los-last-pos) (-> self string-trans)) (tracking-spline-method-10 (-> self position-spline) (-> self string-trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) @@ -3603,7 +3579,7 @@ (let ((f28-0 (cond ((logtest? (-> self options) (cam-slave-options-u32 COLLIDE)) - (set! (-> gp-2 start-pos quad) (-> self trans quad)) + (vector-copy! (-> gp-2 start-pos) (-> self trans)) (let ((s1-0 gp-2)) (set! (-> s1-0 radius) (-> *CAMERA-bank* collide-move-rad)) (set! (-> s1-0 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -3623,7 +3599,7 @@ (cond ((>= f28-0 0.0) (vector+float*! (-> self trans) (-> self trans) s5-0 f28-0) - (set! (-> s4-0 quad) (-> gp-2 best-other-tri normal quad)) + (vector-copy! s4-0 (-> gp-2 best-other-tri normal)) (vector-flatten! (-> self velocity) (-> self velocity) s4-0) (set! f30-0 (- f30-0 (* f30-0 f28-0))) (set! s2-0 1) @@ -3690,7 +3666,7 @@ (vector-normalize! (-> self view-flat) (-> self view-off z)) (vector--float*! (-> self desired-pos) (-> self view-flat) (-> *camera* local-down) (-> self view-off y)) (vector+! (-> self desired-pos) (-> self desired-pos) (-> self tracking follow-pt)) - (set! (-> self trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self trans) (-> self desired-pos)) (vector-reset! (-> self velocity)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-2)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-2)) @@ -3727,36 +3703,30 @@ (let ((f0-16 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 32.0 110.0 (* 21845.334 (seconds-per-frame))) ) - (gp-0 (new 'stack-no-clear 'matrix)) - ) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) - (let ((s3-0 (new-stack-vector0)) - (s5-0 (new-stack-vector0)) - (s4-0 (new-stack-vector0)) - ) - (if (-> *camera* settings flip-horizontal) - (set! f0-16 (- f0-16)) - ) - (cond - ((!= f0-16 0.0) - (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-16) - (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) - ) - ((logtest? (-> self options) (cam-slave-options-u32 BUTT_CAM)) - (set-vector! s5-0 0.0 0.0 1.0 1.0) - (vector-normalize-copy! s5-0 (-> self view-flat) 1.0) - (set! (-> s3-0 quad) (-> *camera* tgt-rot-mat fvec quad)) - (vector-flatten! s3-0 s3-0 (-> *camera* local-down)) - (vector-negate! s3-0 s3-0) - (set! (-> s4-0 quad) (-> s5-0 quad)) - (vector-normalize-copy! s4-0 s3-0 1.0) - (matrix-from-two-vectors-max-angle-partial! gp-0 s5-0 s4-0 (* 10922.667 (seconds-per-frame)) 0.05) - (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) - ) + (gp-0 (new-stack-matrix0)) + (s3-0 (new-stack-vector0)) + (s5-0 (new-stack-vector0)) + (s4-0 (new-stack-vector0)) ) + (if (-> *camera* settings flip-horizontal) + (set! f0-16 (- f0-16)) + ) + (cond + ((!= f0-16 0.0) + (matrix-axis-angle! gp-0 (-> *camera* local-down) f0-16) + (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) + ) + ((logtest? (-> self options) (cam-slave-options-u32 BUTT_CAM)) + (set-vector! s5-0 0.0 0.0 1.0 1.0) + (vector-normalize-copy! s5-0 (-> self view-flat) 1.0) + (vector-copy! s3-0 (-> *camera* tgt-rot-mat fvec)) + (vector-flatten! s3-0 s3-0 (-> *camera* local-down)) + (vector-negate! s3-0 s3-0) + (vector-copy! s4-0 s5-0) + (vector-normalize-copy! s4-0 s3-0 1.0) + (matrix-from-two-vectors-max-angle-partial! gp-0 s5-0 s4-0 (* 10922.667 (seconds-per-frame)) 0.05) + (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) + ) ) ) ) @@ -3818,11 +3788,7 @@ ;; definition for function cam-bike-code ;; INFO: Used lq/sq (defbehavior cam-bike-code camera-slave () - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 rvec quad) (the-as uint128 0)) - (set! (-> s4-0 uvec quad) (the-as uint128 0)) - (set! (-> s4-0 fvec quad) (the-as uint128 0)) - (set! (-> s4-0 trans quad) (the-as uint128 0)) + (let ((s4-0 (new-stack-matrix0))) (let ((gp-0 (new-stack-vector0)) (s5-0 (new-stack-vector0)) ) @@ -3880,7 +3846,7 @@ (let ((f28-0 (cond ((logtest? (-> self options) (cam-slave-options-u32 COLLIDE)) - (set! (-> gp-3 start-pos quad) (-> self trans quad)) + (vector-copy! (-> gp-3 start-pos) (-> self trans)) (let ((s3-2 gp-3)) (set! (-> s3-2 radius) 4096.0) (set! (-> s3-2 collide-with) (collide-spec backgnd obstacle hit-by-others-list camera-blocker pusher)) @@ -3937,7 +3903,7 @@ (vector-normalize! (-> self view-flat) (-> self view-off z)) (vector--float*! (-> self desired-pos) (-> self view-flat) (-> *camera* local-down) (-> self view-off y)) (vector+! (-> self desired-pos) (-> self desired-pos) (-> *camera* tpos-curr-adj)) - (set! (-> self trans quad) (-> self desired-pos quad)) + (vector-copy! (-> self trans) (-> self desired-pos)) (vector-reset! (-> self velocity)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-0)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-1)) diff --git a/test/decompiler/reference/jak3/engine/camera/cam-update_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-update_REF.gc index 63000e8a9f5..db052ff47b9 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-update_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-update_REF.gc @@ -225,9 +225,9 @@ (let ((v1-109 (-> s4-1 bsp nodes (-> s4-1 bsp cam-box-idx))) (a2-7 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-7 quad) (-> s4-1 bsp bsp-offset quad)) + (vector-copy! a2-7 (-> s4-1 bsp bsp-offset)) (let ((a3-6 (new 'stack-no-clear 'vector))) - (set! (-> a3-6 quad) (-> s4-1 bsp bsp-offset quad)) + (vector-copy! a3-6 (-> s4-1 bsp bsp-offset)) (cond ((zero? (-> s4-1 bsp cam-using-back)) (+! (-> a2-7 x) (the float (* (-> v1-109 front-box-min x) (the int (-> s4-1 bsp bsp-scale x))))) @@ -299,18 +299,7 @@ ) ) ) - (let* ((a2-2 (-> *math-camera* inv-camera-rot)) - (a3-1 *save-camera-inv-rot*) - (v1-14 (-> a3-1 rvec quad)) - (a0-13 (-> a3-1 uvec quad)) - (a1-2 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> a2-2 rvec quad) v1-14) - (set! (-> a2-2 uvec quad) a0-13) - (set! (-> a2-2 fvec quad) a1-2) - (set! (-> a2-2 trans quad) a3-2) - ) + (matrix-copy! (-> *math-camera* inv-camera-rot) *save-camera-inv-rot*) arg0 ) @@ -322,19 +311,8 @@ (vector-reset! (-> *math-camera* trans)) (matrix-identity! (-> *math-camera* inv-camera-rot)) (when *camera-combiner* - (let* ((v1-7 (-> *math-camera* inv-camera-rot)) - (a3-0 (-> *camera-combiner* inv-camera-rot)) - (a0-2 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-2) - (set! (-> v1-7 uvec quad) a1-0) - (set! (-> v1-7 fvec quad) a2-0) - (set! (-> v1-7 trans quad) a3-1) - ) - (set! (-> *math-camera* trans quad) (-> *camera-combiner* trans quad)) + (matrix-copy! (-> *math-camera* inv-camera-rot) (-> *camera-combiner* inv-camera-rot)) + (vector-copy! (-> *math-camera* trans) (-> *camera-combiner* trans)) ) ) 0 @@ -355,19 +333,8 @@ (defun update-camera () (with-pp (let ((gp-0 *math-camera*)) - (let* ((a2-0 (-> gp-0 prev-inv-camera-rot)) - (a3-0 (-> gp-0 inv-camera-rot)) - (v1-0 (-> a3-0 rvec quad)) - (a0-0 (-> a3-0 uvec quad)) - (a1-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-0) - (set! (-> a2-0 uvec quad) a0-0) - (set! (-> a2-0 fvec quad) a1-0) - (set! (-> a2-0 trans quad) a3-1) - ) - (set! (-> gp-0 prev-trans quad) (-> gp-0 trans quad)) + (matrix-copy! (-> gp-0 prev-inv-camera-rot) (-> gp-0 inv-camera-rot)) + (vector-copy! (-> gp-0 prev-trans) (-> gp-0 trans)) (when *start-timer* (when (= *timer-value* 180) (format @@ -377,7 +344,7 @@ (-> *target* control trans y) (-> *target* control trans z) ) - (set! (-> *start-pos* quad) (-> *target* control trans quad)) + (vector-copy! *start-pos* (-> *target* control trans)) ) (when (= *timer-value* 480) (format @@ -447,61 +414,17 @@ ) ((nonzero? *camera-look-through-other*) (set! (-> gp-0 fov) (-> *camera-other-fov* data)) - (set! (-> gp-0 trans quad) (-> *camera-other-trans* quad)) + (vector-copy! (-> gp-0 trans) *camera-other-trans*) (+! (-> gp-0 trans y) f28-0) - (let* ((a2-6 (-> gp-0 inv-camera-rot)) - (a3-5 *camera-other-matrix*) - (v1-76 (-> a3-5 rvec quad)) - (a0-34 (-> a3-5 uvec quad)) - (a1-7 (-> a3-5 fvec quad)) - (a3-6 (-> a3-5 trans quad)) - ) - (set! (-> a2-6 rvec quad) v1-76) - (set! (-> a2-6 uvec quad) a0-34) - (set! (-> a2-6 fvec quad) a1-7) - (set! (-> a2-6 trans quad) a3-6) - ) - (let* ((a2-7 *save-camera-inv-rot*) - (a3-7 *camera-other-matrix*) - (v1-77 (-> a3-7 rvec quad)) - (a0-35 (-> a3-7 uvec quad)) - (a1-8 (-> a3-7 fvec quad)) - (a3-8 (-> a3-7 trans quad)) - ) - (set! (-> a2-7 rvec quad) v1-77) - (set! (-> a2-7 uvec quad) a0-35) - (set! (-> a2-7 fvec quad) a1-8) - (set! (-> a2-7 trans quad) a3-8) - ) + (matrix-copy! (-> gp-0 inv-camera-rot) *camera-other-matrix*) + (matrix-copy! *save-camera-inv-rot* *camera-other-matrix*) ) ((and *camera-combiner* (not *external-cam-mode*)) (set! (-> gp-0 fov) (-> *camera-combiner* fov)) - (set! (-> gp-0 trans quad) (-> *camera-combiner* trans quad)) + (vector-copy! (-> gp-0 trans) (-> *camera-combiner* trans)) (+! (-> gp-0 trans y) f28-0) - (let* ((v1-84 (-> gp-0 inv-camera-rot)) - (a3-9 (-> *camera-combiner* inv-camera-rot)) - (a0-40 (-> a3-9 rvec quad)) - (a1-9 (-> a3-9 uvec quad)) - (a2-8 (-> a3-9 fvec quad)) - (a3-10 (-> a3-9 trans quad)) - ) - (set! (-> v1-84 rvec quad) a0-40) - (set! (-> v1-84 uvec quad) a1-9) - (set! (-> v1-84 fvec quad) a2-8) - (set! (-> v1-84 trans quad) a3-10) - ) - (let* ((v1-85 *save-camera-inv-rot*) - (a3-11 (-> *camera-combiner* inv-camera-rot)) - (a0-42 (-> a3-11 rvec quad)) - (a1-10 (-> a3-11 uvec quad)) - (a2-9 (-> a3-11 fvec quad)) - (a3-12 (-> a3-11 trans quad)) - ) - (set! (-> v1-85 rvec quad) a0-42) - (set! (-> v1-85 uvec quad) a1-10) - (set! (-> v1-85 fvec quad) a2-9) - (set! (-> v1-85 trans quad) a3-12) - ) + (matrix-copy! (-> gp-0 inv-camera-rot) (-> *camera-combiner* inv-camera-rot)) + (matrix-copy! *save-camera-inv-rot* (-> *camera-combiner* inv-camera-rot)) ) (*camera* (move-camera-from-pad gp-0) @@ -540,18 +463,7 @@ ) ) (else - (let* ((a2-12 (-> gp-0 inv-camera-rot-smooth)) - (a3-14 (-> gp-0 inv-camera-rot)) - (v1-106 (-> a3-14 rvec quad)) - (a0-51 (-> a3-14 uvec quad)) - (a1-16 (-> a3-14 fvec quad)) - (a3-15 (-> a3-14 trans quad)) - ) - (set! (-> a2-12 rvec quad) v1-106) - (set! (-> a2-12 uvec quad) a0-51) - (set! (-> a2-12 fvec quad) a1-16) - (set! (-> a2-12 trans quad) a3-15) - ) + (matrix-copy! (-> gp-0 inv-camera-rot-smooth) (-> gp-0 inv-camera-rot)) ) ) (when (and (!= *master-mode* 'menu) *display-camera-info*) @@ -579,20 +491,9 @@ ) ) ) - (when (zero? (-> gp-0 reset)) - (let* ((a2-16 (-> gp-0 prev-camera-temp)) - (a3-19 (-> gp-0 camera-temp)) - (v1-119 (-> a3-19 rvec quad)) - (a0-58 (-> a3-19 uvec quad)) - (a1-20 (-> a3-19 fvec quad)) - (a3-20 (-> a3-19 trans quad)) - ) - (set! (-> a2-16 rvec quad) v1-119) - (set! (-> a2-16 uvec quad) a0-58) - (set! (-> a2-16 fvec quad) a1-20) - (set! (-> a2-16 trans quad) a3-20) + (if (zero? (-> gp-0 reset)) + (matrix-copy! (-> gp-0 prev-camera-temp) (-> gp-0 camera-temp)) ) - ) (let ((s3-1 (-> gp-0 camera-temp)) (s2-0 (-> gp-0 camera-rot)) (s5-3 (-> gp-0 inv-camera-rot)) @@ -610,18 +511,7 @@ (set! (-> s5-3 trans quad) (-> s4-2 quad)) ) (when (nonzero? (-> gp-0 reset)) - (let* ((a2-19 (-> gp-0 prev-camera-temp)) - (a3-21 (-> gp-0 camera-temp)) - (v1-125 (-> a3-21 rvec quad)) - (a0-61 (-> a3-21 uvec quad)) - (a1-23 (-> a3-21 fvec quad)) - (a3-22 (-> a3-21 trans quad)) - ) - (set! (-> a2-19 rvec quad) v1-125) - (set! (-> a2-19 uvec quad) a0-61) - (set! (-> a2-19 fvec quad) a1-23) - (set! (-> a2-19 trans quad) a3-22) - ) + (matrix-copy! (-> gp-0 prev-camera-temp) (-> gp-0 camera-temp)) (set! (-> gp-0 reset) 0) 0 ) @@ -664,7 +554,7 @@ ) (quaternion->matrix s0-0 (-> gp-0 quat-other)) (mem-copy! (the-as pointer s5-4) (the-as pointer s0-0) 64) - (set! (-> s5-4 trans quad) (-> gp-0 trans-other quad)) + (vector-copy! (-> s5-4 trans) (-> gp-0 trans-other)) (set! (-> s5-4 trans w) 1.0) (matrix*! s3-2 s5-4 s4-3) (matrix-inverse-of-rot-trans! s2-1 s3-2) diff --git a/test/decompiler/reference/jak3/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak3/engine/camera/camera-h_REF.gc index 8d50a78dc0a..81a96ef3d0d 100644 --- a/test/decompiler/reference/jak3/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/camera-h_REF.gc @@ -277,8 +277,8 @@ (defmethod init ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> this target quad) (-> arg0 quad)) - (set! (-> this value quad) (-> arg0 quad)) + (vector-copy! (-> this target) arg0) + (vector-copy! (-> this value) arg0) ) (else (vector-reset! (-> this target)) diff --git a/test/decompiler/reference/jak3/engine/camera/camera_REF.gc b/test/decompiler/reference/jak3/engine/camera/camera_REF.gc index abe29b7e447..9eda907f73b 100644 --- a/test/decompiler/reference/jak3/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/camera_REF.gc @@ -56,7 +56,7 @@ #t ) (s3-0 - (set! (-> arg1 quad) (-> (the-as vector s3-0) quad)) + (vector-copy! arg1 (the-as vector s3-0)) #t ) (else @@ -468,7 +468,7 @@ ) (arg3 (set! (-> this vec 0 quad) (-> arg3 cverts 0 quad)) - (set! (-> this vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) + (vector-copy! (-> this vec 1) (-> arg3 cverts (+ (-> arg3 num-cverts) -1))) ) (else (return #f) @@ -539,7 +539,7 @@ (set! (-> this max-move) 0.0) (set! (-> this sample-len) 0.0) (set! (-> this used-count) 1) - (set! (-> this old-position quad) (-> arg0 quad)) + (vector-copy! (-> this old-position) arg0) (let ((v1-6 1)) (while (!= v1-6 31) (set! (-> this point v1-6 next) (+ v1-6 1)) @@ -937,8 +937,8 @@ (let ((a2-3 (-> s3-0 cur-pt))) (set! (-> this debug-last-point) a2-3) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> this debug-old-position quad) (-> this old-position quad)) - (set! (-> this debug-out-position quad) (-> arg0 quad)) + (vector-copy! (-> this debug-old-position) (-> this old-position)) + (vector-copy! (-> this debug-out-position) arg0) (vector-! s4-1 arg0 (-> this old-position)) (tracking-spline-method-20 this s4-1 a2-3) (vector+! arg0 (-> this old-position) s4-1) @@ -946,7 +946,7 @@ ) ) ) - (set! (-> this old-position quad) (-> arg0 quad)) + (vector-copy! (-> this old-position) arg0) arg0 ) ) @@ -1054,7 +1054,7 @@ ) ) (set! (-> self fov) (-> *camera-combiner* fov)) - (set! (-> self velocity quad) (-> *camera-combiner* velocity quad)) + (vector-copy! (-> self velocity) (-> *camera-combiner* velocity)) ) (else (vector-reset! (-> self trans)) @@ -1207,8 +1207,8 @@ (let ((s3-1 (new 'stack-no-clear 'vector))) (curve-length (-> self spline-curve)) (if arg3 - (set! (-> s3-1 quad) (-> self tracking follow-pt quad)) - (set! (-> s3-1 quad) (-> *camera* tpos-curr-adj quad)) + (vector-copy! s3-1 (-> self tracking follow-pt)) + (vector-copy! s3-1 (-> *camera* tpos-curr-adj)) ) (let ((f0-22 (curve-closest-point (-> self spline-curve) s3-1 (-> self spline-tt) 40960.0 10 (-> self spline-follow-dist)) @@ -1284,7 +1284,7 @@ (update! (-> arg0 underwater-blend) 0.0) ) (else - (set! (-> arg0 old-cam-trans quad) (-> arg1 quad)) + (vector-copy! (-> arg0 old-cam-trans) arg1) (jump-to-target! (-> arg0 tilt-adjust) 0.0) (jump-to-target! (-> arg0 point-of-interest-blend) 0.0) (jump-to-target! (-> arg0 underwater-blend) 0.0) @@ -1292,7 +1292,7 @@ ) (set! (-> arg0 follow-height-extra target) (-> *camera* settings extra-follow-height)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> arg0 follow-pt quad)) + (vector-copy! s4-0 (-> arg0 follow-pt)) (cond ((logtest? (-> *camera* settings slave-options) (cam-slave-options BIKE_MODE)) (let ((s1-0 (new 'stack-no-clear 'vector)) @@ -1339,7 +1339,7 @@ (vector+! (-> arg0 follow-off) (-> arg0 follow-off) s2-0) ) (else - (set! (-> arg0 follow-off quad) (-> s2-0 quad)) + (vector-copy! (-> arg0 follow-off) s2-0) ) ) ) @@ -1407,7 +1407,7 @@ ) ) (else - (set! (-> arg0 follow-off quad) (-> s2-1 quad)) + (vector-copy! (-> arg0 follow-off) s2-1) (jump-to-target! (-> arg0 follow-height-extra) 0.0) ) ) @@ -1440,7 +1440,7 @@ (vector-! (-> arg0 follow-off) (-> arg0 follow-off) (-> *camera* tpos-curr-adj)) ) ) - (set! (-> arg0 old-cam-trans quad) (-> arg1 quad)) + (vector-copy! (-> arg0 old-cam-trans) arg1) (-> arg0 follow-pt) ) ) @@ -1451,11 +1451,7 @@ (let ((s4-0 (new-stack-vector0))) 0.0 0.0 - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (vector-negate! s4-0 arg1) (vector-flatten! s4-0 s4-0 (-> arg0 fvec)) (vector-normalize! s4-0 1.0) @@ -1555,11 +1551,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (let ((s3-0 (new-stack-vector0)) (s2-0 (new-stack-vector0)) ) @@ -1682,6 +1674,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] (defun slave-set-rotation! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 cam-slave-options-u32) (arg3 float) (arg4 symbol)) (local-vars + (v1-60 matrix) (f0-9 float) (sv-208 vector) (sv-224 vector) @@ -1697,15 +1690,11 @@ ) (init-vf0-vector) (if (-> *camera* settings use-look-at-point) - (set! (-> arg0 follow-pt quad) (-> *camera* settings look-at-point quad)) + (vector-copy! (-> arg0 follow-pt) (-> *camera* settings look-at-point)) ) (let ((s0-0 (new-stack-vector0)) - (s1-0 (new 'stack-no-clear 'matrix)) + (s1-0 (new-stack-matrix0)) ) - (set! (-> s1-0 rvec quad) (the-as uint128 0)) - (set! (-> s1-0 uvec quad) (the-as uint128 0)) - (set! (-> s1-0 fvec quad) (the-as uint128 0)) - (set! (-> s1-0 trans quad) (the-as uint128 0)) (let ((f30-0 (-> arg0 tilt-adjust value))) (cond ((< 0.0001 (-> arg0 point-of-interest-blend value)) @@ -1736,7 +1725,7 @@ ) (else (vector-! s0-0 (-> arg0 follow-pt) arg1) - (set! (-> arg0 looking-interesting quad) (-> arg1 quad)) + (vector-copy! (-> arg0 looking-interesting) arg1) ) ) (vector+! (-> arg0 looking-at) s0-0 arg1) @@ -1803,25 +1792,16 @@ (let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value)))) (sv-256 sv-272 sv-288 a2-5) ) - (cond - (arg4 - (slave-matrix-blend-2 (-> arg0 inv-mat) arg2 s0-0 s1-0) - ) - (else - (let* ((v1-60 (-> arg0 inv-mat)) - (a3-2 s1-0) - (a0-34 (-> a3-2 rvec quad)) - (a1-19 (-> a3-2 uvec quad)) - (a2-7 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> v1-60 rvec quad) a0-34) - (set! (-> v1-60 uvec quad) a1-19) - (set! (-> v1-60 fvec quad) a2-7) - (set! (-> v1-60 trans quad) a3-3) + (set! v1-60 (cond + (arg4 + (slave-matrix-blend-2 (-> arg0 inv-mat) arg2 s0-0 s1-0) + v1-60 + ) + (else + (matrix-copy! (-> arg0 inv-mat) s1-0) + ) + ) ) - ) - ) ) (mat-remove-z-rot (-> arg0 inv-mat) (-> *camera* local-down)) (cond @@ -1916,8 +1896,8 @@ ) ) (else - (set! (-> s0-0 quad) (-> arg1 quad)) - (set! (-> sv-160 quad) (-> arg2 quad)) + (vector-copy! s0-0 arg1) + (vector-copy! sv-160 arg2) (set! f30-0 (vector-normalize-ret-len! s0-0 1.0)) (set! f28-0 (vector-normalize-ret-len! sv-160 1.0)) (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) @@ -2000,11 +1980,7 @@ (f30-0 1.0) ) 0.0 - (let ((s0-0 (new 'stack-no-clear 'matrix))) - (set! (-> s0-0 rvec quad) (the-as uint128 0)) - (set! (-> s0-0 uvec quad) (the-as uint128 0)) - (set! (-> s0-0 fvec quad) (the-as uint128 0)) - (set! (-> s0-0 trans quad) (the-as uint128 0)) + (let ((s0-0 (new-stack-matrix0))) (cond (arg3 (vector-flatten! s1-0 arg1 arg3) @@ -2020,8 +1996,8 @@ ) ) (else - (set! (-> s1-0 quad) (-> arg1 quad)) - (set! (-> sv-160 quad) (-> arg2 quad)) + (vector-copy! s1-0 arg1) + (vector-copy! sv-160 arg2) (set! f28-0 (vector-normalize-ret-len! s1-0 1.0)) (set! f26-0 (vector-normalize-ret-len! sv-160 1.0)) (vector-normalize! (vector-cross! s3-0 arg2 arg1) 1.0) diff --git a/test/decompiler/reference/jak3/engine/camera/pov-camera_REF.gc b/test/decompiler/reference/jak3/engine/camera/pov-camera_REF.gc index ea0a60106ad..f5bf33628bb 100644 --- a/test/decompiler/reference/jak3/engine/camera/pov-camera_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/pov-camera_REF.gc @@ -198,7 +198,7 @@ (set-time! (-> self debounce-start-time)) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (when (and (logtest? (-> self flags) (pov-camera-flag inherit-orientation)) arg4) (let ((v1-22 (if (type? arg4 process-drawable) arg4 @@ -338,7 +338,7 @@ (format #t "ERROR: othercam parent invalid~%") (deactivate self) ) - (set! (-> *camera-other-root* quad) (-> (the-as process-drawable s2-0) root trans quad)) + (vector-copy! *camera-other-root* (-> (the-as process-drawable s2-0) root trans)) (let ((s4-0 (-> (the-as process-drawable s2-0) node-list data (-> self cam-joint-index) bone transform)) (s3-0 (-> (the-as process-drawable s2-0) node-list data (-> self cam-joint-index) bone scale)) (gp-0 (new 'stack-no-clear 'vector)) @@ -361,10 +361,10 @@ (s1-0 (when (not (-> self had-valid-frame)) (set! (-> self had-valid-frame) #t) - (set! (-> self old-pos quad) (-> s5-0 quad)) - (set! (-> self old-mat-z quad) (-> gp-0 quad)) + (vector-copy! (-> self old-pos) s5-0) + (vector-copy! (-> self old-mat-z) gp-0) ) - (set! (-> *camera-other-trans* quad) (-> s5-0 quad)) + (vector-copy! *camera-other-trans* s5-0) (vector-normalize-copy! (-> *camera-other-matrix* rvec) (-> s4-0 rvec) -1.0) (set! (-> *camera-other-matrix* rvec w) 0.0) (vector-normalize-copy! (-> *camera-other-matrix* uvec) (-> s4-0 uvec) 1.0) @@ -374,8 +374,8 @@ (vector-reset! (-> *camera-other-matrix* trans)) (set! (-> self fov) (othercam-calc (-> s3-0 x))) (set! *camera-look-through-other* 2) - (set! (-> self old-pos quad) (-> s5-0 quad)) - (set! (-> self old-mat-z quad) (-> gp-0 quad)) + (vector-copy! (-> self old-pos) s5-0) + (vector-copy! (-> self old-mat-z) gp-0) ) ) ) @@ -423,7 +423,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-debug_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-debug_REF.gc index 3fa762f2e5a..4722509ea1d 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-debug_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-debug_REF.gc @@ -80,7 +80,7 @@ ;; WARN: Return type mismatch symbol vs none. (defun col-rend-draw ((arg0 col-rend) (arg1 col-rend-filter)) (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 rvec quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! (-> s4-0 rvec) (-> (math-camera-matrix) fvec)) (vector-normalize! (-> s4-0 rvec) 1.0) (let ((s3-1 (the-as collide-cache-tri (-> *collide-cache* tris)))) (countdown (s2-0 (-> *collide-cache* num-tris)) @@ -188,7 +188,7 @@ (let ((v1-0 (-> this track))) (cond ((zero? v1-0) - (set! (-> this bbox-center quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this bbox-center) (target-pos 0)) (+! (-> this bbox-center y) (* 0.7 f30-0)) ) ((= v1-0 1) @@ -204,7 +204,7 @@ (set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0)) (set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0)) (set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0)) - (set! (-> s5-0 bbox max quad) (-> this bbox-center quad)) + (vector-copy! (-> s5-0 bbox max) (-> this bbox-center)) (+! (-> s5-0 bbox max x) f30-0) (+! (-> s5-0 bbox max y) f30-0) (+! (-> s5-0 bbox max z) f30-0) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc index a81ead466f0..f1d102f204c 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc @@ -55,9 +55,9 @@ (when (nonzero? (-> s5-0 num-tris)) (find-grabbable-edges s5-0) (when (nonzero? (-> s5-0 num-edges)) - (set! (-> s5-0 search-pt quad) (-> this control midpoint-of-hands quad)) + (vector-copy! (-> s5-0 search-pt) (-> this control midpoint-of-hands)) (when (!= (-> *cpad-list* cpads (-> this control cpad number) stick0-speed) 0.0) - (set! (-> s5-0 search-dir-vec quad) (-> this control to-target-pt-xz quad)) + (vector-copy! (-> s5-0 search-dir-vec) (-> this control to-target-pt-xz)) (search-for-edges s5-0 (-> s5-0 hold-list)) (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) (set! (-> *edge-grab-info* found-edge?) #t) @@ -204,15 +204,16 @@ ) ) (set! (-> arg1 tri-vertex 0 quad) (-> s1-0 vertex 0 quad)) - (set! (-> arg1 world-vertex 4 quad) (-> s1-0 vertex 1 quad)) - (set! (-> arg1 world-vertex 5 quad) (-> s1-0 vertex 2 quad)) + (vector-copy! (-> arg1 world-vertex 4) (-> s1-0 vertex 1)) + (vector-copy! (-> arg1 world-vertex 5) (-> s1-0 vertex 2)) (set! (-> arg1 edge-tri-pat) (-> s1-0 pat)) - (set! (-> arg1 center-hold quad) (-> arg0 center-pt quad)) + (vector-copy! (-> arg1 center-hold) (-> arg0 center-pt)) (set! (-> arg1 world-vertex 0 quad) (-> s2-0 vertex-ptr 0 0 quad)) - (set! (-> arg1 world-vertex 1 quad) (-> s2-0 vertex-ptr 1 0 quad)) - (set! (-> arg1 hanging-matrix uvec quad) - (-> (the-as collide-shape-moving (-> this process 0 root)) dynam gravity-normal quad) - ) + (vector-copy! (-> arg1 world-vertex 1) (-> s2-0 vertex-ptr 1 0)) + (vector-copy! + (-> arg1 hanging-matrix uvec) + (-> (the-as collide-shape-moving (-> this process 0 root)) dynam gravity-normal) + ) (vector-normalize! (vector-! (-> arg1 hanging-matrix fvec) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) 1.0 @@ -230,7 +231,7 @@ (the-as vector (-> arg1 hanging-matrix)) (-> arg1 hanging-matrix uvec) ) - (set! (-> arg1 hanging-matrix trans quad) (-> arg1 center-hold quad)) + (vector-copy! (-> arg1 hanging-matrix trans) (-> arg1 center-hold)) (transform-vectors! (-> arg1 hanging-matrix) (-> this world-player-spheres) @@ -324,9 +325,7 @@ (dotimes (s2-0 6) ((method-of-type sphere new) (the-as symbol (-> s5-0 s2-0)) sphere) ) - (set! (-> s4-0 uvec quad) - (-> (the-as collide-shape-moving (-> arg0 process 0 root)) dynam gravity-normal quad) - ) + (vector-copy! (-> s4-0 uvec) (-> (the-as collide-shape-moving (-> arg0 process 0 root)) dynam gravity-normal)) (vector-normalize! (vector-! (-> s4-0 fvec) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) 1.0) (vector-normalize! (vector-cross! (-> s4-0 rvec) (-> s4-0 fvec) (-> s4-0 uvec)) 1.0) (vector-cross! (-> s4-0 fvec) (-> s4-0 rvec) (-> s4-0 uvec)) @@ -376,7 +375,7 @@ ) (set! (-> s5-0 left-dot) f30-0) (set! (-> s5-0 found-left?) #t) - (set! (-> arg1 adjacent-edge-left-vertex quad) (-> s1-0 vertex-ptr 0 0 quad)) + (vector-copy! (-> arg1 adjacent-edge-left-vertex) (-> s1-0 vertex-ptr 0 0)) 0 ) ) @@ -392,7 +391,7 @@ ) (set! (-> s5-0 right-dot) f30-1) (set! (-> s5-0 found-right?) #t) - (set! (-> arg1 adjacent-edge-right-vertex quad) (-> s1-0 vertex-ptr 1 0 quad)) + (vector-copy! (-> arg1 adjacent-edge-right-vertex) (-> s1-0 vertex-ptr 1 0)) 0 ) ) @@ -440,7 +439,7 @@ (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-4 vertex-ptr 0 0) (-> v1-4 vertex-ptr 1 0) s2-0))) (when (or (< f30-0 0.0) (< f0-0 f30-0)) (set! f30-0 f0-0) - (set! (-> arg0 quad) (-> s2-0 quad)) + (vector-copy! arg0 s2-0) ) ) ) @@ -678,7 +677,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s2-0 #t) ) - (set! (-> s3-0 quad) (-> *target* control midpoint-of-hands quad)) + (vector-copy! s3-0 (-> *target* control midpoint-of-hands)) (while s4-0 (+! s5-0 1) (set! (-> s3-0 y) (-> s4-0 center-pt y)) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc index aa64875bcd1..90b68c4ef34 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc @@ -1700,7 +1700,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (defmethod new collide-shape-moving ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) (let ((v0-0 ((method-of-type collide-shape new) allocation type-to-make arg0 arg1))) (set! (-> (the-as collide-shape-moving v0-0) gspot-pos y) -40959590.0) - (set! (-> (the-as collide-shape-moving v0-0) gspot-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> (the-as collide-shape-moving v0-0) gspot-normal) *y-vector*) (set! (-> (the-as collide-shape-moving v0-0) surf) *standard-ground-surface*) (the-as collide-shape-moving v0-0) ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape-rider_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape-rider_REF.gc index 419cca69ea6..8f356d8e07f 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-shape-rider_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape-rider_REF.gc @@ -366,7 +366,7 @@ (let ((s2-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> gp-0 trans quad)) + (vector-copy! s3-0 (-> gp-0 trans)) (vector-! s2-0 (-> arg0 rider-dest) s3-0) (cond ((logtest? (-> this root-prim prim-core action) (collide-action pull-rider-can-collide)) @@ -383,7 +383,7 @@ (set! (-> this root-prim prim-core collide-as) s1-0) ) (let ((s1-1 (new 'stack-no-clear 'vector))) - (set! (-> s1-1 quad) (-> s2-0 quad)) + (vector-copy! s1-1 s2-0) (let ((v1-19 s1-1)) (.lvf vf1 (&-> s1-1 quad)) (let ((f0-2 (-> pp clock frames-per-second))) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape_REF.gc index 1444517a9a0..02ef592ef32 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-shape_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape_REF.gc @@ -663,7 +663,7 @@ ) (and (= (-> s1-0 best-other-tri pat event) (pat-event none)) (< 0.7 (-> s1-0 best-other-tri normal y))) ) - (set! (-> arg1 quad) (-> s1-0 best-other-tri intersect quad)) + (vector-copy! arg1 (-> s1-0 best-other-tri intersect)) (set! sv-560 (+ sv-560 1)) (if (>= sv-560 2) (return arg1) @@ -953,7 +953,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defun collide-shape-moving-angle-set! ((arg0 collide-shape-moving) (arg1 vector) (arg2 vector)) - (set! (-> arg0 surface-normal quad) (-> arg1 quad)) + (vector-copy! (-> arg0 surface-normal) arg1) (set! (-> arg0 surface-angle) (vector-dot arg1 (-> arg0 dynam gravity-normal))) (set! (-> arg0 poly-angle) (vector-dot (-> arg0 poly-normal) (-> arg0 dynam gravity-normal))) (set! (-> arg0 touch-angle) @@ -984,7 +984,7 @@ ((and (= (-> arg1 best-dist) 0.0) (< (vector-length sv-48) (+ -40.96 (-> arg1 best-my-prim prim-core world-sphere w))) ) - (set! (-> sv-48 quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! sv-48 (-> arg1 best-other-tri normal)) (set! (-> arg0 coverage) 0.0) ) (else @@ -1004,7 +1004,7 @@ (if (= (-> arg1 best-dist) 0.0) (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-52 6.0)) ) - (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! (-> arg0 poly-normal) (-> arg1 best-other-tri normal)) (collide-shape-moving-angle-set! arg0 sv-52 arg2) (if (< (-> arg0 poly-angle) -0.2) (set! sv-56 (logior sv-56 (collide-status touch-ceiling))) @@ -1021,12 +1021,12 @@ ) (else (set! sv-56 (logior sv-56 (collide-status on-surface))) - (set! (-> arg0 local-normal quad) (-> sv-52 quad)) + (vector-copy! (-> arg0 local-normal) sv-52) ) ) (when (and (not sv-96) (>= (-> arg0 coverage) 0.9)) (set! sv-56 (logior sv-56 (collide-status on-ground))) - (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) + (vector-copy! (-> arg0 ground-poly-normal) (-> arg0 poly-normal)) (when (!= (-> arg0 poly-pat mode) (pat-mode wall)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) (set! (-> arg0 ground-touch-point quad) (-> arg1 best-other-tri intersect quad)) @@ -1046,7 +1046,7 @@ (defun cshape-reaction-default ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) (cshape-reaction-update-state arg0 arg1 arg3) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> arg3 quad)) + (vector-copy! a1-1 arg3) (when (and (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) (not (logtest? (-> arg0 status) (collide-status touch-wall))) ) @@ -1104,7 +1104,7 @@ (s2-0 (new 'stack-no-clear 'vector)) ) (vector-float*! s2-0 arg1 (* arg2 (seconds-per-frame))) - (set! (-> s5-0 move-dist quad) (-> s2-0 quad)) + (vector-copy! (-> s5-0 move-dist) s2-0) (set! (-> s5-0 best-dist) -100000000.0) (set! (-> s5-0 best-my-prim) #f) (set! (-> s5-0 best-other-prim) #f) @@ -1129,7 +1129,7 @@ ((>= f30-0 0.0) (let ((s2-1 (new 'stack-no-clear 'vector))) (if *display-collision-marks* - (set! (-> s2-1 quad) (-> arg1 quad)) + (vector-copy! s2-1 arg1) ) (set! (-> this prev-status) ((-> this reaction) (the-as control-info this) s5-0 arg0 arg1)) (when *display-collision-marks* @@ -1178,7 +1178,7 @@ ((-> this no-reaction) this s5-0 arg0 arg1) (set! (-> this prev-status) (collide-status)) (move-by-vector! this s2-0) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) 1.0 ) ) @@ -1241,9 +1241,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-13 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-13 quad)) - (set! (-> this surface-normal quad) (-> v1-13 quad)) - (set! (-> this poly-normal quad) (-> v1-13 quad)) + (vector-copy! (-> this local-normal) v1-13) + (vector-copy! (-> this surface-normal) v1-13) + (vector-copy! (-> this poly-normal) v1-13) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -1301,29 +1301,29 @@ (let ((s2-0 (-> this max-iteration-count)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (let ((s4-0 (-> this status))) (let ((t9-4 (method-of-type collide-shape-moving integrate-and-collide!))) (t9-4 this a1-8) ) (set! (-> this max-iteration-count) s2-0) - (set! (-> arg0 quad) (-> s3-0 quad)) + (vector-copy! arg0 s3-0) (logior! (-> this status) s4-0) ) ) ) ) (let ((s3-1 (new-stack-vector0))) - (set! (-> s3-1 quad) (-> arg0 quad)) + (vector-copy! s3-1 arg0) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> arg0 quad)) + (vector-copy! s4-1 arg0) (let ((t9-5 (method-of-type collide-shape-moving integrate-and-collide!))) (t9-5 this s3-1) ) (let ((s1-0 (new-stack-vector0))) - (set! (-> s1-0 quad) (-> s4-1 quad)) + (vector-copy! s1-0 s4-1) (let ((s2-1 (new-stack-vector0))) - (set! (-> s2-1 quad) (-> s3-1 quad)) + (vector-copy! s2-1 s3-1) (let ((v1-32 (new-stack-vector0))) (let ((f0-6 (vector-dot (-> this dynam gravity-normal) s1-0))) 0.0 @@ -1385,13 +1385,13 @@ ) ) ) - (set! (-> arg0 quad) (-> s3-1 quad)) + (vector-copy! arg0 s3-1) (if (and (logtest? (-> this status) (collide-status on-surface)) (and (not (logtest? (-> this status) (collide-status touch-wall blocked))) (< (vector-length (-> this btransv)) (vector-length s4-1)) ) ) - (set! (-> this btransv quad) (-> s4-1 quad)) + (vector-copy! (-> this btransv) s4-1) ) ) ) @@ -1422,7 +1422,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> this trans quad)) + (vector-copy! gp-0 (-> this trans)) (vector-normalize-copy! (-> this trans) arg0 arg1) (vector+! (-> this trans) (-> this trans) gp-0) (update-transforms this) @@ -1457,9 +1457,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-13 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-13 quad)) - (set! (-> this surface-normal quad) (-> v1-13 quad)) - (set! (-> this poly-normal quad) (-> v1-13 quad)) + (vector-copy! (-> this local-normal) v1-13) + (vector-copy! (-> this surface-normal) v1-13) + (vector-copy! (-> this poly-normal) v1-13) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -1507,11 +1507,11 @@ (defmethod move-to-ground-point ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) (move-to-point! this arg0) (set! (-> arg1 y) 0.0) - (set! (-> this ground-touch-point quad) (-> arg0 quad)) - (set! (-> this poly-normal quad) (-> arg2 quad)) - (set! (-> this surface-normal quad) (-> arg2 quad)) - (set! (-> this local-normal quad) (-> arg2 quad)) - (set! (-> this ground-poly-normal quad) (-> arg2 quad)) + (vector-copy! (-> this ground-touch-point) arg0) + (vector-copy! (-> this poly-normal) arg2) + (vector-copy! (-> this surface-normal) arg2) + (vector-copy! (-> this local-normal) arg2) + (vector-copy! (-> this ground-poly-normal) arg2) (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) (set! (-> this ground-impact-vel) (- (vector-dot arg1 (-> this dynam gravity-normal)))) 0 @@ -1552,9 +1552,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-13 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-13 quad)) - (set! (-> this surface-normal quad) (-> v1-13 quad)) - (set! (-> this poly-normal quad) (-> v1-13 quad)) + (vector-copy! (-> this local-normal) v1-13) + (vector-copy! (-> this surface-normal) v1-13) + (vector-copy! (-> this poly-normal) v1-13) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -1598,8 +1598,8 @@ (arg4 float) (arg5 process) ) - (set! (-> this gspot-pos quad) (-> this trans quad)) - (set! (-> arg0 start-pos quad) (-> this trans quad)) + (vector-copy! (-> this gspot-pos) (-> this trans)) + (vector-copy! (-> arg0 start-pos) (-> this trans)) (vector-reset! (-> arg0 move-dist)) (let ((f0-0 (-> this transv y))) (if (< f0-0 0.0) @@ -1628,7 +1628,7 @@ ) (else (set! (-> this gspot-pos y) -40959590.0) - (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> this gspot-normal) *y-vector*) #f ) ) @@ -1645,7 +1645,7 @@ (arg4 float) (arg5 float) ) - (set! (-> arg0 start-pos quad) (-> arg1 quad)) + (vector-copy! (-> arg0 start-pos) arg1) (+! (-> arg0 start-pos y) arg3) (vector-reset! (-> arg0 move-dist)) (set! (-> arg0 move-dist y) (- (+ arg3 arg4))) @@ -1688,14 +1688,14 @@ ) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) - (set! (-> arg1 old-gspot-pos quad) (-> this gspot-pos quad)) - (set! (-> arg1 old-gspot-normal quad) (-> this gspot-normal quad)) + (vector-copy! (-> arg1 old-gspot-pos) (-> this gspot-pos)) + (vector-copy! (-> arg1 old-gspot-normal) (-> this gspot-normal)) (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) (set! (-> this trans-old-old quad) (-> this trans-old quad)) (set! (-> this trans-old quad) (-> this trans quad)) (set! (-> this prev-status) (-> this status)) (vector-v+! (-> this trans) (-> this trans) arg0) - (set! (-> arg1 new-pos quad) (-> this trans quad)) + (vector-copy! (-> arg1 new-pos) (-> this trans)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) (cond ((find-ground this s3-1 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0 (the-as process #f)) @@ -1714,7 +1714,7 @@ ) ) ) - (set! (-> this trans quad) (-> this trans-old quad)) + (vector-copy! (-> this trans) (-> this trans-old)) (move-to-point! this (-> arg1 new-pos)) (when (logtest? (logand (-> arg1 overlaps-params collide-with-filter) (collide-spec hit-by-player-list hit-by-others-list player-list) @@ -1725,8 +1725,8 @@ (when (-> arg1 dont-move-if-overlaps?) (set! (-> arg1 do-move?) #f) (move-to-point! this (-> this trans-old)) - (set! (-> this gspot-pos quad) (-> arg1 old-gspot-pos quad)) - (set! (-> this gspot-normal quad) (-> arg1 old-gspot-normal quad)) + (vector-copy! (-> this gspot-pos) (-> arg1 old-gspot-pos)) + (vector-copy! (-> this gspot-normal) (-> arg1 old-gspot-normal)) ) ) ) @@ -1737,11 +1737,11 @@ (a0-31 (-> this gspot-normal)) (v1-59 (-> arg1 pat)) ) - (set! (-> this ground-touch-point quad) (-> a1-8 quad)) - (set! (-> this poly-normal quad) (-> a0-31 quad)) - (set! (-> this surface-normal quad) (-> a0-31 quad)) - (set! (-> this local-normal quad) (-> a0-31 quad)) - (set! (-> this ground-poly-normal quad) (-> a0-31 quad)) + (vector-copy! (-> this ground-touch-point) a1-8) + (vector-copy! (-> this poly-normal) a0-31) + (vector-copy! (-> this surface-normal) a0-31) + (vector-copy! (-> this local-normal) a0-31) + (vector-copy! (-> this ground-poly-normal) a0-31) (set! (-> this poly-pat) v1-59) (set! (-> this cur-pat) v1-59) (set! (-> this ground-pat) v1-59) @@ -1768,9 +1768,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-69 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-69 quad)) - (set! (-> this surface-normal quad) (-> v1-69 quad)) - (set! (-> this poly-normal quad) (-> v1-69 quad)) + (vector-copy! (-> this local-normal) v1-69) + (vector-copy! (-> this surface-normal) v1-69) + (vector-copy! (-> this poly-normal) v1-69) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -1829,7 +1829,7 @@ (cond ((find-ground this s1-1 arg3 arg0 arg1 1024.0 (the-as process #f)) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> this trans quad)) + (vector-copy! a1-4 (-> this trans)) (set! (-> a1-4 y) (-> s1-1 best-other-tri intersect y)) (move-to-point! this a1-4) ) @@ -1837,11 +1837,11 @@ (a0-21 (-> s1-1 best-other-tri normal)) (v1-25 (-> s1-1 best-other-tri pat)) ) - (set! (-> this ground-touch-point quad) (-> a1-5 quad)) - (set! (-> this poly-normal quad) (-> a0-21 quad)) - (set! (-> this surface-normal quad) (-> a0-21 quad)) - (set! (-> this local-normal quad) (-> a0-21 quad)) - (set! (-> this ground-poly-normal quad) (-> a0-21 quad)) + (vector-copy! (-> this ground-touch-point) a1-5) + (vector-copy! (-> this poly-normal) a0-21) + (vector-copy! (-> this surface-normal) a0-21) + (vector-copy! (-> this local-normal) a0-21) + (vector-copy! (-> this ground-poly-normal) a0-21) (set! (-> this poly-pat) v1-25) (set! (-> this cur-pat) v1-25) (set! (-> this ground-pat) v1-25) @@ -1869,9 +1869,9 @@ ) (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-36 (-> this dynam gravity-normal))) - (set! (-> this local-normal quad) (-> v1-36 quad)) - (set! (-> this surface-normal quad) (-> v1-36 quad)) - (set! (-> this poly-normal quad) (-> v1-36 quad)) + (vector-copy! (-> this local-normal) v1-36) + (vector-copy! (-> this surface-normal) v1-36) + (vector-copy! (-> this poly-normal) v1-36) ) (set! (-> this coverage) 0.0) (set! (-> this touch-angle) 0.0) @@ -2253,7 +2253,7 @@ (defmethod move-to-point! ((this collide-shape) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> this trans)) - (set! (-> this trans quad) (-> arg0 quad)) + (vector-copy! (-> this trans) arg0) (let ((a1-2 (-> this root-prim))) (countdown (a0-1 (-> this total-prims)) (vector+! (the-as vector (-> a1-2 prim-core)) (the-as vector (-> a1-2 prim-core)) v1-0) @@ -2563,7 +2563,7 @@ (fill-cache-for-shape s1-0 8192.0 (-> gp-0 cquery)) (let ((s4-1 3)) (until (or (<= s4-1 0) (not (should-push-away this s1-0 (-> gp-0 cquery)))) - (set! (-> gp-0 vec33 quad) (-> s1-0 trans quad)) + (vector-copy! (-> gp-0 vec33) (-> s1-0 trans)) (let* ((f0-4 (+ 2867.2 (-> gp-0 vec33 y))) (f2-2 (+ 5734.4 f0-4)) (f1-11 (-> gp-0 cquery best-other-tri intersect y)) @@ -3065,12 +3065,12 @@ ) ) (let ((s2-1 (new 'stack-no-clear 'vector))) - (set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root transv quad)) + (vector-copy! s2-1 (-> (the-as process-focusable gp-0) root transv)) (let* ((v1-26 (-> (the-as process-focusable gp-0) root transv)) (f30-0 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) ) (if (= f30-0 0.0) - (set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat)) quad)) + (vector-copy! s2-1 (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat))) ) (vector-xz-normalize! s2-1 (fmax f30-0 arg4)) ) @@ -3119,7 +3119,7 @@ (let ((f0-3 (vector-vector-distance-squared s4-0 s1-0))) (when (or (< f30-0 0.0) (< f0-3 f30-0)) (set! f30-0 f0-3) - (set! (-> s5-0 quad) (-> s1-0 quad)) + (vector-copy! s5-0 s1-0) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc index c59c6b75f9b..d30e17bb623 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-target-h_REF.gc @@ -160,8 +160,8 @@ (unknown-float37 float :offset 5636) (unknown-vector37 vector :inline :offset 5648) (unknown-vector38 vector :inline :offset 5664) - (unknown-vector39 vector :inline :offset 5680) - (unknown-vector40 vector :inline :offset 5696) + (unknown-quat39 quaternion :inline :offset 5680) + (unknown-quat40 quaternion :inline :offset 5696) (sliding-start-time time-frame :offset 5712) (unknown-time-frame18 time-frame :offset 5720) (unknown-sound-id00 sound-id :offset 5776) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc index 234f42fe3f6..9cc8d4a5c44 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc @@ -539,7 +539,7 @@ (when arg1 (let ((a0-2 (get-touched-tri arg1 arg2 arg3))) (if a0-2 - (set! (-> arg0 quad) (-> a0-2 intersect quad)) + (vector-copy! arg0 (-> a0-2 intersect)) (touching-prims-entry-method-9 arg1 arg0) ) ) diff --git a/test/decompiler/reference/jak3/engine/collide/find-nearest_REF.gc b/test/decompiler/reference/jak3/engine/collide/find-nearest_REF.gc index f5c50c2ba86..3f0f2ddb999 100644 --- a/test/decompiler/reference/jak3/engine/collide/find-nearest_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/find-nearest_REF.gc @@ -266,16 +266,16 @@ (init-vf0-vector) (let ((gp-0 *search-info*)) (set! (-> gp-0 match) #f) - (set! (-> gp-0 point quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 point) arg1) (set! (-> gp-0 radius) arg2) (set! (-> gp-0 best) 1000000000000000000000.0) (set! (-> gp-0 rating) (search-info-flag)) (set! (-> gp-0 require) arg4) (set! (-> gp-0 mask) arg3) - (set! (-> gp-0 rot-base quad) (-> arg5 quad)) + (vector-copy! (-> gp-0 rot-base) arg5) (if arg6 - (set! (-> gp-0 back-point quad) (-> arg6 quad)) - (set! (-> gp-0 back-point quad) (-> gp-0 rot-base quad)) + (vector-copy! (-> gp-0 back-point) arg6) + (vector-copy! (-> gp-0 back-point) (-> gp-0 rot-base)) ) (set! arg7 (cond ((= arg7 65536.0) @@ -299,7 +299,7 @@ ) ) (when s3-0 - (let ((s1-0 (process-mask->search-info-flag (the-as process-focusable s3-0)))) + (let ((s1-0 (get-search-info-flag (the-as process-focusable s3-0)))) (when (and (and s3-0 (not (logtest? (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead)))) (logtest? s1-0 (search-info-flag crate guard attackable enemy attackable-priority high-priority)) ) @@ -442,7 +442,7 @@ ) (when (logtest? (search-info-flag probe) (-> gp-0 mask)) (let ((a1-13 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-13 start-pos quad) (-> gp-0 back-point quad)) + (vector-copy! (-> a1-13 start-pos) (-> gp-0 back-point)) (vector-! (-> a1-13 move-dist) s2-1 (-> gp-0 back-point)) (let ((v1-124 a1-13)) (set! (-> v1-124 radius) 1228.8) @@ -481,7 +481,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/los-control_REF.gc b/test/decompiler/reference/jak3/engine/collide/los-control_REF.gc index c981b504337..738af0674ae 100644 --- a/test/decompiler/reference/jak3/engine/collide/los-control_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/los-control_REF.gc @@ -7,7 +7,7 @@ ;; definition for method 13 of type los-control ;; INFO: Used lq/sq (defmethod los-control-method-13 ((this los-control) (arg0 collide-query) (arg1 vector) (arg2 int) (arg3 float)) - (set! (-> arg0 move-dist quad) (-> arg1 quad)) + (vector-copy! (-> arg0 move-dist) arg1) (vector-length-max! (-> arg0 move-dist) (-> this max-check-distance)) (set! (-> arg0 radius) arg3) (set! (-> arg0 collide-with) (the-as collide-spec (logand (the-as collide-spec arg2) (-> this collide-with)))) @@ -84,7 +84,7 @@ (if (not arg1) (set! arg1 (get-trans arg0 3)) ) - (set! (-> s0-2 start-pos quad) (-> sv-592 quad)) + (vector-copy! (-> s0-2 start-pos) sv-592) (set! (-> s0-2 ignore-process0) s1-0) (set! (-> s0-2 ignore-process1) (the-as process arg0)) (set! (-> s0-2 ignore-pat) (-> (the-as process-focusable s1-0) root pat-ignore-mask)) @@ -159,7 +159,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/airlock_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/airlock_REF.gc index 6b646541e99..4563f31b2d5 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/airlock_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/airlock_REF.gc @@ -445,7 +445,7 @@ (level-status (let ((a1-3 (car s5-1))) (while (not (null? s5-1)) - (let ((v1-4 (status-of-level-and-borrows *level* (the-as symbol a1-3) level-status))) + (let ((v1-4 (level-status? *level* (the-as symbol a1-3) level-status))) (case level-status (('display) (if (!= v1-4 'active) @@ -1097,6 +1097,7 @@ ;; definition for method 11 of type com-airlock-outer (defmethod init-from-entity! ((this com-airlock-outer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1169,6 +1170,7 @@ ;; definition for method 11 of type com-airlock-inner (defmethod init-from-entity! ((this com-airlock-inner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1258,6 +1260,7 @@ ;; definition for method 11 of type cty-door (defmethod init-from-entity! ((this cty-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1326,6 +1329,7 @@ ;; definition for method 11 of type vin-door-ctyinda (defmethod init-from-entity! ((this vin-door-ctyinda) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1395,6 +1399,7 @@ ;; definition for method 11 of type com-airlock-outer-mhcity (defmethod init-from-entity! ((this com-airlock-outer-mhcity) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1473,6 +1478,7 @@ ;; definition for method 11 of type hip-door-a (defmethod init-from-entity! ((this hip-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/test/decompiler/reference/jak3/engine/common-obs/base-plat_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/base-plat_REF.gc index 8898bb76f26..8144063a456 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/base-plat_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/base-plat_REF.gc @@ -49,7 +49,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-bounce-params! ((this base-plat)) - (set! (-> this basetrans quad) (-> this root trans quad)) + (vector-copy! (-> this basetrans) (-> this root trans)) (set! (-> this bouncing) #f) (set! (-> this bounce-scale) 819.2) 0 @@ -98,7 +98,7 @@ (cond ((-> self bouncing) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self basetrans quad)) + (vector-copy! gp-0 (-> self basetrans)) (+! (-> gp-0 y) (* (-> self bounce-scale) (update! (-> self smush)))) (move-to-point! (-> self root) gp-0) ) @@ -135,7 +135,7 @@ (spawn (-> this part) (-> this root trans)) ) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -393,6 +393,7 @@ ;; definition for method 11 of type eco-door (defmethod init-from-entity! ((this eco-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) @@ -424,7 +425,3 @@ (go (method-of-object this door-closed)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/basebutton_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/basebutton_REF.gc index 877fc1f3b8a..31acd653843 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/basebutton_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/basebutton_REF.gc @@ -73,8 +73,8 @@ (defmethod move-to! ((this basebutton) (arg0 vector) (arg1 quaternion)) (logclear! (-> this button-status) (button-status button-status-2)) (if arg0 - (set! (-> this move-to-pos quad) (-> arg0 quad)) - (set! (-> this move-to-pos quad) (-> this root trans quad)) + (vector-copy! (-> this move-to-pos) arg0) + (vector-copy! (-> this move-to-pos) (-> this root trans)) ) (if arg1 (quaternion-copy! (-> this move-to-quat) arg1) @@ -138,7 +138,7 @@ :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) (logclear! (-> self button-status) (button-status button-status-2)) - (set! (-> self root trans quad) (-> self move-to-pos quad)) + (vector-copy! (-> self root trans) (-> self move-to-pos)) (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) @@ -179,7 +179,7 @@ :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) (logclear! (-> self button-status) (button-status button-status-2)) - (set! (-> self root trans quad) (-> self move-to-pos quad)) + (vector-copy! (-> self root trans) (-> self move-to-pos)) (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) @@ -226,7 +226,7 @@ :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) (logclear! (-> self button-status) (button-status button-status-2)) - (set! (-> self root trans quad) (-> self move-to-pos quad)) + (vector-copy! (-> self root trans) (-> self move-to-pos)) (quaternion-copy! (-> self root quat) (-> self move-to-quat)) (rider-post) ) @@ -262,7 +262,7 @@ :post (behavior () (when (logtest? (-> self button-status) (button-status button-status-2)) (logclear! (-> self button-status) (button-status button-status-2)) - (set! (-> self root trans quad) (-> self move-to-pos quad)) + (vector-copy! (-> self root trans) (-> self move-to-pos)) (quaternion-copy! (-> self root quat) (-> self move-to-quat)) ) (rider-post) @@ -419,6 +419,7 @@ ;; definition for method 11 of type basebutton ;; INFO: Used lq/sq (defmethod init-from-entity! ((this basebutton) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (init! this) (set! (-> this button-id) -1) @@ -475,7 +476,7 @@ (set! (-> self actor-group) (the-as (pointer actor-group) #f)) (set! (-> self actor-group-count) 0) (init-collision! self) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (quaternion-copy! (-> self root quat) arg2) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (prepare-trigger-event! self) @@ -483,7 +484,3 @@ (idle-state-transition self) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/blocking-plane_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/blocking-plane_REF.gc index 4c0ddc0da17..df735c0be32 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/blocking-plane_REF.gc @@ -173,7 +173,7 @@ (set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH)) (set! (-> s2-1 scale y) (/ arg1 METER_LENGTH)) (set! (-> s2-1 scale z) 0.0) - (set! (-> s1-0 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-copy! (-> s1-0 uvec) (new 'static 'vector :y 1.0 :w 1.0)) (vector-cross! (-> s1-0 fvec) (-> s1-0 rvec) (-> s1-0 uvec)) (vector-normalize! (-> s1-0 fvec) 1.0) (matrix->quaternion (-> s2-1 quat) s1-0) @@ -215,6 +215,7 @@ ;; definition for method 11 of type blocking-plane ;; INFO: Used lq/sq (defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this current-attack-mode) #f) (let ((s5-0 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) diff --git a/test/decompiler/reference/jak3/engine/common-obs/bouncer_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/bouncer_REF.gc index 159073ebd19..726bad218e6 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/bouncer_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/bouncer_REF.gc @@ -262,6 +262,7 @@ ;; definition for method 11 of type bouncer (defmethod init-from-entity! ((this bouncer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this mods) #f) (init-collision! this) (process-drawable-from-entity! this arg0) diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables-part_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables-part_REF.gc index 198fcde8c5d..9c1c6e1c2df 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/collectables-part_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables-part_REF.gc @@ -2103,7 +2103,7 @@ (let ((a0-1 (math-camera-matrix)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> a0-1 rvec quad)) + (vector-copy! s5-0 (-> a0-1 rvec)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (let ((a1-3 (matrix-fr-compose (new 'stack-no-clear 'matrix) *up-vector* s5-0)) @@ -2980,7 +2980,3 @@ (:rotate-y (degrees 0) (degrees 3600)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc index 9406632b9fb..0391eb33a91 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc @@ -201,8 +201,8 @@ ) (set! (-> this collect-timeout) (seconds 0.33)) (set-time! (-> this birth-time)) - (set! (-> this base quad) (-> this root trans quad)) - (set! (-> this old-base quad) (-> this root trans quad)) + (vector-copy! (-> this base) (-> this root trans)) + (vector-copy! (-> this old-base) (-> this root trans)) (set! (-> this pickup-handle) (the-as handle #f)) (case (-> this fact pickup-type) (((pickup-type eco-pill-green) @@ -364,8 +364,8 @@ (set! (-> self fact pickup-amount) f30-0) ) (set! (-> self fact options) (-> arg2 options)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root transv) arg1) (initialize-effects self (-> self fact pickup-type)) (set! (-> self notify) (the-as handle #f)) (case (-> self fact pickup-type) @@ -404,7 +404,7 @@ (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize-allocations this) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (initialize-effects this (-> this fact pickup-type)) (initialize-options this 0 1024.0 (the-as fact-info #f)) (update-transforms (-> this root)) @@ -520,7 +520,7 @@ (when (nonzero? (-> this collect-effect)) (cond ((logtest? (-> this collect-effect flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to s5-1 @@ -529,7 +529,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to s5-1 :group (-> this collect-effect) :callback part-tracker-track-target) ) ) @@ -537,7 +537,7 @@ (when (nonzero? (-> this collect-effect2)) (cond ((logtest? (-> this collect-effect2 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to this @@ -570,7 +570,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to this @@ -761,13 +761,13 @@ ) (cond ((= arg2 'trans) - (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self root trans) (the-as vector (-> arg3 param 0))) (update-transforms (-> self root)) (ja-post) ) ((= arg2 'jump) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self jump-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self jump-pos) (the-as vector (-> arg3 param 0))) (go-virtual jump) ) ((= arg2 'pickup) @@ -923,8 +923,8 @@ ) ) ) - (set! (-> self root trans quad) (-> self jump-pos quad)) - (set! (-> self base quad) (-> self root trans quad)) + (vector-copy! (-> self root trans) (-> self jump-pos)) + (vector-copy! (-> self base) (-> self root trans)) (vector-reset! (-> self root transv)) (update-transforms (-> self root)) (logclear! (-> self flags) (collectable-flag bounce)) @@ -966,7 +966,7 @@ (if (-> self actor-pause) (logior! (-> self mask) (process-mask actor-pause)) ) - (set! (-> self base quad) (-> self root trans quad)) + (vector-copy! (-> self base) (-> self root trans)) (logclear! (-> self root root-prim prim-core action) (collide-action solid)) (set! (-> self root root-prim prim-core collide-with) (collide-spec jak player-list tobot jak-vehicle)) (set! (-> self root root-prim prim-core collide-as) (collide-spec collectable notice-blue-eco-powerup)) @@ -1030,7 +1030,7 @@ (if (and *target* (focus-test? *target* dead)) (go-virtual fade) ) - (set! (-> self root trans quad) (-> self base quad)) + (vector-copy! (-> self root trans) (-> self base)) (add-blue-motion #t #f #f #f) (update-transforms (-> self root)) (common-post self) @@ -1184,7 +1184,7 @@ ) :code (behavior ((arg0 handle)) (until #f - (set! (-> self root trans quad) (-> self base quad)) + (vector-copy! (-> self root trans) (-> self base)) (add-blue-motion #t #f #t #f) (update-transforms (-> self root)) (common-post self) @@ -1333,8 +1333,8 @@ ) ) ) - (set! (-> self base quad) (-> self old-base quad)) - (set! (-> self root trans quad) (-> self base quad)) + (vector-copy! (-> self base) (-> self old-base)) + (vector-copy! (-> self root trans) (-> self base)) (let ((v1-26 (-> self root root-prim))) (set! (-> v1-26 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-26 prim-core collide-with) (-> self root backup-collide-with)) @@ -1381,6 +1381,7 @@ ;; definition for method 11 of type eco-yellow ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) ) @@ -1405,6 +1406,7 @@ ;; definition for method 11 of type eco-red ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-red) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) ) @@ -1429,6 +1431,7 @@ ;; definition for method 11 of type eco-blue ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) ) @@ -1453,6 +1456,7 @@ ;; definition for method 11 of type eco-green ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-green) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) ) @@ -1477,6 +1481,7 @@ ;; definition for method 11 of type health ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this health) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) ) @@ -1530,6 +1535,7 @@ ;; definition for method 11 of type eco-pill ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) ) @@ -1667,7 +1673,7 @@ :code (behavior ((arg0 handle)) (until #f (quaternion-rotate-y! (-> self root quat) (-> self root quat) (* 91022.22 (seconds-per-frame))) - (set! (-> self root trans quad) (-> self base quad)) + (vector-copy! (-> self root trans) (-> self base)) (add-blue-motion #t #t #t #f) (let ((f30-0 (-> self bob-amount))) (if (< 0.0 f30-0) @@ -1755,6 +1761,7 @@ ;; definition for method 11 of type money (defmethod init-from-entity! ((this money) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (initialize-allocations this) (process-drawable-from-entity! this (-> this entity)) (initialize-options this 0 1024.0 (the-as fact-info #f)) @@ -1783,9 +1790,9 @@ ) ) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root transv) arg1) (initialize-options self (the-as int (cond @@ -1822,9 +1829,9 @@ ) ) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root transv) arg1) (initialize-options self 4500 0.0 (the-as fact-info #f)) (logior! (-> self flags) (collectable-flag no-eco-blue)) (update-transforms (-> self root)) @@ -1933,13 +1940,13 @@ (set! (-> gp-2 y) 0.0) (let ((f30-0 (vector-normalize-ret-len! gp-2 1.0))) (let ((a0-6 gp-2)) - (set! (-> a0-6 quad) (-> gp-2 quad)) + (vector-copy! a0-6 gp-2) (set! (-> a0-6 y) 0.0) (vector-normalize! a0-6 1.0) ) (vector-float*! gp-2 gp-2 (rand-vu-float-range (/ f30-0 4) (* 0.75 f30-0))) ) - (set! (-> self root transv quad) (-> gp-2 quad)) + (vector-copy! (-> self root transv) gp-2) ) (set! (-> self root transv y) 81920.0) ) @@ -2449,6 +2456,7 @@ ;; definition for method 11 of type trick-point (defmethod init-from-entity! ((this trick-point) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (initialize-allocations this) (process-drawable-from-entity! this (-> this entity)) (initialize-options this 0 1024.0 (the-as fact-info #f)) @@ -2638,8 +2646,8 @@ (set! (-> self fact pickup-amount) f30-0) ) (set! (-> self fact options) (-> arg2 options)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root transv) arg1) (initialize-effects self (-> self fact pickup-type)) (set! (-> self notify) (the-as handle #f)) (initialize-options self 4500 1024.0 arg2) @@ -2655,7 +2663,7 @@ (set! (-> this pickup-amount) arg2) (set! (-> this pickup-type) arg1) (initialize-allocations this) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (initialize-effects this (-> this fact pickup-type)) (initialize-options this 0 1024.0 (the-as fact-info #f)) (update-transforms (-> this root)) @@ -2748,8 +2756,8 @@ (set! (-> self fact pickup-amount) f30-0) ) (set! (-> self fact options) (-> arg2 options)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root transv) arg1) (initialize-effects self (-> self fact pickup-type)) (set! (-> self notify) (the-as handle #f)) (initialize-options @@ -2769,6 +2777,7 @@ ;; definition for method 11 of type eco (defmethod init-from-entity! ((this eco) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0))) (set! (-> this type) (cond ((= (the-as uint v1-1) 3) @@ -3395,7 +3404,7 @@ (return (the-as (pointer process) #f)) ) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) + (vector-copy! (-> s3-1 start-pos) (-> (the-as process-drawable (-> this process)) root trans)) (set-vector! (-> s3-1 move-dist) 0.0 -81920.0 0.0 1.0) (+! (-> s3-1 start-pos y) 12288.0) (let ((v1-33 s3-1)) @@ -3409,8 +3418,8 @@ (set! (-> v1-33 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) - (set! (-> s3-1 start-pos quad) (-> s3-1 best-other-tri intersect quad)) - (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) + (vector-copy! (-> s3-1 start-pos) (-> s3-1 best-other-tri intersect)) + (vector-copy! (-> s3-1 start-pos) (-> (the-as process-drawable (-> this process)) root trans)) ) (if (= sv-16 (pickup-type fuel-cell)) (+! (-> s3-1 start-pos y) 6144.0) diff --git a/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc index 5c7152e1df5..dd924515dfc 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/crates_REF.gc @@ -546,7 +546,8 @@ ;; definition for method 20 of type crate ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this crate)) +(defmethod get-search-info-flag ((this crate)) + "Get search-info-flag for this process." (the-as search-info-flag (if (logtest? (actor-option no-track) (-> this fact options)) 0 2 @@ -705,7 +706,7 @@ ) (('fall) (when (not (and (-> self next-state) (= (-> self next-state name) 'fall))) - (set! (-> self root transv quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self root transv) (the-as vector (-> arg3 param 0))) (go-virtual fall) ) ) @@ -778,7 +779,7 @@ (-> self carry) ) (('drop) - (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) + (vector-copy! (-> self root transv) (the-as vector (-> block param 1))) (go-virtual fall) ) ) @@ -824,7 +825,7 @@ (vector-reset! (-> self root transv)) (when (= (vector-length (-> self root transv)) 0.0) (set! (-> self root root-prim local-sphere w) (-> self carry backup-radius)) - (set! (-> self base quad) (-> self root trans quad)) + (vector-copy! (-> self base) (-> self root trans)) (let ((v1-16 (-> self root root-prim))) (set! (-> v1-16 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-16 prim-core collide-with) (-> self root backup-collide-with)) @@ -1028,11 +1029,11 @@ ((= v1-55 'darkeco) (cond ((logtest? (-> *part-group-id-table* 197 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 197)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 197)) ) ) @@ -1040,21 +1041,21 @@ ((or (= v1-55 'steel) (= v1-55 'iron)) (cond ((logtest? (-> *part-group-id-table* 196 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 196)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 196)) ) ) ) ((logtest? (-> *part-group-id-table* 195 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 195)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 195)) ) ) @@ -1175,7 +1176,7 @@ (defbehavior crate-init-by-other crate ((arg0 entity) (arg1 vector) (arg2 symbol) (arg3 fact-info-crate)) (process-entity-set! self arg0) (init! self (the-as entity-actor arg0)) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (set! (-> self look) arg2) (set! (-> self defense) arg2) (init-skel! self) @@ -1191,6 +1192,7 @@ ;; definition for method 11 of type crate ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this crate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init! this arg0) (init-skel! this) (set! (-> this draw light-index) (the-as uint 10)) @@ -1380,7 +1382,7 @@ ) ) ) - (set! (-> this base quad) (-> this root trans quad)) + (vector-copy! (-> this base) (-> this root trans)) (crate-post) (nav-mesh-connect-from-ent this) (none) diff --git a/test/decompiler/reference/jak3/engine/common-obs/debris_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/debris_REF.gc index 3b8f4e6eb4b..d577ed281a4 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/debris_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/debris_REF.gc @@ -322,7 +322,7 @@ (let ((f0-9 (* (-> s1-0 gravity) (seconds-per-frame))) (s0-0 (new 'stack-no-clear 'quaternion)) ) - (set! (-> s1-0 prev-pos quad) (-> s1-0 root trans quad)) + (vector-copy! (-> s1-0 prev-pos) (-> s1-0 root trans)) (+! (-> s1-0 transv y) f0-9) (vector-v+! (the-as vector (-> s1-0 root)) (the-as vector (-> s1-0 root)) (-> s1-0 transv)) (quaternion-vector-angle! s0-0 (-> s1-0 rot-axis) (* (-> s1-0 rot-angle) (seconds-per-frame))) @@ -333,7 +333,7 @@ (when (nonzero? (-> s1-0 params collide-spec)) (let ((s0-1 (new 'stack-no-clear 'vector))) (vector-! (-> cquery move-dist) (the-as vector (-> s1-0 root)) (-> s1-0 prev-pos)) - (set! (-> cquery start-pos quad) (-> s1-0 prev-pos quad)) + (vector-copy! (-> cquery start-pos) (-> s1-0 prev-pos)) (let ((v1-34 cquery)) (set! (-> v1-34 radius) 2048.0) (set! (-> v1-34 collide-with) (-> s1-0 params collide-spec)) @@ -553,7 +553,7 @@ (let ((joint-transform (-> pdraw node-list data (-> params joints i parent-joint-index) bone transform))) (matrix->quaternion (-> debris root quat) joint-transform) (matrix->trans joint-transform (the-as vector (-> debris root))) - (set! (-> debris root scale quad) (-> pdraw root scale quad)) + (vector-copy! (-> debris root scale) (-> pdraw root scale)) (if (nonzero? (-> params joints i offset)) (vector-matrix*! (the-as vector (-> debris root)) (-> params joints i offset) joint-transform) ) @@ -600,7 +600,7 @@ (let ((s0-5 (new 'stack-no-clear 'vector))) (rand-vu-sphere-point-uniform! s0-5 1.0) (vector-normalize! s0-5 1.0) - (set! (-> debris rot-axis quad) (-> s0-5 quad)) + (vector-copy! (-> debris rot-axis) s0-5) ) (set! (-> debris rot-angle) (* 182.04445 (-> tuning rot-speed))) (set! (-> debris duration) (the float (-> tuning duration))) @@ -616,7 +616,7 @@ ) ) (set! (-> debris draw) draw) - (set! (-> draw skeleton bones 0 transform trans quad) (-> *null-vector* quad)) + (vector-copy! (-> draw skeleton bones 0 transform trans) *null-vector*) ) ) (else @@ -736,7 +736,3 @@ ((dm-debris-d-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 2) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/elevator_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/elevator_REF.gc index 0dd1841a157..29278cb5259 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/elevator_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/elevator_REF.gc @@ -172,7 +172,7 @@ (let ((s4-0 (-> gp-0 control collision-spheres 0)) (s5-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s5-0 start-pos quad) (-> s4-0 prim-core world-sphere quad)) + (vector-copy! (-> s5-0 start-pos) (-> s4-0 prim-core world-sphere)) (+! (-> s5-0 start-pos y) 8192.0) (set! (-> s5-0 start-pos w) 1.0) (vector-reset! (-> s5-0 move-dist)) @@ -200,6 +200,7 @@ ) ;; definition for method 51 of type elevator +;; WARN: Return type mismatch object vs none. (defmethod toggle-fence-collision ((this elevator) (arg0 symbol)) (when (and (logtest? (-> this params flags) (elevator-flags fence)) (nonzero? (-> this fence-prim-index))) (let ((v1-7 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child (-> this fence-prim-index)))) @@ -791,7 +792,7 @@ (f0-9 (+ f30-0 (* (ease-value-in-out (-> self path-pos) 0.08) (- f28-0 f30-0)))) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self basetrans quad)) + (vector-copy! gp-0 (-> self basetrans)) (get-point-in-path! (-> self path) (-> self basetrans) f0-9 'interp) (set! (-> self speed) (* (- (-> self basetrans y) (-> gp-0 y)) (-> self clock frames-per-second))) ) @@ -933,6 +934,7 @@ ;; WARN: Return type mismatch none vs object. ;; INFO: Process stack size was changed from 512 to 1024 (defmethod init-from-entity! ((this elevator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-32 float) (sv-36 path-control) (sv-40 target)) (stack-size-set! (-> this main-thread) 1024) (set! (-> this sound-running-loop) #f) @@ -1022,7 +1024,3 @@ (init-sound! this) (go-arrived-or-waiting this) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc index 528ba7c6de3..9a118993ab5 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc @@ -68,7 +68,7 @@ ) 0 (logior! (-> self draw status) (draw-control-status no-draw)) - (set! (-> self draw origin quad) (-> self root trans quad)) + (vector-copy! (-> self draw origin) (-> self root trans)) (if (logtest? (enemy-flag directed) (-> self enemy-flags)) (logior! (-> self enemy-flags) (enemy-flag directed-ready)) ) @@ -96,7 +96,7 @@ :trans (behavior () (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0)) (if (logtest? (enemy-option ambush) (-> self fact enemy-options)) - (go-ambush-delay self) + (go-ambush self) (go-virtual active) ) ) @@ -219,10 +219,10 @@ (let ((gp-1 (-> self focus aware))) (when (logtest? (-> self enemy-flags) (enemy-flag alert)) (cond - ((and (= gp-1 (enemy-aware ea3)) (get-focus! self)) + ((and (= gp-1 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) - ((= gp-1 (enemy-aware ea4)) + ((= gp-1 (enemy-aware flee)) (go-flee self) ) (else @@ -249,7 +249,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post enemy-simple-post ) @@ -283,7 +283,7 @@ ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) (go-stare self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -321,10 +321,10 @@ ((>= 1 (the-as int gp-0)) (go-virtual active) ) - ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + ((and (= gp-0 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -369,7 +369,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post enemy-simple-post ) @@ -386,7 +386,7 @@ ) :trans (behavior () (when (time-elapsed? (-> self state-time) (-> self reaction-time)) - (if (!= (-> self focus aware) (enemy-aware ea4)) + (if (!= (-> self focus aware) (enemy-aware flee)) (go-stare self) ) ) @@ -433,17 +433,17 @@ (init-jump-info! self gp-0) (if (and (-> self enemy-info use-jump-blocked) (logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags)) - (enemy-method-91 self gp-0) + (check-jump-blocked? self gp-0) ) (go-virtual jump-blocked) ) (when (logtest? (-> gp-0 flags) (enemy-jump-flags ejf0)) (until #f - (if (jump-anim-handler self s5-0 gp-0) + (if (jump-anim-handler self (the-as jump-stage s5-0) gp-0) (goto cfg-12) ) - (in-jump-handler self s5-0 gp-0) - (enemy-method-101 self s5-0 gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-0) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-0) gp-0) (suspend) (set! s5-0 1) ) @@ -454,11 +454,11 @@ (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) (let ((s5-1 2)) (logior! (-> self focus-status) (focus-status in-air)) - (until (on-ground? self gp-0) + (until (landed-jump-yet? self gp-0) (+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter))) - (jump-anim-handler self s5-1 gp-0) - (in-jump-handler self s5-1 gp-0) - (enemy-method-101 self s5-1 gp-0) + (jump-anim-handler self (the-as jump-stage s5-1) gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-1) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-1) gp-0) (suspend) (set! s5-1 3) ) @@ -467,11 +467,11 @@ (move-to-gspot! self) (let ((s5-2 4)) (until #f - (if (jump-anim-handler self s5-2 gp-0) + (if (jump-anim-handler self (the-as jump-stage s5-2) gp-0) (goto cfg-19) ) - (in-jump-handler self s5-2 gp-0) - (enemy-method-101 self s5-2 gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-2) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-2) gp-0) (suspend) (set! s5-2 5) ) @@ -482,7 +482,7 @@ (if (logtest? (enemy-flag directed) (-> self enemy-flags)) ((lambda :behavior enemy () (send-event (ppointer->process (-> self parent)) 'child-jumped))) ) - (go-directed2 self) + (go-next-state-auto self) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) @@ -507,7 +507,7 @@ (when (time-elapsed? (-> self state-time) (seconds 0.5)) (if (logtest? (enemy-flag directed) (-> self enemy-flags)) (go-virtual jump) - (go-directed2 self) + (go-next-state-auto self) ) ) ) @@ -619,7 +619,7 @@ (if (logtest? (enemy-option knocked-into-water) (-> self fact enemy-options)) (logior! (-> self enemy-flags) (enemy-flag check-water)) ) - (if (and (enemy-method-123 self) (-> self enemy-info ragdoll-info)) + (if (and (allow-ragdoll? self) (-> self enemy-info ragdoll-info)) (set! (-> self root transv y) 0.0) ) (let ((v1-43 (-> self root))) @@ -642,9 +642,9 @@ ) (when (not (logtest? (-> v1-43 root-prim prim-core action) (collide-action no-normal-reset))) (let ((a0-25 (-> v1-43 dynam gravity-normal))) - (set! (-> v1-43 local-normal quad) (-> a0-25 quad)) - (set! (-> v1-43 surface-normal quad) (-> a0-25 quad)) - (set! (-> v1-43 poly-normal quad) (-> a0-25 quad)) + (vector-copy! (-> v1-43 local-normal) a0-25) + (vector-copy! (-> v1-43 surface-normal) a0-25) + (vector-copy! (-> v1-43 poly-normal) a0-25) ) (set! (-> v1-43 coverage) 0.0) (set! (-> v1-43 touch-angle) 0.0) @@ -663,8 +663,8 @@ (logclear! (-> self enemy-flags) (enemy-flag trackable)) ) (set! (-> self root penetrate-using) (penetrate lunge vehicle knocked)) - (reset-penetrate! self) - (enemy-method-50 self 1) + (reset-penetrate-later! self) + (update-collision-action self 1) (ragdoll-spawn! self #t #f) ) :exit (behavior () @@ -681,12 +681,12 @@ (suspend-for (seconds 0.2) ) (until (ragdoll-settled? self) - (if (or (time-elapsed? (-> self state-time) (seconds 4)) (enemy-method-109 self)) + (if (or (time-elapsed? (-> self state-time) (seconds 4)) (out-of-bounds? self)) (go-die self) ) (suspend) ) - (if (within-gspot-range? self) + (if (invalid-height? self) (go-die self) ) ) @@ -696,7 +696,7 @@ (set! (-> gp-1 anim-speed) (rnd-float-range self 0.9 1.1)) (set! (-> gp-1 on-surface-count) 0) (set! (-> gp-1 move-count) 0) - (until (enemy-method-88 self gp-1) + (until (done-being-knocked? self gp-1) (if (time-elapsed? (-> self state-time) (seconds 2)) (go-die self) ) @@ -721,7 +721,7 @@ (suspend) (+! (-> gp-1 move-count) 1) (set! s5-1 3) - (if (enemy-method-88 self gp-1) + (if (done-being-knocked? self gp-1) (set-time! (-> gp-1 land-can-land-time)) ) ) @@ -729,8 +729,8 @@ #f (label cfg-33) (if (and (not (logtest? (enemy-flag death-start) (-> self enemy-flags))) - (or (within-gspot-range? self) - (enemy-method-109 self) + (or (invalid-height? self) + (out-of-bounds? self) (time-elapsed? (-> gp-1 land-can-land-time) (-> self enemy-info knocked-can-land-timeout)) ) ) @@ -802,7 +802,7 @@ (set! (-> self root penetrate-using) (the-as penetrate (logclear (-> self root penetrate-using) (penetrate knocked))) ) - (enemy-method-50 self 2) + (update-collision-action self 2) (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -835,9 +835,7 @@ :trans (behavior () (if (and (time-elapsed? (-> self state-time) (seconds 0.01)) (and (not (handle->process (-> self ragdoll-proc))) - (or (within-gspot-range? self) - (time-elapsed? (-> self state-time) (-> self enemy-info knocked-recover-timeout)) - ) + (or (invalid-height? self) (time-elapsed? (-> self state-time) (-> self enemy-info knocked-recover-timeout))) ) ) (go-die self) @@ -868,7 +866,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -877,7 +875,7 @@ (when (not (handle->process (-> self ragdoll-proc))) (let ((gp-0 (-> self root))) (if (focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) (vector-v++! (-> gp-0 transv) (compute-acc-due-to-gravity gp-0 (new 'stack-no-clear 'vector) (-> self enemy-info slip-factor)) @@ -898,12 +896,12 @@ (a1-5 (new 'stack-no-clear 'collide-query)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> gp-1 gspot-pos quad)) + (vector-copy! s5-1 (-> gp-1 gspot-pos)) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> gp-1 gspot-normal quad)) + (vector-copy! s4-1 (-> gp-1 gspot-normal)) (when (not (find-ground gp-1 a1-5 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f))) - (set! (-> gp-1 gspot-pos quad) (-> s5-1 quad)) - (set! (-> gp-1 gspot-normal quad) (-> s4-1 quad)) + (vector-copy! (-> gp-1 gspot-pos) s5-1) + (vector-copy! (-> gp-1 gspot-normal) s4-1) ) ) ) @@ -1336,7 +1334,7 @@ (set! (-> self root transv quad) (the-as uint128 0)) (gun-dark-2-ragdoll-start self) (let* ((s4-1 self) - (s1-0 (method-of-object s4-1 get-incoming-attack!)) + (s1-0 (method-of-object s4-1 handle-incoming-attack!)) (s0-0 proc) ) (set! sv-112 block) @@ -1353,7 +1351,7 @@ ) ) ) - (damage-enemy! self proc block) + (damage-enemy-from-attack! self proc block) (set! (-> self incoming penetrate-using) (penetrate vehicle)) (set! (-> self incoming knocked-type) (knocked-type vehicle)) (set! (-> self incoming attack-direction quad) (the-as uint128 0)) @@ -1374,7 +1372,7 @@ (else (when (!= (-> (the-as attack-info s5-0) id) (-> self incoming attack-id)) (let* ((s2-1 self) - (s1-1 (method-of-object s2-1 get-incoming-attack!)) + (s1-1 (method-of-object s2-1 handle-incoming-attack!)) (s0-1 proc) ) (set! sv-128 block) @@ -1513,8 +1511,8 @@ (let ((s3-0 (new 'stack 'collide-query)) (gp-2 (vector-float*! (new 'stack-no-clear 'vector) (-> self root transv) (seconds-per-frame))) ) - (set! (-> s3-0 start-pos quad) (-> (get-trans self 3) quad)) - (set! (-> s3-0 move-dist quad) (-> gp-2 quad)) + (vector-copy! (-> s3-0 start-pos) (get-trans self 3)) + (vector-copy! (-> s3-0 move-dist) gp-2) (let ((v1-26 s3-0)) (set! (-> v1-26 radius) (* 0.7 (-> self root root-prim prim-core world-sphere w))) (set! (-> v1-26 collide-with) @@ -1537,8 +1535,8 @@ (v1-31 (-> s3-0 best-other-tri)) (f28-0 0.9) ) - (set! (-> s5-1 quad) (-> v1-31 normal quad)) - (set! (-> s4-0 quad) (-> v1-31 intersect quad)) + (vector-copy! s5-1 (-> v1-31 normal)) + (vector-copy! s4-0 (-> v1-31 intersect)) (let ((v1-32 (and (-> v1-31 collide-ptr) (let ((s2-0 (-> v1-31 collide-ptr))) (if (type? s2-0 collide-shape-prim-sphere) s2-0 @@ -1550,7 +1548,7 @@ (when v1-32 (let ((s2-1 (-> (the-as collide-shape-prim-sphere v1-32) cshape process))) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> self root transv quad)) + (vector-copy! s1-0 (-> self root transv)) (let* ((s0-0 s2-1) (v1-37 (if (type? s0-0 process-focusable) s0-0 diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc index ddfab9654b2..c0c4e1d4a24 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc @@ -77,7 +77,7 @@ ) (if a0-7 (move-to-point! (the-as collide-shape a0-7) (-> (the-as process-drawable gp-0) root trans)) - (set! (-> self root trans quad) (-> (the-as process-drawable gp-0) root trans quad)) + (vector-copy! (-> self root trans) (-> (the-as process-drawable gp-0) root trans)) ) ) (quaternion-copy! (-> self root quat) (-> (the-as process-drawable gp-0) root quat)) @@ -168,7 +168,7 @@ ) ) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (let ((f30-0 (lerp-scale -0.1 -0.05 (-> this speed) 8192.0 20480.0)) (f0-6 (lerp-scale 0.7 1.0 (-> this speed) 8192.0 20480.0)) ) @@ -271,10 +271,11 @@ ;; definition for method 11 of type swingpole ;; INFO: Used lq/sq (defmethod init-from-entity! ((this swingpole) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." "Copy defaults from the entity." (stack-size-set! (-> this main-thread) 128) (init-collision! this) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (quaternion-copy! (-> this root quat) (-> arg0 quat)) (vector-identity! (-> this root scale)) (vector-y-quaternion! (-> this dir) (-> this root quat)) @@ -333,7 +334,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (vector-copy! (-> self root trans) (-> (the-as process-drawable (-> self parent 0)) root trans)) (quaternion-identity! (-> self root quat)) (vector-identity! (-> self root scale)) (set! (-> self joint-track) arg0) @@ -350,6 +351,7 @@ ;; definition for method 11 of type process-hidden (defmethod init-from-entity! ((this process-hidden) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." "Copy defaults from the entity." (process-entity-status! this (entity-perm-status dead) #t) (go (method-of-object this die)) @@ -943,7 +945,7 @@ (s3-0 (new 'stack-no-clear 'collide-query)) (f28-0 122880.0) ) - (set! (-> s3-0 start-pos quad) (-> s4-1 quad)) + (vector-copy! (-> s3-0 start-pos) s4-1) (vector-normalize-copy! (-> s3-0 move-dist) s5-2 f28-0) (let ((v1-91 s3-0)) (set! (-> v1-91 radius) 1638.4) @@ -1276,7 +1278,7 @@ (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self old-grab-pos)) ) ) - (set! (-> self old-grab-pos quad) (-> gp-1 quad)) + (vector-copy! (-> self old-grab-pos) gp-1) ) ) ) @@ -1441,7 +1443,7 @@ (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) ) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self arg2 (the-as pair 0)) (if (type? (-> self root) collide-shape) (update-transforms (-> self root)) @@ -1605,11 +1607,11 @@ (nonzero? (-> (the-as process-drawable v1-15) node-list)) ) (spawn-from-cspace (-> self part) (-> (the-as process-drawable v1-15) node-list data (-> self target-joint))) - (set! (-> self root trans quad) (-> self part origin trans quad)) + (vector-copy! (-> self root trans) (-> self part origin trans)) ) (else (let ((a0-11 (-> self root trans))) - (set! (-> self mat trans quad) (-> a0-11 quad)) + (vector-copy! (-> self mat trans) a0-11) ) (spawn-from-mat (-> self part) (-> self mat)) ) @@ -1689,11 +1691,11 @@ (-> self subsampler) (-> (the-as process-drawable v1-15) node-list data (-> self target-joint) bone transform) ) - (set! (-> self root trans quad) (-> self subsampler spawn-mat trans quad)) + (vector-copy! (-> self root trans) (-> self subsampler spawn-mat trans)) ) (else (let ((a0-11 (-> self root trans))) - (set! (-> self mat trans quad) (-> a0-11 quad)) + (vector-copy! (-> self mat trans) a0-11) ) (init-with-mat! (-> self subsampler) (-> self mat)) ) @@ -1723,39 +1725,17 @@ (set! (-> self target-joint) (the-as int arg5)) ) ((logtest? (-> arg0 flags) (sp-group-flag sp5)) - (let* ((s1-1 (-> self mat)) - (a2-1 (math-camera-matrix)) - (v1-18 (-> a2-1 rvec quad)) - (a0-10 (-> a2-1 uvec quad)) - (a1-2 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> s1-1 rvec quad) v1-18) - (set! (-> s1-1 uvec quad) a0-10) - (set! (-> s1-1 fvec quad) a1-2) - (set! (-> s1-1 trans quad) a2-2) - ) - (set! (-> self mat trans quad) (-> (the-as matrix arg5) trans quad)) - (set! (-> self offset quad) (-> self mat trans quad)) + (matrix-copy! (-> self mat) (math-camera-matrix)) + (vector-copy! (-> self mat trans) (-> (the-as matrix arg5) trans)) + (vector-copy! (-> self offset) (-> self mat trans)) ) (else - (let* ((v1-21 (-> self mat)) - (a3-1 (the-as matrix arg5)) - (a0-15 (-> a3-1 rvec quad)) - (a1-3 (-> a3-1 uvec quad)) - (a2-3 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-21 rvec quad) a0-15) - (set! (-> v1-21 uvec quad) a1-3) - (set! (-> v1-21 fvec quad) a2-3) - (set! (-> v1-21 trans quad) a3-2) - ) - (set! (-> self offset quad) (-> self mat trans quad)) + (matrix-copy! (-> self mat) (the-as matrix arg5)) + (vector-copy! (-> self offset) (-> self mat trans)) ) ) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> self mat trans quad)) + (vector-copy! (-> self root trans) (-> self mat trans)) (if (zero? arg0) (go process-drawable-art-error "null group") ) @@ -1903,7 +1883,7 @@ ) (v0-1 (-> arg0 root trans)) ) - (set! (-> v0-1 quad) (-> v1-2 quad)) + (vector-copy! v0-1 v1-2) v0-1 ) ) @@ -2006,7 +1986,7 @@ (let ((a0-26 (-> this lightning)) (v1-44 (-> this offset1)) ) - (set! (-> a0-26 state meet data (+ (-> a0-26 state points-to-draw) -1) quad) (-> v1-44 quad)) + (vector-copy! (-> a0-26 state meet data (+ (-> a0-26 state points-to-draw) -1)) v1-44) ) ) ) @@ -2017,14 +1997,14 @@ (let ((gp-1 (-> this lightning)) (v1-51 (get-trans a0-22 3)) ) - (set! (-> gp-1 state meet data (+ (-> gp-1 state points-to-draw) -1) quad) (-> v1-51 quad)) + (vector-copy! (-> gp-1 state meet data (+ (-> gp-1 state points-to-draw) -1)) v1-51) ) ) (else (let ((s5-4 (-> this lightning)) (v1-54 (vector<-cspace! (new 'stack-no-clear 'vector) (-> a0-22 node-list data (-> this target-joint1)))) ) - (set! (-> s5-4 state meet data (+ (-> s5-4 state points-to-draw) -1) quad) (-> v1-54 quad)) + (vector-copy! (-> s5-4 state meet data (+ (-> s5-4 state points-to-draw) -1)) v1-54) ) ) ) @@ -2075,7 +2055,7 @@ (let ((gp-1 (-> self lightning spec sound))) (when gp-1 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> self offset1 quad)) + (vector-copy! s5-1 (-> self offset1)) (when (and (>= (-> self target-joint1) 0) (< (-> self target-joint1) 256)) (let* ((s4-0 (handle->process (-> self target1))) (v1-28 (if (type? s4-0 process-drawable) @@ -2084,9 +2064,10 @@ ) ) (if (and v1-28 (nonzero? (-> v1-28 root))) - (set! (-> s5-1 quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-28 node-list data (-> self target-joint1))) quad) - ) + (vector-copy! + s5-1 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-28 node-list data (-> self target-joint1))) + ) ) ) ) @@ -2188,7 +2169,7 @@ ) (else (set! (-> self target-joint0) -1) - (set! (-> self offset0 quad) (-> arg4 quad)) + (vector-copy! (-> self offset0) arg4) ) ) (cond @@ -2198,7 +2179,7 @@ ) (else (set! (-> self target-joint1) -1) - (set! (-> self offset1 quad) (-> arg5 quad)) + (vector-copy! (-> self offset1) arg5) ) ) (set! (-> self root) (new 'process 'trsqv)) @@ -2411,6 +2392,7 @@ ;; definition for method 11 of type med-res-level (defmethod init-from-entity! ((this med-res-level) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (res-lump-struct arg0 'art-name structure)) (s3-0 (res-lump-struct (-> this entity) 'level structure)) @@ -2505,6 +2487,7 @@ ;; INFO: Used lq/sq ;; INFO: Process stack size was changed from 16 to 64 (defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 string)) (stack-size-set! (-> this main-thread) 64) (logior! (-> this mask) (process-mask ambient)) @@ -2512,7 +2495,7 @@ (+! (-> *display* part-clock ref-count) 1) (set! (-> this clock) (-> *display* part-clock)) (set! (-> this root) (new 'process 'trsqv)) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (quaternion-copy! (-> this root quat) (-> arg0 quat)) (vector-identity! (-> this root scale)) (set! (-> this radius) 12288.0) @@ -2884,22 +2867,18 @@ ;; INFO: Used lq/sq (defbehavior cam-launcher-joystick camera-slave () (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (let ((gp-0 (vector-reset! (new 'stack-no-clear 'vector)))) - (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) - (f0-1 (* -546.13336 f0-0)) - (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) - ) - (matrix-axis-angle! s5-0 (-> *camera* local-down) f0-3) + (let ((s5-0 (new-stack-matrix0)) + (gp-0 (vector-reset! (new 'stack-no-clear 'vector))) ) - (vector-! gp-0 (-> self trans) (-> *camera* tpos-curr)) - (vector-matrix*! gp-0 gp-0 s5-0) - (vector+! (-> self trans) gp-0 (-> *camera* tpos-curr)) + (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) + (f0-1 (* -546.13336 f0-0)) + (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) + ) + (matrix-axis-angle! s5-0 (-> *camera* local-down) f0-3) ) + (vector-! gp-0 (-> self trans) (-> *camera* tpos-curr)) + (vector-matrix*! gp-0 gp-0 s5-0) + (vector+! (-> self trans) gp-0 (-> *camera* tpos-curr)) ) ) ) @@ -2922,7 +2901,7 @@ (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) (vector-flatten! gp-0 (-> self tracking inv-mat fvec) (-> *camera* local-down)) (vector-normalize! gp-0 1.0) - (set! (-> self pivot-pt quad) (-> gp-0 quad)) + (vector-copy! (-> self pivot-pt) gp-0) (vector+float*! gp-0 gp-0 (-> *camera* local-down) 1000.0) (vector-normalize-copy! (-> self tracking inv-mat fvec) gp-0 1.0) ) @@ -2962,11 +2941,7 @@ ;; INFO: Used lq/sq (defbehavior cam-launcher-long-joystick camera-slave () (when (not (logtest? (-> *camera* settings master-options) (cam-master-options IGNORE_ANALOG))) - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) + (let ((gp-0 (new-stack-matrix0))) (let* ((f0-0 (analog-input (the-as int (+ (-> *cpad-list* cpads 0 rightx) -128)) 0.0 48.0 110.0 -1.0)) (f0-1 (* -546.13336 f0-0)) (f0-3 (fmin 546.13336 (fmax -546.13336 f0-1))) @@ -3185,6 +3160,7 @@ ;; definition for method 11 of type launcher (defmethod init-from-entity! ((this launcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -3268,7 +3244,7 @@ ) (set! (-> self root) s2-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (set-vector! (-> self root quat) 0.0 0.0 0.0 1.0) (update-transforms (the-as collide-shape (-> self root))) @@ -3396,9 +3372,10 @@ ) ) (if a0-6 - (set! (-> (the-as collide-shape (-> self root)) trans quad) - (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere quad) - ) + (vector-copy! + (-> (the-as collide-shape (-> self root)) trans) + (-> (the-as collide-shape a0-6) root-prim prim-core world-sphere) + ) ) ) ) @@ -3462,7 +3439,7 @@ (set! (-> s4-0 event-self) 'touched) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self duration) arg2) (set! (-> self target) (the-as handle #f)) (set! (-> self event) #f) @@ -3503,7 +3480,7 @@ (set! (-> self root) s5-0) ) (set! (-> (the-as collide-shape (-> self root)) event-self) 'touched) - (set! (-> self root trans quad) (-> arg0 spawn-point quad)) + (vector-copy! (-> self root trans) (-> arg0 spawn-point)) (quaternion-copy! (-> self root quat) (-> arg0 spawn-quat)) (vector-identity! (-> self root scale)) (vector-float*! (-> self root scale) (-> self root scale) (-> arg0 scale)) @@ -3621,9 +3598,10 @@ (case message (('touched) (let ((s4-0 (new 'stack-no-clear 'mystery-cquery-type0))) - (set! (-> s4-0 explosion-trans quad) - (-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere quad) - ) + (vector-copy! + (-> s4-0 explosion-trans) + (-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere) + ) (let* ((s2-0 proc) (s3-0 (if (type? s2-0 process-drawable) s2-0 @@ -3640,7 +3618,7 @@ ) (cond (v1-6 - (set! (-> s4-0 proc-trans quad) (-> v1-6 prim-core world-sphere quad)) + (vector-copy! (-> s4-0 proc-trans) (-> v1-6 prim-core world-sphere)) ) ((begin (let ((s2-2 proc)) @@ -3651,7 +3629,7 @@ ) a0-13 ) - (set! (-> s4-0 proc-trans quad) (-> (get-trans (the-as process-focusable a0-13) 3) quad)) + (vector-copy! (-> s4-0 proc-trans) (get-trans (the-as process-focusable a0-13) 3)) ) (else (let* ((s2-4 (-> (the-as process-focusable s3-0) root)) @@ -3661,8 +3639,8 @@ ) ) (if v1-12 - (set! (-> s4-0 proc-trans quad) (-> v1-12 root-prim prim-core world-sphere quad)) - (set! (-> s4-0 proc-trans quad) (-> (the-as process-focusable s3-0) root trans quad)) + (vector-copy! (-> s4-0 proc-trans) (-> v1-12 root-prim prim-core world-sphere)) + (vector-copy! (-> s4-0 proc-trans) (-> (the-as process-focusable s3-0) root trans)) ) ) ) @@ -3672,7 +3650,7 @@ (set! (-> s4-0 dist) (fmax 0.0 (- (-> s4-0 dist) (-> s4-0 proc-trans w)))) (set! (-> s4-0 probe) -1.0) (when (< 0.0 (-> s4-0 dist)) - (set! (-> s4-0 cquery start-pos quad) (-> s4-0 explosion-trans quad)) + (vector-copy! (-> s4-0 cquery start-pos) (-> s4-0 explosion-trans)) (vector-! (-> s4-0 cquery move-dist) (-> s4-0 proc-trans) (-> s4-0 explosion-trans)) (let ((v1-23 (-> s4-0 cquery))) (set! (-> v1-23 radius) 40.96) @@ -3813,6 +3791,7 @@ ;; definition for method 11 of type simple-prim (defmethod init-from-entity! ((this simple-prim) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (allocate-trans-and-strip! this) (process-entity-set! this arg0) (process-drawable-from-entity! this arg0) @@ -3858,8 +3837,8 @@ ;; INFO: Used lq/sq (defbehavior simple-prim-init-by-other simple-prim ((arg0 vector) (arg1 vector) (arg2 texture-id)) (allocate-trans-and-strip! self) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root scale quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root scale) arg1) (set! (-> self strip tex-id) arg2) (go-virtual active) ) @@ -3920,7 +3899,7 @@ (let ((v1-8 (-> this strip data))) (vector+! s4-0 (-> this root trans) s2-0) (vector+! s4-0 s4-0 s3-0) - (set! (-> v1-8 0 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-8 0 pos) s4-0) (set! (-> v1-8 0 stq z) 0.0) (set! (-> v1-8 0 stq x) 0.0) (set! (-> v1-8 0 stq y) 0.0) @@ -3929,7 +3908,7 @@ (let ((v1-9 (-> v1-8 1))) (vector+float*! s4-0 (-> this root trans) s2-0 -1.0) (vector+! s4-0 s4-0 s3-0) - (set! (-> v1-9 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-9 pos) s4-0) (set! (-> v1-9 stq z) 0.0) (set! (-> v1-9 stq x) 1.0) (set! (-> v1-9 stq y) 0.0) @@ -3938,7 +3917,7 @@ (let ((v1-10 (&+ v1-9 32))) (vector+! s4-0 (-> this root trans) s2-0) (vector+float*! s4-0 s4-0 s3-0 -1.0) - (set! (-> v1-10 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-10 pos) s4-0) (set! (-> v1-10 stq z) 0.0) (set! (-> v1-10 stq x) 0.0) (set! (-> v1-10 stq y) 1.0) @@ -3947,7 +3926,7 @@ (let ((v1-11 (&+ v1-10 32))) (vector+float*! s4-0 (-> this root trans) s2-0 -1.0) (vector+float*! s4-0 s4-0 s3-0 -1.0) - (set! (-> v1-11 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-11 pos) s4-0) (set! (-> v1-11 stq z) 0.0) (set! (-> v1-11 stq x) 1.0) (set! (-> v1-11 stq y) 1.0) @@ -4193,6 +4172,7 @@ ;; definition for method 11 of type part-controller ;; INFO: Used lq/sq (defmethod init-from-entity! ((this part-controller) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag) (sv-32 string)) (stack-size-set! (-> this main-thread) 32) (set! sv-16 (new 'static 'res-tag)) @@ -4288,7 +4268,7 @@ (sound-play-by-name (-> self spawn-sound) (new-sound-id) 1024 0 0 (sound-group) gp-1) (cond ((logtest? (-> self particle-launchers (-> self current-part-index) 0 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -4296,7 +4276,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* @@ -4347,6 +4327,7 @@ ;; definition for method 11 of type sound-controller ;; INFO: Used lq/sq (defmethod init-from-entity! ((this sound-controller) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (let ((a0-3 (the-as string ((method-of-type res-lump get-property-struct) arg0 @@ -4362,7 +4343,7 @@ ) (set! (-> this spawn-sound) (string->sound-name a0-3)) ) - (set! (-> this pos quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this pos) (-> arg0 extra trans)) (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) (let ((v1-5 0)) (if #f @@ -4480,6 +4461,7 @@ ;; definition for method 11 of type sound-on-path (defmethod init-from-entity! ((this sound-on-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -4559,7 +4541,7 @@ (gp-1 (new 'stack-no-clear 'vector)) ) (get-point-at-percent-along-path! (-> self path) gp-1 f0-0 'interp) - (set! (-> self root trans quad) (-> gp-1 quad)) + (vector-copy! (-> self root trans) gp-1) (cond ((-> self is-spooling?) (case (get-status *gui-control* (the-as sound-id (-> self loop-sound))) @@ -4660,6 +4642,7 @@ ;; definition for method 11 of type level-exit (defmethod init-from-entity! ((this level-exit) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this minimap) #f) diff --git a/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc index 03edf47f32b..c9adee09ef4 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/guard-projectile_REF.gc @@ -357,7 +357,7 @@ (a1-4 (-> *part-id-table* 855)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -410,7 +410,7 @@ (f28-1 (-> *part-id-table* 853 init-specs 4 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 853 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 853 init-specs 4 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 853) s4-1 :origin-is-matrix #t) @@ -431,27 +431,27 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) (v1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-1 quad) (-> s5-0 trans quad)) + (vector-copy! v1-1 (-> s5-0 trans)) (vector+! v1-1 v1-1 a0-3) (cond ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) ) ) ) ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) ) ) @@ -620,7 +620,7 @@ ;; INFO: Used lq/sq (defmethod init-proj-settings! ((this guard-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'guard-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) guard-shot-move) @@ -654,8 +654,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/metalhead-projectile_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/metalhead-projectile_REF.gc index 6893336c864..996799fd7ac 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/metalhead-projectile_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/metalhead-projectile_REF.gc @@ -352,7 +352,7 @@ (a1-4 (-> *part-id-table* 867)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -404,7 +404,7 @@ (f28-1 (-> *part-id-table* 865 init-specs 5 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 865 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 865 init-specs 5 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 865) s4-1 :origin-is-matrix #t) @@ -425,15 +425,15 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector-copy! v1-2 (-> gp-0 trans)) (vector+! v1-2 v1-2 a0-3) (cond ((logtest? (-> *part-group-id-table* 214 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 214)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 214)) ) ) @@ -553,7 +553,7 @@ ;; definition for method 31 of type metalhead-shot ;; INFO: Used lq/sq (defmethod init-proj-settings! ((this metalhead-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'metalhead-shot) (set! (-> this max-speed) 532480.0) (set! (-> this move) metalhead-shot-move) @@ -584,7 +584,7 @@ (set! (-> gp-0 attack-id) a2-12) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) (the-as (pointer metalhead-shot) (spawn-projectile metalhead-shot gp-0 arg0 *default-dead-pool*)) @@ -706,11 +706,11 @@ (defmethod projectile-method-26 ((this metalhead-grenade-shot)) (cond ((logtest? (-> *part-group-id-table* 104 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 104)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 104)) ) ) @@ -763,7 +763,7 @@ (a1-3 (new 'stack 'collide-query)) ) 0.0 - (set! (-> a1-3 start-pos quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> a1-3 start-pos) (-> self root root-prim prim-core world-sphere)) (vector-! (-> a1-3 move-dist) (the-as vector (-> s4-1 root-prim prim-core)) (-> a1-3 start-pos)) (let ((v1-6 a1-3)) (set! (-> v1-6 radius) 40.96) @@ -958,7 +958,7 @@ (set! (-> gp-0 attack-id) a2-12) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) (the-as (pointer metalhead-grenade-shot) (spawn-projectile metalhead-shot gp-0 arg0 *default-dead-pool*)) diff --git a/test/decompiler/reference/jak3/engine/common-obs/particle-curves_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/particle-curves_REF.gc index 88ee49abb26..431024e8f84 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/particle-curves_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/particle-curves_REF.gc @@ -188,14 +188,10 @@ (set! (-> a3-0 y) 40960.0) (set! (-> a3-0 z) 0.0) (set! (-> a3-0 w) 1.0) - (set! (-> v1-1 quad) (-> a3-0 quad)) + (vector-copy! v1-1 a3-0) ) (t9-0 a0-0 a1-0 a2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/plat_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/plat_REF.gc index 91a8fe92b56..cf06822e838 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/plat_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/plat_REF.gc @@ -156,6 +156,7 @@ ;; definition for method 11 of type plat (defmethod init-from-entity! ((this plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logior! (-> this mask) (process-mask platform)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -277,13 +278,13 @@ ) ) ) - (set! (-> self hit-point quad) (-> self root trans quad)) + (vector-copy! (-> self hit-point) (-> self root trans)) (let ((a0-13 (if (type? proc process-focusable) proc ) ) ) - (set! (-> self hit-point quad) (-> (get-trans (the-as process-focusable a0-13) 0) quad)) + (vector-copy! (-> self hit-point) (get-trans (the-as process-focusable a0-13) 0)) ) (if (zero? (-> self bounce-time)) (start-bounce! self) diff --git a/test/decompiler/reference/jak3/engine/common-obs/powerups_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/powerups_REF.gc index fa04de7863c..b38bc3eb2a8 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/powerups_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/powerups_REF.gc @@ -577,9 +577,7 @@ ) (s2-0 *launch-matrix*) ) - (set! (-> s2-0 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-0)) quad) - ) + (vector-copy! (-> s2-0 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-0))) (gp-1 s5-0 s4-0 s2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (dotimes (gp-2 2) @@ -589,9 +587,7 @@ (s3-1 (-> *part-id-table* 800)) (s1-1 *launch-matrix*) ) - (set! (-> s1-1 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-58)) quad) - ) + (vector-copy! (-> s1-1 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-58))) (s5-1 s4-1 s3-1 s1-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -619,9 +615,7 @@ ) (s2-2 *launch-matrix*) ) - (set! (-> s2-2 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-2)) quad) - ) + (vector-copy! (-> s2-2 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-2))) (gp-3 s5-2 s4-2 s2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (dotimes (gp-4 2) @@ -631,9 +625,7 @@ (s3-3 (-> *part-id-table* 804)) (s1-3 *launch-matrix*) ) - (set! (-> s1-3 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-91)) quad) - ) + (vector-copy! (-> s1-3 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-91))) (s5-3 s4-3 s3-3 s1-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -680,9 +672,7 @@ (s4-7 (-> *part-id-table* 789)) (s2-7 *launch-matrix*) ) - (set! (-> s2-7 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-128)) quad) - ) + (vector-copy! (-> s2-7 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-128))) (gp-7 s5-7 s4-7 s2-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 1 (seconds 0.1)) @@ -700,9 +690,7 @@ ) (s2-8 *launch-matrix*) ) - (set! (-> s2-8 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-6)) quad) - ) + (vector-copy! (-> s2-8 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data s1-6))) (gp-8 s5-8 s4-8 s2-8 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (dotimes (gp-9 2) @@ -712,9 +700,7 @@ (s3-9 (-> *part-id-table* 808)) (s1-7 *launch-matrix*) ) - (set! (-> s1-7 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-152)) quad) - ) + (vector-copy! (-> s1-7 trans) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data v1-152))) (s5-9 s4-9 s3-9 s1-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc index c203a0cc586..4261cfa9109 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc @@ -214,7 +214,7 @@ (let ((gp-0 (-> arg0 root))) (let ((a1-0 (new 'stack-no-clear 'collide-query))) (let ((a2-0 (-> gp-0 root-prim))) - (set! (-> a1-0 start-pos quad) (-> gp-0 trans quad)) + (vector-copy! (-> a1-0 start-pos) (-> gp-0 trans)) (let ((v1-1 (-> a1-0 move-dist))) (.lvf vf1 (&-> (-> gp-0 transv) quad)) (let ((f0-0 (seconds-per-frame))) @@ -328,9 +328,9 @@ ) ) (let ((gp-0 (-> self root))) - (set! (-> self pre-move-transv quad) (-> gp-0 transv quad)) + (vector-copy! (-> self pre-move-transv) (-> gp-0 transv)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ((-> self move) self) (projectile-method-39 self) (set! (-> self old-dist (-> self old-dist-count)) (* 0.0625 (vector-vector-distance s5-0 (-> gp-0 trans)))) @@ -513,7 +513,7 @@ (set! (-> self pick-target) #f) (set! (-> self stop-speed) 204.8) (set! (-> self desired-target) (-> arg0 target-handle)) - (set! (-> self desired-target-pos quad) (-> arg0 target-pos quad)) + (vector-copy! (-> self desired-target-pos) (-> arg0 target-pos)) (countdown (v1-29 16) (set! (-> self old-dist v1-29) 4095996000.0) ) @@ -527,16 +527,16 @@ ) (logior! (-> self mask) (process-mask projectile)) (logclear! (-> self mask) (process-mask enemy)) - (set! (-> s5-0 trans quad) (-> arg0 pos quad)) - (set! (-> self starting-pos quad) (-> arg0 pos quad)) + (vector-copy! (-> s5-0 trans) (-> arg0 pos)) + (vector-copy! (-> self starting-pos) (-> arg0 pos)) (quaternion-copy! (-> s5-0 quat) (-> self parent 0 root quat)) (vector-identity! (-> s5-0 scale)) - (set! (-> s5-0 transv quad) (-> arg0 vel quad)) - (set! (-> self pre-move-transv quad) (-> arg0 vel quad)) + (vector-copy! (-> s5-0 transv) (-> arg0 vel)) + (vector-copy! (-> self pre-move-transv) (-> arg0 vel)) (vector-normalize-copy! (-> self starting-dir) (-> arg0 vel) 1.0) (vector+float*! (-> self base-target-pos) (-> s5-0 trans) (-> self starting-dir) 2048000.0) ) - (set! (-> self target-pos quad) (-> self base-target-pos quad)) + (vector-copy! (-> self target-pos) (-> self base-target-pos)) (set! (-> self event-hook) projectile-event-handler) (init-proj-settings! self) (update-transforms (-> self root)) @@ -580,7 +580,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (projectile-bounce-update-velocity self) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) (vector-v++! s5-0 (-> gp-0 transv)) (when (find-ground gp-0 diff --git a/test/decompiler/reference/jak3/engine/common-obs/ragdoll-test_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/ragdoll-test_REF.gc index db55c1e6042..2808b271741 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/ragdoll-test_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/ragdoll-test_REF.gc @@ -277,7 +277,7 @@ (when (cpad-pressed? 0 l2) (cond ((-> self entity) - (set! (-> self root trans quad) (-> self entity trans quad)) + (vector-copy! (-> self root trans) (-> self entity trans)) ) (else (vector-reset! (-> self root trans)) @@ -310,9 +310,10 @@ ) ) ) - (set! (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)) trans quad) - (-> self root trans quad) - ) + (vector-copy! + (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)) trans) + (-> self root trans) + ) ) ) (ja :num! (loop!)) @@ -348,7 +349,7 @@ (set! (-> s5-0 event-self) 'touched) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 orient-tform quad)) + (vector-copy! (-> self root trans) (-> arg0 orient-tform)) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-ragdoll-test" (the-as (pointer level) #f))) @@ -362,7 +363,3 @@ ) (go-virtual idle) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/rigid-body-plat_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/rigid-body-plat_REF.gc index 250fcdd3dfc..d8b3b1aa6f5 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/rigid-body-plat_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/rigid-body-plat_REF.gc @@ -297,7 +297,7 @@ (let ((v1-1 (the-as object (-> arg3 param 0)))) (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> this flags) (rigid-body-object-flag player-contact-force)) - (set! (-> this player-force-position quad) (-> (the-as rigid-body-control-point v1-1) velocity quad)) + (vector-copy! (-> this player-force-position) (-> (the-as rigid-body-control-point v1-1) velocity)) (vector-reset! (-> this player-force)) (set! (-> this player-force y) (* -1.0 (-> this info player-weight))) ) @@ -318,7 +318,7 @@ ) (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> this flags) (rigid-body-object-flag player-contact-force)) - (set! (-> this player-force-position quad) (-> (the-as process-focusable v1-11) root trans quad)) + (vector-copy! (-> this player-force-position) (-> (the-as process-focusable v1-11) root trans)) (vector-reset! (-> this player-force)) (let* ((a1-5 (-> this player-force-position)) (f30-0 0.0) @@ -347,7 +347,7 @@ ) (when v1-31 (logior! (-> this flags) (rigid-body-object-flag player-impulse-force)) - (set! (-> this player-force-position quad) (-> (the-as process-focusable v1-31) root trans quad)) + (vector-copy! (-> this player-force-position) (-> (the-as process-focusable v1-31) root trans)) (let ((f0-14 (fmin (* 0.00012207031 (the-as float (-> arg3 param 1)) @@ -401,7 +401,7 @@ (the-as (function rigid-body-object float) (method-of-object this apply-gravity!)) ) (set-time! (-> this player-bonk-timeout)) - (set! (-> this player-force quad) (-> *null-vector* quad)) + (vector-copy! (-> this player-force) *null-vector*) (set! (-> this root max-iteration-count) (the-as uint 4)) (set! (-> this max-time-step) (-> arg0 extra max-time-step)) (set! (-> this water-anim) (entity-actor-lookup (-> this entity) 'water-actor 0)) @@ -498,6 +498,7 @@ ;; definition for method 11 of type rigid-body-platform ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this rigid-body-platform) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logior! (-> this mask) (process-mask platform)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -505,7 +506,3 @@ (go-idle this) 0 ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/shield-sphere_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/shield-sphere_REF.gc index aac69845ace..af3fcb95d17 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/shield-sphere_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/shield-sphere_REF.gc @@ -511,7 +511,7 @@ (set! (-> self sphere-size) (-> arg0 sphere-size)) (set! (-> self owner) (-> arg0 owner)) (set! (-> self track-joint) (-> arg0 track-joint)) - (set! (-> self offset-vec quad) (-> arg0 offset-vec quad)) + (vector-copy! (-> self offset-vec) (-> arg0 offset-vec)) (init-collision! self) (initialize-skeleton self @@ -778,7 +778,7 @@ :trans (behavior () (let ((v1-1 (handle->process (-> self owner)))) (when v1-1 - (set! (-> self root trans quad) (-> (the-as process-drawable v1-1) root trans quad)) + (vector-copy! (-> self root trans) (-> (the-as process-drawable v1-1) root trans)) (quaternion-copy! (-> self root quat) (-> (the-as process-drawable v1-1) root quat)) ) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc index efd9db2340c..b64bed2272b 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc @@ -62,7 +62,7 @@ ) (set! (-> this root) s3-0) ) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (update-transforms (-> this root)) (set! (-> this root pause-adjust-distance) 409600.0) (set! (-> this fact) (new 'process 'fact-info this arg1 (-> *FACT-bank* eco-full-inc))) @@ -234,7 +234,7 @@ (when v1-9 (cond ((logtest? (-> self collect-effect flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-9 root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> v1-9 root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to gp-0 @@ -243,13 +243,13 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-9 root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> v1-9 root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to gp-0 :group (-> self collect-effect) :callback part-tracker-track-target) ) ) (cond ((logtest? (-> self collect-effect2 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to self @@ -258,7 +258,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to self @@ -299,6 +299,7 @@ ;; definition for method 11 of type ecovent (defmethod init-from-entity! ((this ecovent) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init! this arg0 (pickup-type eco-green)) ) @@ -469,6 +470,7 @@ ;; definition for method 11 of type light-eco-vent (defmethod init-from-entity! ((this light-eco-vent) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -696,6 +698,7 @@ ;; definition for method 11 of type dark-eco-vent (defmethod init-from-entity! ((this dark-eco-vent) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -745,7 +748,3 @@ (set-falloff-mode! (-> this sound) 9) (go (method-of-object this open) #t) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc index 9e0ac865dd8..3196a5c58c7 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc @@ -119,7 +119,7 @@ (defmethod get-track-pt-and-scale ((this remote) (arg0 vector)) (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 - (set! (-> arg0 quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (vector-copy! arg0 (get-trans (the-as process-focusable s4-0) 3)) (let ((a0-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s4-0) 0)))) (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> this blend)))) ) @@ -188,10 +188,10 @@ (let ((gp-0 (handle->process (-> self focus handle))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self parent 0 trans quad)) + (vector-copy! s5-0 (-> self parent 0 trans)) (let ((f30-0 (get-track-pt-and-scale self s5-0))) (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self parent 0 trans quad)) + (vector-copy! a1-2 (-> self parent 0 trans)) (vector-lerp! (-> self root trans) a1-2 s5-0 (-> self blend)) ) (+! (-> self root trans y) (* 1638.4 (sin (* 54.613335 (the float (mod (current-time) 1200)))))) @@ -267,7 +267,7 @@ ) ) (if a1-1 - (try-update-focus (-> self focus) (the-as process-focusable a1-1)) + (focus-on! (-> self focus) (the-as process-focusable a1-1)) ) ) ) @@ -425,8 +425,8 @@ (defbehavior voicebox-init-by-other voicebox ((arg0 vector) (arg1 handle)) (set! (-> self hint) arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self base-trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self base-trans) arg0) (init self) (set! (-> self event-hook) (-> (method-of-object self enter) event)) (go-virtual enter) @@ -494,7 +494,7 @@ ;; definition for method 24 of type judge ;; INFO: Used lq/sq (defmethod get-track-pt-and-scale ((this judge) (arg0 vector)) - (set! (-> arg0 quad) (-> this base-trans quad)) + (vector-copy! arg0 (-> this base-trans)) 1.0 ) @@ -554,7 +554,7 @@ ) (when s4-0 (change-parent self (ppointer->process s4-0)) - (try-update-focus (-> self focus) (the-as process-focusable s5-2)) + (focus-on! (-> self focus) (the-as process-focusable s5-2)) (go-virtual enter) ) ) @@ -661,11 +661,12 @@ ;; definition for method 11 of type judge ;; INFO: Used lq/sq (defmethod init-from-entity! ((this judge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (setup-collision! this) (init this) (process-drawable-from-entity! this arg0) (+! (-> this root trans y) 4096.0) - (set! (-> this base-trans quad) (-> this root trans quad)) + (vector-copy! (-> this base-trans) (-> this root trans)) (set! (-> this total-time) (seconds 90)) (go (method-of-object this wait)) ) @@ -679,8 +680,8 @@ (init self) (vector-identity! (-> self root scale)) (quaternion-identity! (-> self root quat)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self base-trans quad) (-> self root trans quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self base-trans) (-> self root trans)) (set! (-> self total-time) (seconds 90)) (set! (-> self timer?) arg2) (go-virtual wait) diff --git a/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc index 7d74ee44dc7..9ddafa0cfee 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc @@ -688,7 +688,7 @@ (set! (-> s5-0 message) 'change-state) (set! (-> s5-0 param 0) (the-as uint target-warp-out)) (let ((v1-22 (new 'static 'vector))) - (set! (-> v1-22 quad) (-> self center quad)) + (vector-copy! v1-22 (-> self center)) (set! (-> s5-0 param 1) (the-as uint v1-22)) ) (set! (-> s5-0 param 2) (the-as uint (target-pos 0))) @@ -697,22 +697,21 @@ ) (script-eval (-> self on-activate)) (while (begin - (set! v1-38 - (when (-> self wait-for) - (let* ((s5-1 (-> self wait-for)) - (a1-8 (car s5-1)) - ) - (while (not (null? s5-1)) - (when (not (member (status-of-level-and-borrows *level* (the-as symbol a1-8) #f) '(loaded active))) - (set! v1-38 #t) - (goto cfg-21) + (set! v1-38 (when (-> self wait-for) + (let* ((s5-1 (-> self wait-for)) + (a1-8 (car s5-1)) + ) + (while (not (null? s5-1)) + (when (not (member (level-status? *level* (the-as symbol a1-8) #f) '(loaded active))) + (set! v1-38 #t) + (goto cfg-21) + ) + (set! s5-1 (cdr s5-1)) + (set! a1-8 (car s5-1)) + ) + ) + #f ) - (set! s5-1 (cdr s5-1)) - (set! a1-8 (car s5-1)) - ) - ) - #f - ) ) (label cfg-21) (or v1-38 (not (time-elapsed? (-> self state-time) (seconds 2)))) @@ -780,7 +779,7 @@ (set! (-> this continue) #f) (set! (-> this on-close) #f) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 202) this)) - (set! (-> this center quad) (-> this root trans quad)) + (vector-copy! (-> this center) (-> this root trans)) (+! (-> this center y) 13516.8) (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "warpgate" :group 0 :fo-max 30) (-> this root trans) 0.0) @@ -799,7 +798,7 @@ (process-drawable-from-entity! self arg0) ) (if arg1 - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) ) (logior! (-> self mask) (process-mask actor-pause)) (init-defaults! self) @@ -810,6 +809,7 @@ ;; definition for method 11 of type warp-gate ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this warp-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (warp-gate-init arg0 (the-as vector #f)) ) @@ -866,14 +866,14 @@ (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *warp-jump-mods*) - (set! (-> self control unknown-vector37 quad) (-> arg0 quad)) - (set! (-> self control unknown-vector38 quad) (-> arg1 quad)) + (vector-copy! (-> self control unknown-vector37) arg0) + (vector-copy! (-> self control unknown-vector38) arg1) (+! (-> self control unknown-vector37 y) -4096.0) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control unknown-handle02) arg2) (vector-reset! (-> self control transv)) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> arg1 quad)) + (vector-copy! (-> self alt-cam-pos) arg1) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-! (new 'stack-no-clear 'vector) arg1 (-> self control trans)) @@ -1228,7 +1228,7 @@ (let ((t9-0 (method-of-type warp-gate init-defaults!))) (t9-0 this) ) - (set! (-> this base-pos quad) (-> this root trans quad)) + (vector-copy! (-> this base-pos) (-> this root trans)) (let ((v1-2 (-> this level-name))) (set! (-> this dust-y) (cond ((= v1-2 'nest) @@ -1270,7 +1270,7 @@ (let ((f0-9 (-> self dust-y))) (when (!= f0-9 (the-as float #x7f800000)) (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self root trans quad)) + (vector-copy! a1-2 (-> self root trans)) (set! (-> a1-2 y) f0-9) (spawn (-> self part-dust) a1-2) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/water-anim_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/water-anim_REF.gc index 1fee5bcef8a..8d445dcbb9c 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/water-anim_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/water-anim_REF.gc @@ -182,7 +182,7 @@ ) (('move-to-y) (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self root trans quad)) + (vector-copy! a1-2 (-> self root trans)) (set! (-> a1-2 y) (the-as float (-> arg3 param 0))) (move-to-point! self a1-2) ) @@ -306,7 +306,7 @@ ;; definition for method 22 of type water-anim ;; INFO: Used lq/sq (defmethod move-to-point! ((this water-anim) (arg0 vector)) - (set! (-> this root trans quad) (-> arg0 quad)) + (vector-copy! (-> this root trans) arg0) (set! (-> this water-height) (-> this root trans y)) (if (nonzero? (-> this sound)) (update-trans! (-> this sound) (-> this root trans)) @@ -473,6 +473,7 @@ ;; definition for method 11 of type water-anim (defmethod init-from-entity! ((this water-anim) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stub this) (alloc-root! this) (water-anim-init! this) @@ -480,7 +481,3 @@ (init-water! this) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/water-flow_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/water-flow_REF.gc index 0ed8ee65fa2..491c098a7d4 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/water-flow_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/water-flow_REF.gc @@ -133,7 +133,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (set! (-> s5-0 w) 1.0) (when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0) (let* ((s1-0 (-> this sections)) @@ -220,7 +220,7 @@ (let ((s2-1 (new 'stack-no-clear 'vector)) (s1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-1 quad) (-> s3-0 pull-dir quad)) + (vector-copy! s2-1 (-> s3-0 pull-dir)) (vector-normalize! s2-1 1.0) (vector-cross! s1-1 s2-1 *y-vector*) (vector-normalize! s1-1 1.0) @@ -269,7 +269,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (get-trans arg0 0) quad)) + (vector-copy! s5-0 (get-trans arg0 0)) (set! (-> s5-0 w) 1.0) (when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0) (let* ((v1-7 (-> this sections)) @@ -517,7 +517,7 @@ (set! (-> sv-80 speed) (-> this speed)) ) ) - (set! (-> sv-80 start quad) (-> s3-0 quad)) + (vector-copy! (-> sv-80 start) s3-0) (get-point-in-path! s5-0 s3-0 (the float (+ sv-64 1)) 'interp) (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (vector-! (-> sv-80 pull-dir) s3-0 (-> sv-80 start)) @@ -688,6 +688,7 @@ ;; definition for method 11 of type water-flow (defmethod init-from-entity! ((this water-flow) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) (process-drawable-from-entity! (the-as process-drawable this) arg0) (set! (-> this flow) (new 'process 'flow-control (the-as process-drawable this) (the-as res-lump #f))) diff --git a/test/decompiler/reference/jak3/engine/common-obs/water_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/water_REF.gc index 1e39ff6866b..a8bb0c1880f 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/water_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/water_REF.gc @@ -217,7 +217,7 @@ (set! (-> *water-wake-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *water-wake-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *water-wake-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *water-wake-trail* use-tape-mode?) #t) @@ -290,7 +290,7 @@ ) ) (set! (-> this base-height) (-> s5-0 base-height)) - (set! (-> this normal quad) (-> s5-0 normal quad)) + (vector-copy! (-> this normal) (-> s5-0 normal)) (set! (-> this base-ocean-offset) (- (-> s5-0 trans y) (-> s5-0 base-height))) ) (cond @@ -309,10 +309,10 @@ (logclear! (-> this flags) (water-flag break-surface)) ) ((begin - (set! (-> this top 1 quad) (-> this top 0 quad)) + (vector-copy! (-> this top 1) (-> this top 0)) (vector<-cspace! (the-as vector (-> this top)) (-> this process node-list data (-> this joint-index))) (+! (-> this top 0 y) (-> this top-y-offset)) - (set! (-> this bottom 1 quad) (-> this bottom 0 quad)) + (vector-copy! (-> this bottom 1) (-> this bottom 0)) (set! (-> this bottom 0 quad) (-> this process control trans quad)) (logclear! (-> this flags) (water-flag under-water head-under-water bouncing wading swimming break-surface)) (set! (-> this bob-offset) (update! (-> this bob))) @@ -370,7 +370,7 @@ (cond ((>= (-> this top 0 y) (-> this height)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this bottom 0 quad)) + (vector-copy! s3-0 (-> this bottom 0)) (let ((v1-82 (-> this process control transv))) (sqrtf (+ (* (-> v1-82 x) (-> v1-82 x)) (* (-> v1-82 z) (-> v1-82 z)))) ) @@ -398,7 +398,7 @@ (s1-0 s0-0 (sv-336 sv-352 a1-11 a2-2) (-> s5-0 normal)) ) ) - (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s2-0 trans) s3-0) (set! (-> *part-id-table* 762 init-specs 1 initial-valuef) (* 0.000004150391 f30-0)) (set! (-> *part-id-table* 762 init-specs 16 initial-valuef) 0.0) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 762) s2-0 :origin-is-matrix #t) @@ -498,7 +498,7 @@ (not (logtest? (water-flag jump-out) (-> this flags))) ) (let ((v1-191 (new 'stack-no-clear 'vector))) - (set! (-> v1-191 quad) (-> this bottom 0 quad)) + (vector-copy! v1-191 (-> this bottom 0)) (set! (-> v1-191 y) (- (-> this height) (-> this swim-height))) (let ((s3-3 (-> this process control))) (when (and (not (logtest? (-> s3-3 status) (collide-status touch-background))) @@ -542,7 +542,7 @@ ) (logior! (-> this flags) (water-flag swimming)) (let ((a1-42 (new 'stack-no-clear 'vector))) - (set! (-> a1-42 quad) (-> this bottom 0 quad)) + (vector-copy! a1-42 (-> this bottom 0)) (let ((s4-1 (-> this process control))) (set! (-> a1-42 y) f30-1) (when (not (logtest? (focus-status board pilot) (-> this process focus-status))) @@ -663,7 +663,7 @@ (< (-> this height) (-> v0-32 y)) ) (set! (-> this drip-joint-index) s5-1) - (set! (-> this drip-old-pos quad) (-> v0-32 quad)) + (vector-copy! (-> this drip-old-pos) v0-32) (logior! (-> this flags) (water-flag spawn-drip)) ) ) @@ -761,7 +761,7 @@ ) (sp-group-flag sp13) ) - (set! (-> *launch-matrix* trans quad) (-> arg1 quad)) + (vector-copy! (-> *launch-matrix* trans) arg1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -774,7 +774,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg1 quad)) + (vector-copy! (-> *launch-matrix* trans) arg1) (part-tracker-spawn part-tracker :to *entity-pool* @@ -906,7 +906,7 @@ ) ) (when s1-0 - (set! (-> arg0 trans quad) (-> arg2 (+ arg3 -1) sphere quad)) + (vector-copy! (-> arg0 trans) (-> arg2 (+ arg3 -1) sphere)) (set-vector! (-> arg0 normal) 0.0 1.0 0.0 1.0) (case (-> (the-as pair (-> (the-as pair s1-0) cdr)) car) (('height) @@ -1034,7 +1034,7 @@ ) ) (dotimes (s1-2 (the-as int (+ arg3 -1))) - (set! (-> (the-as region-prim-area #x70000000) pos quad) (-> arg2 s1-2 sphere quad)) + (vector-copy! (-> (the-as region-prim-area #x70000000) pos) (-> arg2 s1-2 sphere)) (when (and (within-area? arg1 (the-as region-prim-area (+ #x70000000 0))) (begin (logior! (-> arg0 flags) (water-flag over-water)) @@ -1067,7 +1067,7 @@ (set! (-> arg2 extra-flags) (the-as uint 0)) (set! (-> (the-as region-prim-area #x70000000) region-prim-list num-items) 0) (set! (-> (the-as region-prim-area #x70000000) region-inside-count) 0) - (set! (-> (the-as region-prim-area #x70000000) pos quad) (-> arg0 sphere quad)) + (vector-copy! (-> (the-as region-prim-area #x70000000) pos) (-> arg0 sphere)) (dotimes (gp-0 (-> *level* length)) (let ((v1-7 (-> *level* level gp-0))) (when (= (-> v1-7 status) 'active) diff --git a/test/decompiler/reference/jak3/engine/debug/collision-editor_REF.gc b/test/decompiler/reference/jak3/engine/debug/collision-editor_REF.gc index 0534cae2f23..3200692606c 100644 --- a/test/decompiler/reference/jak3/engine/debug/collision-editor_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/collision-editor_REF.gc @@ -240,8 +240,8 @@ (s1-0 (new 'stack-no-clear 'vector)) ) (when (nonzero? (-> *collide-cache* num-tris)) - (set! (-> v1-41 quad) (-> (the-as (inline-array collide-cache-tri) a0-26) 0 vertex 0 quad)) - (set! (-> s2-0 quad) (-> (the-as (inline-array collide-cache-tri) a0-26) 0 vertex 0 quad)) + (vector-copy! v1-41 (-> (the-as (inline-array collide-cache-tri) a0-26) 0 vertex 0)) + (vector-copy! s2-0 (-> (the-as (inline-array collide-cache-tri) a0-26) 0 vertex 0)) ) (countdown (a1-27 (-> *collide-cache* num-tris)) (set! (-> v1-41 x) (fmin @@ -805,45 +805,24 @@ (let ((s4-2 (collision-edit-get-prim arg0 (-> this current-prim)))) (when s4-2 (set! (-> s4-2 local-sphere w) (* (-> s4-2 local-sphere w) f24-0)) - (let ((s3-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-17 (matrix-local->world #f #f)) - (v1-107 (-> a2-17 rvec quad)) - (a0-58 (-> a2-17 uvec quad)) - (a1-37 (-> a2-17 fvec quad)) - (a2-18 (-> a2-17 trans quad)) - ) - (set! (-> s3-1 rvec quad) v1-107) - (set! (-> s3-1 uvec quad) a0-58) - (set! (-> s3-1 fvec quad) a1-37) - (set! (-> s3-1 trans quad) a2-18) - ) - (let ((s2-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-19 (-> arg0 node-list data (-> s4-2 transform-index) bone transform)) - (v1-111 (-> a2-19 rvec quad)) - (a0-61 (-> a2-19 uvec quad)) - (a1-38 (-> a2-19 fvec quad)) - (a2-20 (-> a2-19 trans quad)) - ) - (set! (-> s2-1 rvec quad) v1-111) - (set! (-> s2-1 uvec quad) a0-61) - (set! (-> s2-1 fvec quad) a1-38) - (set! (-> s2-1 trans quad) a2-20) - ) - (let ((s1-1 (new 'stack-no-clear 'vector))) - (set! (-> s1-1 x) f30-0) - (set! (-> s1-1 y) f28-0) - (set! (-> s1-1 z) f26-0) - (set! (-> s1-1 w) 1.0) - (vector-reset! (-> s3-1 trans)) - (vector-matrix*! s1-1 s1-1 s3-1) - (vector-reset! (-> s2-1 trans)) - (matrix-transpose! s2-1 s2-1) - (vector-matrix*! s1-1 s1-1 s2-1) - (+! (-> s4-2 local-sphere x) (-> s1-1 x)) - (+! (-> s4-2 local-sphere y) (-> s1-1 y)) - (+! (-> s4-2 local-sphere z) (-> s1-1 z)) + (let ((s3-1 (matrix-copy! (new 'stack-no-clear 'matrix) (matrix-local->world #f #f))) + (s2-1 + (matrix-copy! (new 'stack-no-clear 'matrix) (-> arg0 node-list data (-> s4-2 transform-index) bone transform)) + ) + (s1-1 (new 'stack-no-clear 'vector)) ) - ) + (set! (-> s1-1 x) f30-0) + (set! (-> s1-1 y) f28-0) + (set! (-> s1-1 z) f26-0) + (set! (-> s1-1 w) 1.0) + (vector-reset! (-> s3-1 trans)) + (vector-matrix*! s1-1 s1-1 s3-1) + (vector-reset! (-> s2-1 trans)) + (matrix-transpose! s2-1 s2-1) + (vector-matrix*! s1-1 s1-1 s2-1) + (+! (-> s4-2 local-sphere x) (-> s1-1 x)) + (+! (-> s4-2 local-sphere y) (-> s1-1 y)) + (+! (-> s4-2 local-sphere z) (-> s1-1 z)) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/debug/debug-sphere_REF.gc b/test/decompiler/reference/jak3/engine/debug/debug-sphere_REF.gc index c621ffed756..279ab04b0c0 100644 --- a/test/decompiler/reference/jak3/engine/debug/debug-sphere_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/debug-sphere_REF.gc @@ -31,9 +31,9 @@ (set! (-> sv-80 z) (+ (-> s2-0 z) (* (sin (* (the float (+ sv-112 1)) (/ 65536.0 arg1))) f28-0))) (set! (-> sv-96 x) (+ (-> s2-0 x) (* (cos (* (the float sv-112) (/ 65536.0 arg1))) f26-0))) (set! (-> sv-96 z) (+ (-> s2-0 z) (* (sin (* (the float sv-112) (/ 65536.0 arg1))) f26-0))) - (set! (-> arg0 data s5-0 quad) (-> s0-0 quad)) - (set! (-> arg0 data (+ s5-0 1) quad) (-> sv-80 quad)) - (set! (-> arg0 data (+ s5-0 2) quad) (-> sv-96 quad)) + (vector-copy! (-> arg0 data s5-0) s0-0) + (vector-copy! (-> arg0 data (+ s5-0 1)) sv-80) + (vector-copy! (-> arg0 data (+ s5-0 2)) sv-96) (+! s5-0 3) (set! sv-112 (+ sv-112 1)) ) @@ -97,7 +97,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/debug/debug_REF.gc b/test/decompiler/reference/jak3/engine/debug/debug_REF.gc index d8f7848fddb..58af9cee4e1 100644 --- a/test/decompiler/reference/jak3/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/debug_REF.gc @@ -54,7 +54,7 @@ (let ((s5-0 (new 'stack 'vector4w-2)) (a1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-2 quad) (-> pt quad)) + (vector-copy! a1-2 pt) (set! (-> a1-2 w) 1.0) (when (transform-point-qword! (the-as vector4w (-> s5-0 vector)) a1-2) (with-dma-buffer-add-bucket ((v1-11 (-> *display* frames (-> *display* on-screen) debug-buf)) @@ -375,9 +375,9 @@ (s2-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-3 quad) (-> sv-160 quad)) - (set! (-> s2-0 quad) (-> sv-176 quad)) - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! a1-3 sv-160) + (vector-copy! s2-0 sv-176) + (vector-copy! s1-0 s0-0) (set! (-> a1-3 w) 1.0) (set! (-> s2-0 w) 1.0) (set! (-> s1-0 w) 1.0) @@ -632,8 +632,8 @@ (let ((v1-4 (get-debug-line))) (when v1-4 (set! (-> v1-4 bucket) bucket) - (set! (-> v1-4 v1 quad) (-> p0 quad)) - (set! (-> v1-4 v2 quad) (-> p1 quad)) + (vector-copy! (-> v1-4 v1) p0) + (vector-copy! (-> v1-4 v2) p1) (set! (-> v1-4 color) color) (set! (-> v1-4 color2) color2) (set! (-> v1-4 mode) mode) @@ -734,9 +734,9 @@ (defun-debug add-debug-box ((enable symbol) (bucket bucket-id) (p0 vector) (p1 vector) (color rgba)) "Draw an axis-aligned box." (let ((s5-0 (new-stack-vector0))) - (set! (-> s5-0 quad) (-> p0 quad)) + (vector-copy! s5-0 p0) (let ((s1-0 (new-stack-vector0))) - (set! (-> s1-0 quad) (-> p0 quad)) + (vector-copy! s1-0 p0) (when (and enable (not *display-capture-mode*)) (set! (-> s1-0 x) (-> p1 x)) (add-debug-line #t bucket s5-0 s1-0 color #f (the-as rgba -1)) @@ -755,8 +755,8 @@ (set! (-> s1-0 y) (-> p0 y)) (set! (-> s5-0 x) (-> p1 x)) (add-debug-line #t bucket s5-0 s1-0 color #f (the-as rgba -1)) - (set! (-> s5-0 quad) (-> p1 quad)) - (set! (-> s1-0 quad) (-> p1 quad)) + (vector-copy! s5-0 p1) + (vector-copy! s1-0 p1) (set! (-> s1-0 x) (-> p0 x)) (add-debug-line #t bucket s5-0 s1-0 color #f (the-as rgba -1)) (set! (-> s1-0 x) (-> p1 x)) @@ -790,8 +790,8 @@ (let ((s2-0 (new 'stack-no-clear 'inline-array 'vector 2)) (s1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 0 quad) (-> box min quad)) - (set! (-> s2-0 1 quad) (-> box max quad)) + (vector-copy! (-> s2-0 0) (-> box min)) + (vector-copy! (-> s2-0 1) (-> box max)) (set! (-> s1-0 w) 1.0) (dotimes (s0-0 8) (set! (-> s1-0 x) (-> s2-0 (logand s0-0 1) x)) @@ -926,7 +926,7 @@ (when v1-4 (set! (-> v1-4 flags) 0) (set! (-> v1-4 bucket) bucket) - (set! (-> v1-4 pos quad) (-> pos quad)) + (vector-copy! (-> v1-4 pos) pos) (cond (offset (set! (-> v1-4 offset x) (-> offset x)) @@ -1072,7 +1072,7 @@ ) (forward-down->inv-matrix sv-112 gp-0 s5-0) ) - (set! (-> sv-112 trans quad) (-> sv-24 quad)) + (vector-copy! (-> sv-112 trans) sv-24) (set! (-> sv-112 trans w) 1.0) (let ((gp-1 (new 'static 'inline-array vector 3 (new 'static 'vector :y 0.5877 :z 0.951 :w 0.951) @@ -1097,7 +1097,7 @@ (set! (-> s1-0 y) (* sv-32 (-> gp-1 2 y))) (vector-matrix*! s3-0 s1-0 sv-112) (dotimes (s0-0 10) - (set! (-> s4-0 quad) (-> s3-0 quad)) + (vector-copy! s4-0 s3-0) (set! (-> s1-0 x) (* sv-32 (-> (&-> s5-1 0 data s0-0) 0))) (set! (-> s1-0 y) (* sv-32 (-> (&-> gp-1 0 data s0-0) 0))) (vector-matrix*! s3-0 s1-0 sv-112) @@ -1307,7 +1307,7 @@ (curve-evaluate! sv-48 (-> arg4 0) arg2 arg3 arg4 arg5) (set! sv-80 0) (while (< sv-80 sv-64) - (set! (-> s0-0 quad) (-> sv-48 quad)) + (vector-copy! s0-0 sv-48) (curve-evaluate! sv-48 (/ (the float (+ sv-80 1)) (the float sv-64)) arg2 arg3 arg4 arg5) (add-debug-line #t arg1 s0-0 sv-48 arg6 #f (the-as rgba -1)) (set! sv-80 (+ sv-80 1)) @@ -1338,7 +1338,7 @@ (dotimes (s0-0 arg3) (set! sv-96 (new 'stack-no-clear 'vector)) (set! (-> sv-96 quad) (the-as uint128 0)) - (set! (-> sv-96 quad) (-> arg2 s0-0 quad)) + (vector-copy! sv-96 (-> arg2 s0-0)) (if (!= arg5 0.0) (set! (-> sv-96 y) arg5) ) @@ -1596,7 +1596,7 @@ (set! (-> arg0 points) (the-as (inline-array vector) (malloc 'debug (* (-> arg0 num-points) 16)))) ) (when (-> arg0 points) - (set! (-> arg0 points (-> arg0 h-first) quad) (-> arg2 quad)) + (vector-copy! (-> arg0 points (-> arg0 h-first)) arg2) (+! (-> arg0 h-first) 1) (when (>= (-> arg0 h-first) (-> arg0 num-points)) (set! (-> arg0 h-first) 0) @@ -1625,12 +1625,8 @@ ;; INFO: Used lq/sq (defun-debug dma-timeout-cam () (let ((a0-0 (new-stack-vector0)) - (a1-0 (new 'stack-no-clear 'matrix)) + (a1-0 (new-stack-matrix0)) ) - (set! (-> a1-0 rvec quad) (the-as uint128 0)) - (set! (-> a1-0 uvec quad) (the-as uint128 0)) - (set! (-> a1-0 fvec quad) (the-as uint128 0)) - (set! (-> a1-0 trans quad) (the-as uint128 0)) (set! (-> a0-0 x) -666764.4) (set! (-> a0-0 y) 21102.984) (set! (-> a0-0 z) 51613.348) @@ -1821,16 +1817,16 @@ ((not (logtest? s3-0 1)) (dotimes (v1-10 3) (set! (-> *boundary-polygon* v1-10 pos quad) (-> arg1 (+ s3-0 v1-10) quad)) - (set! (-> *boundary-polygon* v1-10 stq quad) (-> s2-0 (+ s3-0 v1-10) quad)) + (vector-copy! (-> *boundary-polygon* v1-10 stq) (-> s2-0 (+ s3-0 v1-10))) ) ) (else (set! (-> *boundary-polygon* 0 pos quad) (-> arg1 (+ s3-0 1) quad)) (set! (-> *boundary-polygon* 1 pos quad) (-> arg1 s3-0 quad)) (set! (-> *boundary-polygon* 2 pos quad) (-> arg1 (+ s3-0 2) quad)) - (set! (-> *boundary-polygon* 0 stq quad) (-> s2-0 (+ s3-0 1) quad)) - (set! (-> *boundary-polygon* 1 stq quad) (-> s2-0 s3-0 quad)) - (set! (-> *boundary-polygon* 2 stq quad) (-> s2-0 (+ s3-0 2) quad)) + (vector-copy! (-> *boundary-polygon* 0 stq) (-> s2-0 (+ s3-0 1))) + (vector-copy! (-> *boundary-polygon* 1 stq) (-> s2-0 s3-0)) + (vector-copy! (-> *boundary-polygon* 2 stq) (-> s2-0 (+ s3-0 2))) ) ) (render-boundary-tri (-> *boundary-polygon* 0) arg0) diff --git a/test/decompiler/reference/jak3/engine/debug/editable-h_REF.gc b/test/decompiler/reference/jak3/engine/debug/editable-h_REF.gc index 49f0cbe2d6b..09a26ea600c 100644 --- a/test/decompiler/reference/jak3/engine/debug/editable-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/editable-h_REF.gc @@ -646,7 +646,7 @@ ) (s2-0) ) - (set! (-> gp-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 trans) arg0) (set! (-> gp-0 radius) 2048.0) (set! (-> gp-0 owner) '()) gp-0 @@ -741,7 +741,7 @@ ) (s1-0) ) - (set! (-> s5-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 trans) arg0) (set! (-> s5-0 radius) arg1) (set! (-> s5-0 owner) '()) s5-0 @@ -921,7 +921,7 @@ ) (s1-0) ) - (set! (-> gp-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 trans) arg0) (set! (-> gp-0 radius) arg1) (set! (-> gp-0 owner) '()) (set! (-> gp-0 prefix) (new 'debug 'string 32 *editable-default-name*)) @@ -1035,7 +1035,7 @@ ) (s1-0) ) - (set! (-> gp-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 trans) arg0) (set! (-> gp-0 radius) arg1) (set! (-> gp-0 owner) '()) (set! (-> gp-0 prefix) (new 'debug 'string 32 "entity")) @@ -1353,7 +1353,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc b/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc index 1e2cf16c8d5..048e7ae86f1 100644 --- a/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc @@ -273,7 +273,7 @@ (.svf (&-> a0-14 quad) vf6) ) (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! s1-0 s0-0) (let ((a0-18 s0-0)) (let ((v1-29 s0-0)) (let ((a1-12 (-> *math-camera* inv-camera-rot))) @@ -290,7 +290,7 @@ (.svf (&-> a0-18 quad) vf6) ) (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! s1-0 s0-0) (let ((a0-22 s0-0)) (let ((v1-31 s0-0)) (let ((a1-15 (-> *math-camera* inv-camera-rot uvec))) @@ -307,7 +307,7 @@ (.svf (&-> a0-22 quad) vf6) ) (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! s1-0 s0-0) (let ((a0-26 s0-0)) (let ((v1-33 s0-0)) (let ((a1-18 (-> *math-camera* inv-camera-rot))) @@ -466,8 +466,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod manipulator-method-12 ((this manipulator) (arg0 vector)) (set! (-> this rotate-ref) (the int (-> *mouse* posx))) - (set! (-> this mouse-ref-position quad) (-> arg0 quad)) - (set! (-> this drag-ref-position quad) (-> this position quad)) + (vector-copy! (-> this mouse-ref-position) arg0) + (vector-copy! (-> this drag-ref-position) (-> this position)) (set! (-> this dragging?) #t) (set! (-> this speed quad) (the-as uint128 0)) 0 @@ -488,7 +488,7 @@ (init-vf0-vector) (cond ((= (-> this mode) (manipulator-mode mm0)) - (set! (-> this speed quad) (-> this position quad)) + (vector-copy! (-> this speed) (-> this position)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this mouse-ref-position) arg0)) ) @@ -506,36 +506,36 @@ ((= (-> this action) (manipulator-action ma1)) (cond ((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat fvec)))) - (set! (-> s2-0 quad) (-> this mat fvec quad)) - (set! (-> s1-0 quad) (-> this mat uvec quad)) + (vector-copy! s2-0 (-> this mat fvec)) + (vector-copy! s1-0 (-> this mat uvec)) ) (else - (set! (-> s2-0 quad) (-> this mat uvec quad)) - (set! (-> s1-0 quad) (-> this mat fvec quad)) + (vector-copy! s2-0 (-> this mat uvec)) + (vector-copy! s1-0 (-> this mat fvec)) ) ) ) ((= (-> this action) (manipulator-action ma2)) (cond ((< (fabs (vector-dot s5-1 (the-as vector (-> this mat)))) (fabs (vector-dot s5-1 (-> this mat fvec)))) - (set! (-> s2-0 quad) (-> this mat fvec quad)) - (set! (-> s1-0 quad) (-> this mat rvec quad)) + (vector-copy! s2-0 (-> this mat fvec)) + (vector-copy! s1-0 (-> this mat rvec)) ) (else - (set! (-> s2-0 quad) (-> this mat rvec quad)) - (set! (-> s1-0 quad) (-> this mat fvec quad)) + (vector-copy! s2-0 (-> this mat rvec)) + (vector-copy! s1-0 (-> this mat fvec)) ) ) ) ((= (-> this action) (manipulator-action ma3)) (cond ((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (the-as vector (-> this mat))))) - (set! (-> s2-0 quad) (-> this mat rvec quad)) - (set! (-> s1-0 quad) (-> this mat uvec quad)) + (vector-copy! s2-0 (-> this mat rvec)) + (vector-copy! s1-0 (-> this mat uvec)) ) (else - (set! (-> s2-0 quad) (-> this mat uvec quad)) - (set! (-> s1-0 quad) (-> this mat rvec quad)) + (vector-copy! s2-0 (-> this mat uvec)) + (vector-copy! s1-0 (-> this mat rvec)) ) ) ) @@ -586,16 +586,16 @@ ) (cond ((= (-> this action) (manipulator-action ma4)) - (set! (-> s2-0 quad) (-> *z-vector* quad)) + (vector-copy! s2-0 *z-vector*) ) ((= (-> this action) (manipulator-action ma5)) - (set! (-> s2-0 quad) (-> *y-vector* quad)) + (vector-copy! s2-0 *y-vector*) ) ((= (-> this action) (manipulator-action ma6)) - (set! (-> s2-0 quad) (-> *x-vector* quad)) + (vector-copy! s2-0 *x-vector*) ) ((= (-> this action) (manipulator-action ma7)) - (set! (-> s2-0 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! s2-0 (-> *math-camera* inv-camera-rot fvec)) ) ) (vector-normalize! s2-0 1.0) diff --git a/test/decompiler/reference/jak3/engine/debug/viewer_REF.gc b/test/decompiler/reference/jak3/engine/debug/viewer_REF.gc index 39f548d14fd..5e978b54048 100644 --- a/test/decompiler/reference/jak3/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/viewer_REF.gc @@ -215,6 +215,7 @@ ;; definition for method 11 of type viewer (defmethod init-from-entity! ((this viewer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! *viewer* this) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -232,7 +233,7 @@ (set! *viewer* self) (process-entity-set! self arg2) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (init-viewer arg0 arg0) @@ -278,7 +279,3 @@ (init-entity arg0 arg1 viewer) #t ) - - - - diff --git a/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc index 1a12fa69958..7f56fc4b5ee 100644 --- a/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc @@ -872,7 +872,7 @@ ) (cond ((logtest? (-> arg1 shadow-ctrl settings flags) (shadow-flags shdf08)) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) ) (else (when (not (paused?)) diff --git a/test/decompiler/reference/jak3/engine/entity/entity_REF.gc b/test/decompiler/reference/jak3/engine/entity/entity_REF.gc index 4ecc215b207..155f4749c58 100644 --- a/test/decompiler/reference/jak3/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak3/engine/entity/entity_REF.gc @@ -528,6 +528,7 @@ ) ;; definition for method 2 of type process +;; INFO: this function exists in multiple non-identical object files (defmethod print ((this process)) (cond ((and (-> this top-thread) (!= (-> this status) 'dead)) @@ -801,7 +802,7 @@ ) ) (set! (-> arg0 entity-link) v1-4) - (set! (-> v1-4 trans quad) (-> this trans quad)) + (vector-copy! (-> v1-4 trans) (-> this trans)) ) (set! (-> this extra perm aid) arg2) (set! (-> this extra level) arg1) @@ -1009,14 +1010,14 @@ (let ((enemy-option (res-lump-value sv-40 'enemy-options enemy-option :time -1000000000.0))) (cond ((logtest? (enemy-option spawner) (the-as uint128 enemy-option)) - (set! (-> sv-20 quad) (-> sv-36 quad)) - (set! (-> sv-24 quad) (-> sv-36 quad)) + (vector-copy! sv-20 sv-36) + (vector-copy! sv-24 sv-36) (set! sv-28 (the-as float -409.6)) (set! sv-32 (the-as float 409.6)) ) ((string-prefix= "battle" (res-lump-struct sv-40 'name string)) - (set! (-> sv-20 quad) (-> sv-36 quad)) - (set! (-> sv-24 quad) (-> sv-36 quad)) + (vector-copy! sv-20 sv-36) + (vector-copy! sv-24 sv-36) (set! sv-48 (new 'static 'res-tag)) (let ((v1-29 (res-lump-data sv-40 'actor-groups (pointer actor-group) :tag-ptr (& sv-48)))) (when (and v1-29 (nonzero? (-> sv-48 elt-count))) @@ -1039,8 +1040,8 @@ ) ) (else - (set! (-> sv-20 quad) (-> sv-36 quad)) - (set! (-> sv-24 quad) (-> sv-36 quad)) + (vector-copy! sv-20 sv-36) + (vector-copy! sv-24 sv-36) ) ) (+! (-> sv-20 x) sv-28) @@ -2105,7 +2106,7 @@ (defun process-drawable-scale-from-entity! ((arg0 process-drawable) (arg1 entity)) (let ((v1-1 (res-lump-struct arg1 'scale vector))) (if v1-1 - (set! (-> arg0 root scale quad) (-> v1-1 quad)) + (vector-copy! (-> arg0 root scale) v1-1) (vector-identity! (-> arg0 root scale)) ) ) @@ -2118,7 +2119,7 @@ ;; WARN: Return type mismatch process-drawable vs none. (defun process-drawable-from-entity! ((arg0 process-drawable) (arg1 entity-actor)) (logior! (-> arg0 mask) (process-mask actor-pause)) - (set! (-> arg0 root trans quad) (-> arg1 extra trans quad)) + (vector-copy! (-> arg0 root trans) (-> arg1 extra trans)) (quaternion-copy! (-> arg0 root quat) (-> arg1 quat)) (vector-identity! (-> arg0 root scale)) (none) diff --git a/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc index f896771b49a..950ebd22108 100644 --- a/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc @@ -401,15 +401,17 @@ ) (cond ((logtest? (-> s2-1 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) + ) (part-tracker-spawn part-tracker-subsampler :to (-> this process) :group s2-1) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) + ) (part-tracker-spawn part-tracker :to (-> this process) :group s2-1) ) ) diff --git a/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc index 179ed48807f..dc7c8b5c639 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc @@ -318,7 +318,7 @@ (task-node-commands (array game-task-node-command)) (task-node-exclusive (array uint16)) (task-counter uint32) - (unknown-arr4 (array uint16)) + (talker-state (array uint16)) (level-opened uint8 32) (total-deaths int32) (continue-deaths int32) diff --git a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc index 71e0d5da800..6d4179143b6 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc @@ -177,7 +177,7 @@ (dotimes (ii 3) (set! (-> this want-sound ii) (-> arg0 want-sound ii name)) ) - (set! (-> this camera-trans quad) (-> *camera-combiner* trans quad)) + (vector-copy! (-> this camera-trans) (-> *camera-combiner* trans)) (when *camera-combiner* (let ((rot (-> *camera-combiner* inv-camera-rot)) (continue-rot (-> this camera-rot)) @@ -201,7 +201,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod move-camera! ((this continue-point)) - (set! (-> *camera-combiner* trans quad) (-> this camera-trans quad)) + (vector-copy! (-> *camera-combiner* trans) (-> this camera-trans)) (let ((gp-0 (-> *camera-combiner* inv-camera-rot)) (s5-0 (-> this camera-rot)) ) @@ -385,7 +385,7 @@ (when (or (and (-> subtask manager) (handle->process (-> subtask manager manager))) (and (-> subtask manager) (-> subtask manager level) - (= (status-of-level-and-borrows *level* (-> subtask manager level) #f) 'active) + (= (level-status? *level* (-> subtask manager level) #f) 'active) ) (and (not (-> subtask manager)) (= (-> level info taskname) (-> subtask level))) ) @@ -520,8 +520,8 @@ (set! (-> this dark-crystal) 0.0) (set! (-> this karma) 0.0) (set! (-> this perm-list length) 0) - (dotimes (v1-57 (-> this unknown-arr4 allocated-length)) - (set! (-> this unknown-arr4 v1-57) (the-as uint 0)) + (dotimes (v1-57 (-> this talker-state allocated-length)) + (set! (-> this talker-state v1-57) (the-as uint 0)) ) (set! (-> this death-movie-tick) (rand-vu-int-count 10)) (set! (-> this gun-type) (pickup-type gun-red-1)) @@ -2120,8 +2120,8 @@ (set! (-> gp-0 perm-list length) 0) 0 ) - (if (zero? (-> gp-0 unknown-arr4)) - (set! (-> gp-0 unknown-arr4) (new 'global 'boxed-array uint16 1460)) + (if (zero? (-> gp-0 talker-state)) + (set! (-> gp-0 talker-state) (new 'global 'boxed-array uint16 1460)) ) (when (zero? (-> gp-0 death-pos)) (set! (-> gp-0 death-pos) (new 'global 'vector-array 64)) diff --git a/test/decompiler/reference/jak3/engine/game/game-save_REF.gc b/test/decompiler/reference/jak3/engine/game/game-save_REF.gc index 641308f7212..130b5e3adf7 100644 --- a/test/decompiler/reference/jak3/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-save_REF.gc @@ -1119,7 +1119,7 @@ (mem-copy! (the-as pointer (+ s2-12 (* s1-6 16))) (the-as pointer (-> this task-perm-list data s1-6)) 16) ) (let ((a0-111 (+ s2-12 (logand -16 (+ (* s3-4 16) 15)))) - (v1-187 (-> this unknown-arr4 allocated-length)) + (v1-187 (-> this talker-state allocated-length)) ) (let ((a1-118 (the-as object (+ a0-111 0)))) (set! (-> (the-as (inline-array game-save-tag) a1-118) 0 elt-type) (game-save-elt talker-state)) @@ -1128,7 +1128,7 @@ ) (let ((a0-112 (+ a0-111 16))) (dotimes (a1-119 v1-187) - (set! (-> (the-as (pointer uint16) (+ a0-112 (* a1-119 2))) 0) (-> this unknown-arr4 a1-119)) + (set! (-> (the-as (pointer uint16) (+ a0-112 (* a1-119 2))) 0) (-> this talker-state a1-119)) ) (let ((a0-113 (+ a0-112 (logand -16 (+ (* v1-187 2) 15)))) (v1-193 (-> this game-score allocated-length)) @@ -1950,17 +1950,17 @@ ) ) (((game-save-elt talker-state)) - (let ((v1-116 (-> this unknown-arr4 allocated-length)) + (let ((v1-116 (-> this talker-state allocated-length)) (a0-153 (-> (the-as game-save-tag s4-0) elt-count)) ) (dotimes (a1-82 v1-116) (cond ((>= a1-82 a0-153) - (set! (-> this unknown-arr4 a1-82) (the-as uint 0)) + (set! (-> this talker-state a1-82) (the-as uint 0)) 0 ) (else - (set! (-> this unknown-arr4 a1-82) (-> (&+ (the-as game-save-tag s4-0) 16) user-uint16 a1-82)) + (set! (-> this talker-state a1-82) (-> (&+ (the-as game-save-tag s4-0) 16) user-uint16 a1-82)) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/game/main_REF.gc b/test/decompiler/reference/jak3/engine/game/main_REF.gc index ba6b29cf394..a7a48a5a659 100644 --- a/test/decompiler/reference/jak3/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/main_REF.gc @@ -380,9 +380,9 @@ ) "Initialize the screen-filter with the given settings." (set! (-> this draw?) #t) - (set! (-> this color quad) (-> arg0 quad)) - (set! (-> this color-src quad) (-> arg0 quad)) - (set! (-> this color-dest quad) (-> arg1 quad)) + (vector-copy! (-> this color) arg0) + (vector-copy! (-> this color-src) arg0) + (vector-copy! (-> this color-dest) arg1) (set! (-> this extra x) arg2) (set! (-> this extra y) 0.0) (set! (-> this bucket) arg3) diff --git a/test/decompiler/reference/jak3/engine/game/settings_REF.gc b/test/decompiler/reference/jak3/engine/game/settings_REF.gc index 8f0fe186880..f361cec1715 100644 --- a/test/decompiler/reference/jak3/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/settings_REF.gc @@ -930,7 +930,7 @@ ) ) (('pov-offset) - (set! (-> this pov-offset quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this pov-offset) (the-as vector arg2)) ) (('string-max-length) (case arg1 @@ -1147,20 +1147,20 @@ ) (('string-startup-vector) (set! (-> this use-string-startup-vector) #t) - (set! (-> this string-startup-vector quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this string-startup-vector) (the-as vector arg2)) ) (('look-at-point) (set! (-> this use-look-at-point) #t) - (set! (-> this look-at-point quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this look-at-point) (the-as vector arg2)) ) (('point-of-interest) (set! (-> this use-point-of-interest) #t) - (set! (-> this point-of-interest quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this point-of-interest) (the-as vector arg2)) (set! (-> this handle-of-interest) (the-as handle #f)) ) (('mouse-tumble-point) (set! (-> this use-mouse-tumble-point) #t) - (set! (-> this mouse-tumble-point quad) (-> (the-as vector arg2) quad)) + (vector-copy! (-> this mouse-tumble-point) (the-as vector arg2)) ) (('handle-of-interest) (let ((a0-128 (new 'static 'handle :process arg1 :pid arg3))) @@ -1425,7 +1425,7 @@ (set! (-> s5-0 allow-error) (-> s4-0 allow-error)) (set! (-> s5-0 under-water-pitch-mod) (-> s4-0 under-water-pitch-mod)) (set! (-> s5-0 slow-time) (-> s4-0 slow-time)) - (if (and (-> s4-0 mirror) (= (status-of-level-and-borrows *level* 'ctywide #f) 'active)) + (if (and (-> s4-0 mirror) (= (level-status? *level* 'ctywide #f) 'active)) (set! (-> s5-0 mirror) #f) (set! (-> s5-0 mirror) (-> s4-0 mirror)) ) @@ -1921,7 +1921,7 @@ (set! (-> s5-1 fov-priority) (-> s4-1 fov-priority)) (set! (-> s5-1 pov-handle) (-> s4-1 pov-handle)) (set! (-> s5-1 pov-bone) (-> s4-1 pov-bone)) - (set! (-> s5-1 pov-offset quad) (-> s4-1 pov-offset quad)) + (vector-copy! (-> s5-1 pov-offset) (-> s4-1 pov-offset)) (set! (-> s5-1 string-default) (-> s4-1 string-default)) (set! (-> s5-1 string-max-length-default) (-> s4-1 string-max-length-default)) (set! (-> s5-1 string-min-length-default) (-> s4-1 string-min-length-default)) @@ -1944,7 +1944,7 @@ (set! (-> s5-1 gun-max-height) (-> s4-1 string-max-height)) ) ) - (set! (-> s5-1 string-local-down quad) (-> s4-1 string-local-down quad)) + (vector-copy! (-> s5-1 string-local-down) (-> s4-1 string-local-down)) (set! (-> s5-1 slave-options) (-> s4-1 slave-options)) (seek! (-> s5-1 matrix-blend-max-angle) (-> s4-1 matrix-blend-max-angle) 182.04445) (seek! (-> s5-1 matrix-blend-max-partial) (-> s4-1 matrix-blend-max-partial) 0.05) @@ -1969,13 +1969,13 @@ (set! (-> s5-1 interp-time) (-> s4-1 interp-time)) (set! (-> s5-1 interp-time-priority) (-> s4-1 interp-time-priority)) (set! (-> s5-1 use-string-startup-vector) (-> s4-1 use-string-startup-vector)) - (set! (-> s5-1 string-startup-vector quad) (-> s4-1 string-startup-vector quad)) + (vector-copy! (-> s5-1 string-startup-vector) (-> s4-1 string-startup-vector)) (set! (-> s5-1 use-look-at-point) (-> s4-1 use-look-at-point)) - (set! (-> s5-1 look-at-point quad) (-> s4-1 look-at-point quad)) + (vector-copy! (-> s5-1 look-at-point) (-> s4-1 look-at-point)) (set! (-> s5-1 use-point-of-interest) (-> s4-1 use-point-of-interest)) - (set! (-> s5-1 point-of-interest quad) (-> s4-1 point-of-interest quad)) + (vector-copy! (-> s5-1 point-of-interest) (-> s4-1 point-of-interest)) (set! (-> s5-1 use-mouse-tumble-point) (-> s4-1 use-mouse-tumble-point)) - (set! (-> s5-1 mouse-tumble-point quad) (-> s4-1 mouse-tumble-point quad)) + (vector-copy! (-> s5-1 mouse-tumble-point) (-> s4-1 mouse-tumble-point)) (set! (-> s5-1 handle-of-interest) (-> s4-1 handle-of-interest)) (let* ((s3-11 (handle->process (-> s5-1 handle-of-interest))) (a0-159 (if (type? s3-11 process-focusable) @@ -1985,10 +1985,10 @@ ) (when a0-159 (set! (-> s5-1 use-point-of-interest) #t) - (set! (-> s5-1 point-of-interest quad) (-> (get-trans (the-as process-focusable a0-159) 4) quad)) + (vector-copy! (-> s5-1 point-of-interest) (get-trans (the-as process-focusable a0-159) 4)) ) ) - (set! (-> this cam-default point-of-interest quad) (-> s5-1 point-of-interest quad)) + (vector-copy! (-> this cam-default point-of-interest) (-> s5-1 point-of-interest)) (set! (-> s5-1 butt-handle) (-> s4-1 butt-handle)) (set! (-> s5-1 butt-angle) (-> s4-1 butt-angle)) (set! (-> s5-1 extra-follow-height) (-> s4-1 extra-follow-height)) diff --git a/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc index e639a0d108e..25fd805db5f 100644 --- a/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/task-arrow_REF.gc @@ -89,8 +89,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod task-arrow-method-23 ((this task-arrow) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> s5-0 vec0 quad) (-> arg0 quad)) - (set! (-> s5-0 cquery start-pos quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec0) arg0) + (vector-copy! (-> s5-0 cquery start-pos) (-> s5-0 vec0)) (+! (-> s5-0 cquery start-pos y) 20480.0) (set-vector! (-> s5-0 cquery move-dist) 0.0 -81920.0 0.0 1.0) (let ((v1-4 (-> s5-0 cquery))) @@ -108,7 +108,7 @@ (vector+float*! (-> s5-0 vec0) (-> s5-0 cquery start-pos) (-> s5-0 cquery move-dist) f0-7) ) ) - (set! (-> arg0 quad) (-> s5-0 vec0 quad)) + (vector-copy! arg0 (-> s5-0 vec0)) ) 0 (none) @@ -168,7 +168,7 @@ ((-> this moving) (cond ((logtest? (-> this flags) (task-arrow-flags taf6)) - (set! (-> this root trans quad) (-> this pos quad)) + (vector-copy! (-> this root trans) (-> this pos)) (if (logtest? (-> this flags) (task-arrow-flags taf4)) (seek! (-> this rod-of-god-scale) 0.0 (* 8.0 (seconds-per-frame))) (seek! (-> this rod-of-god-scale) 1.0 (* 8.0 (seconds-per-frame))) @@ -183,13 +183,13 @@ (cond ((< (* f0-26 f0-26) (vector-vector-xz-distance-squared (-> this pos) (-> this root trans))) (kill-callback (-> *minimap* engine) (-> this minimap)) - (set! (-> this root trans quad) (-> this pos quad)) + (vector-copy! (-> this root trans) (-> this pos)) (if (not (logtest? (-> this flags) (task-arrow-flags taf5))) (set! (-> this minimap) (add-icon! *minimap* this (-> this map-icon) (the-as int #f) (the-as vector #t) 0)) ) ) (else - (set! (-> this root trans quad) (-> this pos quad)) + (vector-copy! (-> this root trans) (-> this pos)) ) ) ) @@ -198,7 +198,7 @@ ) ) (else - (set! (-> this pos quad) (-> this root trans quad)) + (vector-copy! (-> this pos) (-> this root trans)) (if (logtest? (-> this flags) (task-arrow-flags taf4)) (seek! (-> this rod-of-god-scale) 0.0 (* 8.0 (seconds-per-frame))) (seek! (-> this rod-of-god-scale) 1.0 (* 8.0 (seconds-per-frame))) @@ -244,7 +244,7 @@ (else (+! (-> this theta) (* 32768.0 (seconds-per-frame))) (+! (-> this phi) (* 9102.223 (seconds-per-frame))) - (set! (-> this root trans quad) (-> this pos quad)) + (vector-copy! (-> this root trans) (-> this pos)) (set! (-> this root trans y) (+ 28672.0 (* 4096.0 (cos (-> this theta))) (-> this pos y))) ) ) @@ -265,7 +265,7 @@ (case message (('set-position) (let ((a0-3 (the-as object (-> block param 0)))) - (set! (-> self pos quad) (-> (the-as vector a0-3) quad)) + (vector-copy! (-> self pos) (the-as vector a0-3)) ) (if (logtest? (-> self flags) (task-arrow-flags taf3)) (task-arrow-method-23 self (-> self pos)) @@ -344,7 +344,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! gp-1 (-> (math-camera-matrix) fvec)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (math-camera-pos) (-> self root trans)))) (set! (-> gp-1 y) 0.0) (set! (-> s5-1 y) 0.0) @@ -411,11 +411,11 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self pos quad) (-> arg0 pos quad)) + (vector-copy! (-> self pos) (-> arg0 pos)) (if (logtest? (-> self flags) (task-arrow-flags taf3)) (task-arrow-method-23 self (-> self pos)) ) - (set! (-> self root trans quad) (-> self pos quad)) + (vector-copy! (-> self root trans) (-> self pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (quaternion-copy! (-> self base-quat) (-> arg0 quat)) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) diff --git a/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc index 208f9163c96..694c0707d01 100644 --- a/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/task-control_REF.gc @@ -801,7 +801,7 @@ (spawn-resetter! *resetter-control* (-> s4-1 reset fail-info) (the-as game-task-node-info #f)) (return 0) ) - ((= (status-of-level-and-borrows *level* 'wasall #f) 'active) + ((= (level-status? *level* 'wasall #f) 'active) (set! gp-1 "wasdoors-desert") (if (and (-> *game-info* current-continue) (logtest? (continue-flags race) (-> *game-info* current-continue flags)) diff --git a/test/decompiler/reference/jak3/engine/geometry/bounding-box_REF.gc b/test/decompiler/reference/jak3/engine/geometry/bounding-box_REF.gc index 49659dc6608..9cdc2d9db4b 100644 --- a/test/decompiler/reference/jak3/engine/geometry/bounding-box_REF.gc +++ b/test/decompiler/reference/jak3/engine/geometry/bounding-box_REF.gc @@ -118,8 +118,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-to-point! ((this bounding-box) (arg0 vector)) "Set the box to be a single point." - (set! (-> this min quad) (-> arg0 quad)) - (set! (-> this max quad) (-> arg0 quad)) + (vector-copy! (-> this min) arg0) + (vector-copy! (-> this max) arg0) 0 (none) ) diff --git a/test/decompiler/reference/jak3/engine/geometry/geometry-h_REF.gc b/test/decompiler/reference/jak3/engine/geometry/geometry-h_REF.gc index c293a7d54c6..26e544a7e42 100644 --- a/test/decompiler/reference/jak3/engine/geometry/geometry-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/geometry/geometry-h_REF.gc @@ -79,6 +79,8 @@ ;; definition of type lissajous (deftype lissajous (structure) + "A curve where the x and y position are set by two different sinusoids. +This stores the parameters and state for evaluating this curve." ((x-mag float) (y-mag float) (theta float) @@ -89,7 +91,7 @@ ) :pack-me (:methods - (lissajous-method-9 (_type_ vector) vector) + (evaluate! (_type_ vector) vector) ) ) @@ -113,13 +115,15 @@ ;; definition of type lissajous-interp (deftype lissajous-interp (structure) + "Handles interpolating between two different lissajous parameters, and also +stepping forward the dynamics." ((current lissajous :inline) (dest lissajous :inline) (rate lissajous :inline) ) (:methods - (lissajous-interp-method-9 (_type_ vector) vector) - (lissajous-interp-method-10 (_type_) float) + (evaluate! (_type_ vector) vector) + (update! (_type_) float) ) ) @@ -139,7 +143,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/geometry/geometry_REF.gc b/test/decompiler/reference/jak3/engine/geometry/geometry_REF.gc index f6f8288502d..6c2c20c00cf 100644 --- a/test/decompiler/reference/jak3/engine/geometry/geometry_REF.gc +++ b/test/decompiler/reference/jak3/engine/geometry/geometry_REF.gc @@ -107,7 +107,7 @@ ;; INFO: Used lq/sq (defun vector-reflect-flat-gravity! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> arg1 quad)) + (vector-copy! s4-0 arg1) (vector-reflect-flat! arg0 s4-0 arg2) (let* ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 1.0)) (f28-0 (vector-length s4-0)) @@ -464,17 +464,7 @@ (defun forward-up-nopitch->quaternion ((arg0 quaternion) (arg1 vector) (arg2 vector)) "Create a quaternion representing a transform where arg1 is forward (+z) and arg2 is up (+y). Will not use the pitch of forward." - (let ((gp-0 matrix->quaternion) - (s5-0 arg0) - (t9-0 forward-up-nopitch->inv-matrix) - (a0-1 (new 'stack-no-clear 'matrix)) - ) - (set! (-> a0-1 rvec quad) (the-as uint128 0)) - (set! (-> a0-1 uvec quad) (the-as uint128 0)) - (set! (-> a0-1 fvec quad) (the-as uint128 0)) - (set! (-> a0-1 trans quad) (the-as uint128 0)) - (gp-0 s5-0 (t9-0 a0-1 arg1 arg2)) - ) + (matrix->quaternion arg0 (forward-up-nopitch->inv-matrix (new-stack-matrix0) arg1 arg2)) ) ;; definition for function forward-up->quaternion @@ -482,16 +472,9 @@ (defun forward-up->quaternion ((arg0 quaternion) (arg1 vector) (arg2 vector)) "Create a quaternion representing a transform where arg1 is forward (+z) and arg2 is up (+y). Will use the pitch of forward." - (let ((gp-0 matrix->quaternion) - (s5-0 arg0) - (s4-0 forward-down->inv-matrix) - (s3-0 (new 'stack-no-clear 'matrix)) - ) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) - (gp-0 s5-0 (s4-0 s3-0 arg1 (vector-negate! (new 'stack-no-clear 'vector) arg2))) + (matrix->quaternion + arg0 + (forward-down->inv-matrix (new-stack-matrix0) arg1 (vector-negate! (new 'stack-no-clear 'vector) arg2)) ) ) @@ -711,11 +694,7 @@ (let ((s4-0 (new-stack-vector0))) 0.0 0.0 - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (vector-negate! s4-0 arg1) (vector-flatten! s4-0 s4-0 (-> arg0 fvec)) (vector-normalize! s4-0 1.0) @@ -738,7 +717,7 @@ ;; definition for function matrix-rot-diff! ;; INFO: Used lq/sq -(defun matrix-rot-diff! ((arg0 vector) (arg1 matrix) (arg2 matrix)) +(defun matrix-rot-diff! ((arg0 quaternion) (arg1 matrix) (arg2 matrix)) "Get the difference of rotation between two matrices, expressed as a quaternion." (let ((s3-0 (new-stack-quaternion0)) (s2-0 (new-stack-quaternion0)) @@ -755,8 +734,8 @@ ) (let ((f30-1 (* 2.0 (acos (-> s5-0 w))))) (set! (-> arg0 quad) (-> s5-0 quad)) - (vector-negate! arg0 arg0) - (if (= (vector-normalize-ret-len! arg0 1.0) 0.0) + (vector-negate! (the-as vector arg0) (the-as vector arg0)) + (if (= (vector-normalize-ret-len! (the-as vector arg0) 1.0) 0.0) (set! (-> arg0 y) 1.0) ) f30-1 @@ -768,22 +747,14 @@ ;; INFO: Used lq/sq (defun quaternion-seek ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float) (arg4 float)) "Strange quaternion rotate toward function. arg3 is ignored. arg4 is the max seek amount." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 rvec quad) (the-as uint128 0)) - (set! (-> s4-0 uvec quad) (the-as uint128 0)) - (set! (-> s4-0 fvec quad) (the-as uint128 0)) - (set! (-> s4-0 trans quad) (the-as uint128 0)) - (quaternion->matrix s5-0 arg1) - (quaternion->matrix s4-0 arg2) - (let ((s2-1 (new-stack-quaternion0))) - (quaternion-from-two-vectors-max-angle! s2-1 (-> s5-0 fvec) (-> s4-0 fvec) arg4) - (quaternion-normalize! (quaternion*! arg0 arg0 s2-1)) + (let ((s5-0 (new-stack-matrix0)) + (s4-0 (new-stack-matrix0)) ) + (quaternion->matrix s5-0 arg1) + (quaternion->matrix s4-0 arg2) + (let ((s2-1 (new-stack-quaternion0))) + (quaternion-from-two-vectors-max-angle! s2-1 (-> s5-0 fvec) (-> s4-0 fvec) arg4) + (quaternion-normalize! (quaternion*! arg0 arg0 s2-1)) ) ) ) @@ -792,11 +763,7 @@ ;; INFO: Used lq/sq (defun vector-deg-seek ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) "Make one vector closer to another, doing at most a rotation by arg3 degrees." - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 rvec quad) (the-as uint128 0)) - (set! (-> s4-0 uvec quad) (the-as uint128 0)) - (set! (-> s4-0 fvec quad) (the-as uint128 0)) - (set! (-> s4-0 trans quad) (the-as uint128 0)) + (let ((s4-0 (new-stack-matrix0))) (matrix-from-two-vectors-max-angle! s4-0 arg1 arg2 arg3) (vector-matrix*! arg0 arg1 s4-0) ) @@ -808,19 +775,15 @@ "Slerp for vectors. (imagine that they are the z axis of two frames)" (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) arg0 ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) arg0 ) (else - (let ((s1-0 (new 'stack-no-clear 'matrix))) - (set! (-> s1-0 rvec quad) (the-as uint128 0)) - (set! (-> s1-0 uvec quad) (the-as uint128 0)) - (set! (-> s1-0 fvec quad) (the-as uint128 0)) - (set! (-> s1-0 trans quad) (the-as uint128 0)) + (let ((s1-0 (new-stack-matrix0))) (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) (a2-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 1.0)) ) @@ -839,10 +802,10 @@ (local-vars (sv-112 (function float float float float))) (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (let* ((s0-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) @@ -1286,7 +1249,7 @@ (-> arg0 num-knots) ) (dotimes (s2-0 s3-0) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) (curve-evaluate! s4-0 (/ (the float (+ s2-0 1)) (the float s3-0)) @@ -1470,12 +1433,14 @@ ) ;; definition for method 9 of type lissajous-interp -(defmethod lissajous-interp-method-9 ((this lissajous-interp) (arg0 vector)) - (lissajous-method-9 (-> this current) arg0) +(defmethod evaluate! ((this lissajous-interp) (arg0 vector)) + "Set the x and y component of the vector to the current point on the curve." + (evaluate! (-> this current) arg0) ) ;; definition for method 10 of type lissajous-interp -(defmethod lissajous-interp-method-10 ((this lissajous-interp)) +(defmethod update! ((this lissajous-interp)) + "Update both the interpolation, and the curves themselves." (seek! (-> this current x-mag) (-> this dest x-mag) (-> this rate x-mag)) (seek! (-> this current y-mag) (-> this dest y-mag) (-> this rate y-mag)) (seek! (-> this current theta-rate) (-> this dest theta-rate) (-> this rate theta-rate)) @@ -1488,7 +1453,8 @@ ) ;; definition for method 9 of type lissajous -(defmethod lissajous-method-9 ((this lissajous) (arg0 vector)) +(defmethod evaluate! ((this lissajous) (arg0 vector)) + "Set the x and y component of the vector to the current point on the curve." 0.0 0.0 (let ((f30-0 (* (cos (* (-> this theta) (-> this wx))) (-> this x-mag))) diff --git a/test/decompiler/reference/jak3/engine/geometry/path_REF.gc b/test/decompiler/reference/jak3/engine/geometry/path_REF.gc index a888de36e56..d88ee736175 100644 --- a/test/decompiler/reference/jak3/engine/geometry/path_REF.gc +++ b/test/decompiler/reference/jak3/engine/geometry/path_REF.gc @@ -108,13 +108,13 @@ ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this curve cverts (the int (the float (the int f24-0))) quad)) + (vector-copy! s4-0 (-> this curve cverts (the int (the float (the int f24-0))))) 0.0 (let ((f0-16 (vector-vector-distance s5-0 s4-0))) (cond ((< f0-16 f26-0) (set! f26-0 (- f26-0 f0-16)) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) f24-0 ) (else @@ -150,13 +150,13 @@ ) (cond ((< arg1 0.0) - (set! (-> arg0 quad) (-> this curve cverts 0 quad)) + (vector-copy! arg0 (-> this curve cverts 0)) ) ((>= f0-3 (the float (+ a1-1 -1))) - (set! (-> arg0 quad) (-> this curve cverts (+ a1-1 -1) quad)) + (vector-copy! arg0 (-> this curve cverts (+ a1-1 -1))) ) ((or (= arg2 'exact) (= f0-3 arg1)) - (set! (-> arg0 quad) (-> this curve cverts (the int f0-3) quad)) + (vector-copy! arg0 (-> this curve cverts (the int f0-3))) ) (else (vector-lerp! @@ -178,7 +178,7 @@ (cond ((> (-> this curve num-cverts) 0) (let ((a0-2 (rand-vu-int-count (-> this curve num-cverts)))) - (set! (-> arg0 quad) (-> this curve cverts a0-2 quad)) + (vector-copy! arg0 (-> this curve cverts a0-2)) ) ) (else @@ -186,7 +186,7 @@ (if pp (format #t "current process is ~A~%" (-> pp name)) ) - (set! (-> arg0 quad) (-> *null-vector* quad)) + (vector-copy! arg0 *null-vector*) ) ) arg0 @@ -400,7 +400,7 @@ (vector+float*! sv-116 arg0 arg1 (-> s1-0 x)) (cond ((and s0-0 (not sv-120)) - (set! (-> sv-108 quad) (-> sv-116 quad)) + (vector-copy! sv-108 sv-116) (set! sv-112 (vector-vector-distance-squared sv-116 arg0)) (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) (set! sv-120 #t) @@ -408,7 +408,7 @@ ((and s0-0 sv-120) (let ((f0-22 (vector-vector-distance-squared sv-116 arg0))) (when (< f0-22 (the-as float sv-112)) - (set! (-> sv-108 quad) (-> sv-116 quad)) + (vector-copy! sv-108 sv-116) (set! sv-112 f0-22) (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) ) @@ -424,7 +424,7 @@ (f0-33 (* f0-32 f0-32)) ) (when (< f0-33 (the-as float sv-112)) - (set! (-> sv-108 quad) (-> s0-1 quad)) + (vector-copy! sv-108 s0-1) (set! sv-112 f0-33) (set! sv-124 (lerp (the float s2-0) (the float (+ s2-0 1)) (-> s1-0 y))) ) @@ -435,7 +435,7 @@ ) ) ) - (set! (-> sv-96 quad) (-> sv-100 quad)) + (vector-copy! sv-96 sv-100) ) ) (set! sv-124 (/ sv-124 (the float (+ (-> this curve num-cverts) -1)))) @@ -461,12 +461,12 @@ (f28-0 0.0) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (set! (-> s3-0 y) 0.0) (get-point-in-path! this s4-0 0.0 'interp) (set! (-> s4-0 y) 0.0) (dotimes (s1-0 (+ (-> this curve num-cverts) -1)) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) (get-point-in-path! this s4-0 (the float (+ s1-0 1)) 'interp) (set! (-> s4-0 y) 0.0) (let ((f0-5 (vector-segment-distance-point! s3-0 s5-0 s4-0 s2-0))) @@ -493,10 +493,10 @@ (f28-0 0.0) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (get-point-in-path! this s4-0 0.0 'interp) (dotimes (s1-0 (+ (-> this curve num-cverts) -1)) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) (get-point-in-path! this s4-0 (the float (+ s1-0 1)) 'interp) (let ((f0-2 (vector-segment-distance-point! s3-0 s5-0 s4-0 s2-0))) (when (< f0-2 f30-0) @@ -603,7 +603,3 @@ ) arg0 ) - - - - diff --git a/test/decompiler/reference/jak3/engine/geometry/vol_REF.gc b/test/decompiler/reference/jak3/engine/geometry/vol_REF.gc index 240d769e3d8..bcbbac108f7 100644 --- a/test/decompiler/reference/jak3/engine/geometry/vol_REF.gc +++ b/test/decompiler/reference/jak3/engine/geometry/vol_REF.gc @@ -65,7 +65,7 @@ (set! sv-148 (the-as float 0.0)) (set! sv-152 0) (set! sv-160 (new-stack-vector0)) - (set! (-> sv-144 quad) (-> sv-224 quad)) + (vector-copy! sv-144 sv-224) (set! sv-256 0) (while (< sv-256 (-> this num-planes)) (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) @@ -75,7 +75,7 @@ ) ((zero? sv-152) (vector+float*! sv-144 sv-144 sv-192 f0-6) - (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (vector-copy! sv-160 (-> s2-0 sv-256)) (set! sv-148 (the-as float 8192000.0)) (set! sv-152 1) ) @@ -89,7 +89,7 @@ ) (else (vector+float*! sv-144 sv-144 sv-192 f0-6) - (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (vector-copy! sv-160 (-> s2-0 sv-256)) (set! sv-152 (+ sv-152 1)) (if (< (fabs f0-6) (fabs sv-148)) (set! sv-148 (- sv-148 f0-6)) @@ -120,8 +120,8 @@ (format 0 "ERROR : vol-control #x~X out of volume points~%" this) ) (else - (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) - (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) + (vector-copy! (-> arg1 data (-> arg1 length)) sv-144) + (vector-copy! (-> arg1 data (+ (-> arg1 length) 1)) sv-224) (+! (-> arg1 length) 2) (+! (-> this point-count) 2) ) @@ -144,8 +144,8 @@ (format 0 "ERROR : vol-control #x~X out of volume normals~%" this) ) (else - (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) - (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) + (vector-copy! (-> arg2 data (-> arg2 length)) s1-0) + (vector-copy! (-> arg2 data (+ (-> arg2 length) 1)) (-> s2-0 s3-0)) (+! (-> arg2 length) 2) (set! (-> this normal-count) (+ (-> this normal-count) 2)) ) @@ -260,7 +260,3 @@ ) #f ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/background/background_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/background_REF.gc index ccd3380b712..5b98bbfc407 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/background_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/background_REF.gc @@ -372,7 +372,7 @@ ) ) (when (nonzero? (-> *background-work* tie-tree-count)) - (set! (-> *instance-tie-work* tod-env-color quad) (-> *time-of-day-context* current-env-color quad)) + (vector-copy! (-> *instance-tie-work* tod-env-color) (-> *time-of-day-context* current-env-color)) (when *debug-segment* (let ((s5-7 (-> *display* frames (-> *display* on-screen) profile-array data 0)) (v1-192 'tie) diff --git a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-vu1_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-vu1_REF.gc index c5098410643..f7c412d2d06 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-vu1_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-vu1_REF.gc @@ -35,7 +35,7 @@ (let ((gp-0 *math-camera*)) (let ((v1-0 *hfrag-vu1-constants-base*)) (dotimes (a0-1 81) - (set! (-> arg0 base far-verts a0-1 quad) (-> v1-0 far-verts a0-1 quad)) + (vector-copy! (-> arg0 base far-verts a0-1) (-> v1-0 far-verts a0-1)) ) ) (case *subdivide-draw-mode* @@ -236,8 +236,8 @@ (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) ) (mem-copy! (the-as pointer (-> arg0 matrix)) (the-as pointer (-> gp-0 camera-temp)) 64) - (set! (-> arg0 hvdf-offset quad) (-> gp-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> gp-0 hmge-scale quad)) + (vector-copy! (-> arg0 hvdf-offset) (-> gp-0 hvdf-off)) + (vector-copy! (-> arg0 hmge-scale) (-> gp-0 hmge-scale)) (set-vector! (-> arg0 fog) (-> gp-0 pfog0) (-> gp-0 fog-min) (-> gp-0 fog-max) 3072.0) ) (none) @@ -380,7 +380,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag_REF.gc index 4e8eaa86d95..4dd1f016f65 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag_REF.gc @@ -841,9 +841,9 @@ ((< (fabs (-> sv-72 z)) (fabs (-> sv-72 x))) (when (< (-> sv-72 x) 0.0) (let ((v1-15 (new 'stack-no-clear 'vector))) - (set! (-> v1-15 quad) (-> sv-64 quad)) - (set! (-> sv-64 quad) (-> sv-68 quad)) - (set! (-> sv-68 quad) (-> v1-15 quad)) + (vector-copy! v1-15 sv-64) + (vector-copy! sv-64 sv-68) + (vector-copy! sv-68 v1-15) ) (vector-negate! sv-72 sv-72) ) @@ -908,9 +908,9 @@ (else (when (< (-> sv-72 z) 0.0) (let ((v1-42 (new 'stack-no-clear 'vector))) - (set! (-> v1-42 quad) (-> sv-64 quad)) - (set! (-> sv-64 quad) (-> sv-68 quad)) - (set! (-> sv-68 quad) (-> v1-42 quad)) + (vector-copy! v1-42 sv-64) + (vector-copy! sv-64 sv-68) + (vector-copy! sv-68 v1-42) ) (vector-negate! sv-72 sv-72) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag-near_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag-near_REF.gc index c5d38dd50fb..88cd32c7228 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag-near_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag-near_REF.gc @@ -44,12 +44,8 @@ ;; WARN: Return type mismatch vector vs none. (defun-debug clip-restore () (let ((a0-0 (new-stack-vector0)) - (a1-0 (new 'stack-no-clear 'matrix)) + (a1-0 (new-stack-matrix0)) ) - (set! (-> a1-0 rvec quad) (the-as uint128 0)) - (set! (-> a1-0 uvec quad) (the-as uint128 0)) - (set! (-> a1-0 fvec quad) (the-as uint128 0)) - (set! (-> a1-0 trans quad) (the-as uint128 0)) (set! (-> a0-0 x) 92648.22) (set! (-> a0-0 y) 238025.03) (set! (-> a0-0 z) 199836.31) @@ -74,7 +70,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag_REF.gc index e5902ee12ac..836166f7040 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag_REF.gc @@ -284,10 +284,10 @@ ) (set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) (set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 guard quad) (-> v1-0 guard quad)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) + (vector-copy! (-> arg0 invh-scale) (-> v1-0 inv-hmge-scale)) + (vector-copy! (-> arg0 guard) (-> v1-0 guard)) ) (set-tfrag-dists! (-> arg0 dists)) (none) @@ -612,7 +612,3 @@ ;; definition for function stats-tfrag-asm ;; ERROR: function was not converted to expressions. Cannot decompile. - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/blit-displays_REF.gc b/test/decompiler/reference/jak3/engine/gfx/blit-displays_REF.gc index 5c7151e59b6..c456a47e314 100644 --- a/test/decompiler/reference/jak3/engine/gfx/blit-displays_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/blit-displays_REF.gc @@ -326,7 +326,7 @@ ) (cond ((-> this zoom-blur-2d) - (set! (-> s5-0 quad) (-> this zoom-blur-pos quad)) + (vector-copy! s5-0 (-> this zoom-blur-pos)) (let* ((f2-0 (* (/ f28-0 512) (-> s5-0 x))) (f0-6 (- f26-0 (- f28-0 f2-0))) (f3-1 (* (/ f28-0 416) (-> s5-0 y))) @@ -411,7 +411,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod setup-zoom-blur-2d ((this blit-displays-work) (arg0 vector) (arg1 int) (arg2 float) (arg3 symbol)) (set! (-> this zoom-blur-2d) arg3) - (set! (-> this zoom-blur-pos quad) (-> arg0 quad)) + (vector-copy! (-> this zoom-blur-pos) arg0) (set! (-> this zoom-blur-texels) arg1) (set! (-> this zoom-blur-alpha-target) arg2) 0 diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/lights_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/lights_REF.gc index c6c4e7b2c70..de99d79b544 100644 --- a/test/decompiler/reference/jak3/engine/gfx/foreground/lights_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/lights_REF.gc @@ -141,7 +141,7 @@ (+! f0-0 (-> a1-9 bsphere w)) ) ) - (set! (-> arg0 base-trans quad) (-> v1-0 min quad)) + (vector-copy! (-> arg0 base-trans) (-> v1-0 min)) (let ((f0-1 (/ f0-0 (the float (-> arg0 num-lights))))) (dotimes (a0-8 3) (set! (-> s5-0 data a0-8) (- (-> v1-0 max data a0-8) (-> v1-0 min data a0-8))) diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/merc/emerc_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/emerc_REF.gc index 1c6d3d7ff92..02de53f1b3b 100644 --- a/test/decompiler/reference/jak3/engine/gfx/foreground/merc/emerc_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/emerc_REF.gc @@ -26,7 +26,7 @@ (set! (-> s5-0 tri-strip-gif word 3) (shr (make-u128 0 (shl #x303e4000 32)) 32)) (set! (-> s5-0 ad-gif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) (set! (-> s5-0 ad-gif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> s5-0 hvdf-offset quad) (-> *math-camera* hvdf-off quad)) + (vector-copy! (-> s5-0 hvdf-offset) (-> *math-camera* hvdf-off)) (quad-copy! (the-as pointer (-> s5-0 perspective)) (the-as pointer (-> *math-camera* perspective)) 4) (set-vector! (-> s5-0 fog) (-> *math-camera* pfog0) (-> *math-camera* fog-min) (-> *math-camera* fog-max) 0.0) (set-vector! diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc_REF.gc index 46e69b5c406..59b0aa00c29 100644 --- a/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/merc/merc_REF.gc @@ -545,7 +545,7 @@ ) (set! (-> s5-0 ad-gif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) (set! (-> s5-0 ad-gif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> s5-0 hvdf-offset quad) (-> *math-camera* hvdf-off quad)) + (vector-copy! (-> s5-0 hvdf-offset) (-> *math-camera* hvdf-off)) (quad-copy! (-> s5-0 perspective) (the-as pointer (-> *math-camera* perspective)) 4) (set-vector! (-> s5-0 fog) (-> *math-camera* pfog0) (-> *math-camera* fog-min) (-> *math-camera* fog-max) 0.0) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/generic-effect_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/generic-effect_REF.gc index f5bdb33c666..e1298156c77 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/generic-effect_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/generic-effect_REF.gc @@ -247,17 +247,7 @@ (defun generic-initialize-without-sync ((arg0 matrix) (arg1 vu-lights)) "Init generic, version for generic-merc, which relies on generic-merc init running after." (upload-vu0-program generic-vu0-block (the-as pointer #x70000054)) - (let ((a2-0 (-> (the-as generic-work #x70000000) fx-buf work consts matrix)) - (v1-1 (-> arg0 rvec quad)) - (a0-3 (-> arg0 uvec quad)) - (a1-2 (-> arg0 fvec quad)) - (a3-0 (-> arg0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-1) - (set! (-> a2-0 uvec quad) a0-3) - (set! (-> a2-0 fvec quad) a1-2) - (set! (-> a2-0 trans quad) a3-0) - ) + (matrix-copy! (-> (the-as generic-work #x70000000) fx-buf work consts matrix) arg0) (if arg1 (quad-copy! (the-as pointer (-> (the-as generic-work #x70000000) fx-buf work lights)) (the-as pointer arg1) 7) ) @@ -272,17 +262,7 @@ "Normal init for generic - sets up scratchpad and VU0." (generic-work-init arg0) (generic-upload-vu0) - (let ((a2-1 (-> (the-as generic-work #x70000000) fx-buf work consts matrix)) - (v1-1 (-> arg1 rvec quad)) - (a0-2 (-> arg1 uvec quad)) - (a1-1 (-> arg1 fvec quad)) - (a3-0 (-> arg1 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-1) - (set! (-> a2-1 uvec quad) a0-2) - (set! (-> a2-1 fvec quad) a1-1) - (set! (-> a2-1 trans quad) a3-0) - ) + (matrix-copy! (-> (the-as generic-work #x70000000) fx-buf work consts matrix) arg1) (if arg2 (quad-copy! (the-as pointer (-> (the-as generic-work #x70000000) fx-buf work lights)) (the-as pointer arg2) 7) ) @@ -388,7 +368,3 @@ ;; definition (debug) for function generic-post-debug ;; ERROR: function has no type analysis. Cannot decompile. - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1_REF.gc index c36ccef51c4..9908133d5c4 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/generic-vu1_REF.gc @@ -12,10 +12,10 @@ (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) (set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x7 :nreg #x1)) (set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 guard quad) (-> v1-0 guard quad)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) + (vector-copy! (-> arg0 invh-scale) (-> v1-0 inv-hmge-scale)) + (vector-copy! (-> arg0 guard) (-> v1-0 guard)) ) (set! (-> arg0 flush dword 0) (the-as uint #x3f80000080808080)) (set! (-> arg0 flush dword 1) (the-as uint 1)) diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-h_REF.gc index f00dbb55ef2..d0fd0bea9aa 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-h_REF.gc @@ -172,7 +172,7 @@ (defmethod set-point! ((this lightning-control) (arg0 int) (arg1 vector)) (let ((v1-0 (-> this state))) (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) - (set! (-> v1-0 path data arg0 quad) (-> arg1 quad)) + (vector-copy! (-> v1-0 path data arg0) arg1) (when (and (< (+ (-> v1-0 points-to-draw) -1) arg0) (case (-> v1-0 mode) ((2 3) #t @@ -182,8 +182,8 @@ ) ) ) - (set! (-> v1-0 line data arg0 quad) (-> arg1 quad)) - (set! (-> v1-0 meet data arg0 quad) (-> arg1 quad)) + (vector-copy! (-> v1-0 line data arg0) arg1) + (vector-copy! (-> v1-0 meet data arg0) arg1) ) ) ) @@ -203,7 +203,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. (defmethod set-last-meet-point ((this lightning-control) (arg0 vector)) - (set! (-> this state meet data (+ (-> this state points-to-draw) -1) quad) (-> arg0 quad)) + (vector-copy! (-> this state meet data (+ (-> this state points-to-draw) -1)) arg0) (none) ) @@ -315,7 +315,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc index d4fe7494361..1be929ad5a0 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new_REF.gc @@ -97,7 +97,7 @@ ) (set! (-> s3-0 z) (the float (-> arg1 index))) (set! (-> s3-0 w) 1.0) - (set! (-> this desired-points data arg0 quad) (-> s3-0 quad)) + (vector-copy! (-> this desired-points data arg0) s3-0) ) (set! (-> this current-points data arg0 z) (the float (-> arg1 index))) (-> this desired-points data arg0) @@ -297,7 +297,7 @@ (and (logtest? (-> a2-13 span-flags) 2) (not (logtest? (-> a2-13 span-flags) 1))) ) (dotimes (v1-55 s3-0) - (set! (-> this current-points data (+ v1-55 s5-0) quad) (-> this desired-points data (+ v1-55 s5-0) quad)) + (vector-copy! (-> this current-points data (+ v1-55 s5-0)) (-> this desired-points data (+ v1-55 s5-0))) ) ) (lightning-bolt-method-20 this s5-0 a2-13) @@ -308,7 +308,7 @@ (when (time-elapsed? (-> this last-generate-time) (-> this new-inner-point-generate-time)) (lightning-bolt-method-20 this s5-0 (-> this spans-internal data (-> this num-active-spans))) (if (-> this snap-inner-points?) - (set! (-> this current-points data s5-0 quad) (-> this desired-points data s5-0 quad)) + (vector-copy! (-> this current-points data s5-0) (-> this desired-points data s5-0)) ) (set-time! (-> this last-generate-time)) (set! (-> this new-inner-point-generate-time) (rand-vu-int-range @@ -429,7 +429,7 @@ ;; definition for function matrix<-vector-yz2! ;; INFO: Used lq/sq (defun matrix<-vector-yz2! ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (vector-cross! (-> arg0 rvec) arg2 arg1) (vector-normalize! (-> arg0 rvec) 1.0) (vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec)) @@ -575,7 +575,7 @@ (matrix<-vector-yz2! sv-224 sv-240 (choose-nice-perp sv-240)) (let ((f30-0 (-> sv-96 random-offset-size-start))) (lightning-bolt-method-19 this sv-104 sv-48 (+ sv-48 1) sv-224 f30-0 sv-236) - (set! (-> sv-232 quad) (-> this current-points data sv-48 quad)) + (vector-copy! sv-232 (-> this current-points data sv-48)) (set! (-> sv-232 x) (* (-> sv-232 x) f30-0)) (set! (-> sv-232 y) (* (-> sv-232 y) f30-0)) ) @@ -588,7 +588,7 @@ (dotimes (s4-1 (-> sv-100 num-inner-points)) (set! sv-256 (+ sv-48 1 s4-1)) (lightning-bolt-method-19 this sv-104 (+ sv-256 -1) sv-256 sv-224 sv-248 sv-236) - (set! (-> sv-232 quad) (-> this current-points data sv-256 quad)) + (vector-copy! sv-232 (-> this current-points data sv-256)) (set! (-> sv-232 x) (* (-> sv-232 x) sv-248)) (set! (-> sv-232 y) (* (-> sv-232 y) sv-248)) (set! (-> sv-232 z) (- (-> sv-232 z) sv-244)) @@ -618,7 +618,7 @@ (vector-normalize! sv-428 1.0) (matrix<-vector-yz2! sv-416 sv-428 (choose-nice-perp sv-428)) (let ((f0-33 (-> sv-288 random-offset-size-start))) - (set! (-> sv-424 quad) (-> this current-points data sv-48 quad)) + (vector-copy! sv-424 (-> this current-points data sv-48)) (set! (-> sv-424 x) (* (-> sv-424 x) f0-33)) (set! (-> sv-424 y) (* (-> sv-424 y) f0-33)) ) @@ -793,7 +793,7 @@ (defmethod lightning-bolt-method-18 ((this lightning-bolt) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) (when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts)) (let ((v1-5 (-> arg0 data (-> arg0 num-verts)))) - (set! (-> v1-5 pos quad) (-> arg1 quad)) + (vector-copy! (-> v1-5 pos) arg1) (set! (-> v1-5 col) arg2) (set! (-> v1-5 stq x) arg3) (set! (-> v1-5 stq y) arg4) @@ -811,7 +811,7 @@ (init! (-> self bolt) 2 (+ (-> arg0 num-inner-points) 2) (-> arg0 appearance)) (set! (-> self lifetime) (-> arg0 lifetime)) (set! (-> self bolt span-pts-start data 0 quad) (-> arg0 start-pt quad)) - (set! (-> self bolt span-pts-start data 1 quad) (-> arg0 end-pt quad)) + (vector-copy! (-> self bolt span-pts-start data 1) (-> arg0 end-pt)) (set! (-> self bolt spans-internal data 0 num-inner-points) (-> arg0 num-inner-points)) (set! (-> self bolt spans data 0 inner-random-offset-size) (-> arg0 inner-random-offset-size)) (set! (-> self bolt spans data 0 random-offset-size-start) (-> arg0 random-offset-size-start)) diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning_REF.gc index dbb8a362d03..0e380f474d7 100644 --- a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning_REF.gc @@ -399,7 +399,7 @@ ) (when sv-32 (dotimes (v1-43 gp-0) - (set! (-> sv-20 data v1-43 quad) (-> sv-24 data v1-43 quad)) + (vector-copy! (-> sv-20 data v1-43) (-> sv-24 data v1-43)) ) ) ) @@ -407,7 +407,7 @@ (case (-> sv-16 rand-func) ((2) (set! (-> sv-24 data 0 quad) (-> sv-28 data 0 quad)) - (set! (-> sv-24 data s4-0 quad) (-> sv-28 data s4-0 quad)) + (vector-copy! (-> sv-24 data s4-0) (-> sv-28 data s4-0)) (lightning-trail-fractal-gen (-> sv-24 data) (-> sv-28 data) 0 s4-0 (-> s5-0 box-size) sv-16) ) (else @@ -416,7 +416,7 @@ ) (when sv-32 (dotimes (v1-63 gp-0) - (set! (-> sv-20 data v1-63 quad) (-> sv-28 data v1-63 quad)) + (vector-copy! (-> sv-20 data v1-63) (-> sv-28 data v1-63)) ) ) ) @@ -669,18 +669,7 @@ (set! (-> v1-81 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-73) 16)))) ) (set! sv-176 (the-as gcf-control (-> arg0 base))) - (let* ((v1-84 (-> sv-176 matrix)) - (a3-31 (-> sv-16 perspective)) - (a0-76 (-> a3-31 rvec quad)) - (a1-88 (-> a3-31 uvec quad)) - (a2-58 (-> a3-31 fvec quad)) - (a3-32 (-> a3-31 trans quad)) - ) - (set! (-> v1-84 rvec quad) a0-76) - (set! (-> v1-84 uvec quad) a1-88) - (set! (-> v1-84 fvec quad) a2-58) - (set! (-> v1-84 trans quad) a3-32) - ) + (matrix-copy! (-> sv-176 matrix) (-> sv-16 perspective)) (quad-copy! (the-as pointer (-> sv-176 giftag)) (the-as pointer (-> s1-0 giftag)) 3) (set! (-> sv-176 giftag num-strips) (the-as uint 1)) (set! (-> sv-176 num-dps) (the-as uint (* sv-144 2))) @@ -868,7 +857,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak3/engine/gfx/math-camera_REF.gc index 25cd5d0d83d..5b0409cfa04 100644 --- a/test/decompiler/reference/jak3/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/math-camera_REF.gc @@ -188,7 +188,7 @@ Without this corrector, the fogginess of the world would change as the FOV chang (set-vector! (-> arg0 sprite-2d fvec) 0.0 0.0 (- f0-48) 0.0) (set-vector! (-> arg0 sprite-2d trans) 0.0 0.0 (* 500000000.0 f0-48) (* 60.0 f0-48 (-> arg0 pfog0))) ) - (set! (-> arg0 sprite-2d-hvdf quad) (-> arg0 hvdf-off quad)) + (vector-copy! (-> arg0 sprite-2d-hvdf) (-> arg0 hvdf-off)) (set! (-> arg0 sprite-2d-hvdf x) 2048.0) (set! (-> arg0 sprite-2d-hvdf y) 2048.0) (set! (-> arg0 sprite-2d-hvdf z) (-> arg0 hvdf-off z)) @@ -315,12 +315,8 @@ Without this corrector, the fogginess of the world would change as the FOV chang ) (set! (-> s4-0 w) 1.0) (let ((a0-5 (new-stack-vector0)) - (s3-0 (new 'stack-no-clear 'matrix)) + (s3-0 (new-stack-matrix0)) ) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) (vector-negate! a0-5 (-> arg0 rot)) (matrix-rotate-zyx! s3-0 (-> arg0 rot)) (vector-matrix*! s4-0 s4-0 s3-0) @@ -558,84 +554,74 @@ Without this corrector, the fogginess of the world would change as the FOV chang (vf8 :class vf) (vf9 :class vf) ) - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (let ((s4-0 (new 'stack 'vector4s-3)) - (s3-0 (new-stack-vector0)) - ) - (let ((s2-0 (new 'stack 'vector4s-3))) - (matrix*! s5-0 arg0 (-> *math-camera* camera-temp)) - (matrix-3x3-inverse-transpose! gp-0 arg0) - (set-vector! s3-0 0.4 0.4 0.4 1.0) - (let ((v1-4 (-> s4-0 data))) - (set! (-> v1-4 0) 1.0) - (set! (-> v1-4 1) 1.0) - (set! (-> v1-4 2) 1.0) - (set! (-> v1-4 3) 1.0) - ) - (let ((v1-5 (&-> s4-0 data 4))) - (set! (-> v1-5 0) 0.0) - (set! (-> v1-5 1) 0.0) - (set! (-> v1-5 2) 0.0) - (set! (-> v1-5 3) 1.0) - ) - (let ((v1-6 (&-> s4-0 data 8))) - (set! (-> v1-6 0) 0.0) - (set! (-> v1-6 1) 0.0) - (set! (-> v1-6 2) 0.0) - (set! (-> v1-6 3) 1.0) - ) - (let ((v1-7 (-> s2-0 data))) - (set! (-> v1-7 0) 1.0) - (set! (-> v1-7 1) 0.0) - (set! (-> v1-7 2) 0.0) - (set! (-> v1-7 3) 1.0) - ) - (let ((v1-8 (&-> s2-0 data 4))) - (set! (-> v1-8 0) 0.0) - (set! (-> v1-8 1) 1.0) - (set! (-> v1-8 2) 0.0) - (set! (-> v1-8 3) 1.0) - ) - (let ((v1-9 (&-> s2-0 data 8))) - (set! (-> v1-9 0) 0.0) - (set! (-> v1-9 1) 0.0) - (set! (-> v1-9 2) 1.0) - (set! (-> v1-9 3) 1.0) - ) - (.lvf vf7 (&-> *math-camera* hmge-scale quad)) - (.lvf vf8 (&-> *math-camera* hvdf-off quad)) - (.lvf vf9 (&-> *math-camera* giftex)) - (let ((v1-13 255)) - (.mov vf6 v1-13) - ) - (.mov v1-14 vf6) - (.itof.vf vf6 vf6) - (.lvf vf1 (&-> s5-0 rvec quad)) - (.lvf vf2 (&-> s5-0 uvec quad)) - (.lvf vf3 (&-> s5-0 fvec quad)) - (.lvf vf4 (&-> s5-0 trans quad)) - (.lvf vf17 (&-> gp-0 rvec quad)) - (.lvf vf18 (&-> gp-0 uvec quad)) - (.lvf vf19 (&-> gp-0 fvec quad)) - (.lvf vf23 (&-> s2-0 quad 0)) - (.lvf vf24 (&-> s2-0 quad 1)) - (.lvf vf25 (&-> s2-0 quad 2)) - ) - (.lvf vf27 (&-> s4-0 quad 0)) - (.lvf vf28 (&-> s4-0 quad 1)) - (.lvf vf29 (&-> s4-0 quad 2)) - (.lvf vf26 (&-> s3-0 quad)) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + (s4-0 (new 'stack 'vector4s-3)) + (s3-0 (new-stack-vector0)) + ) + (let ((s2-0 (new 'stack 'vector4s-3))) + (matrix*! s5-0 arg0 (-> *math-camera* camera-temp)) + (matrix-3x3-inverse-transpose! gp-0 arg0) + (set-vector! s3-0 0.4 0.4 0.4 1.0) + (let ((v1-4 (-> s4-0 data))) + (set! (-> v1-4 0) 1.0) + (set! (-> v1-4 1) 1.0) + (set! (-> v1-4 2) 1.0) + (set! (-> v1-4 3) 1.0) + ) + (let ((v1-5 (&-> s4-0 data 4))) + (set! (-> v1-5 0) 0.0) + (set! (-> v1-5 1) 0.0) + (set! (-> v1-5 2) 0.0) + (set! (-> v1-5 3) 1.0) + ) + (let ((v1-6 (&-> s4-0 data 8))) + (set! (-> v1-6 0) 0.0) + (set! (-> v1-6 1) 0.0) + (set! (-> v1-6 2) 0.0) + (set! (-> v1-6 3) 1.0) + ) + (let ((v1-7 (-> s2-0 data))) + (set! (-> v1-7 0) 1.0) + (set! (-> v1-7 1) 0.0) + (set! (-> v1-7 2) 0.0) + (set! (-> v1-7 3) 1.0) + ) + (let ((v1-8 (&-> s2-0 data 4))) + (set! (-> v1-8 0) 0.0) + (set! (-> v1-8 1) 1.0) + (set! (-> v1-8 2) 0.0) + (set! (-> v1-8 3) 1.0) + ) + (let ((v1-9 (&-> s2-0 data 8))) + (set! (-> v1-9 0) 0.0) + (set! (-> v1-9 1) 0.0) + (set! (-> v1-9 2) 1.0) + (set! (-> v1-9 3) 1.0) + ) + (.lvf vf7 (&-> *math-camera* hmge-scale quad)) + (.lvf vf8 (&-> *math-camera* hvdf-off quad)) + (.lvf vf9 (&-> *math-camera* giftex)) + (let ((v1-13 255)) + (.mov vf6 v1-13) ) + (.mov v1-14 vf6) + (.itof.vf vf6 vf6) + (.lvf vf1 (&-> s5-0 rvec quad)) + (.lvf vf2 (&-> s5-0 uvec quad)) + (.lvf vf3 (&-> s5-0 fvec quad)) + (.lvf vf4 (&-> s5-0 trans quad)) + (.lvf vf17 (&-> gp-0 rvec quad)) + (.lvf vf18 (&-> gp-0 uvec quad)) + (.lvf vf19 (&-> gp-0 fvec quad)) + (.lvf vf23 (&-> s2-0 quad 0)) + (.lvf vf24 (&-> s2-0 quad 1)) + (.lvf vf25 (&-> s2-0 quad 2)) ) + (.lvf vf27 (&-> s4-0 quad 0)) + (.lvf vf28 (&-> s4-0 quad 1)) + (.lvf vf29 (&-> s4-0 quad 2)) + (.lvf vf26 (&-> s3-0 quad)) ) (none) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/mood/mood-funcs_REF.gc b/test/decompiler/reference/jak3/engine/gfx/mood/mood-funcs_REF.gc index 3fd4aecd8e5..004ed95cf32 100644 --- a/test/decompiler/reference/jak3/engine/gfx/mood/mood-funcs_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/mood/mood-funcs_REF.gc @@ -42,7 +42,7 @@ (defun get-sphere-interp ((arg0 sphere) (arg1 vector) (arg2 float) (arg3 float)) (let ((v1-0 (new 'stack-no-clear 'vector))) 0.0 - (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-copy! v1-0 arg0) (vector-! v1-0 arg1 v1-0) (let ((f1-0 (vector-length v1-0))) (/ (fmax 0.0 (fmin (- f1-0 arg2) arg3)) arg3) @@ -1068,7 +1068,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak3/engine/gfx/mood/mood_REF.gc index 8eb3b0be459..6962bb74e2f 100644 --- a/test/decompiler/reference/jak3/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/mood/mood_REF.gc @@ -8,7 +8,7 @@ (cond ((logtest? (-> *time-of-day-context* mode) (ash 16 v1-0)) (if (-> *time-of-day-context* overide-enable) - (set! (-> arg0 times v1-0 quad) (-> *time-of-day-context* times v1-0 quad)) + (vector-copy! (-> arg0 times v1-0) (-> *time-of-day-context* times v1-0)) (set! (-> arg0 times v1-0 w) 1.0) ) ) @@ -469,13 +469,13 @@ (a0-16 (-> arg0 light-group)) ) (set! (-> v1-26 0 quad) (-> a2-1 amb-color quad)) - (set! (-> a1-2 quad) (-> a2-1 lgt-color quad)) - (set! (-> arg0 times 2 quad) (-> a1-2 quad)) - (set! (-> arg0 times 3 quad) (-> a1-2 quad)) - (set! (-> arg0 times 4 quad) (-> a1-2 quad)) + (vector-copy! a1-2 (-> a2-1 lgt-color)) + (vector-copy! (-> arg0 times 2) a1-2) + (vector-copy! (-> arg0 times 3) a1-2) + (vector-copy! (-> arg0 times 4) a1-2) (set! (-> a0-16 0 ambi color quad) (-> v1-26 0 quad)) ) - (set! (-> arg0 current-sky-color quad) (-> arg1 mood-sky-table data s3-0 quad)) + (vector-copy! (-> arg0 current-sky-color) (-> arg1 mood-sky-table data s3-0)) (mem-copy! (the-as pointer (-> arg0 current-fog)) (the-as pointer (-> arg1 mood-fog-table data s3-0)) 48) ) (else @@ -486,9 +486,9 @@ (let ((s0-0 (-> arg0 light-group))) (vector4-lerp! (the-as vector s1-0) (-> sv-32 amb-color) (-> sv-48 amb-color) f30-0) (vector4-lerp! sv-64 (-> sv-32 lgt-color) (-> sv-48 lgt-color) f30-0) - (set! (-> arg0 times 2 quad) (-> sv-64 quad)) - (set! (-> arg0 times 3 quad) (-> sv-64 quad)) - (set! (-> arg0 times 4 quad) (-> sv-64 quad)) + (vector-copy! (-> arg0 times 2) sv-64) + (vector-copy! (-> arg0 times 3) sv-64) + (vector-copy! (-> arg0 times 4) sv-64) (set! (-> s0-0 0 ambi color quad) (-> s1-0 0 quad)) ) ) @@ -589,7 +589,7 @@ (-> *level* level-default mood-context times 1) ) (when arg1 - (set! (-> arg0 times 1 quad) (-> *level* level-default mood-context times 1 quad)) + (vector-copy! (-> arg0 times 1) (-> *level* level-default mood-context times 1)) (set! (-> arg0 times 1 w) 1.0) ) ) @@ -1042,10 +1042,10 @@ (v1-7 (-> arg0 times 1)) ) (set! (-> a1-7 0 quad) (-> (the-as (inline-array vector) (+ a0-6 16)) 0 quad)) - (set! (-> v1-7 quad) (-> (the-as (inline-array vector) (+ a0-6 0)) 0 quad)) - (set! (-> arg0 times 2 quad) (-> v1-7 quad)) - (set! (-> arg0 times 3 quad) (-> v1-7 quad)) - (set! (-> arg0 times 4 quad) (-> v1-7 quad)) + (vector-copy! v1-7 (-> (the-as (inline-array vector) (+ a0-6 0)) 0)) + (vector-copy! (-> arg0 times 2) v1-7) + (vector-copy! (-> arg0 times 3) v1-7) + (vector-copy! (-> arg0 times 4) v1-7) ) ) (else @@ -1056,9 +1056,9 @@ ) (vector4-lerp! (the-as vector a0-14) (the-as vector (+ s3-0 16)) (the-as vector (+ s2-0 16)) f30-0) (vector4-lerp! s4-0 (the-as vector (+ s3-0 0)) (the-as vector (+ s2-0 0)) f30-0) - (set! (-> arg0 times 2 quad) (-> s4-0 quad)) - (set! (-> arg0 times 3 quad) (-> s4-0 quad)) - (set! (-> arg0 times 4 quad) (-> s4-0 quad)) + (vector-copy! (-> arg0 times 2) s4-0) + (vector-copy! (-> arg0 times 3) s4-0) + (vector-copy! (-> arg0 times 4) s4-0) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-mid_REF.gc index f694d3e455f..4ff3f5b589f 100644 --- a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-mid_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-mid_REF.gc @@ -9,9 +9,9 @@ ;; WARN: Return type mismatch int vs none. (defmethod ocean-mid-setup-constants ((this ocean) (arg0 ocean-mid-constants)) (let ((v1-0 *math-camera*)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) + (vector-copy! (-> arg0 inv-hmge-scale) (-> v1-0 inv-hmge-scale)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) ) (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0) @@ -404,18 +404,7 @@ (set! (-> a0-1 base) (&+ (the-as pointer a1-1) 16)) ) (let ((s3-0 (the-as object (-> arg0 base)))) - (let* ((t0-4 (the-as matrix s3-0)) - (t1-2 v1-3) - (a0-2 (-> t1-2 rvec quad)) - (a1-3 (-> t1-2 uvec quad)) - (a3-4 (-> t1-2 fvec quad)) - (t1-3 (-> t1-2 trans quad)) - ) - (set! (-> t0-4 rvec quad) a0-2) - (set! (-> t0-4 uvec quad) a1-3) - (set! (-> t0-4 fvec quad) a3-4) - (set! (-> t0-4 trans quad) t1-3) - ) + (matrix-copy! (the-as matrix s3-0) v1-3) (let ((s2-0 (the-as object (&+ (the-as pointer s3-0) 48)))) (vector-matrix*! s4-0 arg1 v1-3) (set! (-> (the-as vector s2-0) x) (-> s4-0 x)) diff --git a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-near_REF.gc index 3209c66ebd2..aa642b9833b 100644 --- a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-near_REF.gc @@ -39,9 +39,9 @@ ;; WARN: Return type mismatch int vs none. (defmethod ocean-near-setup-constants ((this ocean) (arg0 ocean-near-constants)) (let ((v1-0 *math-camera*)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) - (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) + (vector-copy! (-> arg0 inv-hmge-scale) (-> v1-0 inv-hmge-scale)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) ) (set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526) @@ -440,18 +440,7 @@ (set! (-> v1-6 base) (&+ (the-as pointer a0-1) 16)) ) (let ((s3-0 (the-as object (-> arg0 base)))) - (let* ((v1-7 (the-as matrix s3-0)) - (t0-2 (-> *math-camera* camera-rot)) - (a0-4 (-> t0-2 rvec quad)) - (a1-5 (-> t0-2 uvec quad)) - (a3-4 (-> t0-2 fvec quad)) - (t0-3 (-> t0-2 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-4) - (set! (-> v1-7 uvec quad) a1-5) - (set! (-> v1-7 fvec quad) a3-4) - (set! (-> v1-7 trans quad) t0-3) - ) + (matrix-copy! (the-as matrix s3-0) (-> *math-camera* camera-rot)) (let ((s2-0 (the-as object (&+ (the-as pointer s3-0) 48)))) (vector-matrix*! s4-0 arg1 (-> *math-camera* camera-rot)) (set! (-> (the-as vector s2-0) x) (-> s4-0 x)) diff --git a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-texture_REF.gc b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-texture_REF.gc index c89ad3dbe3e..0cf64b625d8 100644 --- a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-texture_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean-texture_REF.gc @@ -777,7 +777,7 @@ (f30-0 0.015625) ) (let ((s3-0 (-> this cloud-lights))) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (vector--float*! s5-0 arg2 (-> s3-0 sun0-normal) 9.0) (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) (vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0) diff --git a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean_REF.gc b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean_REF.gc index 67f5121a128..6b0c64c1445 100644 --- a/test/decompiler/reference/jak3/engine/gfx/ocean/ocean_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/ocean/ocean_REF.gc @@ -114,7 +114,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (-> this haze-lights)) ) - (set! (-> s3-0 quad) (-> arg1 pos quad)) + (vector-copy! s3-0 (-> arg1 pos)) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (+! (-> s3-0 y) 0.1) @@ -176,11 +176,11 @@ (set! (-> s4-0 3 pos x) f0-8) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-0 colors) (* (+ s1-0 1) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-56 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-52 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-56) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-52) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-0 #t) @@ -222,9 +222,9 @@ (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-1 colors) (* (+ s1-1 1) 4)))) (add-colors! this (-> s4-0 0 col) (-> s4-0 0)) (add-colors! this (-> s4-0 1 col) (-> s4-0 1)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-52 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-52) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-1 #t) @@ -278,11 +278,11 @@ (set! (-> s4-0 3 pos x) f0-9) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-56 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-52 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-56) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-52) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-0 #t) @@ -322,11 +322,11 @@ (set! (-> s4-0 3 pos x) f0-18) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-56) (add-colors! this (-> s4-0 2 col) (-> s4-0 2)) (add-colors! this (-> s4-0 3 col) (-> s4-0 3)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-1 #t) @@ -380,11 +380,11 @@ (set! (-> s4-0 3 pos z) f1-6) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-0 colors) (* 208 (+ s1-0 1))))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-52 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-56 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-52) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-56) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-0 #t) @@ -425,10 +425,10 @@ ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-1 colors) (* 208 (+ s1-1 1))))) (add-colors! this (-> s4-0 0 col) (-> s4-0 0)) - (set! (-> s4-0 1 col quad) (-> sv-52 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 1 col) sv-52) + (vector-copy! (-> s4-0 2 col) sv-56) (add-colors! this (-> s4-0 3 col) (-> s4-0 3)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-1 #t) @@ -482,11 +482,11 @@ (set! (-> s4-0 3 pos z) f1-7) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) - (set! (-> s4-0 1 col quad) (-> sv-52 quad)) - (set! (-> s4-0 2 col quad) (-> sv-56 quad)) - (set! (-> s4-0 3 col quad) (-> sv-56 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) + (vector-copy! (-> s4-0 1 col) sv-52) + (vector-copy! (-> s4-0 2 col) sv-56) + (vector-copy! (-> s4-0 3 col) sv-56) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-0 #t) @@ -526,11 +526,11 @@ (set! (-> s4-0 3 pos z) f1-15) ) (rgba-to-vector! this sv-56 (the-as (pointer int32) (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4)))) - (set! (-> s4-0 0 col quad) (-> sv-52 quad)) + (vector-copy! (-> s4-0 0 col) sv-52) (add-colors! this (-> s4-0 1 col) (-> s4-0 1)) (add-colors! this (-> s4-0 2 col) (-> s4-0 2)) - (set! (-> s4-0 3 col quad) (-> sv-56 quad)) - (set! (-> sv-52 quad) (-> sv-56 quad)) + (vector-copy! (-> s4-0 3 col) sv-56) + (vector-copy! sv-52 sv-56) (cond ((render-ocean-quad s4-0 arg0) (set! s2-1 #t) @@ -575,10 +575,10 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 1.0) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s4-0 quad)) - (set! (-> gp-0 1 col quad) (-> s4-0 quad)) - (set! (-> gp-0 2 col quad) (-> s4-0 quad)) - (set! (-> gp-0 3 col quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 0 col) s4-0) + (vector-copy! (-> gp-0 1 col) s4-0) + (vector-copy! (-> gp-0 2 col) s4-0) + (vector-copy! (-> gp-0 3 col) s4-0) (render-ocean-quad gp-0 arg0) (let ((f0-7 (+ -5898240.0 (-> this start-corner x))) (f1-1 (-> this start-corner z)) @@ -601,8 +601,8 @@ (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 0.0) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) - (set! (-> gp-0 1 col quad) (-> s4-0 quad)) - (set! (-> gp-0 2 col quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 1 col) s4-0) + (vector-copy! (-> gp-0 2 col) s4-0) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) (let ((f0-13 (+ -5898240.0 (-> this start-corner x))) @@ -627,7 +627,7 @@ (set! (-> gp-0 3 pos w) 0.0) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) - (set! (-> gp-0 2 col quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 2 col) s4-0) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) (let ((f0-18 (-> this start-corner x)) @@ -652,8 +652,8 @@ (set! (-> gp-0 3 pos w) 0.5) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) (add-colors! this (-> gp-0 1 col) (-> gp-0 2)) - (set! (-> gp-0 2 col quad) (-> s4-0 quad)) - (set! (-> gp-0 3 col quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 2 col) s4-0) + (vector-copy! (-> gp-0 3 col) s4-0) ) (render-ocean-quad gp-0 arg0) ) @@ -686,10 +686,10 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 1.0) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) + (vector-copy! (-> gp-0 2 col) s3-0) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let ((f0-8 (+ 24772608.0 (-> this start-corner x))) (f1-2 (-> this start-corner z)) @@ -711,10 +711,10 @@ (set! (-> gp-0 1 pos w) 0.0) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let ((f0-14 (+ 18874368.0 (-> this start-corner x))) (f1-5 (+ -5898240.0 (-> this start-corner z))) @@ -738,8 +738,8 @@ (set! (-> gp-0 3 pos w) 0.5) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 2 col) s3-0) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let ((f0-20 (+ 24772608.0 (-> this start-corner x))) (f1-8 (+ -5898240.0 (-> this start-corner z))) @@ -764,7 +764,7 @@ (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 3 col) s3-0) ) (render-ocean-quad gp-0 arg0) ) @@ -797,10 +797,10 @@ (set! (-> gp-0 1 pos w) 1.0) (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) + (vector-copy! (-> gp-0 2 col) s3-0) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let* ((f0-8 (+ -5898240.0 (-> this start-corner x))) (f1-3 (+ 18874368.0 (-> this start-corner z))) @@ -821,8 +821,8 @@ (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 0.0) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 1 col) s3-0) + (vector-copy! (-> gp-0 2 col) s3-0) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) (let* ((f0-14 (+ -5898240.0 (-> this start-corner x))) @@ -844,7 +844,7 @@ (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.0) (add-colors! this (-> gp-0 0 col) (-> gp-0 0)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 1 col) s3-0) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) @@ -866,8 +866,8 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.0) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) ) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) @@ -902,10 +902,10 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 0.5) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) - (set! (-> gp-0 2 col quad) (-> s3-0 quad)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) + (vector-copy! (-> gp-0 2 col) s3-0) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let* ((f0-9 (+ 24772608.0 (-> this start-corner x))) (f1-4 (+ 18874368.0 (-> this start-corner z))) @@ -925,10 +925,10 @@ (set! (-> gp-0 1 pos w) 0.0) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.5) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) - (set! (-> gp-0 3 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 3 col) s3-0) (render-ocean-quad gp-0 arg0) (let* ((f0-15 (+ 18874368.0 (-> this start-corner x))) (f1-7 (+ 24772608.0 (-> this start-corner z))) @@ -948,8 +948,8 @@ (set! (-> gp-0 1 pos w) 0.5) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.0) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) - (set! (-> gp-0 1 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) + (vector-copy! (-> gp-0 1 col) s3-0) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) (add-colors! this (-> gp-0 3 col) (-> gp-0 3)) (render-ocean-quad gp-0 arg0) @@ -971,7 +971,7 @@ (set! (-> gp-0 1 pos w) 0.0) (set! (-> gp-0 2 pos w) 0.0) (set! (-> gp-0 3 pos w) 0.0) - (set! (-> gp-0 0 col quad) (-> s3-0 quad)) + (vector-copy! (-> gp-0 0 col) s3-0) ) (add-colors! this (-> gp-0 1 col) (-> gp-0 1)) (add-colors! this (-> gp-0 2 col) (-> gp-0 2)) @@ -1332,8 +1332,8 @@ ) (let ((v1-20 (new 'stack-no-clear 'vector))) (if (-> *time-of-day-context* use-camera-other) - (set! (-> v1-20 quad) (-> *math-camera* inv-camera-rot-other fvec quad)) - (set! (-> v1-20 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! v1-20 (-> *math-camera* inv-camera-rot-other fvec)) + (vector-copy! v1-20 (-> *math-camera* inv-camera-rot fvec)) ) (cond ((< (fabs (-> v1-20 z)) (fabs (-> v1-20 x))) diff --git a/test/decompiler/reference/jak3/engine/gfx/shrub/shrubbery_REF.gc b/test/decompiler/reference/jak3/engine/gfx/shrub/shrubbery_REF.gc index 7f732a746a1..94a90c0e9a1 100644 --- a/test/decompiler/reference/jak3/engine/gfx/shrub/shrubbery_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/shrub/shrubbery_REF.gc @@ -273,18 +273,7 @@ ;; INFO: Used lq/sq (defun shrub-make-perspective-matrix ((arg0 matrix) (arg1 matrix)) "Create shrub drawing matrix." - (let* ((v1-0 arg0) - (t0-0 arg1) - (a1-1 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a1-1) - (set! (-> v1-0 uvec quad) a2-0) - (set! (-> v1-0 fvec quad) a3-0) - (set! (-> v1-0 trans quad) t0-1) - ) + (matrix-copy! arg0 arg1) (let ((f0-1 (/ 1.0 (-> *math-camera* pfog0)))) (set! (-> arg0 rvec w) (* (-> arg0 rvec w) f0-1)) (set! (-> arg0 uvec w) (* (-> arg0 uvec w) f0-1)) @@ -1203,7 +1192,3 @@ ;; definition for function move-test-func ;; ERROR: function was not converted to expressions. Cannot decompile. - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/sky/sky-data_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sky/sky-data_REF.gc index 51899978132..dcd8eda965e 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sky/sky-data_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sky/sky-data_REF.gc @@ -856,7 +856,7 @@ (fmin (cos (* 182.04445 (* 10.0 (-> s3-0 pos x)))) (cos (* 182.04445 (* 10.0 (-> s3-0 pos z))))) ) (set-vector! (-> s3-0 stq) (* 0.25 (the float (+ s4-0 -4))) (* 0.25 (the float (+ s5-0 -4))) 1.0 1.0) - (set! (-> s3-0 nrm quad) (-> s3-0 pos quad)) + (vector-copy! (-> s3-0 nrm) (-> s3-0 pos)) (+! (-> s3-0 nrm y) 1.0) (vector-normalize! (-> s3-0 nrm) 1.0) (vector-negate! (-> s3-0 nrm2) (-> s3-0 nrm)) @@ -1045,7 +1045,7 @@ (set! (-> s4-0 pos x) (* 9.0 (sin (* 182.04445 (* 10.0 (the float s5-0)))))) (set! (-> s4-0 pos z) (* 9.0 (cos (* 182.04445 (* 10.0 (the float s5-0)))))) (set! (-> s4-0 pos y) 0.0) - (set! (-> s4-0 nrm quad) (-> s4-0 pos quad)) + (vector-copy! (-> s4-0 nrm) (-> s4-0 pos)) (+! (-> s4-0 nrm y) 1.0) (vector-normalize! (-> s4-0 nrm) 1.0) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sky/sky-tng_REF.gc index 7affb7663d3..b13f515d8d6 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sky/sky-tng_REF.gc @@ -56,18 +56,7 @@ (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((v1-0 (-> this cam-mat))) - (let* ((a0-1 v1-0) - (t0-0 arg0) - (a1-1 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> a0-1 rvec quad) a1-1) - (set! (-> a0-1 uvec quad) a2-0) - (set! (-> a0-1 fvec quad) a3-0) - (set! (-> a0-1 trans quad) t0-1) - ) + (matrix-copy! v1-0 arg0) (.svf (&-> v1-0 trans quad) vf0) (matrix*! v1-0 v1-0 (-> *math-camera* perspective)) ) @@ -85,8 +74,8 @@ (a0-2 (-> *level* level-default mood-context current-sky-color)) ) (dotimes (a1-1 12) - (set! (-> sky-base-polygons a1-1 col quad) (-> v1-1 quad)) - (set! (-> sky-roof-polygons a1-1 col quad) (-> a0-2 quad)) + (vector-copy! (-> sky-base-polygons a1-1 col) v1-1) + (vector-copy! (-> sky-roof-polygons a1-1 col) a0-2) ) ) 0 @@ -140,7 +129,7 @@ ) (cond ((= a0-7 v1-7) - (set! (-> this sun0-color quad) (-> s5-0 data a0-7 lgt-color quad)) + (vector-copy! (-> this sun0-color) (-> s5-0 data a0-7 lgt-color)) ) (else (let ((a1-5 (-> s5-0 data a0-7)) @@ -151,14 +140,14 @@ ) ) ) - (set! (-> this sun0-color-lower quad) (-> s3-0 times 1 quad)) - (set! (-> this ambi-color-lower quad) (-> s3-0 times 0 quad)) + (vector-copy! (-> this sun0-color-lower) (-> s3-0 times 1)) + (vector-copy! (-> this ambi-color-lower) (-> s3-0 times 0)) (set-vector! s4-0 1.9921875 1.9921875 1.9921875 1.0) (vector4-lerp! (-> this ambi-color) (-> this ambi-color-lower) s4-0 (-> *mood-control* lightning-flash)) ) - (set! (-> this sun0-color quad) (-> this sun0-color quad)) - (set! (-> this sun1-color quad) (-> s5-0 data 7 lgt-color quad)) - (set! (-> this moon-color quad) (-> s5-0 data 6 lgt-color quad)) + (vector-copy! (-> this sun0-color) (-> this sun0-color)) + (vector-copy! (-> this sun1-color) (-> s5-0 data 7 lgt-color)) + (vector-copy! (-> this moon-color) (-> s5-0 data 6 lgt-color)) ) 0 (none) @@ -200,7 +189,7 @@ (f28-0 0.00390625) (f30-0 0.015625) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (vector--float*! (the-as vector s5-0) arg2 (-> arg3 sun0-normal) 9.0) (vector--float*! (the-as vector s2-0) arg2 (-> arg3 sun1-normal) 9.0) (vector--float*! (the-as vector s4-0) arg2 (-> arg3 moon-normal) 9.0) @@ -223,7 +212,7 @@ ) (set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0)) (set! (-> s4-0 sun1-normal quad) (-> (&-> this upload-data data 4) 0)) - (set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad)) + (vector-copy! (-> s4-0 moon-normal) (-> this upload-data moon pos)) (vector-normalize! (-> s4-0 sun0-normal) 1.0) (vector-normalize! (-> s4-0 sun1-normal) 1.0) (vector-normalize! (-> s4-0 moon-normal) 1.0) @@ -413,7 +402,7 @@ ) (set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0)) (set! (-> s4-0 sun1-normal quad) (-> (&-> this upload-data data 4) 0)) - (set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad)) + (vector-copy! (-> s4-0 moon-normal) (-> this upload-data moon pos)) (vector-normalize! (-> s4-0 sun0-normal) 1.0) (vector-normalize! (-> s4-0 sun1-normal) 1.0) (vector-normalize! (-> s4-0 moon-normal) 1.0) diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/light-trails_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/light-trails_REF.gc index 7c63346bfbb..a8676aa7c6c 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/light-trails_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/light-trails_REF.gc @@ -79,7 +79,7 @@ (if (-> this appearance use-tape-mode?) (set! f0-5 (- f2-0 f1-2)) ) - (set! (-> a1-5 pos quad) (-> arg0 quad)) + (vector-copy! (-> a1-5 pos) arg0) (set! (-> a1-5 birth-time) (the-as uint (the int (- (the float (+ (-> this start-marker) arg1)) f0-5)))) ) (mem-copy! @@ -128,7 +128,7 @@ (if (-> this appearance use-tape-mode?) (set! f0-4 (- f2-0 f1-3)) ) - (set! (-> gp-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 pos) arg0) (set! (-> gp-0 birth-time) (the-as uint @@ -150,7 +150,7 @@ (defmethod add-vert-to-prim-strip! ((this light-trail) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) "Add a single vertex to the prim." (let ((v1-3 (-> arg0 data (-> arg0 num-verts)))) - (set! (-> v1-3 pos quad) (-> arg1 quad)) + (vector-copy! (-> v1-3 pos) arg1) (set! (-> v1-3 col) arg2) (set! (-> v1-3 stq x) arg3) (set! (-> v1-3 stq y) arg4) @@ -170,7 +170,7 @@ (cond ((= (-> this appearance lie-mode) (lie-mode use-two-strips)) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> this cache-vector 0 quad)) + (vector-copy! s1-0 (-> this cache-vector 0)) (vector-normalize! s1-0 (/ arg2 2)) (add-vert-to-prim-strip! this @@ -190,7 +190,7 @@ ) ) (let ((s1-1 (new 'stack-no-clear 'vector))) - (set! (-> s1-1 quad) (-> this cache-vector 1 quad)) + (vector-copy! s1-1 (-> this cache-vector 1)) (vector-normalize! s1-1 (/ arg2 2)) (add-vert-to-prim-strip! this @@ -212,7 +212,7 @@ ) (else (let ((s1-2 (new 'stack-no-clear 'vector))) - (set! (-> s1-2 quad) (-> arg3 quad)) + (vector-copy! s1-2 arg3) (vector-normalize! s1-2 (/ arg2 2)) (add-vert-to-prim-strip! this @@ -318,7 +318,7 @@ (vector-cross! arg3 v1-0 (-> this appearance lie-vector)) (set! (-> arg3 y) 0.0) (vector-cross! arg3 v1-0 arg3) - (set! (-> this cache-vector 1 quad) (-> arg3 quad)) + (vector-copy! (-> this cache-vector 1) arg3) ) ) ) @@ -593,10 +593,10 @@ ) ) (set! sv-92 sv-152) - (set! (-> sv-104 quad) (-> (the-as vector (&+ (the-as (pointer uint8) s4-1) 0)) quad)) + (vector-copy! sv-104 (the-as vector (&+ (the-as (pointer uint8) s4-1) 0))) (set! sv-96 sv-196) (set! (-> sv-100 quad) (-> sv-200 quad)) - (set! (-> sv-132 quad) (-> sv-204 quad)) + (vector-copy! sv-132 sv-204) ) ) ) @@ -829,7 +829,7 @@ ) ) (if a0-2 - (set! (-> arg1 quad) (-> (get-trans a0-2 0) quad)) + (vector-copy! arg1 (get-trans a0-2 0)) ) ) arg1 @@ -851,7 +851,7 @@ (when a0-2 (let ((s5-1 (-> a0-2 water))) (when (and s5-1 a0-2 (nonzero? s5-1)) - (set! (-> arg1 quad) (-> (get-trans a0-2 0) quad)) + (vector-copy! arg1 (get-trans a0-2 0)) (set! (-> arg1 y) (+ 40.96 (-> s5-1 surface-height))) ) ) @@ -918,7 +918,7 @@ (defmethod get-tracked-object-pos ((this light-trail-tracker-projectile) (arg0 process-focusable) (arg1 vector)) (let ((a0-1 arg0)) (if a0-1 - (set! (-> arg1 quad) (-> a0-1 root trans quad)) + (vector-copy! arg1 (-> a0-1 root trans)) ) ) arg1 @@ -1081,7 +1081,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. (defmethod calc-vertex-pos! ((this weapon-trail) (arg0 light-trail-breadcrumb) (arg1 int) (arg2 vector) (arg3 vector)) - (set! (-> arg3 quad) (-> (&+ arg0 16) pos quad)) + (vector-copy! arg3 (-> (&+ arg0 16) pos)) (none) ) @@ -1161,8 +1161,8 @@ (if (-> this appearance use-tape-mode?) (set! f0-6 (- f2-0 f1-2)) ) - (set! (-> gp-0 pos quad) (-> s3-0 quad)) - (set! (-> gp-0 offset quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 pos) s3-0) + (vector-copy! (-> gp-0 offset) s4-0) (set! (-> gp-0 birth-time) (the-as uint @@ -1199,7 +1199,7 @@ ) (vector-float*! arg3 arg3 arg2) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> arg3 quad)) + (vector-copy! s2-0 arg3) (add-vert-to-prim-strip! this (-> this strip) @@ -1311,7 +1311,7 @@ (if (-> this appearance use-tape-mode?) (set! f0-4 (- f2-0 f1-3)) ) - (set! (-> s5-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 pos) arg0) (set! (-> s5-0 birth-time) (the-as uint @@ -1319,7 +1319,7 @@ ) ) ) - (set! (-> s5-0 normal quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 normal) arg1) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index fbf263df3d0..058d5418b35 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -517,7 +517,7 @@ (let ((a3-5 (-> v1-0 queue (-> v1-0 in-use)))) (set! (-> a3-5 sp-system) arg0) (set! (-> a3-5 sp-launcher) arg1) - (set! (-> a3-5 pos quad) (-> arg2 trans quad)) + (vector-copy! (-> a3-5 pos) (-> arg2 trans)) ) (let ((v0-1 (+ (-> v1-0 in-use) 1))) (set! (-> v1-0 in-use) v0-1) @@ -832,7 +832,7 @@ (when (> (-> gp-0 in-use) 0) (dotimes (s4-0 (-> gp-0 in-use)) (let ((v1-4 (-> gp-0 queue s4-0))) - (set! (-> s5-0 trans quad) (-> v1-4 pos quad)) + (vector-copy! (-> s5-0 trans) (-> v1-4 pos)) (launch-particles :system (-> v1-4 sp-system) (-> v1-4 sp-launcher) s5-0 :origin-is-matrix #t) ) ) @@ -868,18 +868,7 @@ (quaternion->matrix sv-96 (-> arg2 key proc root quat)) ) ((logtest? (-> arg2 key group flags) (sp-group-flag sp12)) - (let* ((v1-17 sv-96) - (a3-1 (-> arg2 key local-space-binding mat-new)) - (a0-5 (-> a3-1 rvec quad)) - (a1-2 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-17 rvec quad) a0-5) - (set! (-> v1-17 uvec quad) a1-2) - (set! (-> v1-17 fvec quad) a2-1) - (set! (-> v1-17 trans quad) a3-2) - ) + (matrix-copy! sv-96 (-> arg2 key local-space-binding mat-new)) ) (else (set! s3-0 #f) @@ -1282,17 +1271,9 @@ (a0-13 (-> (the-as particle-local-space-info a1-0) next0)) ) (while (!= a1-0 (-> v1-7 alive-list-end)) - (let* ((a2-0 (-> (the-as particle-local-space-info a1-0) mat-prev)) - (t1-0 (-> (the-as particle-local-space-info a1-0) mat-new)) - (a1-1 (-> t1-0 rvec quad)) - (a3-0 (-> t1-0 uvec quad)) - (t0-0 (-> t1-0 fvec quad)) - (t1-1 (-> t1-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) a1-1) - (set! (-> a2-0 uvec quad) a3-0) - (set! (-> a2-0 fvec quad) t0-0) - (set! (-> a2-0 trans quad) t1-1) + (matrix-copy! + (-> (the-as particle-local-space-info a1-0) mat-prev) + (-> (the-as particle-local-space-info a1-0) mat-new) ) (set! a1-0 a0-13) (set! a0-13 (-> a0-13 next0)) @@ -1316,20 +1297,10 @@ (cond ((logtest? (-> arg0 flags) (part-local-space-flags pls0)) (matrix-identity! gp-0) - (set! (-> gp-0 trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> gp-0 trans) (-> s5-0 trans)) ) ((logtest? (-> arg0 flags) (part-local-space-flags pls1)) - (let ((a2-0 gp-0) - (v1-7 (-> s5-0 rvec quad)) - (a0-4 (-> s5-0 uvec quad)) - (a1-0 (-> s5-0 fvec quad)) - (a3-0 (-> s5-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-7) - (set! (-> a2-0 uvec quad) a0-4) - (set! (-> a2-0 fvec quad) a1-0) - (set! (-> a2-0 trans quad) a3-0) - ) + (matrix-copy! gp-0 s5-0) (set! (-> gp-0 rvec y) 0.0) (set! (-> gp-0 fvec y) 0.0) (vector-normalize! (-> gp-0 rvec) 1.0) @@ -1337,17 +1308,7 @@ (vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec)) ) (else - (let* ((a2-1 s5-0) - (v1-10 (-> a2-1 rvec quad)) - (a0-8 (-> a2-1 uvec quad)) - (a1-4 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-10) - (set! (-> gp-0 uvec quad) a0-8) - (set! (-> gp-0 fvec quad) a1-4) - (set! (-> gp-0 trans quad) a2-2) - ) + (matrix-copy! gp-0 s5-0) ) ) ) @@ -1368,20 +1329,10 @@ (cond ((logtest? (-> arg0 flags) (part-local-space-flags pls0)) (matrix-identity! gp-0) - (set! (-> gp-0 trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> gp-0 trans) (-> s5-0 trans)) ) ((logtest? (-> arg0 flags) (part-local-space-flags pls1)) - (let ((a2-2 gp-0) - (v1-14 (-> s5-0 rvec quad)) - (a0-4 (-> s5-0 uvec quad)) - (a1-5 (-> s5-0 fvec quad)) - (a3-0 (-> s5-0 trans quad)) - ) - (set! (-> a2-2 rvec quad) v1-14) - (set! (-> a2-2 uvec quad) a0-4) - (set! (-> a2-2 fvec quad) a1-5) - (set! (-> a2-2 trans quad) a3-0) - ) + (matrix-copy! gp-0 s5-0) (set! (-> gp-0 rvec y) 0.0) (set! (-> gp-0 fvec y) 0.0) (vector-normalize! (-> gp-0 rvec) 1.0) @@ -1389,17 +1340,7 @@ (vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec)) ) (else - (let* ((a2-3 s5-0) - (v1-17 (-> a2-3 rvec quad)) - (a0-8 (-> a2-3 uvec quad)) - (a1-9 (-> a2-3 fvec quad)) - (a2-4 (-> a2-3 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-17) - (set! (-> gp-0 uvec quad) a0-8) - (set! (-> gp-0 fvec quad) a1-9) - (set! (-> gp-0 trans quad) a2-4) - ) + (matrix-copy! gp-0 s5-0) ) ) ) @@ -1413,18 +1354,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defmethod spawn-from-mat ((this sparticle-launch-control) (arg0 matrix)) - (let* ((a2-0 (-> this origin)) - (a3-0 arg0) - (v1-0 (-> a3-0 rvec quad)) - (a0-1 (-> a3-0 uvec quad)) - (a1-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-0) - (set! (-> a2-0 uvec quad) a0-1) - (set! (-> a2-0 fvec quad) a1-1) - (set! (-> a2-0 trans quad) a3-1) - ) + (matrix-copy! (-> this origin) arg0) (let ((s4-0 (-> this group))) (when (logtest? (-> s4-0 flags) (sp-group-flag sp6)) (let ((f0-0 (-> s4-0 rotate-x)) @@ -1462,18 +1392,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defmethod spawn-from-cspace ((this sparticle-launch-control) (arg0 cspace)) - (let* ((v1-0 (-> this origin)) - (a3-0 (-> arg0 bone transform)) - (a0-2 (-> a3-0 rvec quad)) - (a1-1 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-2) - (set! (-> v1-0 uvec quad) a1-1) - (set! (-> v1-0 fvec quad) a2-0) - (set! (-> v1-0 trans quad) a3-1) - ) + (matrix-copy! (-> this origin) (-> arg0 bone transform)) (let ((s4-0 (-> this group))) (when (logtest? (-> s4-0 flags) (sp-group-flag sp6)) (let ((f0-0 (-> s4-0 rotate-x)) @@ -1512,7 +1431,7 @@ ;; WARN: Return type mismatch int vs object. (defmethod spawn ((this sparticle-launch-control) (arg0 vector)) (with-pp - (set! (-> this origin trans quad) (-> arg0 quad)) + (vector-copy! (-> this origin trans) arg0) (if (not (or (is-visible? this arg0) (logtest? (-> this group flags) (sp-group-flag sp1 sp2)) (and (logtest? (-> this group flags) (sp-group-flag sp2 sp11)) @@ -1522,20 +1441,9 @@ ) (return (the-as object 0)) ) - (when (logtest? (-> this group flags) (sp-group-flag sp12)) - (let* ((v1-18 (-> this origin)) - (a3-0 (-> this local-space-binding mat-prev)) - (a0-5 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-18 rvec quad) a0-5) - (set! (-> v1-18 uvec quad) a1-2) - (set! (-> v1-18 fvec quad) a2-0) - (set! (-> v1-18 trans quad) a3-1) + (if (logtest? (-> this group flags) (sp-group-flag sp12)) + (matrix-copy! (-> this origin) (-> this local-space-binding mat-prev)) ) - ) (let ((s4-0 (the-as int (current-time))) (s5-0 (-> this last-spawn-time)) ) @@ -1612,7 +1520,7 @@ ) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> a3-2 center quad)) + (vector-copy! (-> a2-5 trans) (-> a3-2 center)) (t9-4 a0-37 a1-5 a2-5 a3-2 this f0-5) ) ) @@ -1696,7 +1604,7 @@ ) (a2-23 *launch-matrix*) ) - (set! (-> a2-23 trans quad) (-> a3-2 center quad)) + (vector-copy! (-> a2-23 trans) (-> a3-2 center)) (t9-6 a0-82 a1-5 a2-23 a3-2 this f0-5) ) ) @@ -1743,21 +1651,10 @@ (set! sv-104 (the-as int (-> (the-as connection v1-1) param0))) (when (nonzero? sv-96) (let ((a1-8 (-> a0-2 node-list data sv-104))) - (let* ((v1-7 s3-0) - (t0-0 (-> a1-8 bone transform)) - (a0-5 (-> t0-0 rvec quad)) - (a2-2 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-5) - (set! (-> v1-7 uvec quad) a2-2) - (set! (-> v1-7 fvec quad) a3-0) - (set! (-> v1-7 trans quad) t0-1) - ) + (matrix-copy! s3-0 (-> a1-8 bone transform)) (vector<-cspace! (-> s3-0 trans) a1-8) ) - (set! (-> s2-0 quad) (-> (the-as vector s0-0) quad)) + (vector-copy! s2-0 (the-as vector s0-0)) (set! (-> s2-0 w) 1.0) (vector-matrix*! (-> s3-0 trans) s2-0 s3-0) (launch-particles :system gp-0 sv-96 s3-0 :origin-is-matrix #t) @@ -1795,7 +1692,7 @@ (a0-25 gp-0) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> (the-as vector (&-> s0-1 param0)) quad)) + (vector-copy! (-> a2-5 trans) (the-as vector (&-> s0-1 param0))) (t9-5 a0-25 (the-as sparticle-launcher a1-14) @@ -1903,7 +1800,7 @@ (init-vf0-vector) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 vel-sxvel quad)) + (vector-copy! s5-0 (-> arg1 vel-sxvel)) (let ((s4-0 (-> arg1 key proc))) (vector-normalize! s5-0 1.0) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -2163,7 +2060,7 @@ (a1-3 (-> *part-id-table* (-> gp-0 s5-1))) (a2-1 *launch-matrix*) ) - (set! (-> a2-1 trans quad) (-> s2-0 quad)) + (vector-copy! (-> a2-1 trans) s2-0) (t9-1 a0-2 a1-3 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (+! s5-1 1) @@ -2203,7 +2100,7 @@ (a1-3 (-> *part-id-table* (-> gp-0 s2-1))) (a2-1 *launch-matrix*) ) - (set! (-> a2-1 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a2-1 trans) s4-0) (t9-1 a0-2 a1-3 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (+! s2-1 1) @@ -2943,7 +2840,7 @@ (let ((a0-1 (math-camera-matrix)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> a0-1 rvec quad)) + (vector-copy! s5-0 (-> a0-1 rvec)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (let ((a1-3 (matrix-fr-compose (new 'stack-no-clear 'matrix) s5-0 *up-vector*)) @@ -2978,7 +2875,7 @@ (defmethod init-with-vec! ((this sparticle-subsampler) (arg0 vector)) (let ((f30-0 (-> this spt-num))) (when (not (-> this inited?)) - (set! (-> this spawn-mat trans quad) (-> arg0 quad)) + (vector-copy! (-> this spawn-mat trans) arg0) (set! (-> this inited?) #t) (set! f30-0 0.000000000000000000000000000000000000000000001) ) @@ -2986,18 +2883,7 @@ (let ((f28-0 (/ 1.0 f30-0))) 0.0 (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 s4-0) - (a3-0 (-> this spawn-mat)) - (v1-8 (-> a3-0 rvec quad)) - (a0-3 (-> a3-0 uvec quad)) - (a1-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-8) - (set! (-> a2-0 uvec quad) a0-3) - (set! (-> a2-0 fvec quad) a1-1) - (set! (-> a2-0 trans quad) a3-1) - ) + (matrix-copy! s4-0 (-> this spawn-mat)) (dotimes (s3-0 (the int f30-0)) (let ((f0-5 (* f28-0 (the float s3-0)))) (vector-lerp! (-> s4-0 trans) arg0 (-> this spawn-mat trans) f0-5) @@ -3008,7 +2894,7 @@ ) ) (let ((v0-2 (-> this spawn-mat trans))) - (set! (-> v0-2 quad) (-> arg0 quad)) + (vector-copy! v0-2 arg0) v0-2 ) ) @@ -3017,36 +2903,14 @@ ;; INFO: Used lq/sq (defmethod init-with-mat! ((this sparticle-subsampler) (arg0 matrix)) (when (not (-> this inited?)) - (let* ((a2-0 (-> this spawn-mat)) - (a3-0 arg0) - (v1-2 (-> a3-0 rvec quad)) - (a0-1 (-> a3-0 uvec quad)) - (a1-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-0 rvec quad) v1-2) - (set! (-> a2-0 uvec quad) a0-1) - (set! (-> a2-0 fvec quad) a1-1) - (set! (-> a2-0 trans quad) a3-1) - ) + (matrix-copy! (-> this spawn-mat) arg0) (set! (-> this inited?) #t) ) (set! (-> this sp-launcher birthaccum) 0.0) (let ((f30-0 (/ 1.0 (-> this spt-num)))) 0.0 (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-1 s4-0) - (a3-2 arg0) - (v1-6 (-> a3-2 rvec quad)) - (a0-2 (-> a3-2 uvec quad)) - (a1-2 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-6) - (set! (-> a2-1 uvec quad) a0-2) - (set! (-> a2-1 fvec quad) a1-2) - (set! (-> a2-1 trans quad) a3-3) - ) + (matrix-copy! s4-0 arg0) (dotimes (s3-0 (the int (-> this spt-num))) (let ((f0-5 (* f30-0 (the float s3-0)))) (vector-lerp! (-> s4-0 trans) (-> arg0 trans) (-> this spawn-mat trans) f0-5) @@ -3055,19 +2919,7 @@ ) ) ) - (let ((v0-2 (-> this spawn-mat))) - (let ((v1-10 (-> arg0 rvec quad)) - (a0-5 (-> arg0 uvec quad)) - (a1-5 (-> arg0 fvec quad)) - (a2-4 (-> arg0 trans quad)) - ) - (set! (-> v0-2 rvec quad) v1-10) - (set! (-> v0-2 uvec quad) a0-5) - (set! (-> v0-2 fvec quad) a1-5) - (set! (-> v0-2 trans quad) a2-4) - ) - v0-2 - ) + (matrix-copy! (-> this spawn-mat) arg0) ) ;; definition for function spt-func-relative-pos @@ -3110,30 +2962,8 @@ (set! sv-276 (new 'stack-no-clear 'matrix)) (set! sv-280 (new 'stack-no-clear 'matrix)) (set! sv-284 (new 'stack-no-clear 'matrix)) - (let* ((a2-1 sv-280) - (a3-0 sv-268) - (v1-12 (-> a3-0 rvec quad)) - (a0-4 (-> a3-0 uvec quad)) - (a1-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> a2-1 rvec quad) v1-12) - (set! (-> a2-1 uvec quad) a0-4) - (set! (-> a2-1 fvec quad) a1-1) - (set! (-> a2-1 trans quad) a3-1) - ) - (let* ((a2-2 sv-284) - (a3-2 sv-272) - (v1-13 (-> a3-2 rvec quad)) - (a0-5 (-> a3-2 uvec quad)) - (a1-2 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-2 rvec quad) v1-13) - (set! (-> a2-2 uvec quad) a0-5) - (set! (-> a2-2 fvec quad) a1-2) - (set! (-> a2-2 trans quad) a3-3) - ) + (matrix-copy! sv-280 sv-268) + (matrix-copy! sv-284 sv-272) (dotimes (s4-0 3) (vector-normalize! (the-as vector (&-> sv-280 quad s4-0)) 1.0) (vector-normalize! (the-as vector (&-> sv-284 quad s4-0)) 1.0) @@ -3175,7 +3005,7 @@ (init-vf0-vector) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 vel-sxvel quad)) + (vector-copy! s5-0 (-> arg1 vel-sxvel)) (let ((s3-0 (-> arg1 key proc))) (vector-normalize! s5-0 1.0) (let ((s4-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/simple-sprite-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/simple-sprite-h_REF.gc index 72c40b2c347..3ba290d35c1 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/simple-sprite-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/simple-sprite-h_REF.gc @@ -48,7 +48,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-trans ((this sprite-glow-data) (arg0 vector)) (let ((f0-0 (-> this position w))) - (set! (-> this position quad) (-> arg0 quad)) + (vector-copy! (-> this position) arg0) (set! (-> this position w) f0-0) ) 0 diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-glow_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-glow_REF.gc index 69bb72fe66c..621a7518185 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-glow_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite-glow_REF.gc @@ -316,32 +316,10 @@ (defun sprite-glow-init-consts ((arg0 sprite-glow-consts)) "Fill out sprite-glow-consts to be sent to VU1." (let ((v1-0 *math-camera*)) - (let* ((t0-0 (-> arg0 camera)) - (t1-0 (-> v1-0 camera-rot)) - (a1-0 (-> t1-0 rvec quad)) - (a2-0 (-> t1-0 uvec quad)) - (a3-0 (-> t1-0 fvec quad)) - (t1-1 (-> t1-0 trans quad)) - ) - (set! (-> t0-0 rvec quad) a1-0) - (set! (-> t0-0 uvec quad) a2-0) - (set! (-> t0-0 fvec quad) a3-0) - (set! (-> t0-0 trans quad) t1-1) - ) - (let* ((t0-1 (-> arg0 perspective)) - (t1-2 (-> v1-0 perspective)) - (a1-1 (-> t1-2 rvec quad)) - (a2-1 (-> t1-2 uvec quad)) - (a3-1 (-> t1-2 fvec quad)) - (t1-3 (-> t1-2 trans quad)) - ) - (set! (-> t0-1 rvec quad) a1-1) - (set! (-> t0-1 uvec quad) a2-1) - (set! (-> t0-1 fvec quad) a3-1) - (set! (-> t0-1 trans quad) t1-3) - ) - (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) - (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (matrix-copy! (-> arg0 camera) (-> v1-0 camera-rot)) + (matrix-copy! (-> arg0 perspective) (-> v1-0 perspective)) + (vector-copy! (-> arg0 hvdf-offset) (-> v1-0 hvdf-off)) + (vector-copy! (-> arg0 hmge-scale) (-> v1-0 hmge-scale)) (set! (-> arg0 basis-x quad) (the-as uint128 0)) (set! (-> arg0 basis-x x) (- (-> *math-camera* perspective rvec x))) (set! (-> arg0 basis-y quad) (the-as uint128 0)) diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite_REF.gc index 31d3174de6d..d174ed8bd8c 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite_REF.gc @@ -280,8 +280,8 @@ The glow and distort renderers will pull sprites from here." ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. (defun sprite-setup-frame-data ((arg0 sprite-frame-data) (arg1 uint)) - (set! (-> arg0 hmge-scale quad) (-> *math-camera* hmge-scale quad)) - (set! (-> arg0 inv-hmge-scale quad) (-> *math-camera* inv-hmge-scale quad)) + (vector-copy! (-> arg0 hmge-scale) (-> *math-camera* hmge-scale)) + (vector-copy! (-> arg0 inv-hmge-scale) (-> *math-camera* inv-hmge-scale)) (set! (-> arg0 consts x) (-> *math-camera* pfog0)) (set! (-> arg0 consts y) 0.000095873795) (set! (-> arg0 adgif-giftag tag) (new 'static 'gif-tag64 :nloop #x1 :nreg #x5)) @@ -540,18 +540,7 @@ The glow and distort renderers will pull sprites from here." (set! (-> a2-1 vif1) (new 'static 'vif-tag :num #x5 :cmd (vif-cmd unpack-v4-32) :imm (shr (shl v1-0 54) 54))) (set! (-> a1-1 base) (the-as pointer (&+ a2-1 16))) ) - (let* ((a1-2 (the-as matrix (-> arg0 base))) - (t1-0 (-> *math-camera* camera-temp)) - (a2-4 (-> t1-0 rvec quad)) - (a3-4 (-> t1-0 uvec quad)) - (t0-4 (-> t1-0 fvec quad)) - (t1-1 (-> t1-0 trans quad)) - ) - (set! (-> a1-2 rvec quad) a2-4) - (set! (-> a1-2 uvec quad) a3-4) - (set! (-> a1-2 fvec quad) t0-4) - (set! (-> a1-2 trans quad) t1-1) - ) + (matrix-copy! (-> arg0 base) (-> *math-camera* camera-temp)) (&+! (-> arg0 base) 64) (let ((v1-1 (+ v1-0 4))) (set! (-> (the-as (pointer uint128) (-> arg0 base))) (-> *math-camera* hvdf-off quad)) @@ -587,7 +576,7 @@ The glow and distort renderers will pull sprites from here." (&+! (-> arg0 base) 64) (let ((v1-2 (+ v1-0 4))) (let ((a1-16 (the-as vector (-> arg0 base)))) - (set! (-> a1-16 quad) (-> *math-camera* hvdf-off quad)) + (vector-copy! a1-16 (-> *math-camera* hvdf-off)) (set! (-> a1-16 x) 2048.0) (set! (-> a1-16 y) 2048.0) (set! (-> a1-16 z) (-> *math-camera* hvdf-off z)) diff --git a/test/decompiler/reference/jak3/engine/level/level-h_REF.gc b/test/decompiler/reference/jak3/engine/level/level-h_REF.gc index 2a65674d5d3..e7d982da228 100644 --- a/test/decompiler/reference/jak3/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/level-h_REF.gc @@ -678,7 +678,7 @@ (update-vis-volumes (_type_) none) (level-group-method-24 (_type_) none) (print-volume-sizes (_type_) none) - (status-of-level-and-borrows (_type_ symbol symbol) symbol) + (level-status? (_type_ symbol symbol) symbol) (do-nothing (_type_) none) (load-in-progress? (_type_) symbol) (is-load-allowed? (_type_ (pointer symbol)) symbol) diff --git a/test/decompiler/reference/jak3/engine/level/level_REF.gc b/test/decompiler/reference/jak3/engine/level/level_REF.gc index dae4718ef5a..34427529034 100644 --- a/test/decompiler/reference/jak3/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/level_REF.gc @@ -479,7 +479,7 @@ ) ;; definition for method 26 of type level-group -(defmethod status-of-level-and-borrows ((this level-group) (arg0 symbol) (arg1 symbol)) +(defmethod level-status? ((this level-group) (arg0 symbol) (arg1 symbol)) "Get the combined status of a level and borrow levels." (if (not arg0) (return #f) @@ -496,7 +496,7 @@ (let ((v1-14 (-> s4-0 info borrow borrow-info s3-1))) (when v1-14 (when (car (cdr v1-14)) - (let ((v1-15 (status-of-level-and-borrows this (the-as symbol (car v1-14)) arg1))) + (let ((v1-15 (level-status? this (the-as symbol (car v1-14)) arg1))) (if (!= v1-15 (-> s4-0 status)) (return v1-15) ) @@ -536,7 +536,7 @@ ) ) ) - (let ((v1-29 (status-of-level-and-borrows *level* (the-as symbol (car s5-1)) arg1))) + (let ((v1-29 (level-status? *level* (the-as symbol (car s5-1)) arg1))) (if (!= v1-29 'active) (return v1-29) ) diff --git a/test/decompiler/reference/jak3/engine/level/region_REF.gc b/test/decompiler/reference/jak3/engine/level/region_REF.gc index 425cf8bba5c..2e724eaa908 100644 --- a/test/decompiler/reference/jak3/engine/level/region_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/region_REF.gc @@ -592,9 +592,9 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defun region-execute () - (set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad)) + (vector-copy! (-> *level* camera-pos 1) (-> *level* camera-pos 0)) (set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad)) - (set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad)) + (vector-copy! (-> *level* target-pos 1) (-> *level* target-pos 0)) (set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad)) (when (and *execute-regions* (-> *setting-control* user-current region-mode) (not (paused?))) (region-tree-execute 'camera (-> *level* camera-pos 1) (the-as vector (-> *level* camera-pos))) diff --git a/test/decompiler/reference/jak3/engine/math/euler_REF.gc b/test/decompiler/reference/jak3/engine/math/euler_REF.gc index b316429222e..9ce40ab2e4e 100644 --- a/test/decompiler/reference/jak3/engine/math/euler_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/euler_REF.gc @@ -17,7 +17,7 @@ "Convert from euler angles to 4x4 matrix." (matrix-identity! arg0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (when (= (logand (the int (-> s5-0 w)) 1) 1) (let ((f0-2 (-> s5-0 x))) (set! (-> s5-0 x) (-> s5-0 z)) diff --git a/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc b/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc index 71cd9bb716e..7c03e235c60 100644 --- a/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc @@ -4,17 +4,17 @@ ;; definition for function matrix-fur-compose ;; INFO: Used lq/sq (defun matrix-fur-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg3 quad)) - (set! (-> arg0 uvec quad) (-> arg2 quad)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg3) + (vector-copy! (-> arg0 uvec) arg2) + (vector-copy! (-> arg0 fvec) arg1) arg0 ) ;; definition for function matrix-fu-compose ;; INFO: Used lq/sq (defun matrix-fu-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) - (set! (-> arg0 uvec quad) (-> arg2 quad)) + (vector-copy! (-> arg0 fvec) arg1) + (vector-copy! (-> arg0 uvec) arg2) (vector-cross! (-> arg0 rvec) arg2 arg1) arg0 ) @@ -22,8 +22,8 @@ ;; definition for function matrix-fr-compose ;; INFO: Used lq/sq (defun matrix-fr-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) - (set! (-> arg0 rvec quad) (-> arg2 quad)) + (vector-copy! (-> arg0 fvec) arg1) + (vector-copy! (-> arg0 rvec) arg2) (vector-cross! (-> arg0 uvec) arg1 arg2) arg0 ) @@ -31,8 +31,8 @@ ;; definition for function matrix-ur-compose ;; INFO: Used lq/sq (defun matrix-ur-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg2 quad)) - (set! (-> arg0 uvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg2) + (vector-copy! (-> arg0 uvec) arg1) (vector-cross! (-> arg0 fvec) arg1 arg2) arg0 ) @@ -40,7 +40,7 @@ ;; definition for function matrix-f-u-compose ;; INFO: Used lq/sq (defun matrix-f-u-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (vector-cross! (-> arg0 rvec) arg2 arg1) (vector-normalize! (-> arg0 rvec) 1.0) (vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec)) @@ -50,7 +50,7 @@ ;; definition for function matrix-f-r-compose ;; INFO: Used lq/sq (defun matrix-f-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (vector-cross! (-> arg0 uvec) arg1 arg2) (vector-normalize! (-> arg0 uvec) 1.0) (vector-cross! (-> arg0 rvec) (-> arg0 uvec) arg1) @@ -60,7 +60,7 @@ ;; definition for function matrix-u-f-compose ;; INFO: Used lq/sq (defun matrix-u-f-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 uvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 uvec) arg1) (vector-cross! (-> arg0 rvec) arg1 arg2) (vector-normalize! (-> arg0 rvec) 1.0) (vector-cross! (-> arg0 fvec) (-> arg0 rvec) arg1) @@ -70,7 +70,7 @@ ;; definition for function matrix-u-r-compose ;; INFO: Used lq/sq (defun matrix-u-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 uvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 uvec) arg1) (vector-cross! (-> arg0 fvec) arg2 arg1) (vector-normalize! (-> arg0 fvec) 1.0) (vector-cross! (-> arg0 rvec) arg1 (-> arg0 fvec)) @@ -80,7 +80,7 @@ ;; definition for function matrix-r-f-compose ;; INFO: Used lq/sq (defun matrix-r-f-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg1) (vector-cross! (-> arg0 uvec) arg2 arg1) (vector-normalize! (-> arg0 uvec) 1.0) (vector-cross! (-> arg0 fvec) arg1 (-> arg0 uvec)) @@ -90,7 +90,7 @@ ;; definition for function matrix-r-u-compose ;; INFO: Used lq/sq (defun matrix-r-u-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg1) (vector-cross! (-> arg0 fvec) arg1 arg2) (vector-normalize! (-> arg0 fvec) 1.0) (vector-cross! (-> arg0 uvec) (-> arg0 fvec) arg1) @@ -100,7 +100,7 @@ ;; definition for function matrix-f-compose ;; INFO: Used lq/sq (defun matrix-f-compose ((arg0 matrix) (arg1 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (let ((a2-0 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) (matrix-f-u-compose arg0 arg1 a2-0) ) @@ -110,7 +110,7 @@ ;; definition for function matrix-u-compose ;; INFO: Used lq/sq (defun matrix-u-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 uvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 uvec) arg1) (let ((a2-1 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) (matrix-u-f-compose arg0 arg1 a2-1) ) @@ -120,13 +120,9 @@ ;; definition for function matrix-r-compose ;; INFO: Used lq/sq (defun matrix-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) - (set! (-> arg0 rvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 rvec) arg1) (let ((a2-1 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) (matrix-r-f-compose arg0 arg1 a2-1 arg3) ) arg0 ) - - - - diff --git a/test/decompiler/reference/jak3/engine/math/matrix-h_REF.gc b/test/decompiler/reference/jak3/engine/math/matrix-h_REF.gc index f32c721c80f..62d251301dd 100644 --- a/test/decompiler/reference/jak3/engine/math/matrix-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/matrix-h_REF.gc @@ -94,24 +94,15 @@ and how they were originally packed (for example, in tie/shrub)." ;; INFO: Used lq/sq (defun matrix-copy! ((arg0 matrix) (arg1 matrix)) "Copy arg1 to arg0" - (let ((v1-0 (-> arg1 rvec quad)) - (a2-0 (-> arg1 uvec quad)) - (a3-0 (-> arg1 fvec quad)) - (a1-1 (-> arg1 trans quad)) - ) - (set! (-> arg0 rvec quad) v1-0) - (set! (-> arg0 uvec quad) a2-0) - (set! (-> arg0 fvec quad) a3-0) - (set! (-> arg0 trans quad) a1-1) - ) + (matrix-copy! arg0 arg1) arg0 ) ;; definition for function matrix<-vector-yz-exact! ;; INFO: Used lq/sq (defun matrix<-vector-yz-exact! ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) - (set! (-> arg0 uvec quad) (-> arg2 quad)) + (vector-copy! (-> arg0 fvec) arg1) + (vector-copy! (-> arg0 uvec) arg2) (vector-cross! (-> arg0 rvec) (-> arg0 uvec) arg1) arg0 ) @@ -119,7 +110,7 @@ and how they were originally packed (for example, in tie/shrub)." ;; definition for function matrix<-vector-yz! ;; INFO: Used lq/sq (defun matrix<-vector-yz! ((arg0 matrix) (arg1 vector) (arg2 vector)) - (set! (-> arg0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> arg0 fvec) arg1) (vector-cross! (-> arg0 rvec) arg2 arg1) (vector-normalize! (-> arg0 rvec) 1.0) (vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec)) @@ -136,8 +127,8 @@ and how they were originally packed (for example, in tie/shrub)." (v1-0 (vector-get-closest-perpendicular! s3-0 arg1 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) (s4-1 arg0) ) - (set! (-> s4-1 fvec quad) (-> arg1 quad)) - (set! (-> s4-1 uvec quad) (-> v1-0 quad)) + (vector-copy! (-> s4-1 fvec) arg1) + (vector-copy! (-> s4-1 uvec) v1-0) (vector-cross! (-> s4-1 rvec) (-> s4-1 uvec) arg1) ) arg0 diff --git a/test/decompiler/reference/jak3/engine/math/matrix_REF.gc b/test/decompiler/reference/jak3/engine/math/matrix_REF.gc index 95e301ed457..f332d79f912 100644 --- a/test/decompiler/reference/jak3/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/matrix_REF.gc @@ -2,7 +2,6 @@ (in-package goal) ;; definition for method 3 of type matrix -;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this matrix)) (format #t "[~8x] matrix~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this rvec x) (-> this rvec y) (-> this rvec z) (-> this rvec w)) @@ -13,7 +12,6 @@ ) ;; definition for method 3 of type matrix3 -;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this matrix3)) (format #t "[~8x] matrix3~%" this) (format #t "~T[~F] [~F] [~F]~%" (-> this vector 0 x) (-> this vector 0 y) (-> this vector 0 z)) @@ -127,11 +125,7 @@ "Set dst = src1 * src2. NOTE: this function is a wrapper around matrix*! that adds no additional functionality. It seems to be a leftover from a time when matrix*! wasn't safe to use in place. This is unused." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (matrix*! s5-0 arg1 arg2) (set! (-> arg0 rvec quad) (-> s5-0 rvec quad)) (set! (-> arg0 uvec quad) (-> s5-0 uvec quad)) @@ -667,22 +661,14 @@ ;; INFO: Used lq/sq (defun matrix-rotate-zyx! ((arg0 matrix) (arg1 vector)) "Rotate in z,y,x order." - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (matrix-rotate-x! arg0 (-> arg1 x)) - (matrix-rotate-y! gp-0 (-> arg1 y)) - (matrix*! s5-0 gp-0 arg0) - (matrix-rotate-z! gp-0 (-> arg1 z)) - (matrix*! arg0 gp-0 s5-0) - ) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-x! arg0 (-> arg1 x)) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-z! gp-0 (-> arg1 z)) + (matrix*! arg0 gp-0 s5-0) ) arg0 ) @@ -746,22 +732,14 @@ ;; INFO: Used lq/sq (defun matrix-rotate-zxy! ((arg0 matrix) (arg1 vector)) "Rotate in z,x,y order." - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (matrix-rotate-y! arg0 (-> arg1 y)) - (matrix-rotate-x! gp-0 (-> arg1 x)) - (matrix*! s5-0 gp-0 arg0) - (matrix-rotate-z! gp-0 (-> arg1 z)) - (matrix*! arg0 gp-0 s5-0) - ) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-y! arg0 (-> arg1 y)) + (matrix-rotate-x! gp-0 (-> arg1 x)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-z! gp-0 (-> arg1 z)) + (matrix*! arg0 gp-0 s5-0) ) arg0 ) @@ -770,22 +748,14 @@ ;; INFO: Used lq/sq (defun matrix-rotate-yxz! ((arg0 matrix) (arg1 vector)) "Rotate in y,x,z order." - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (matrix-rotate-z! arg0 (-> arg1 z)) - (matrix-rotate-x! gp-0 (-> arg1 x)) - (matrix*! s5-0 gp-0 arg0) - (matrix-rotate-y! gp-0 (-> arg1 y)) - (matrix*! arg0 gp-0 s5-0) - ) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-z! arg0 (-> arg1 z)) + (matrix-rotate-x! gp-0 (-> arg1 x)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! arg0 gp-0 s5-0) ) arg0 ) @@ -794,22 +764,14 @@ ;; INFO: Used lq/sq (defun matrix-rotate-yzx! ((arg0 matrix) (arg1 vector)) "Rotate in y,z,x order." - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (set! (-> gp-0 rvec quad) (the-as uint128 0)) - (set! (-> gp-0 uvec quad) (the-as uint128 0)) - (set! (-> gp-0 fvec quad) (the-as uint128 0)) - (set! (-> gp-0 trans quad) (the-as uint128 0)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) - (matrix-rotate-z! arg0 (-> arg1 x)) - (matrix-rotate-x! gp-0 (-> arg1 z)) - (matrix*! s5-0 gp-0 arg0) - (matrix-rotate-y! gp-0 (-> arg1 y)) - (matrix*! arg0 gp-0 s5-0) - ) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-z! arg0 (-> arg1 x)) + (matrix-rotate-x! gp-0 (-> arg1 z)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! arg0 gp-0 s5-0) ) arg0 ) @@ -857,16 +819,8 @@ (defun matrix-rotate-yx! ((arg0 matrix) (arg1 float) (arg2 float)) "Rotate by y then x." (matrix-rotate-y! arg0 arg1) - (let ((t9-1 matrix-rotate-x!) - (a0-2 (new 'stack-no-clear 'matrix)) - ) - (set! (-> a0-2 rvec quad) (the-as uint128 0)) - (set! (-> a0-2 uvec quad) (the-as uint128 0)) - (set! (-> a0-2 fvec quad) (the-as uint128 0)) - (set! (-> a0-2 trans quad) (the-as uint128 0)) - (let ((a1-2 (t9-1 a0-2 arg2))) - (matrix*! arg0 a1-2 arg0) - ) + (let ((a1-2 (matrix-rotate-x! (new-stack-matrix0) arg2))) + (matrix*! arg0 a1-2 arg0) ) arg0 ) @@ -1746,7 +1700,7 @@ ;; INFO: Used lq/sq (defun matrix<-trans ((arg0 matrix) (arg1 vector)) "Set the translation." - (set! (-> arg0 trans quad) (-> arg1 quad)) + (vector-copy! (-> arg0 trans) arg1) arg0 ) @@ -1774,18 +1728,7 @@ (defun matrix->quat ((arg0 matrix) (arg1 quaternion)) "Convert matrix to quaternion, works for matrix with scale. unlike matrix->quaternion." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 arg0) - (v1-0 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-0) - (set! (-> s5-0 uvec quad) a0-1) - (set! (-> s5-0 fvec quad) a1-1) - (set! (-> s5-0 trans quad) a2-1) - ) + (let ((s5-0 (matrix-copy! (new 'stack-no-clear 'matrix) arg0))) (vector-reset! (-> s5-0 trans)) (vector-normalize! (-> s5-0 rvec) 1.0) (vector-normalize! (-> s5-0 uvec) 1.0) @@ -1827,18 +1770,7 @@ (.nop.vf) (.mov.vf vf2 vf0 :mask #b1000) (.svf (&-> arg0 trans quad) vf2) - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 arg1) - (v1-0 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s4-0 rvec quad) v1-0) - (set! (-> s4-0 uvec quad) a0-1) - (set! (-> s4-0 fvec quad) a1-1) - (set! (-> s4-0 trans quad) a2-1) - ) + (let ((s4-0 (matrix-copy! (new 'stack-no-clear 'matrix) arg1))) (vector-normalize! (-> s4-0 rvec) 1.0) (vector-normalize! (-> s4-0 uvec) 1.0) (vector-normalize! (-> s4-0 fvec) 1.0) diff --git a/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc index 501eb8f645b..eda7065496e 100644 --- a/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/quaternion_REF.gc @@ -70,7 +70,7 @@ (let ((s5-0 (new 'stack-no-clear 'matrix))) (vector-cross! (-> s5-0 rvec) arg2 arg1) (vector-cross! (-> s5-0 uvec) arg1 (-> s5-0 rvec)) - (set! (-> s5-0 fvec quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 fvec) arg1) (quaternion-normalize! (matrix->quaternion arg0 s5-0)) ) ) @@ -562,11 +562,7 @@ (vf6 :class vf) (vf7 :class vf) ) - (let ((v1-0 (new 'stack-no-clear 'matrix))) - (set! (-> v1-0 rvec quad) (the-as uint128 0)) - (set! (-> v1-0 uvec quad) (the-as uint128 0)) - (set! (-> v1-0 fvec quad) (the-as uint128 0)) - (set! (-> v1-0 trans quad) (the-as uint128 0)) + (let ((v1-0 (new-stack-matrix0))) (let* ((f0-1 (vector-dot (-> arg1 rvec) (-> arg1 rvec))) (f1-1 (vector-dot (-> arg1 uvec) (-> arg1 uvec))) (f2-1 (vector-dot (-> arg1 fvec) (-> arg1 fvec))) @@ -847,13 +843,9 @@ ;; INFO: Used lq/sq (defun vector-x-quaternion! ((arg0 vector) (arg1 quaternion)) "Get the first row of the rotation matrix for this quaternion." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> s5-0 rvec quad)) + (vector-copy! arg0 (-> s5-0 rvec)) ) arg0 ) @@ -862,13 +854,9 @@ ;; INFO: Used lq/sq (defun vector-y-quaternion! ((arg0 vector) (arg1 quaternion)) "Get the second row of the rotation matrix for this quaternion." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> s5-0 uvec quad)) + (vector-copy! arg0 (-> s5-0 uvec)) ) arg0 ) @@ -877,13 +865,9 @@ ;; INFO: Used lq/sq (defun vector-z-quaternion! ((arg0 vector) (arg1 quaternion)) "Get the third row of the rotation matrix for this quaternion." - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (quaternion->matrix s5-0 arg1) - (set! (-> arg0 quad) (-> s5-0 fvec quad)) + (vector-copy! arg0 (-> s5-0 fvec)) ) arg0 ) diff --git a/test/decompiler/reference/jak3/engine/math/transform_REF.gc b/test/decompiler/reference/jak3/engine/math/transform_REF.gc index f9aceb45134..288540efcdf 100644 --- a/test/decompiler/reference/jak3/engine/math/transform_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/transform_REF.gc @@ -24,27 +24,19 @@ ;; INFO: Used lq/sq (defun transform-matrix-calc! ((arg0 transform) (arg1 matrix)) "Convert a transform to matrix. Not efficient, and the output is the second arg." - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 rvec quad) (the-as uint128 0)) - (set! (-> s4-0 uvec quad) (the-as uint128 0)) - (set! (-> s4-0 fvec quad) (the-as uint128 0)) - (set! (-> s4-0 trans quad) (the-as uint128 0)) - (let ((s3-0 (new 'stack-no-clear 'matrix))) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) - (matrix-identity! arg1) - (matrix-translate! arg1 (-> arg0 trans)) - (matrix-rotate-y! s4-0 (-> arg0 rot y)) - (matrix*! s3-0 s4-0 arg1) - (matrix-rotate-x! s4-0 (-> arg0 rot x)) - (matrix*! arg1 s4-0 s3-0) - (matrix-rotate-z! s4-0 (-> arg0 rot z)) - (matrix*! s3-0 s4-0 arg1) - (matrix-scale! s4-0 (-> arg0 scale)) - (matrix*! arg1 s4-0 s3-0) - ) + (let ((s4-0 (new-stack-matrix0)) + (s3-0 (new-stack-matrix0)) + ) + (matrix-identity! arg1) + (matrix-translate! arg1 (-> arg0 trans)) + (matrix-rotate-y! s4-0 (-> arg0 rot y)) + (matrix*! s3-0 s4-0 arg1) + (matrix-rotate-x! s4-0 (-> arg0 rot x)) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-z! s4-0 (-> arg0 rot z)) + (matrix*! s3-0 s4-0 arg1) + (matrix-scale! s4-0 (-> arg0 scale)) + (matrix*! arg1 s4-0 s3-0) ) ) @@ -52,29 +44,21 @@ ;; INFO: Used lq/sq (defun transform-matrix-parent-calc! ((arg0 transform) (arg1 matrix) (arg2 vector)) "Convert a transform to a matrix, applying an inverse scaling." - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 rvec quad) (the-as uint128 0)) - (set! (-> s4-0 uvec quad) (the-as uint128 0)) - (set! (-> s4-0 fvec quad) (the-as uint128 0)) - (set! (-> s4-0 trans quad) (the-as uint128 0)) - (let ((s3-0 (new 'stack-no-clear 'matrix))) - (set! (-> s3-0 rvec quad) (the-as uint128 0)) - (set! (-> s3-0 uvec quad) (the-as uint128 0)) - (set! (-> s3-0 fvec quad) (the-as uint128 0)) - (set! (-> s3-0 trans quad) (the-as uint128 0)) - (matrix-identity! s3-0) - (matrix-translate! s3-0 (-> arg0 trans)) - (matrix-inv-scale! s4-0 arg2) - (matrix*! arg1 s4-0 s3-0) - (matrix-rotate-y! s4-0 (-> arg0 rot y)) - (matrix*! s3-0 s4-0 arg1) - (matrix-rotate-x! s4-0 (-> arg0 rot x)) - (matrix*! arg1 s4-0 s3-0) - (matrix-rotate-z! s4-0 (-> arg0 rot z)) - (matrix*! s3-0 s4-0 arg1) - (matrix-scale! s4-0 (-> arg0 scale)) - (matrix*! arg1 s4-0 s3-0) - ) + (let ((s4-0 (new-stack-matrix0)) + (s3-0 (new-stack-matrix0)) + ) + (matrix-identity! s3-0) + (matrix-translate! s3-0 (-> arg0 trans)) + (matrix-inv-scale! s4-0 arg2) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-y! s4-0 (-> arg0 rot y)) + (matrix*! s3-0 s4-0 arg1) + (matrix-rotate-x! s4-0 (-> arg0 rot x)) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-z! s4-0 (-> arg0 rot z)) + (matrix*! s3-0 s4-0 arg1) + (matrix-scale! s4-0 (-> arg0 scale)) + (matrix*! arg1 s4-0 s3-0) ) ) @@ -83,7 +67,3 @@ "Convert a trs to a matrix." (transform-matrix-calc! (the-as transform (-> arg0 trans)) arg1) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc b/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc index 78181ef0e6b..093073e4407 100644 --- a/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/transformq-h_REF.gc @@ -3,6 +3,7 @@ ;; definition of type transformq (deftype transformq (transform) + "A transform, but the rotation is represented with a quaternion." ((quat quaternion :inline :overlay-at (-> rot data 0)) ) ) @@ -24,6 +25,7 @@ ;; definition of type trsq (deftype trsq (trs) + "A trs, but the rotation is represented with a quaternion." ((quat quaternion :inline :overlay-at (-> rot data 0)) ) ) diff --git a/test/decompiler/reference/jak3/engine/math/vector_REF.gc b/test/decompiler/reference/jak3/engine/math/vector_REF.gc index adcc9b6c4bf..63e3372a556 100644 --- a/test/decompiler/reference/jak3/engine/math/vector_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/vector_REF.gc @@ -874,7 +874,7 @@ (let ((f0-0 (vector-length arg1))) (cond ((= f0-0 0.0) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) (else (let ((v1-3 (/ arg2 f0-0))) @@ -914,7 +914,7 @@ ) (cond ((= f0-4 0.0) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) (else (let ((v1-3 (/ arg2 f0-4))) @@ -974,7 +974,7 @@ (f2-0 (-> arg1 z)) (f0-1 (-> arg1 y)) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (set! (-> arg0 z) (- (* f2-0 f30-0) (* f0-1 f1-0))) (set! (-> arg0 y) (+ (* f2-0 f1-0) (* f0-1 f30-0))) ) @@ -990,7 +990,7 @@ (f28-0 (cos arg2)) (f0-0 (sin arg2)) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (set! (-> arg0 z) (- (* f26-0 f28-0) (* f30-0 f0-0))) (set! (-> arg0 x) (+ (* f26-0 f0-0) (* f30-0 f28-0))) ) @@ -1001,7 +1001,7 @@ ;; INFO: Used lq/sq (defun vector-rotate90-around-y! ((arg0 vector) (arg1 vector)) "Rotate a vector 90 degrees around y." - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (let ((f0-0 (-> arg0 x))) (set! (-> arg0 x) (- (-> arg1 z))) (set! (-> arg0 z) f0-0) @@ -1018,7 +1018,7 @@ (f28-0 (cos arg2)) (f0-0 (sin arg2)) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (set! (-> arg0 x) (- (* f26-0 f28-0) (* f30-0 f0-0))) (set! (-> arg0 y) (+ (* f26-0 f0-0) (* f30-0 f28-0))) ) @@ -1149,10 +1149,10 @@ (init-vf0-vector) (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (let ((v1-3 arg0)) @@ -1205,10 +1205,10 @@ ) (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (let ((v1-3 arg0)) @@ -1324,10 +1324,10 @@ "Apply deg-lerp-clamp to the xyz components of a vector. Sets w = 1." (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (set! (-> arg0 x) (deg-lerp-clamp (-> arg1 x) (-> arg2 x) arg3)) @@ -1733,7 +1733,7 @@ (set! v1-0 2) ) ) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (set! (-> arg0 data v1-0) 1.0) ) arg0 @@ -1749,7 +1749,7 @@ ) (vector-! s5-0 arg2 s5-0) (vector-normalize! s5-0 1.0) - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) ) arg0 ) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-control-h_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-control-h_REF.gc index 64436475050..454c878c552 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-control-h_REF.gc @@ -293,7 +293,7 @@ (clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none) (find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float) (set-spheres-from-nav-ids (_type_) none) - (add-root-sphere-to-hash! (_type_ vector int) symbol) + (check-sphere-blocked! (_type_ vector int) symbol) (get-max-rotation-rate (_type_) float) (get-sphere-mask (_type_) uint) (get-target-speed (_type_) meters) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-control_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-control_REF.gc index ba3d03c8dd9..c4342588048 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-control_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-control_REF.gc @@ -69,7 +69,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-extra-nav-sphere-xyz! ((this nav-control) (arg0 sphere)) (let ((f0-0 (-> this extra-nav-sphere w))) - (set! (-> this extra-nav-sphere quad) (-> arg0 quad)) + (vector-copy! (-> this extra-nav-sphere) arg0) (set! (-> this extra-nav-sphere w) f0-0) ) 0 @@ -603,7 +603,7 @@ (set! (-> t1-0 y) 0.0) (let ((a0-1 t0-0)) (let ((t3-2 t1-0)) - (set! (-> a0-1 quad) (-> t3-2 quad)) + (vector-copy! a0-1 t3-2) ) (let ((f0-1 1.0)) (.lvf vf1 (&-> a0-1 quad)) @@ -623,7 +623,7 @@ (.nop.vf) (.svf (&-> a0-1 quad) vf1) ) - (set! (-> v1-0 quad) (-> t0-0 quad)) + (vector-copy! v1-0 t0-0) (set! (-> v1-0 x) (-> t0-0 z)) (set! (-> v1-0 z) (- (-> t0-0 x))) (let* ((f0-5 (-> arg1 w)) @@ -787,7 +787,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) - (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (vector-copy! (-> s5-0 in-dir) (-> arg0 travel)) (set! (-> s5-0 in-dir y) 0.0) (let ((v1-1 (-> s5-0 in-dir))) (let ((f0-1 1.0)) @@ -809,11 +809,11 @@ (.svf (&-> v1-1 quad) vf1) ) (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) - (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (vector-copy! (-> s5-0 right-dir) (-> s5-0 in-dir)) (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) - (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (vector-copy! (-> s5-0 best-dir 1) (-> s5-0 in-dir)) (set! (-> s5-0 best-dir-angle 0) 0.0) (set! (-> s5-0 best-dir-angle 1) 0.0) (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) @@ -888,7 +888,7 @@ (let ((a0-30 (logand a0-29 1)) (f0-27 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-20)))) ) - (set! (-> s5-0 best-dir a0-30 quad) (-> s5-0 temp-dir v1-20 quad)) + (vector-copy! (-> s5-0 best-dir a0-30) (-> s5-0 temp-dir v1-20)) (set! (-> s5-0 best-dir-angle a0-30) f0-27) ) ) @@ -925,7 +925,7 @@ ) ) (when (< (-> s5-0 best-dir-angle s3-0) f0-30) - (set! (-> s5-0 best-dir s3-0 quad) (-> s5-0 temp-dir v1-30 quad)) + (vector-copy! (-> s5-0 best-dir s3-0) (-> s5-0 temp-dir v1-30)) (set! (-> s5-0 best-dir-angle s3-0) f0-30) (set! (-> s5-0 dir-update) (the-as basic #t)) ) @@ -1086,7 +1086,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) - (set! (-> s5-0 in-dir quad) (-> arg0 travel quad)) + (vector-copy! (-> s5-0 in-dir) (-> arg0 travel)) (set! (-> s5-0 in-dir y) 0.0) (let ((v1-1 (-> s5-0 in-dir))) (let ((f0-1 1.0)) @@ -1108,11 +1108,11 @@ (.svf (&-> v1-1 quad) vf1) ) (set! (-> s5-0 travel-len) (vector-dot (-> s5-0 in-dir) (-> arg0 travel))) - (set! (-> s5-0 right-dir quad) (-> s5-0 in-dir quad)) + (vector-copy! (-> s5-0 right-dir) (-> s5-0 in-dir)) (set! (-> s5-0 right-dir x) (- (-> s5-0 in-dir z))) (set! (-> s5-0 right-dir z) (-> s5-0 in-dir x)) (set! (-> s5-0 best-dir 0 quad) (-> s5-0 in-dir quad)) - (set! (-> s5-0 best-dir 1 quad) (-> s5-0 in-dir quad)) + (vector-copy! (-> s5-0 best-dir 1) (-> s5-0 in-dir)) (set! (-> s5-0 best-dir-angle 0) 0.0) (set! (-> s5-0 best-dir-angle 1) 0.0) (set! (-> s5-0 initial-ignore-mask) (the-as uint 0)) @@ -1180,7 +1180,7 @@ (let ((a0-33 (logand a0-32 1)) (f0-22 (- 1.0 (vector-dot (-> s5-0 in-dir) (-> s5-0 temp-dir v1-19)))) ) - (set! (-> s5-0 best-dir a0-33 quad) (-> s5-0 temp-dir v1-19 quad)) + (vector-copy! (-> s5-0 best-dir a0-33) (-> s5-0 temp-dir v1-19)) (set! (-> s5-0 best-dir-angle a0-33) f0-22) ) ) @@ -1266,7 +1266,7 @@ (set! sv-124 (-> this work)) (vector-! sv-116 arg0 (the-as vector (-> this bounds))) (set! (-> sv-112 current-poly) arg1) - (set! (-> sv-112 current-pos quad) (-> sv-116 quad)) + (vector-copy! (-> sv-112 current-pos) sv-116) (vector+! (-> sv-112 dest-pos) sv-116 arg2) (let* ((t2-0 this) (v1-11 (-> sv-112 dest-pos)) @@ -1370,7 +1370,7 @@ (set! (-> v1-20 next-poly) #f) (cond ((= sv-136 -1) - (set! (-> v1-20 current-pos quad) (-> v1-20 dest-pos quad)) + (vector-copy! (-> v1-20 current-pos) (-> v1-20 dest-pos)) (set! (-> v1-20 reached-dest) #t) (set! (-> v1-20 terminated) #t) ) @@ -1425,7 +1425,7 @@ (set! (-> arg3 edge) (-> sv-112 last-edge)) (vector+! (-> arg3 vert-0) sv-192 (the-as vector (-> this bounds))) (vector+! (-> arg3 vert-1) sv-196 (the-as vector (-> this bounds))) - (set! (-> sv-112 dest-pos quad) (-> sv-112 current-pos quad)) + (vector-copy! (-> sv-112 dest-pos) (-> sv-112 current-pos)) (if (-> sv-112 hit-gap) (set! (-> arg3 gap-poly) (-> sv-112 next-poly)) ) @@ -1570,7 +1570,7 @@ (set! sv-104 0) (set! sv-112 (-> this work)) (set! (-> sv-96 current-poly) arg1) - (set! (-> sv-96 current-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-96 current-pos) arg0) (vector+! (-> sv-96 dest-pos) arg0 arg2) (let* ((t6-0 this) (t4-2 arg1) @@ -1676,7 +1676,7 @@ (set! (-> v1-19 next-poly) #f) (cond ((= sv-128 -1) - (set! (-> v1-19 current-pos quad) (-> v1-19 dest-pos quad)) + (vector-copy! (-> v1-19 current-pos) (-> v1-19 dest-pos)) (set! (-> v1-19 reached-dest) #t) (set! (-> v1-19 terminated) #t) ) @@ -1735,7 +1735,7 @@ (vector+! (-> arg5 vert-0) sv-184 (the-as vector (-> this bounds))) (vector+! (-> arg5 vert-1) sv-188 (the-as vector (-> this bounds))) ) - (set! (-> sv-96 dest-pos quad) (-> sv-96 current-pos quad)) + (vector-copy! (-> sv-96 dest-pos) (-> sv-96 current-pos)) (cond (arg4 (let ((f0-49 (* 1.01 (+ (* sv-192 sv-200) (* sv-196 sv-204))))) @@ -1841,11 +1841,11 @@ ) ;; definition for method 24 of type nav-control -(defmethod add-root-sphere-to-hash! ((this nav-control) (arg0 vector) (arg1 int)) +(defmethod check-sphere-blocked! ((this nav-control) (arg0 vector) (arg1 int)) (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) - (find-nav-sphere-ids + (check-sphere-blocked (-> this state mesh sphere-hash) - (the-as find-nav-sphere-ids-params arg0) + arg0 (logand arg1 255) (the-as int (-> this root-sphere-id)) ) @@ -1875,21 +1875,21 @@ ;; definition for method 12 of type nav-state ;; INFO: Used lq/sq (defmethod get-velocity ((this nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> this velocity quad)) + (vector-copy! arg0 (-> this velocity)) arg0 ) ;; definition for method 14 of type nav-state ;; INFO: Used lq/sq (defmethod get-heading ((this nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> this heading quad)) + (vector-copy! arg0 (-> this heading)) arg0 ) ;; definition for method 15 of type nav-state ;; INFO: Used lq/sq (defmethod get-target-pos ((this nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> this target-pos quad)) + (vector-copy! arg0 (-> this target-pos)) arg0 ) @@ -1911,7 +1911,7 @@ ;; definition for method 13 of type nav-state ;; INFO: Used lq/sq (defmethod get-travel ((this nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> this travel quad)) + (vector-copy! arg0 (-> this travel)) arg0 ) @@ -1919,7 +1919,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod set-velocity! ((this nav-state) (arg0 vector)) - (set! (-> this velocity quad) (-> arg0 quad)) + (vector-copy! (-> this velocity) arg0) 0 (none) ) @@ -1928,7 +1928,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod set-heading! ((this nav-state) (arg0 vector)) - (set! (-> this heading quad) (-> arg0 quad)) + (vector-copy! (-> this heading) arg0) 0 (none) ) @@ -1947,7 +1947,7 @@ (defmethod set-target-pos! ((this nav-state) (arg0 vector)) (logclear! (-> this flags) (nav-state-flag directional-mode)) (logior! (-> this flags) (nav-state-flag target-poly-dirty)) - (set! (-> this target-pos quad) (-> arg0 quad)) + (vector-copy! (-> this target-pos) arg0) 0 (none) ) @@ -1957,7 +1957,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-virtual-cur-pos! ((this nav-state) (arg0 vector)) (logior! (-> this flags) (nav-state-flag use-position)) - (set! (-> this virtual-current-pos-local quad) (-> arg0 quad)) + (vector-copy! (-> this virtual-current-pos-local) arg0) 0 (none) ) @@ -1967,7 +1967,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-travel! ((this nav-state) (arg0 vector)) (logior! (-> this flags) (nav-state-flag directional-mode)) - (set! (-> this travel quad) (-> arg0 quad)) + (vector-copy! (-> this travel) arg0) 0 (none) ) @@ -2014,7 +2014,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) 0.0 (-> this mesh work debug) - (set! (-> s5-1 quad) (-> this current-pos quad)) + (vector-copy! s5-1 (-> this current-pos)) (let ((f30-0 (-> s5-1 y))) (set! (-> s5-1 y) (+ 2048.0 f30-0)) (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> this heading) (meters 1) *color-yellow*) @@ -2080,7 +2080,7 @@ (vector-! (-> s4-0 dest-pos) arg0 (the-as vector (-> s3-0 bounds))) (b! (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) (logior! (-> this flags) (nav-state-flag in-mesh)) - (set! (-> this current-pos quad) (-> arg0 quad)) + (vector-copy! (-> this current-pos) arg0) (b! #t cfg-17 :delay (nop!)) (label cfg-3) (let ((v1-10 s4-0)) @@ -2131,11 +2131,11 @@ (cond ((-> s4-0 reached-dest) (logior! (-> this flags) (nav-state-flag in-mesh)) - (set! (-> this current-pos quad) (-> arg0 quad)) + (vector-copy! (-> this current-pos) arg0) ) (else (logclear! (-> this flags) (nav-state-flag in-mesh)) - (set! (-> this current-pos quad) (-> arg0 quad)) + (vector-copy! (-> this current-pos) arg0) (let ((s4-1 (new 'stack 'nav-find-poly-parms))) (vector-! (-> s4-1 point) arg0 (the-as vector (-> this mesh bounds))) (set! (-> s4-1 y-threshold) (-> this nav nearest-y-threshold)) @@ -2149,7 +2149,7 @@ ) ) (else - (set! (-> this current-pos quad) (-> arg0 quad)) + (vector-copy! (-> this current-pos) arg0) (let ((s4-2 (new 'stack 'nav-find-poly-parms))) (vector-! (-> s4-2 point) arg0 (the-as vector (-> this mesh bounds))) (set! (-> s4-2 y-threshold) (-> this nav nearest-y-threshold)) @@ -2351,7 +2351,7 @@ (set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2)) (set! sv-124 (the-as symbol #f)) (vector-! (-> this current-pos-local) (-> this current-pos) (the-as vector (-> this mesh bounds))) - (set! (-> this virtual-current-pos-local quad) (-> this current-pos-local quad)) + (vector-copy! (-> this virtual-current-pos-local) (-> this current-pos-local)) (set! (-> sv-116 next-poly) #f) (when (not (logtest? (-> this flags) (nav-state-flag directional-mode))) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -2390,8 +2390,8 @@ ) (else (set! (-> this next-poly) (-> sv-116 next-poly)) - (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) - (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + (vector-copy! (-> sv-120 0) (-> sv-116 vertex 0)) + (vector-copy! (-> sv-120 1) (-> sv-116 vertex 1)) (set! sv-124 #t) (while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment? (-> this current-pos-local) @@ -2416,8 +2416,8 @@ (cond ((get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) sv-116) (set! (-> this next-poly) (-> sv-116 next-poly)) - (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) - (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) + (vector-copy! (-> sv-120 0) (-> sv-116 vertex 0)) + (vector-copy! (-> sv-120 1) (-> sv-116 vertex 1)) 0 ) (else @@ -2478,7 +2478,7 @@ (vector-float*! s4-1 s4-1 0.5) ) (else - (set! (-> s4-1 quad) (-> sv-112 quad)) + (vector-copy! s4-1 sv-112) ) ) (countdown (s3-1 2) @@ -2556,9 +2556,9 @@ (logior! (-> this flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) + (vector-copy! (-> this travel) (-> arg0 out-travel 0)) (let ((v1-10 (new 'stack-no-clear 'nav-ray))) - (set! (-> v1-10 current-pos quad) (-> this virtual-current-pos-local quad)) + (vector-copy! (-> v1-10 current-pos) (-> this virtual-current-pos-local)) (set! (-> v1-10 current-poly) (-> this virtual-current-poly)) (vector+! (-> v1-10 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) (let ((a2-5 0)) @@ -2636,7 +2636,7 @@ (set! (-> a3-5 next-poly) #f) (cond ((= sv-96 -1) - (set! (-> a3-5 current-pos quad) (-> a3-5 dest-pos quad)) + (vector-copy! (-> a3-5 current-pos) (-> a3-5 dest-pos)) (set! (-> a3-5 reached-dest) #t) (set! (-> a3-5 terminated) #t) ) @@ -2668,10 +2668,10 @@ ) (cond ((or (-> v1-10 reached-dest) (-> v1-10 hit-gap) (>= (-> v1-10 len) 4096.0)) - (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) + (vector-copy! (-> this travel) (-> arg0 out-travel 0)) ) (else - (set! (-> this travel quad) (-> arg0 out-travel 1 quad)) + (vector-copy! (-> this travel) (-> arg0 out-travel 1)) (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) ) ) @@ -2710,15 +2710,13 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) - (set! (-> s5-0 travel quad) (-> this travel quad)) - (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) - (-> this heading) - (-> this travel) - ) - quad - ) - ) + (vector-copy! (-> s5-0 current-pos) (-> this virtual-current-pos-local)) + (vector-copy! (-> s5-0 travel) (-> this travel)) + (vector-copy! (-> s5-0 pref-dir) (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) + ) + ) (avoid-spheres-1! (-> this nav) s5-0) (when (-> s5-0 avoiding-sphere?) (logior! (-> this flags) (nav-state-flag avoiding-sphere)) @@ -2729,9 +2727,9 @@ (logior! (-> this flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) + (vector-copy! (-> this travel) (-> s5-0 out-travel 0)) (let ((v1-15 (new 'stack-no-clear 'nav-ray))) - (set! (-> v1-15 current-pos quad) (-> this virtual-current-pos-local quad)) + (vector-copy! (-> v1-15 current-pos) (-> this virtual-current-pos-local)) (set! (-> v1-15 current-poly) (-> this virtual-current-poly)) (vector+! (-> v1-15 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) (let ((a0-15 0)) @@ -2809,7 +2807,7 @@ (set! (-> a1-6 next-poly) #f) (cond ((= sv-192 -1) - (set! (-> a1-6 current-pos quad) (-> a1-6 dest-pos quad)) + (vector-copy! (-> a1-6 current-pos) (-> a1-6 dest-pos)) (set! (-> a1-6 reached-dest) #t) (set! (-> a1-6 terminated) #t) ) @@ -2841,10 +2839,10 @@ ) (cond ((or (-> v1-15 reached-dest) (-> v1-15 hit-gap) (>= (-> v1-15 len) 4096.0)) - (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) + (vector-copy! (-> this travel) (-> s5-0 out-travel 0)) ) (else - (set! (-> this travel quad) (-> s5-0 out-travel 1 quad)) + (vector-copy! (-> this travel) (-> s5-0 out-travel 1)) (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) ) ) @@ -2869,7 +2867,7 @@ (vf3 :class vf) ) (init-vf0-vector) - (set! (-> this target-dir quad) (-> this travel quad)) + (vector-copy! (-> this target-dir) (-> this travel)) (let ((v1-1 (-> this target-dir))) (let ((f0-0 1.0)) (.lvf vf1 (&-> v1-1 quad)) @@ -2897,7 +2895,7 @@ (v1-8 (-> this travel)) ) (when (< f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) - (set! (-> this heading quad) (-> this travel quad)) + (vector-copy! (-> this heading) (-> this travel)) (set! (-> this heading y) 0.0) (let ((v1-12 (-> this heading))) (let ((f0-5 1.0)) @@ -2944,7 +2942,7 @@ (v1-26 (-> this travel)) ) (when (< f0-10 (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))) - (set! (-> this heading quad) (-> this travel quad)) + (vector-copy! (-> this heading) (-> this travel)) (set! (-> this heading y) 0.0) (let ((v1-30 (-> this heading))) (let ((f0-12 1.0)) @@ -3040,14 +3038,14 @@ (let ((f0-1 (vector-segment-distance-point! s2-0 (-> s3-0 vertex v1-13) (-> s3-0 vertex s0-0) sv-48))) (when (< f0-1 (the-as float sv-56)) (set! sv-56 f0-1) - (set! (-> sv-52 quad) (-> sv-48 quad)) + (vector-copy! sv-52 sv-48) ) ) (set! v1-13 s0-0) ) ) ) - (set! (-> s4-0 quad) (-> sv-52 quad)) + (vector-copy! s4-0 sv-52) ) (vector+! (-> arg0 dest) (-> arg0 dest) (the-as vector (-> this mesh bounds))) #t @@ -3102,8 +3100,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> this flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> this virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> this nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> this virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> this nav shape trans)) ) (if (or (not (-> this current-poly)) (!= (-> this current-pos x) (-> v1-13 0 x)) @@ -3263,8 +3261,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> s5-0 flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> s5-0 virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> s5-0 nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> s5-0 virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> s5-0 nav shape trans)) ) (if (or (not (-> s5-0 current-poly)) (!= (-> s5-0 current-pos x) (-> v1-13 0 x)) @@ -3366,15 +3364,13 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) - (set! (-> s5-0 travel quad) (-> this travel quad)) - (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) - (-> this heading) - (-> this travel) - ) - quad - ) - ) + (vector-copy! (-> s5-0 current-pos) (-> this virtual-current-pos-local)) + (vector-copy! (-> s5-0 travel) (-> this travel)) + (vector-copy! (-> s5-0 pref-dir) (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) + ) + ) (avoid-spheres-2! (-> this nav) s5-0) (let ((v1-5 this)) (when (-> s5-0 avoiding-sphere?) @@ -3386,9 +3382,9 @@ (logior! (-> v1-5 flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + (vector-copy! (-> v1-5 travel) (-> s5-0 out-travel 0)) (let ((a0-20 (new 'stack-no-clear 'nav-ray))) - (set! (-> a0-20 current-pos quad) (-> v1-5 virtual-current-pos-local quad)) + (vector-copy! (-> a0-20 current-pos) (-> v1-5 virtual-current-pos-local)) (set! (-> a0-20 current-poly) (-> v1-5 virtual-current-poly)) (vector+! (-> a0-20 dest-pos) (-> v1-5 virtual-current-pos-local) (-> v1-5 travel)) (let ((a1-6 0)) @@ -3466,7 +3462,7 @@ (set! (-> a2-5 next-poly) #f) (cond ((= sv-192 -1) - (set! (-> a2-5 current-pos quad) (-> a2-5 dest-pos quad)) + (vector-copy! (-> a2-5 current-pos) (-> a2-5 dest-pos)) (set! (-> a2-5 reached-dest) #t) (set! (-> a2-5 terminated) #t) ) @@ -3498,10 +3494,10 @@ ) (cond ((or (-> a0-20 reached-dest) (-> a0-20 hit-gap) (>= (-> a0-20 len) 4096.0)) - (set! (-> v1-5 travel quad) (-> s5-0 out-travel 0 quad)) + (vector-copy! (-> v1-5 travel) (-> s5-0 out-travel 0)) ) (else - (set! (-> v1-5 travel quad) (-> s5-0 out-travel 1 quad)) + (vector-copy! (-> v1-5 travel) (-> s5-0 out-travel 1)) (logior! (-> v1-5 flags) (nav-state-flag trapped-by-sphere)) ) ) @@ -3614,7 +3610,7 @@ (v1-9 (-> this travel)) ) (when (< f0-3 (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z)))) - (set! (-> this heading quad) (-> this travel quad)) + (vector-copy! (-> this heading) (-> this travel)) (set! (-> this heading y) 0.0) (let ((v1-13 (-> this heading))) (let ((f0-5 1.0)) @@ -3692,8 +3688,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> s5-0 flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> s5-0 virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> s5-0 nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> s5-0 virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> s5-0 nav shape trans)) ) (if (or (not (-> s5-0 current-poly)) (!= (-> s5-0 current-pos x) (-> v1-13 0 x)) @@ -3787,8 +3783,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> gp-0 flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> gp-0 virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> gp-0 nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> gp-0 virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> gp-0 nav shape trans)) ) (if (or (not (-> gp-0 current-poly)) (!= (-> gp-0 current-pos x) (-> v1-13 0 x)) @@ -3907,8 +3903,8 @@ ) (let ((v1-13 (new 'stack-no-clear 'inline-array 'vector 1))) (if (logtest? (-> gp-0 flags) (nav-state-flag use-position)) - (set! (-> v1-13 0 quad) (-> gp-0 virtual-current-pos-local quad)) - (set! (-> v1-13 0 quad) (-> gp-0 nav shape trans quad)) + (vector-copy! (-> v1-13 0) (-> gp-0 virtual-current-pos-local)) + (vector-copy! (-> v1-13 0) (-> gp-0 nav shape trans)) ) (if (or (not (-> gp-0 current-poly)) (!= (-> gp-0 current-pos x) (-> v1-13 0 x)) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc index 3ba24b2d54d..9e98793ad30 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-enemy-h_REF.gc @@ -175,8 +175,8 @@ debug-control ) (:methods - (init-enemy-info! (_type_ nav-enemy-info) none :replace) - (init-enemy-defaults! (_type_ nav-enemy-info) object :replace) + (set-enemy-info! (_type_ nav-enemy-info) none :replace) + (setup-enemy! (_type_ nav-enemy-info) object :replace) (normalize-heading! (_type_ nav-control) none) (nav-enemy-method-161 (_type_ nav-control) none) (nav-enemy-method-162 (_type_) none) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc index 2e4966cccd0..964ca8c0bb4 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-enemy_REF.gc @@ -10,8 +10,9 @@ ) ;; definition for method 68 of type nav-enemy -(defmethod get-enemy-aware ((this nav-enemy) (arg0 enemy-aware)) - (let* ((t9-0 (method-of-type enemy get-enemy-aware)) +(defmethod modify-awareness ((this nav-enemy) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." + (let* ((t9-0 (method-of-type enemy modify-awareness)) (s5-0 (t9-0 this arg0)) ) (if (and (>= 1 (the-as int (-> this focus aware))) (< 1 (the-as int s5-0))) @@ -23,6 +24,7 @@ ;; definition for method 82 of type nav-enemy (defmethod event-handler ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('nav-mesh-kill) (deactivate this) @@ -43,7 +45,7 @@ (go (method-of-object this debug-control)) ) (('debug-control-off) - (go-best-state this) + (go-state-for-focused this) ) (else ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) @@ -89,7 +91,7 @@ (let ((v1-19 (-> this nav state))) (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-19 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-19 target-pos) s5-0) ) ) ) @@ -131,7 +133,7 @@ (let ((f0-2 (vector-vector-xz-distance arg1 arg0))) (when (< f28-0 f0-2) (set! f28-0 f0-2) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) ) ) (set! f30-0 (cond @@ -147,7 +149,7 @@ (+! f24-0 f26-0) ) (when (and (!= f28-0 0.0) (< 4096.0 (vector-vector-xz-distance (-> this root trans) s3-0))) - (set! (-> arg0 quad) (-> s3-0 quad)) + (vector-copy! arg0 s3-0) arg0 ) ) @@ -165,7 +167,9 @@ ;; definition for method 109 of type nav-enemy ;; INFO: Used lq/sq -(defmethod enemy-method-109 ((this nav-enemy)) +(defmethod out-of-bounds? ((this nav-enemy)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (let ((gp-0 (-> this root)) (s3-0 (-> this nav state)) ) @@ -173,7 +177,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (cond ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ) (else (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) @@ -194,6 +198,7 @@ ;; definition for method 59 of type nav-enemy ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this nav-enemy)) + "Common implementation of post. Runs ja-post." (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this last-draw-time)) ) @@ -248,7 +253,7 @@ ) ) (if (logtest? (-> this enemy-flags) (enemy-flag victory)) - (check-victory this) + (clear-stale-victory this) ) (if (logtest? (enemy-flag check-water checking-water) (-> this enemy-flags)) (check-water this) @@ -272,6 +277,7 @@ ;; definition for method 139 of type nav-enemy ;; WARN: Return type mismatch int vs none. (defmethod move-above-ground! ((this nav-enemy) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." (let ((t9-0 (method-of-type enemy move-above-ground!))) (t9-0 this arg0 arg1) ) @@ -362,7 +368,7 @@ (defmethod normalize-heading! ((this nav-enemy) (arg0 nav-control)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) - (set! (-> s5-0 quad) (-> a1-1 heading quad)) + (vector-copy! s5-0 (-> a1-1 heading)) ) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) @@ -377,7 +383,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. (defmethod copy-nav-state-vel! ((this nav-enemy) (arg0 vector)) - (set! (-> arg0 quad) (-> this nav state velocity quad)) + (vector-copy! arg0 (-> this nav state velocity)) (none) ) @@ -394,7 +400,7 @@ (cond ((should-move-to-ground? this) (if (focus-test? this under-water) - (accelerate-fall! this (-> this root transv)) + (adjust-transv-under-water! this (-> this root transv)) (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) @@ -521,7 +527,8 @@ ) ;; definition for method 107 of type nav-enemy -(defmethod is-pfoc-in-mesh? ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (and arg0 (not arg1)) (set! arg1 (get-trans arg0 1)) ) @@ -552,7 +559,7 @@ (set-time! (-> this frustration-time)) (let ((v1-7 (handle->process (-> this focus handle)))) (if v1-7 - (set! (-> this frustration-point quad) (-> (get-trans (the-as process-focusable v1-7) 1) quad)) + (vector-copy! (-> this frustration-point) (get-trans (the-as process-focusable v1-7) 1)) ) ) 0 @@ -668,7 +675,7 @@ ;; definition for method 118 of type nav-enemy ;; WARN: Return type mismatch float vs none. -(defmethod init-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod set-enemy-info! ((this nav-enemy) (arg0 nav-enemy-info)) (set! (-> this enemy-info) arg0) (set! (-> arg0 callback-info) *default-nav-callback-info*) (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) @@ -688,7 +695,7 @@ ;; definition for method 119 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs object. -(defmethod init-enemy-defaults! ((this nav-enemy) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this nav-enemy) (arg0 nav-enemy-info)) (local-vars (sv-16 res-tag)) (rlet ((acc :class vf) (vf0 :class vf) @@ -710,7 +717,7 @@ (logior! (-> this mask) (process-mask actor-pause)) (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (set! (-> this nav-radius-backup) (-> this root nav-radius)) - (init-enemy-info! this arg0) + (set-enemy-info! this arg0) (set! (-> this enemy-info callback-info) *default-nav-callback-info*) (set! (-> this ragdoll-proc) (the-as handle #f)) (let ((a1-2 (-> this enemy-info idle-anim-script))) @@ -878,7 +885,7 @@ ) (set! (-> this penetrate-flinch) (-> arg0 penetrate-flinch)) (set! (-> this penetrate-knocked) (-> arg0 penetrate-knocked)) - (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.8))) + (set! (-> this reaction-time) (rnd-time-frame this (seconds 0.1) (seconds 0.8))) (let* ((v1-132 (-> this enemy-flags)) (a0-61 (-> this fact enemy-options)) (v1-133 @@ -900,7 +907,7 @@ (not (logtest? (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) ) - (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) ) (if (zero? (-> this draw light-index)) (set! (-> this draw light-index) (the-as uint 10)) @@ -912,6 +919,7 @@ ;; definition for method 11 of type nav-enemy ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this nav-enemy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((a1-2 (res-lump-struct arg0 'art-level structure))) (when a1-2 (let ((a0-3 (level-get *level* (the-as symbol a1-2)))) @@ -953,7 +961,7 @@ (go (method-of-object this dormant-aware)) ) (else - (go-idle2 this) + (go-fallback-init this) ) ) ) @@ -1004,7 +1012,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-7 quad)) + (vector-copy! (-> gp-0 target-pos) v1-7) ) 0 ) @@ -1029,12 +1037,12 @@ (let ((a0-7 (-> self nav state)) (a1-3 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-3 quad) (-> a0-7 target-pos quad)) + (vector-copy! a1-3 (-> a0-7 target-pos)) (when (< 2048.0 (vector-vector-xz-distance gp-0 a1-3)) (let ((v1-18 (-> self nav state))) (logclear! (-> v1-18 flags) (nav-state-flag directional-mode)) (logior! (-> v1-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-18 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-18 target-pos) gp-0) ) 0 ) @@ -1097,7 +1105,7 @@ (set! (-> this restore-nav-radius-time) (the-as time-frame - (max (-> this restore-nav-radius-time) (+ (current-time) (set-reaction-time! this (seconds 5) (seconds 8)))) + (max (-> this restore-nav-radius-time) (+ (current-time) (rnd-time-frame this (seconds 5) (seconds 8)))) ) ) (none) @@ -1148,7 +1156,7 @@ (seek-toward-heading-vec! (-> self root) arg0 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) (ja :num! (loop! 0.75)) - (set! v1-18 (or (time-elapsed? s4-0 (seconds 10)) (enemy-method-103 self arg0 arg1))) + (set! v1-18 (or (time-elapsed? s4-0 (seconds 10)) (heading-matches-direction? self arg0 arg1))) ) ) (forward-up->quaternion (-> self root quat) arg0 *y-vector*) @@ -1187,10 +1195,10 @@ ) (go-stare2 this) ) - ((and (= s5-0 (enemy-aware ea3)) (-> this enemy-info use-circling)) + ((and (= s5-0 (enemy-aware hostile)) (-> this enemy-info use-circling)) (go (method-of-object this circling)) ) - ((= s5-0 (enemy-aware ea4)) + ((= s5-0 (enemy-aware flee)) (go-flee this) ) (else @@ -1202,6 +1210,7 @@ ;; definition for method 78 of type nav-enemy (defmethod go-hostile ((this nav-enemy)) + "Go to the hostile state, actively trying to attack the target." (if (or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> this enemy-flags))) (nav-enemy-method-174 this) ) @@ -1212,6 +1221,7 @@ ;; definition for method 79 of type nav-enemy (defmethod go-flee ((this nav-enemy)) + "Go to the flee state, running away." (if (nav-enemy-method-167 this) (go (method-of-object this flee)) (go (method-of-object this stare)) @@ -1242,7 +1252,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (let ((a1-4 (-> self nav state))) - (set! (-> s4-0 quad) (-> a1-4 heading quad)) + (vector-copy! s4-0 (-> a1-4 heading)) ) (vector-rotate-y! s4-0 s4-0 (* 1820.4445 (-> gp-0 steering))) (vector-float*! s4-0 s4-0 20480.0) @@ -1250,7 +1260,7 @@ (let ((v1-26 (-> self nav state))) (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-26 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-26 target-pos) s5-0) ) ) ) @@ -1351,7 +1361,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (when (enemy-method-134 self 0.2) + (when (rnd-chance-for-idle? self 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.6)) (let ((v1-37 self)) @@ -1369,7 +1379,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -1424,7 +1434,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-11 quad)) + (vector-copy! (-> gp-0 target-pos) v1-11) ) 0 ) @@ -1457,14 +1467,14 @@ ) (until (ja-done? 0) (let ((a1-9 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-9 travel quad)) + (vector-copy! gp-0 (-> a1-9 travel)) ) (seek-toward-heading-vec! (-> self root) gp-0 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -1513,7 +1523,7 @@ ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) (go-stare self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -1537,7 +1547,7 @@ (set-time! (-> self state-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> self nav state))) - (set! (-> a1-0 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-0 (-> a2-0 target-pos)) ) (let ((f0-0 (vector-vector-distance (-> self root trans) a1-0))) (set! (-> self state-timeout) @@ -1579,10 +1589,10 @@ (go-virtual active) ) ) - ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + ((and (= gp-0 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) (else @@ -1681,7 +1691,7 @@ (.nop.vf) (.svf (&-> v1-23 quad) vf1) ) - (set! (-> self nav state heading quad) (-> gp-0 quad)) + (vector-copy! (-> self nav state heading) gp-0) ) 0 ) @@ -1701,7 +1711,7 @@ ((>= 1 (the-as int gp-0)) (go-virtual active) ) - ((= gp-0 (enemy-aware ea3)) + ((= gp-0 (enemy-aware hostile)) (if (and (get-focus! self) (not (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags)))) (time-elapsed? (-> self starting-time) (-> self reaction-time)) @@ -1712,10 +1722,10 @@ (go-virtual circling) ) ) - ((and (= gp-0 (enemy-aware ea4)) (nav-enemy-method-167 self)) + ((and (= gp-0 (enemy-aware flee)) (nav-enemy-method-167 self)) (go-flee self) ) - ((and (= gp-0 (enemy-aware ea2)) + ((and (= gp-0 (enemy-aware aware2)) (-> self enemy-info use-pacing) (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) @@ -1756,7 +1766,7 @@ (go-virtual active) ) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) ) :exit (-> (method-of-type nav-enemy stare) exit) @@ -1767,7 +1777,7 @@ ((>= 1 (the-as int v1-6)) (go-virtual active) ) - ((and (= v1-6 (enemy-aware ea3)) (get-focus! self)) + ((and (= v1-6 (enemy-aware hostile)) (get-focus! self)) (go-virtual hostile) ) ) @@ -1777,7 +1787,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) - (let ((gp-0 (set-reaction-time! self (seconds 0.2) (seconds 0.7))) + (let ((gp-0 (rnd-time-frame self (seconds 0.2) (seconds 0.7))) (s5-0 (current-time)) (f28-0 f30-0) ) @@ -1827,8 +1837,8 @@ 0 (nav-enemy-method-176 self) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self move-dest quad) (-> self root trans quad)) - (set! (-> self state-timeout) (set-reaction-time! self (seconds 7) (seconds 11))) + (vector-copy! (-> self move-dest) (-> self root trans)) + (set! (-> self state-timeout) (rnd-time-frame self (seconds 7) (seconds 11))) (set-time! (-> self starting-time)) (if (zero? (rnd-int self 2)) (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef41) (-> self enemy-flags)))) @@ -1838,13 +1848,13 @@ (if (not gp-0) (go-virtual active) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) (if a0-1 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-1) 0)) ) ) (let ((gp-1 (-> self focus aware))) @@ -1855,7 +1865,7 @@ (if (>= 1 (the-as int gp-1)) (go-virtual active) ) - (when (= gp-1 (enemy-aware ea3)) + (when (= gp-1 (enemy-aware hostile)) (when (and (get-focus! self) (time-elapsed? (-> self starting-time) (-> self reaction-time))) (nav-enemy-method-172 self) (go-virtual hostile) @@ -1890,7 +1900,7 @@ (set! f30-1 (- f30-1)) ) ) - (set! (-> s5-0 quad) (-> self focus-pos quad)) + (vector-copy! s5-0 (-> self focus-pos)) (vector-! s4-0 (-> self root trans) s5-0) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 (rnd-float-range self 16384.0 49152.0)) @@ -1931,7 +1941,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1964,7 +1974,7 @@ (if (not gp-0) (go-virtual active) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (let ((f30-0 (-> self enemy-info circle-dist-lo)) (f28-0 (-> self enemy-info circle-dist-hi)) @@ -1983,7 +1993,7 @@ :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) (if a0-1 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-1) 0)) ) ) (let ((gp-1 (-> self focus aware))) @@ -1999,17 +2009,17 @@ (go-virtual active) ) ) - ((and (= gp-1 (enemy-aware ea3)) + ((and (= gp-1 (enemy-aware hostile)) (get-focus! self) (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) (nav-enemy-method-172 self) (go-hostile self) ) - ((= gp-1 (enemy-aware ea2)) + ((= gp-1 (enemy-aware aware2)) (go-stare self) ) - ((= gp-1 (enemy-aware ea4)) + ((= gp-1 (enemy-aware flee)) (go-flee self) ) ((or (nav-enemy-method-174 self) (logtest? (enemy-flag ef42) (-> self enemy-flags))) @@ -2047,7 +2057,7 @@ (if (logtest? (enemy-flag ef41) (-> self enemy-flags)) (set! f30-0 (- f30-0)) ) - (set! (-> s5-0 quad) (-> self focus-pos quad)) + (vector-copy! s5-0 (-> self focus-pos)) (vector-! gp-0 (-> self root trans) s5-0) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 (-> self desired-angle)) @@ -2058,7 +2068,7 @@ (vector+! s5-0 s5-0 gp-0) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (closest-point-on-mesh (-> self nav) gp-1 s5-0 (the-as nav-poly #f)) (if (< (vector-vector-xz-distance gp-1 (-> self root trans)) 409.6) (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag ef42) (-> self enemy-flags)))) @@ -2067,7 +2077,7 @@ (let ((v1-28 (-> self nav state))) (logclear! (-> v1-28 flags) (nav-state-flag directional-mode)) (logior! (-> v1-28 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-28 target-pos quad) (-> gp-1 quad)) + (vector-copy! (-> v1-28 target-pos) gp-1) ) ) ) @@ -2106,7 +2116,7 @@ :trans (behavior () (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (let ((v1-3 (-> self focus aware))) - (if (!= v1-3 (enemy-aware ea4)) + (if (!= v1-3 (enemy-aware flee)) (go-stare self) ) ) @@ -2295,25 +2305,27 @@ ;; definition for method 91 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-91 ((this nav-enemy) (arg0 enemy-jump-info)) +(defmethod check-jump-blocked? ((this nav-enemy) (arg0 enemy-jump-info)) + "Is this jump blocked by something?" (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (vector-copy! v1-0 (-> arg0 dest-pos)) (set! (-> v1-0 w) (-> this nav-radius-backup)) - (add-root-sphere-to-hash! (-> this nav) v1-0 #x100068) + (check-sphere-blocked! (-> this nav) v1-0 #x100068) ) ) ;; definition for method 101 of type nav-enemy ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-101 ((this nav-enemy) (arg0 int) (arg1 enemy-jump-info)) - (let ((v1-0 arg0)) - (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) - (let ((a1-4 this)) - (if (logtest? (enemy-flag ef38) (-> a1-4 enemy-flags)) - (seek-to-point-toward-point! (-> this root) (-> arg1 dest-pos) (-> this nav max-rotation-rate) (seconds 0.02)) - ) - ) - ) +(defmethod adjust-heading-for-jump ((this nav-enemy) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Can be overriden. Yaw the enemy in response to an ongoing jump." + (case arg0 + (((jump-stage init) (jump-stage winding-up) (jump-stage takeoff) (jump-stage in-air)) + (let ((a1-4 this)) + (if (logtest? (enemy-flag ef38) (-> a1-4 enemy-flags)) + (seek-to-point-toward-point! (-> this root) (-> arg1 dest-pos) (-> this nav max-rotation-rate) (seconds 0.02)) + ) + ) + ) ) (none) ) @@ -2355,7 +2367,7 @@ (init-jump-info! self gp-0) (if (and (-> self enemy-info use-jump-blocked) (logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags)) - (enemy-method-91 self gp-0) + (check-jump-blocked? self gp-0) ) (go-virtual jump-blocked) ) @@ -2363,7 +2375,7 @@ (a1-2 (-> gp-0 dest-pos)) (f0-0 (-> v1-13 extra-nav-sphere w)) ) - (set! (-> v1-13 extra-nav-sphere quad) (-> a1-2 quad)) + (vector-copy! (-> v1-13 extra-nav-sphere) a1-2) (set! (-> v1-13 extra-nav-sphere w) f0-0) ) 0 @@ -2377,11 +2389,11 @@ 0 (when (logtest? (-> gp-0 flags) (enemy-jump-flags ejf0)) (until #f - (if (jump-anim-handler self s5-0 gp-0) + (if (jump-anim-handler self (the-as jump-stage s5-0) gp-0) (goto cfg-12) ) - (in-jump-handler self s5-0 gp-0) - (enemy-method-101 self s5-0 gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-0) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-0) gp-0) (suspend) (set! s5-0 1) ) @@ -2392,11 +2404,11 @@ (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) (let ((s5-1 2)) (logior! (-> self focus-status) (focus-status in-air)) - (until (on-ground? self gp-0) + (until (landed-jump-yet? self gp-0) (+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter))) - (jump-anim-handler self s5-1 gp-0) - (in-jump-handler self s5-1 gp-0) - (enemy-method-101 self s5-1 gp-0) + (jump-anim-handler self (the-as jump-stage s5-1) gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-1) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-1) gp-0) (suspend) (set! s5-1 3) ) @@ -2414,11 +2426,11 @@ (move-to-gspot! self) (let ((s5-2 4)) (until #f - (if (jump-anim-handler self s5-2 gp-0) + (if (jump-anim-handler self (the-as jump-stage s5-2) gp-0) (goto cfg-19) ) - (in-jump-handler self s5-2 gp-0) - (enemy-method-101 self s5-2 gp-0) + (move-along-ballistic-trajectory-for-jump self (the-as jump-stage s5-2) gp-0) + (adjust-heading-for-jump self (the-as jump-stage s5-2) gp-0) (suspend) (set! s5-2 5) ) @@ -2435,7 +2447,7 @@ ) ) ) - (go-directed2 self) + (go-next-state-auto self) ) :post (behavior () (let ((a0-0 self)) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-engine_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-engine_REF.gc index 206e41155f5..301334bf957 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-engine_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-engine_REF.gc @@ -231,7 +231,7 @@ ((-> (the-as connection v1-6) param2) (let ((s1-0 (-> (the-as process-focusable a0-4) nav))) (set! (-> s1-0 sec-per-frame) (-> (the-as process-focusable a0-4) clock seconds-per-frame)) - (set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad)) + (vector-copy! (-> s1-0 root-nav-sphere) (-> (the-as collide-shape s2-0) trans)) (set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius)) (if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash)) (set! (-> this output-sphere-hash) (the-as uint 1)) @@ -258,7 +258,7 @@ (else (when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) (let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> (the-as collide-shape s2-0) trans quad)) + (vector-copy! a1-5 (-> (the-as collide-shape s2-0) trans)) (set! (-> a1-5 w) (-> (the-as collide-shape s2-0) nav-radius)) (add-a-sphere-with-flag arg0 a1-5 (the-as int (-> (the-as collide-shape s2-0) backup-collide-as))) ) @@ -279,7 +279,7 @@ (+! s1-1 -1) (when (and (logtest? (collide-action nav-sphere) (-> s2-1 prim-core action)) (= (-> s2-1 prim-core prim-type) -1)) (let ((a1-6 (new 'stack-no-clear 'vector))) - (set! (-> a1-6 quad) (-> s2-1 prim-core world-sphere quad)) + (vector-copy! a1-6 (-> s2-1 prim-core world-sphere)) (set! (-> a1-6 w) (-> (the-as collide-shape-prim-sphere s2-1) nav-radius)) (add-a-sphere-with-flag arg0 a1-6 (the-as int (-> s2-1 prim-core collide-as))) ) @@ -310,7 +310,7 @@ (when *target* (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((v1-8 (-> *target* control))) - (set! (-> a1-0 quad) (-> v1-8 trans quad)) + (vector-copy! a1-0 (-> v1-8 trans)) (set! (-> a1-0 w) (-> v1-8 nav-radius)) ) (add-a-sphere-with-flag gp-0 a1-0 2) @@ -613,7 +613,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/nav/nav-mesh-h_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-mesh-h_REF.gc index fb02eebe7a5..1689002b278 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-mesh-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-mesh-h_REF.gc @@ -516,7 +516,7 @@ Based on the implementation of point-poly-intersection?, these should likely be (vf3 :class vf) ) (init-vf0-vector) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (let ((v0-0 arg0)) (let ((f0-0 1.0)) (.lvf vf1 (&-> v0-0 quad)) @@ -659,13 +659,13 @@ Based on the implementation of point-poly-intersection?, these should likely be (let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-3) (-> arg0 vertex s2-0) sv-48))) (when (< f0-1 (the-as float sv-56)) (set! sv-56 f0-1) - (set! (-> sv-52 quad) (-> sv-48 quad)) + (vector-copy! sv-52 sv-48) ) ) (set! v1-3 s2-0) ) ) - (set! (-> arg1 quad) (-> sv-52 quad)) + (vector-copy! arg1 sv-52) arg1 ) @@ -676,7 +676,7 @@ Based on the implementation of point-poly-intersection?, these should likely be (local-vars (sv-48 vector) (sv-52 vector) (sv-56 number)) (cond ((point-in-poly? this arg0 arg2) - (set! (-> arg1 quad) (-> arg2 quad)) + (vector-copy! arg1 arg2) ) (else (let ((s5-1 arg1)) @@ -690,13 +690,13 @@ Based on the implementation of point-poly-intersection?, these should likely be (let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-6) (-> arg0 vertex s1-0) sv-48))) (when (< f0-1 (the-as float sv-56)) (set! sv-56 f0-1) - (set! (-> sv-52 quad) (-> sv-48 quad)) + (vector-copy! sv-52 sv-48) ) ) (set! v1-6 s1-0) ) ) - (set! (-> s5-1 quad) (-> sv-52 quad)) + (vector-copy! s5-1 sv-52) ) ) ) @@ -759,7 +759,7 @@ Based on the implementation of point-poly-intersection?, these should likely be (set! (-> arg0 next-poly) #f) (cond ((= sv-16 -1) - (set! (-> arg0 current-pos quad) (-> arg0 dest-pos quad)) + (vector-copy! (-> arg0 current-pos) (-> arg0 dest-pos)) (set! (-> arg0 reached-dest) #t) (set! (-> arg0 terminated) #t) ) diff --git a/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc b/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc index 405f878aa6f..f3629afd4f2 100644 --- a/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc +++ b/test/decompiler/reference/jak3/engine/nav/nav-mesh_REF.gc @@ -393,7 +393,7 @@ (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this nav-mesh bounds quad)) + (vector-copy! s5-0 (-> this nav-mesh bounds)) (let ((a0-6 (new 'stack 'random-generator))) (set! (-> a0-6 seed) (-> this aid)) (let* ((v1-4 (rand-uint31-gen a0-6)) @@ -485,7 +485,7 @@ gp-0 ) (else - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) (the-as nav-mesh #f) ) ) @@ -518,7 +518,7 @@ ) ) (else - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) (the-as nav-poly #f) ) ) @@ -536,7 +536,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod debug-draw-poly ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) - (set! (-> gp-0 0 quad) (-> this bounds quad)) + (vector-copy! (-> gp-0 0) (-> this bounds)) (if (logtest? (-> arg0 pat) 15) (+! (-> gp-0 0 y) 409.6) ) @@ -1178,8 +1178,8 @@ (vf3 :class vf) ) (init-vf0-vector) - (set! (-> arg0 current-pos quad) (-> arg2 quad)) - (set! (-> arg0 dest-pos quad) (-> arg3 quad)) + (vector-copy! (-> arg0 current-pos) arg2) + (vector-copy! (-> arg0 dest-pos) arg3) (set! (-> arg0 current-poly) arg1) (let ((v1-2 arg0)) (vector-! (-> v1-2 dir) (-> v1-2 dest-pos) (-> v1-2 current-pos)) @@ -1234,7 +1234,7 @@ ) (init-vf0-vector) (set! (-> arg0 current-poly) arg1) - (set! (-> arg0 current-pos quad) (-> arg2 quad)) + (vector-copy! (-> arg0 current-pos) arg2) (let ((a1-3 (-> arg0 dest-pos))) (let ((v1-1 (-> arg0 current-pos))) (let ((a2-1 arg3)) @@ -1775,7 +1775,7 @@ (set! sv-28 (-> arg0 vertex-count)) (set! sv-32 (-> sv-24 vert0-table)) (set! sv-36 (-> sv-24 vert1-table)) - (set! (-> arg2 quad) (-> arg3 quad)) + (vector-copy! arg2 arg3) (dotimes (v1-8 (the-as int sv-28)) (set! sv-40 (-> arg0 vertex (-> sv-32 v1-8))) (set! sv-44 (-> arg0 vertex (-> sv-36 v1-8))) @@ -1874,12 +1874,12 @@ (nav-normal-from-3-points s4-0 (the-as vector (-> arg0 vertex)) (-> arg0 vertex1) (-> arg0 vertex2)) ) ) - (set! (-> arg2 quad) (-> s4-0 quad)) + (vector-copy! arg2 s4-0) (set! (-> s4-0 w) (- (vector-dot s4-0 (the-as vector (-> arg0 vertex))))) - (set! (-> s5-0 quad) (-> arg3 quad)) + (vector-copy! s5-0 arg3) (set! (-> s5-0 y) (/ (- (+ (* (-> arg3 x) (-> s4-0 x)) (* (-> arg3 z) (-> s4-0 z)) (-> s4-0 w))) (-> s4-0 y))) ) - (set! (-> arg1 quad) (-> s5-0 quad)) + (vector-copy! arg1 s5-0) ) 0 (none) @@ -2015,8 +2015,8 @@ ) (dotimes (s1-0 (the-as int s2-0)) (when (= (-> arg0 adj-poly v1-1) 255) - (set! (-> gp-0 2 quad) (-> arg0 vertex v1-1 quad)) - (set! (-> gp-0 3 quad) (-> arg0 vertex s1-0 quad)) + (vector-copy! (-> gp-0 2) (-> arg0 vertex v1-1)) + (vector-copy! (-> gp-0 3) (-> arg0 vertex s1-0)) (set! (-> gp-0 2 y) (-> arg2 y)) (set! (-> gp-0 3 y) (-> arg2 y)) (set! (-> gp-0 2 w) 1.0) @@ -2024,14 +2024,14 @@ (let ((f0-5 (vector-segment-distance-point! arg2 (-> gp-0 2) (-> gp-0 3) (-> gp-0 0)))) (when (< f0-5 (-> gp-0 4 x)) (set! (-> gp-0 4 x) f0-5) - (set! (-> gp-0 1 quad) (-> gp-0 0 quad)) + (vector-copy! (-> gp-0 1) (-> gp-0 0)) ) ) ) (set! v1-1 s1-0) ) ) - (set! (-> arg1 quad) (-> gp-0 1 quad)) + (vector-copy! arg1 (-> gp-0 1)) (-> gp-0 4 x) ) ) @@ -2044,7 +2044,7 @@ (set! sv-80 arg0) (set! (-> gp-0 vertex3 y) (the-as float #x7f800000)) (set! (-> gp-0 vertex3 x) arg2) - (set! (-> gp-0 vertex1 quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 vertex1) arg1) (set! sv-84 (search-for-sphere (-> this poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) (let ((s4-0 (-> this poly-hash bucket-size)) (s3-0 sv-84) @@ -2086,7 +2086,7 @@ ) ) 0 - (set! (-> sv-80 quad) (-> gp-0 vertex 0 quad)) + (vector-copy! sv-80 (-> gp-0 vertex 0)) (-> gp-0 vertex3 y) ) ) @@ -2099,7 +2099,7 @@ (set! (-> gp-0 2 vertex3 y) arg2) (vector-! (the-as vector (-> gp-0 0)) arg0 (the-as vector (-> this bounds))) (vector-! (-> gp-0 0 vertex1) arg1 (the-as vector (-> this bounds))) - (set! (-> gp-0 2 vertex1 quad) (-> gp-0 0 vertex0 quad)) + (vector-copy! (-> gp-0 2 vertex1) (-> gp-0 0 vertex0)) (set! (-> gp-0 2 vertex2 x) (-> this nearest-y-threshold)) (set! (-> gp-0 2 data 36) (the-as uint 3)) (let ((a1-4 (nav-mesh-method-45 this (the-as nav-poly (-> gp-0 2 vertex1))))) @@ -2112,7 +2112,7 @@ ) (when (< (-> gp-0 2 vertex3 z) (-> gp-0 2 vertex3 y)) (set! (-> gp-0 2 vertex3 y) (-> gp-0 2 vertex3 z)) - (set! (-> gp-0 0 vertex2 quad) (-> gp-0 0 vertex3 quad)) + (vector-copy! (-> gp-0 0 vertex2) (-> gp-0 0 vertex3)) ) (b! (-> gp-0 2 vertex0 x) cfg-6 :delay (nop!)) (advance-ray-to-nearest-poly-edge-or-dest! this (the-as nav-ray (-> gp-0 1))) @@ -2170,7 +2170,7 @@ (set! (-> gp-0 byte04) 3) (set! (-> gp-0 vec3 y) arg1) (set! (-> gp-0 byte02) 0) - (set! (-> gp-0 vec1 quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 vec1) arg0) (b! #t cfg-9 :delay (nop!)) (label cfg-1) (set! (-> gp-0 nav-id-params bsphere quad) (-> gp-0 vec1 quad)) @@ -2188,7 +2188,7 @@ (label cfg-3) (dotimes (v1-15 (-> gp-0 byte01)) (let ((a1-2 (-> gp-0 byte-arr v1-15))) - (set! (-> gp-0 vec4 quad) (-> this sphere-hash sphere-array a1-2 quad)) + (vector-copy! (-> gp-0 vec4) (-> this sphere-hash sphere-array a1-2)) ) (vector-! (-> gp-0 vec5) (-> gp-0 vec1) (-> gp-0 vec4)) (set! (-> gp-0 vec5 y) 0.0) @@ -2199,7 +2199,7 @@ (f1-4 (+ (-> gp-0 vec3 y) (-> gp-0 vec4 w))) ) (when (< f0-8 (* f1-4 f1-4)) - (set! (-> gp-0 vec2 quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> gp-0 vec2) (-> gp-0 vec1)) (set! (-> gp-0 vec3 w) (sqrtf (-> gp-0 vec3 z))) (vector-float*! (-> gp-0 vec6) (-> gp-0 vec5) (/ 1.0 (-> gp-0 vec3 w))) (vector+float*! diff --git a/test/decompiler/reference/jak3/engine/physics/chain-physics_REF.gc b/test/decompiler/reference/jak3/engine/physics/chain-physics_REF.gc index 507c3625913..be7ef958d7f 100644 --- a/test/decompiler/reference/jak3/engine/physics/chain-physics_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/chain-physics_REF.gc @@ -281,9 +281,9 @@ ) ) ) - (set! (-> sv-272 position quad) (-> sv-528 quad)) + (vector-copy! (-> sv-272 position) sv-528) (if (-> sv-272 joint-mod) - (set! (-> sv-272 joint-mod trans quad) (-> sv-528 quad)) + (vector-copy! (-> sv-272 joint-mod trans) sv-528) ) (when (< s0-0 (the-as int (-> this num-joints))) (vector-! (-> s4-0 uvec) sv-528 s3-0) @@ -334,20 +334,20 @@ (.mul.x.vf acc vf2 vf3) (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) (.svf (&-> sv-512 quad) vf4) - (set! (-> sv-272 old-x quad) (-> s4-0 rvec quad)) + (vector-copy! (-> sv-272 old-x) (-> s4-0 rvec)) ) (else - (set! (-> s4-0 rvec quad) (-> sv-496 quad)) - (set! (-> sv-272 old-x quad) (-> s4-0 rvec quad)) + (vector-copy! (-> s4-0 rvec) sv-496) + (vector-copy! (-> sv-272 old-x) (-> s4-0 rvec)) ) ) (vector-cross! (-> s4-0 fvec) (-> s4-0 rvec) (-> s4-0 uvec)) (matrix->quaternion (-> sv-272 joint-mod quat) s4-0) - (set! (-> s1-0 quad) (-> s4-0 uvec quad)) - (set! (-> s2-0 quad) (-> s4-0 fvec quad)) + (vector-copy! s1-0 (-> s4-0 uvec)) + (vector-copy! s2-0 (-> s4-0 fvec)) 0 ) - (set! (-> s3-0 quad) (-> sv-528 quad)) + (vector-copy! s3-0 sv-528) 0 ) ) @@ -380,7 +380,7 @@ (set! (-> arg1 root-joint-index) (the-as uint arg2)) (set! (-> arg1 joint-length) arg3) (set-vector! (-> arg1 gravity) 0.0 -1.0 0.0 1.0) - (set! (-> arg1 gravity-target quad) (-> arg1 gravity quad)) + (vector-copy! (-> arg1 gravity-target) (-> arg1 gravity)) (set! (-> arg1 stretch-vel) 0.7) (set! (-> arg1 stretch-vel-parallel) 0.8) (set! (-> arg1 compress-vel) 0.85) @@ -391,7 +391,3 @@ (set! (-> arg1 turn-off-start) 0) 0 ) - - - - diff --git a/test/decompiler/reference/jak3/engine/physics/cloth_REF.gc b/test/decompiler/reference/jak3/engine/physics/cloth_REF.gc index 4c45b258507..09d47b9d066 100644 --- a/test/decompiler/reference/jak3/engine/physics/cloth_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/cloth_REF.gc @@ -85,30 +85,26 @@ ;; WARN: Return type mismatch cloth-flag vs none. (defmethod pre-physics-update ((this cloth-on-skeleton)) "Callback to update prior to running verlet integration. Can handle movement of the entire system in the world, for example" + (local-vars (v1-4 matrix)) (let ((s5-0 (new 'stack-no-clear 'matrix)) (s4-0 (handle->process (-> this owner))) ) (when s4-0 - (cond - ((< -1 (-> this base-transform-index)) - (let* ((v1-4 s5-0) - (a3-0 (-> (the-as process-focusable s4-0) node-list data (-> this base-transform-index) bone transform)) - (a0-8 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) + (set! v1-4 + (cond + ((< -1 (-> this base-transform-index)) + (matrix-copy! + s5-0 + (-> (the-as process-focusable s4-0) node-list data (-> this base-transform-index) bone transform) + ) + ) + (else + (quaternion->matrix s5-0 (-> (the-as process-focusable s4-0) root quat)) + (vector-copy! (-> s5-0 trans) (-> (the-as process-focusable s4-0) root trans)) + v1-4 ) - (set! (-> v1-4 rvec quad) a0-8) - (set! (-> v1-4 uvec quad) a1-3) - (set! (-> v1-4 fvec quad) a2-0) - (set! (-> v1-4 trans quad) a3-1) - ) - ) - (else - (quaternion->matrix s5-0 (-> (the-as process-focusable s4-0) root quat)) - (set! (-> s5-0 trans quad) (-> (the-as process-focusable s4-0) root trans quad)) - ) - ) + ) + ) (vector-normalize! (-> s5-0 fvec) 1.0) (vector-normalize! (-> s5-0 uvec) 1.0) (vector-normalize! (-> s5-0 rvec) 1.0) @@ -130,7 +126,7 @@ (set! (-> s3-0 trans w) 1.0) (matrix*! s4-1 s4-1 s3-0) (matrix-identity! s3-0) - (set! (-> s3-0 trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> s3-0 trans) (-> s5-0 trans)) (matrix*! s4-1 s4-1 s3-0) ) ) @@ -152,17 +148,7 @@ ) ) ) - (let ((a2-7 (-> this last-owner-mat)) - (v1-54 (-> s5-0 rvec quad)) - (a0-42 (-> s5-0 uvec quad)) - (a1-23 (-> s5-0 fvec quad)) - (a3-2 (-> s5-0 trans quad)) - ) - (set! (-> a2-7 rvec quad) v1-54) - (set! (-> a2-7 uvec quad) a0-42) - (set! (-> a2-7 fvec quad) a1-23) - (set! (-> a2-7 trans quad) a3-2) - ) + (matrix-copy! (-> this last-owner-mat) s5-0) (logclear! (-> this flags) (cloth-flag local-space local-space-xyz local-space-y)) ) ) @@ -174,30 +160,26 @@ ;; WARN: Return type mismatch symbol vs none. (defmethod reset! ((this cloth-on-skeleton)) "Reset to stationary/default state." + (local-vars (v1-5 matrix)) (let ((s5-0 (new 'stack-no-clear 'matrix)) (s4-0 (handle->process (-> this owner))) ) (when s4-0 - (cond - ((< -1 (-> this base-transform-index)) - (let* ((v1-5 s5-0) - (a3-0 (-> (the-as process-focusable s4-0) node-list data (-> this base-transform-index) bone transform)) - (a0-8 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) + (set! v1-5 + (cond + ((< -1 (-> this base-transform-index)) + (matrix-copy! + s5-0 + (-> (the-as process-focusable s4-0) node-list data (-> this base-transform-index) bone transform) + ) + ) + (else + (quaternion->matrix s5-0 (-> (the-as process-focusable s4-0) root quat)) + (vector-copy! (-> s5-0 trans) (-> (the-as process-focusable s4-0) root trans)) + v1-5 ) - (set! (-> v1-5 rvec quad) a0-8) - (set! (-> v1-5 uvec quad) a1-3) - (set! (-> v1-5 fvec quad) a2-0) - (set! (-> v1-5 trans quad) a3-1) - ) - ) - (else - (quaternion->matrix s5-0 (-> (the-as process-focusable s4-0) root quat)) - (set! (-> s5-0 trans quad) (-> (the-as process-focusable s4-0) root trans quad)) - ) - ) + ) + ) (dotimes (s4-1 (-> this particles length)) (vector-matrix*! (the-as vector (-> this particles data s4-1)) (the-as vector (-> this mesh mesh s4-1)) s5-0) (vector-float*! @@ -215,7 +197,7 @@ ) ) (let ((a0-25 (-> s5-0 trans))) - (set! (-> this last-owner-pos quad) (-> a0-25 quad)) + (vector-copy! (-> this last-owner-pos) a0-25) ) ) ) @@ -830,7 +812,7 @@ (when (< (* f0-0 f0-0) (vector-vector-distance-squared (-> this last-owner-pos) s5-2)) ) ) - (set! (-> this last-owner-pos quad) (-> s5-2 quad)) + (vector-copy! (-> this last-owner-pos) s5-2) ) ) ) @@ -917,8 +899,8 @@ (vector-! a1-4 a1-4 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) (vector+float*! a1-4 a1-4 a3-0 f0-1) ) - (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) - (set! (-> a2-1 pos quad) (-> a1-4 quad)) + (vector-copy! (-> a2-1 prev-pos) (-> a2-1 pos)) + (vector-copy! (-> a2-1 pos) a1-4) ) ) ) @@ -1247,7 +1229,7 @@ (when (< 0.0 f0-2) (vector+float*! t0-7 a3-7 (-> a0-6 normal) (* -1.0 f0-2)) (if (< (vector-length (vector-! (new 'stack-no-clear 'vector) t0-7 (-> a0-6 origin))) (-> a0-6 radius)) - (set! (-> a3-7 quad) (-> t0-7 quad)) + (vector-copy! a3-7 t0-7) ) ) ) @@ -1270,8 +1252,8 @@ (a1-20 (the-as object (&-> (-> this particles) _data (* (* 48 (-> this cloth-width)) v1-13)))) ) (set! (-> a0-19 mass-scale) 0.0) - (set! (-> a0-19 pos quad) (-> (the-as vector (&-> (the-as vector a1-20) x)) quad)) - (set! (-> a0-19 prev-pos quad) (-> (the-as vector (&-> (the-as vector a1-20) x)) quad)) + (vector-copy! (-> a0-19 pos) (the-as vector (&-> (the-as vector a1-20) x))) + (vector-copy! (-> a0-19 prev-pos) (the-as vector (&-> (the-as vector a1-20) x))) ) ) ) @@ -2016,7 +1998,7 @@ (cond (s5-0 (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this collision-constraints data s4-1 quad)) + (vector-copy! s3-0 (-> this collision-constraints data s4-1)) (set! (-> s3-0 w) 1.0) (vector-matrix*! s3-0 @@ -2200,7 +2182,7 @@ (when (logtest? (-> this flags) (cloth-flag use-parent-momentum)) (let ((proc (handle->process (-> this owner)))) (if proc - (set! (-> this momentum quad) (-> (the-as process-drawable proc) root transv quad)) + (vector-copy! (-> this momentum) (-> (the-as process-drawable proc) root transv)) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc b/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc index a6c6d4e9632..7264f6f48d1 100644 --- a/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/ragdoll-edit_REF.gc @@ -147,27 +147,16 @@ (cond (s2-0 (quaternion->matrix arg0 (-> s2-0 quat)) - (set! (-> arg1 quad) (-> s2-0 position quad)) + (vector-copy! arg1 (-> s2-0 position)) arg1 ) ((< (-> arg2 0 parent-joint) 0) (quaternion->matrix arg0 (-> arg4 root quat)) - (set! (-> arg1 quad) (-> arg4 root trans quad)) + (vector-copy! arg1 (-> arg4 root trans)) arg1 ) (else - (let* ((v1-8 arg0) - (a3-1 (-> arg4 node-list data (-> arg2 0 parent-joint) bone transform)) - (a0-7 (-> a3-1 rvec quad)) - (a1-6 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-8 rvec quad) a0-7) - (set! (-> v1-8 uvec quad) a1-6) - (set! (-> v1-8 fvec quad) a2-1) - (set! (-> v1-8 trans quad) a3-2) - ) + (matrix-copy! arg0 (-> arg4 node-list data (-> arg2 0 parent-joint) bone transform)) (vector<-cspace! arg1 (-> arg4 node-list data (-> arg2 0 parent-joint))) ) ) @@ -274,25 +263,15 @@ (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s0-0 pre-tform) (- (-> s0-0 pre-tform w))) ) (set! sv-4432 (new 'stack-no-clear 'vector)) - (let* ((v1-11 s1-0) - (a3-0 - (-> s3-0 - (/ (the-as uint (&- (the-as pointer sv-4352) (the-as uint (the-as pointer (-> arg0 ragdoll-joints))))) - (the-as uint 192) - ) - ) + (matrix-copy! + s1-0 + (-> s3-0 + (/ (the-as uint (&- (the-as pointer sv-4352) (the-as uint (the-as pointer (-> arg0 ragdoll-joints))))) + (the-as uint 192) ) - (a0-9 (-> a3-0 rvec quad)) - (a1-5 (-> a3-0 uvec quad)) - (a2-2 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-11 rvec quad) a0-9) - (set! (-> v1-11 uvec quad) a1-5) - (set! (-> v1-11 fvec quad) a2-2) - (set! (-> v1-11 trans quad) a3-1) + ) ) - (set! (-> sv-4432 quad) (-> s1-0 trans quad)) + (vector-copy! sv-4432 (-> s1-0 trans)) (vector-reset! (-> s1-0 trans)) (when (and (-> this auto-setup-now) (ragdoll-edit-info-method-10 this arg0 (the-as ragdoll-joint (-> s0-0 joint-index))) @@ -312,49 +291,27 @@ ) (t9-10 a0-21 sv-4416 a2-8) ) - (set! (-> s1-0 trans quad) (-> sv-4432 quad)) + (vector-copy! (-> s1-0 trans) sv-4432) (vector-! (-> sv-4368 uvec) (-> s0-0 position) (-> sv-4352 position)) (vector-normalize! (-> sv-4368 uvec) 1.0) (vector-flatten! (-> sv-4368 rvec) (-> s1-0 rvec) (-> sv-4368 uvec)) (vector-normalize! (-> sv-4368 rvec) 1.0) (vector-cross! (-> sv-4368 fvec) (-> sv-4368 rvec) (-> sv-4368 uvec)) - (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (vector-copy! (-> sv-4368 trans) (-> s0-0 position)) (set! (-> sv-4368 rvec w) 0.0) (set! (-> sv-4368 uvec w) 0.0) (set! (-> sv-4368 fvec w) 0.0) ) ((= s0-0 (-> arg0 ragdoll-joints)) (quaternion->matrix sv-4368 (-> s0-0 quat)) - (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) + (vector-copy! (-> sv-4368 trans) (-> s0-0 position)) (quaternion->matrix s1-0 (-> arg1 root quat)) - (set! (-> s1-0 trans quad) (-> arg1 root trans quad)) + (vector-copy! (-> s1-0 trans) (-> arg1 root trans)) ) (else - (let* ((v1-43 sv-4368) - (a3-2 (-> arg1 node-list data (-> s0-0 joint-index) bone transform)) - (a0-43 (-> a3-2 rvec quad)) - (a1-27 (-> a3-2 uvec quad)) - (a2-10 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> v1-43 rvec quad) a0-43) - (set! (-> v1-43 uvec quad) a1-27) - (set! (-> v1-43 fvec quad) a2-10) - (set! (-> v1-43 trans quad) a3-3) - ) - (set! (-> sv-4368 trans quad) (-> s0-0 position quad)) - (let* ((a2-11 s1-0) - (a3-4 sv-4368) - (v1-46 (-> a3-4 rvec quad)) - (a0-46 (-> a3-4 uvec quad)) - (a1-28 (-> a3-4 fvec quad)) - (a3-5 (-> a3-4 trans quad)) - ) - (set! (-> a2-11 rvec quad) v1-46) - (set! (-> a2-11 uvec quad) a0-46) - (set! (-> a2-11 fvec quad) a1-28) - (set! (-> a2-11 trans quad) a3-5) - ) + (matrix-copy! sv-4368 (-> arg1 node-list data (-> s0-0 joint-index) bone transform)) + (vector-copy! (-> sv-4368 trans) (-> s0-0 position)) + (matrix-copy! s1-0 sv-4368) (vector<-cspace! (-> s1-0 trans) (-> arg1 node-list data (-> s0-0 parent-joint))) ) ) @@ -363,18 +320,7 @@ ) (set! sv-4464 (new 'stack-no-clear 'matrix)) (set! sv-4480 (new 'stack-no-clear 'matrix)) - (let* ((a2-13 sv-4464) - (a3-6 sv-4368) - (v1-56 (-> a3-6 rvec quad)) - (a0-49 (-> a3-6 uvec quad)) - (a1-32 (-> a3-6 fvec quad)) - (a3-7 (-> a3-6 trans quad)) - ) - (set! (-> a2-13 rvec quad) v1-56) - (set! (-> a2-13 uvec quad) a0-49) - (set! (-> a2-13 fvec quad) a1-32) - (set! (-> a2-13 trans quad) a3-7) - ) + (matrix-copy! sv-4464 sv-4368) (vector-reset! (-> sv-4464 trans)) (matrix-transpose! sv-4464 sv-4464) (set! sv-4448 (matrix->quaternion @@ -415,7 +361,7 @@ (matrix-axis-angle! (new 'stack-no-clear 'matrix) (-> s0-0 geo-tform) (- (-> s0-0 geo-tform w))) ) (matrix*! sv-4496 sv-4496 sv-4368) - (set! (-> sv-4496 trans quad) (-> (the-as matrix sv-4368) trans quad)) + (vector-copy! (-> sv-4496 trans) (-> (the-as matrix sv-4368) trans)) (let ((t9-30 add-debug-matrix) (a0-66 #t) (a1-46 577) @@ -424,7 +370,7 @@ (t9-30 a0-66 (the-as bucket-id a1-46) sv-4496 (the-as meters a3-10)) ) (let ((a2-22 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> s0-0 quat)))) - (set! (-> a2-22 trans quad) (-> (the-as matrix sv-4368) trans quad)) + (vector-copy! (-> a2-22 trans) (-> (the-as matrix sv-4368) trans)) (add-debug-matrix #t (bucket-id debug-no-zbuf1) a2-22 (meters 0.15)) ) (when (or (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) @@ -459,18 +405,7 @@ (let ((s2-0 (new 'stack-no-clear 'matrix)) (s1-0 (new 'stack-no-clear 'vector)) ) - (let* ((v1-1 s2-0) - (a3-0 (-> arg0 node-list data s3-0 bone transform)) - (a0-4 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-1 rvec quad) a0-4) - (set! (-> v1-1 uvec quad) a1-2) - (set! (-> v1-1 fvec quad) a2-1) - (set! (-> v1-1 trans quad) a3-1) - ) + (matrix-copy! s2-0 (-> arg0 node-list data s3-0 bone transform)) (vector<-cspace! (-> s2-0 trans) (-> arg0 node-list data s3-0)) (when (or (= arg1 -1) (= arg1 s3-0)) (add-debug-matrix #t (bucket-id debug-no-zbuf1) s2-0 (the-as meters arg2)) diff --git a/test/decompiler/reference/jak3/engine/physics/ragdoll_REF.gc b/test/decompiler/reference/jak3/engine/physics/ragdoll_REF.gc index 6291b6a3357..7cfba1fd7c1 100644 --- a/test/decompiler/reference/jak3/engine/physics/ragdoll_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/ragdoll_REF.gc @@ -39,8 +39,8 @@ (let ((s4-1 (new 'stack-no-clear 'collide-query)) (s5-1 (new 'stack-no-clear 'bounding-box)) ) - (set! (-> s5-1 min quad) (-> this ragdoll-joints 0 position quad)) - (set! (-> s5-1 max quad) (-> s5-1 min quad)) + (vector-copy! (-> s5-1 min) (-> this ragdoll-joints 0 position)) + (vector-copy! (-> s5-1 max) (-> s5-1 min)) (dotimes (v1-25 (the-as int (-> this num-joints))) (let ((a2-2 (-> this ragdoll-joints v1-25)) (a0-21 (new 'stack-no-clear 'vector)) @@ -231,7 +231,7 @@ (a0-4 (new 'stack-no-clear 'vector)) ) 0.0 - (set! (-> a0-4 quad) (-> s5-1 quad)) + (vector-copy! a0-4 s5-1) (let ((f30-0 (vector-normalize-ret-len! a0-4 1.0))) (if (< f30-0 0.1) (return #f) @@ -239,7 +239,7 @@ (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (-> this ragdoll-joints 0 velocity))) (s1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s1-1 quad) (-> s3-1 quad)) + (vector-copy! s1-1 s3-1) (let ((f28-1 (* arg2 (vector-normalize-ret-len! s1-1 1.0) (/ 1.0 (-> pp clock time-adjust-ratio)))) (a0-7 (vector+float*! (new 'stack-no-clear 'vector) arg0 s1-1 (vector-dot s5-1 s1-1))) ) @@ -325,7 +325,7 @@ ) (logclear! (-> s4-1 ragdoll-joint-flags) (ragdoll-joint-flag rjf0 rjf2)) (set! (-> s4-1 original-speed) 0.0) - (set! (-> arg0 quad) (-> s4-1 position quad)) + (vector-copy! arg0 (-> s4-1 position)) (until (or (< 6 s1-1) (begin (.lvf vf1 (&-> s3-2 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -342,8 +342,8 @@ ) ) (+! s1-1 1) - (set! (-> s2-1 start-pos quad) (-> arg0 quad)) - (set! (-> s2-1 move-dist quad) (-> s3-2 quad)) + (vector-copy! (-> s2-1 start-pos) arg0) + (vector-copy! (-> s2-1 move-dist) s3-2) (let ((v1-49 s2-1)) (set! (-> v1-49 radius) (-> s4-1 coll-rad)) (set! (-> v1-49 collide-with) (the-as collide-spec (-> this bg-collide-with))) @@ -458,7 +458,7 @@ (let ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> proc node-list data (-> s4-0 0 joint-index)))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> s4-0 0 position quad)) + (vector-copy! s3-0 (-> s4-0 0 position)) (if (logtest? (-> this ragdoll-flags) (ragdoll-flag mirror)) (vector-matrix*! s3-0 s3-0 (-> this mirror)) ) @@ -487,16 +487,8 @@ 0.0 (let ((s3-0 (new-stack-vector0))) 0.0 - (let ((s2-0 (new 'stack-no-clear 'matrix))) - (set! (-> s2-0 rvec quad) (the-as uint128 0)) - (set! (-> s2-0 uvec quad) (the-as uint128 0)) - (set! (-> s2-0 fvec quad) (the-as uint128 0)) - (set! (-> s2-0 trans quad) (the-as uint128 0)) - (let ((s0-0 (new 'stack-no-clear 'matrix))) - (set! (-> s0-0 rvec quad) (the-as uint128 0)) - (set! (-> s0-0 uvec quad) (the-as uint128 0)) - (set! (-> s0-0 fvec quad) (the-as uint128 0)) - (set! (-> s0-0 trans quad) (the-as uint128 0)) + (let ((s2-0 (new-stack-matrix0))) + (let ((s0-0 (new-stack-matrix0))) (vector-normalize-copy! (-> s0-0 rvec) (-> sv-208 rvec) 1.0) (vector-normalize-copy! (-> s0-0 uvec) (-> sv-208 uvec) 1.0) (vector-normalize-copy! (-> s0-0 fvec) (-> sv-208 fvec) 1.0) @@ -563,7 +555,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defun ragdoll-joint-callback ((arg0 cspace) (arg1 transformq) (arg2 process-drawable) (arg3 ragdoll-proc)) - (local-vars (sv-240 int) (sv-256 quaternion) (sv-272 vector) (sv-288 matrix)) + (local-vars (a2-10 matrix) (sv-240 int) (sv-256 quaternion) (sv-272 vector) (sv-288 matrix)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -626,40 +618,33 @@ ) ) ) - (set! (-> s2-1 trans quad) (-> s1-1 position quad)) + (vector-copy! (-> s2-1 trans) (-> s1-1 position)) (set! (-> s2-1 trans w) 1.0) (if (logtest? (-> s3-1 ragdoll-flags) (ragdoll-flag mirror)) (matrix*! s2-1 s2-1 (-> s3-1 mirror)) ) - (cond - ((>= (-> s3-1 flex-blend) 1.0) - (let ((a2-10 (-> arg0 bone transform)) - (v1-51 (-> s2-1 rvec quad)) - (a0-45 (-> s2-1 uvec quad)) - (a1-20 (-> s2-1 fvec quad)) - (a3-1 (-> s2-1 trans quad)) + (set! a2-10 + (cond + ((>= (-> s3-1 flex-blend) 1.0) + (matrix-copy! (-> arg0 bone transform) s2-1) ) - (set! (-> a2-10 rvec quad) v1-51) - (set! (-> a2-10 uvec quad) a0-45) - (set! (-> a2-10 fvec quad) a1-20) - (set! (-> a2-10 trans quad) a3-1) - ) - ) - (else - (let ((s1-3 (vector-lerp! - (new 'stack-no-clear 'vector) - (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)) - (-> s2-1 trans) - (-> s3-1 flex-blend) - ) + (else + (let ((s1-3 (vector-lerp! + (new 'stack-no-clear 'vector) + (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)) + (-> s2-1 trans) + (-> s3-1 flex-blend) + ) + ) ) + (ragdoll-matrix-interp (-> arg0 bone transform) (-> arg0 bone transform) s2-1 (-> s3-1 flex-blend)) + (vector-copy! (-> arg0 bone transform trans) s1-3) + ) + (set! (-> arg0 bone transform trans w) 1.0) + a2-10 ) - (ragdoll-matrix-interp (-> arg0 bone transform) (-> arg0 bone transform) s2-1 (-> s3-1 flex-blend)) - (set! (-> arg0 bone transform trans quad) (-> s1-3 quad)) + ) ) - (set! (-> arg0 bone transform trans w) 1.0) - ) - ) ) (let ((v1-60 (new 'stack-no-clear 'vector))) (let ((a0-50 v1-60)) @@ -894,7 +879,7 @@ ) (vector-! (-> s1-0 velocity) sv-144 (-> s1-0 position)) (vector-float*! (-> s1-0 velocity) (-> s1-0 velocity) (/ 1.0 (-> pp clock time-adjust-ratio))) - (set! (-> s1-0 position quad) (-> sv-144 quad)) + (vector-copy! (-> s1-0 position) sv-144) ) (else (vector<-cspace! (-> s1-0 position) (-> arg0 node-list data (-> s1-0 joint-index))) @@ -922,7 +907,7 @@ (vector<-cspace! s0-0 (-> arg0 node-list data (-> this ragdoll-joints (+ s2-1 -1) joint-index))) ) (else - (set! (-> s0-0 quad) (-> arg0 root trans quad)) + (vector-copy! s0-0 (-> arg0 root trans)) ) ) (if (logtest? (-> this ragdoll-flags) (ragdoll-flag mirror)) @@ -1027,7 +1012,7 @@ (let ((s4-1 (new 'stack-no-clear 'matrix))) (matrix-axis-angle! s4-1 (-> this orient-tform) (- (-> this orient-tform w))) (matrix*! s4-1 s4-1 arg2) - (set! (-> s4-1 trans quad) (-> arg2 trans quad)) + (vector-copy! (-> s4-1 trans) (-> arg2 trans)) (add-debug-matrix #t (bucket-id debug-no-zbuf1) s4-1 (meters 2)) ) ) @@ -1049,7 +1034,7 @@ (quaternion->matrix arg3 (-> s2-0 quat)) (matrix-axis-angle! s3-0 (-> arg1 pre-tform) (- (-> arg1 pre-tform w))) (matrix*! arg3 s3-0 arg3) - (set! (-> arg3 trans quad) (-> s2-0 position quad)) + (vector-copy! (-> arg3 trans) (-> s2-0 position)) ) (else (matrix-axis-angle! s3-0 (-> arg1 pre-tform) (- (-> arg1 pre-tform w))) @@ -1063,15 +1048,15 @@ (let ((s3-1 (new 'stack-no-clear 'matrix)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> arg3 trans quad)) + (vector-copy! s5-1 (-> arg3 trans)) (matrix-axis-angle! s3-1 (-> arg1 pre-tform) (- (-> arg1 pre-tform w))) (matrix*! arg3 s3-1 arg3) - (set! (-> arg3 trans quad) (-> s5-1 quad)) + (vector-copy! (-> arg3 trans) s5-1) ) ) (else (quaternion->matrix arg3 (-> arg0 root quat)) - (set! (-> arg3 trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> arg3 trans) (-> arg0 root trans)) ) ) 0 @@ -1389,7 +1374,7 @@ (.svf (&-> v1-176 quad) vf1) ) ) - (set! (-> s0-1 position quad) (-> sv-560 quad)) + (vector-copy! (-> s0-1 position) sv-560) (cond ((or (> s1-1 0) (!= (-> s0-1 parent-joint) -1)) (vector-! (-> s3-1 uvec) sv-560 (-> s2-1 trans)) @@ -1437,11 +1422,11 @@ (.mul.x.vf acc vf2 vf3) (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) (.svf (&-> sv-544 quad) vf4) - (set! (-> s0-1 old-x quad) (-> s3-1 rvec quad)) + (vector-copy! (-> s0-1 old-x) (-> s3-1 rvec)) ) (else - (set! (-> s3-1 rvec quad) (-> sv-528 quad)) - (set! (-> s0-1 old-x quad) (-> s3-1 rvec quad)) + (vector-copy! (-> s3-1 rvec) sv-528) + (vector-copy! (-> s0-1 old-x) (-> s3-1 rvec)) ) ) (vector-cross! (-> s3-1 fvec) (-> s3-1 rvec) (-> s3-1 uvec)) @@ -1456,27 +1441,16 @@ (quaternion->matrix s3-1 (-> s0-1 quat)) ) ) - (set! (-> s3-1 trans quad) (-> sv-560 quad)) + (vector-copy! (-> s3-1 trans) sv-560) (set! (-> s3-1 rvec w) 0.0) (set! (-> s3-1 uvec w) 0.0) (set! (-> s3-1 fvec w) 0.0) (if (and (zero? s1-1) (< (-> s0-1 parent-joint) 0) (logtest? (-> this ragdoll-flags) (ragdoll-flag rf7))) - (set! (-> arg0 root trans quad) (-> s3-1 trans quad)) + (vector-copy! (-> arg0 root trans) (-> s3-1 trans)) ) (ragdoll-method-13 this arg1 s0-1 s3-1 s2-1) ) - (let* ((a2-19 s2-1) - (a3-10 s3-1) - (v1-216 (-> a3-10 rvec quad)) - (a0-119 (-> a3-10 uvec quad)) - (a1-47 (-> a3-10 fvec quad)) - (a3-11 (-> a3-10 trans quad)) - ) - (set! (-> a2-19 rvec quad) v1-216) - (set! (-> a2-19 uvec quad) a0-119) - (set! (-> a2-19 fvec quad) a1-47) - (set! (-> a2-19 trans quad) a3-11) - ) + (matrix-copy! s2-1 s3-1) ) ) (if (and (< (min (the-as int (-> this num-joints)) (max 2 (the int (* 0.9 (the float (-> this num-joints)))))) @@ -1527,8 +1501,8 @@ (set! (-> s2-0 joint-type) (-> v1-15 joint-type)) (set! (-> s2-0 joint-index) (-> v1-15 joint-index)) (set! (-> s2-0 parent-joint) (-> v1-15 parent-joint)) - (set! (-> s2-0 pre-tform quad) (-> v1-15 pre-tform quad)) - (set! (-> s2-0 geo-tform quad) (-> v1-15 geo-tform quad)) + (vector-copy! (-> s2-0 pre-tform) (-> v1-15 pre-tform)) + (vector-copy! (-> s2-0 geo-tform) (-> v1-15 geo-tform)) (set! (-> s2-0 axial-slop) (-> v1-15 axial-slop)) (set! (-> s2-0 max-angle) (-> v1-15 max-angle)) (set! (-> s2-0 coll-rad) (-> v1-15 coll-rad)) @@ -1557,11 +1531,11 @@ ) 0 ) - (set! (-> this orient-tform quad) (-> setup orient-tform quad)) - (set! (-> this scale quad) (-> setup scale quad)) + (vector-copy! (-> this orient-tform) (-> setup orient-tform)) + (vector-copy! (-> this scale) (-> setup scale)) (set! (-> this bg-collide-with) (the-as uint (-> setup bg-collide-with))) (set-vector! (-> this gravity) 0.0 -1.0 0.0 1.0) - (set! (-> this gravity-target quad) (-> this gravity quad)) + (vector-copy! (-> this gravity-target) (-> this gravity)) (set! (-> this stretch-vel) 0.7) (set! (-> this stretch-vel-parallel) 0.8) (set! (-> this compress-vel) 0.85) @@ -1642,7 +1616,7 @@ ) ) ((= proc *target*) - (set! (-> s4-0 quad) (-> (the-as process-drawable proc) root trans quad)) + (vector-copy! s4-0 (-> (the-as process-drawable proc) root trans)) (vector-! s5-0 (-> s2-0 root trans) (-> (the-as process-drawable proc) root trans)) (set! s3-0 #t) ) @@ -1658,12 +1632,12 @@ (the-as touching-shapes-entry a3-1) ) ) - (set! (-> s4-0 quad) (-> s5-0 quad)) + (vector-copy! s4-0 s5-0) (vector-! s5-0 (-> s2-0 root trans) s5-0) (set! s3-0 #t) ) (when (logtest? (attack-mask attacker-velocity) (-> (the-as attack-info gp-0) mask)) - (set! (-> s5-0 quad) (-> (the-as attack-info gp-0) attacker-velocity quad)) + (vector-copy! s5-0 (-> (the-as attack-info gp-0) attacker-velocity)) (when (not s3-0) (vector-! s4-0 (-> self ragdoll ragdoll-joints 0 position) s5-0) (set! s3-0 #t) @@ -1678,7 +1652,7 @@ (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 409.6) (+! (-> s5-0 y) 1024.0) - (set! (-> self ragdoll ragdoll-joints 0 velocity quad) (-> s5-0 quad)) + (vector-copy! (-> self ragdoll ragdoll-joints 0 velocity) s5-0) (if (logtest? (-> (the-as attack-info gp-0) mask) (attack-mask id)) (set! (-> self last-attack-id) (-> (the-as attack-info gp-0) id)) ) @@ -1746,7 +1720,3 @@ ) (go-virtual idle) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc index 0d26053f5b6..0aceed623d0 100644 --- a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc @@ -201,18 +201,7 @@ ;; INFO: Used lq/sq (defun matrix-3x3-triple-transpose-product ((arg0 matrix) (arg1 matrix) (arg2 matrix)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 3))) - (let* ((v1-0 (-> s5-0 0)) - (a3-0 arg1) - (a0-1 (-> a3-0 rvec quad)) - (a1-1 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-1) - (set! (-> v1-0 uvec quad) a1-1) - (set! (-> v1-0 fvec quad) a2-1) - (set! (-> v1-0 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 0) arg1) (vector-reset! (-> s5-0 0 trans)) (matrix-transpose! (-> s5-0 1) (-> s5-0 0)) (matrix*! (-> s5-0 2) arg2 (-> s5-0 0)) @@ -572,11 +561,11 @@ (set! (-> s5-0 cquery best-dist) -100000000.0) (set! (-> s5-0 cquery best-my-prim) #f) (set! (-> s5-0 cquery best-other-prim) #f) - (set! (-> s5-0 orig-position quad) (-> arg0 position quad)) + (vector-copy! (-> s5-0 orig-position) (-> arg0 position)) (quaternion-copy! (-> s5-0 orig-rotation) (the-as quaternion (-> arg0 rot))) (rigid-body-control-method-14 arg0 (* (-> s5-0 time-step-scale) (-> s5-0 time-step))) (mem-copy! (the-as pointer (-> s5-0 mat)) (the-as pointer (-> arg0 matrix)) 64) - (set! (-> arg0 position quad) (-> s5-0 orig-position quad)) + (vector-copy! (-> arg0 position) (-> s5-0 orig-position)) (quaternion-copy! (the-as quaternion (-> arg0 rot)) (-> s5-0 orig-rotation)) (rigid-body-control-method-26 arg0) (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) @@ -952,7 +941,7 @@ (defmethod update-rbody-transform! ((this rigid-body-control) (arg0 collide-shape-moving)) (quaternion-copy! (-> arg0 quat) (the-as quaternion (-> this rot))) (rigid-body-control-method-25 this (-> arg0 trans)) - (set! (-> arg0 transv quad) (-> this lin-velocity quad)) + (vector-copy! (-> arg0 transv) (-> this lin-velocity)) 0 (none) ) @@ -1124,6 +1113,7 @@ ;; definition for method 11 of type rigid-body-object ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this rigid-body-object) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (init-rbody-control! this) @@ -1244,7 +1234,7 @@ (set! (-> arg0 prim-id) (the-as uint 0)) (vector-reset! (-> arg0 normal)) (vector-reset! (-> arg0 velocity)) - (set! (-> arg0 point quad) (-> this root trans quad)) + (vector-copy! (-> arg0 point) (-> this root trans)) (when arg1 (let ((s3-0 (-> arg1 head))) (when s3-0 @@ -1319,13 +1309,13 @@ (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) (init-rbody-impact-from-tshape! this s5-0 arg2) (if (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) - (set! (-> s5-0 velocity quad) (-> arg1 attacker-velocity quad)) + (vector-copy! (-> s5-0 velocity) (-> arg1 attacker-velocity)) (vector-! (-> s5-0 velocity) (-> s5-0 point) (-> arg0 root trans)) ) (impulse-force<-penetrate this s5-0 arg1 arg3) (impulse-handler this) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> s5-0 velocity quad)) + (vector-copy! s4-1 (-> s5-0 velocity)) (vector-normalize! s4-1 1.0) (vector-float*! s4-1 s4-1 (-> s5-0 impulse)) (apply-impact! (-> this rbody) (-> s5-0 point) s4-1) @@ -1362,10 +1352,10 @@ (init-rbody-impact-from-tshape! this s5-0 arg1) (if (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (rigid-body-control-method-23 (-> this rbody) (-> s5-0 point) (-> s5-0 velocity)) - (set! (-> s5-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 velocity) (-> this root transv)) ) (let ((v1-17 (-> arg0 root))) - (set! (-> s4-0 quad) (-> v1-17 transv quad)) + (vector-copy! s4-0 (-> v1-17 transv)) (vector-! (-> s5-0 velocity) (-> v1-17 transv) (-> s5-0 velocity)) ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) @@ -1468,7 +1458,7 @@ (when a0-25 (let ((f0-1 (/ 163840.0 (get-inv-mass a0-25)))) (logior! (-> this flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) - (set! (-> this player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) + (vector-copy! (-> this player-force-position) (-> (the-as attack-info s5-2) attacker-velocity)) (vector-reset! (-> this player-force)) (set! (-> this player-force y) (* -1.0 f0-1)) ) @@ -1493,7 +1483,7 @@ ) (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) (logior! (-> this flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) - (set! (-> this player-force-position quad) (-> (the-as process-focusable a0-34) root trans quad)) + (vector-copy! (-> this player-force-position) (-> (the-as process-focusable a0-34) root trans)) (vector-reset! (-> this player-force)) (let ((f0-4 (/ 163840.0 (get-inv-mass (the-as process-focusable a0-34)))) (f1-1 1.0) @@ -1518,7 +1508,7 @@ (logior! (-> this flags) (rigid-body-object-flag player-touching player-impulse-force)) (set-time! (-> this player-touch-time)) (impulse-handler this) - (set! (-> this player-force-position quad) (-> (the-as process-focusable s4-1) root trans quad)) + (vector-copy! (-> this player-force-position) (-> (the-as process-focusable s4-1) root trans)) (let ((f30-2 (* 0.00012207031 (the-as float (-> arg3 param 1)))) (f0-9 (/ 163840.0 (get-inv-mass (the-as process-focusable s4-1)))) ) diff --git a/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc index 6eb27af2f73..a4ce968b85c 100644 --- a/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc @@ -11,7 +11,7 @@ ;; definition for method 10 of type trajectory ;; INFO: Used lq/sq (defmethod compute-transv-at-time ((this trajectory) (arg0 float) (arg1 vector)) - (set! (-> arg1 quad) (-> this initial-velocity quad)) + (vector-copy! arg1 (-> this initial-velocity)) (+! (-> arg1 y) (* arg0 (-> this gravity))) arg1 ) @@ -25,7 +25,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod setup-from-to-duration! ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) - (set! (-> this initial-position quad) (-> arg0 quad)) + (vector-copy! (-> this initial-position) arg0) (set! (-> this gravity) arg3) (set! (-> this time) arg2) (let ((f0-3 (/ (vector-vector-xz-distance arg1 arg0) arg2))) @@ -126,9 +126,9 @@ (s4-0 (new 'stack-no-clear 'vector)) (s3-0 10) ) - (set! (-> s4-0 quad) (-> arg0 initial-position quad)) + (vector-copy! s4-0 (-> arg0 initial-position)) (dotimes (s2-0 s3-0) - (set! (-> s5-0 quad) (-> s4-0 quad)) + (vector-copy! s5-0 s4-0) (let ((f0-1 (* (-> arg0 time) (/ (+ 1.0 (the float s2-0)) (the float s3-0))))) (compute-trans-at-time arg0 f0-1 s4-0) ) @@ -168,7 +168,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod update-from-cspace ((this impact-control)) (when (>= (-> this joint) 0) - (set! (-> this trans 1 quad) (-> this trans 0 quad)) + (vector-copy! (-> this trans 1) (-> this trans 0)) (vector<-cspace! (the-as vector (-> this trans)) (-> this process 0 node-list data (-> this joint))) (vector-! (-> this dir) (the-as vector (-> this trans)) (-> this trans 1)) ) @@ -179,8 +179,8 @@ ;; definition for method 11 of type impact-control ;; INFO: Used lq/sq (defmethod impact-control-method-11 ((this impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) - (set! (-> arg0 start-pos quad) (-> this trans 1 quad)) - (set! (-> arg0 move-dist quad) (-> this dir quad)) + (vector-copy! (-> arg0 start-pos) (-> this trans 1)) + (vector-copy! (-> arg0 move-dist) (-> this dir)) (let ((v1-2 (ppointer->process (-> this process))) (a0-6 arg0) ) @@ -229,7 +229,7 @@ ;; INFO: Used lq/sq (defmethod initialize ((this point-tracker) (arg0 vector) (arg1 vector)) (set! (-> this trans 0 quad) (-> arg0 quad)) - (set! (-> this trans 1 quad) (-> arg1 quad)) + (vector-copy! (-> this trans 1) arg1) this ) @@ -238,10 +238,10 @@ (defmethod point-tracker-method-10 ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (cond ((>= 0.0 arg3) - (set! (-> arg0 quad) (-> arg1 quad)) + (vector-copy! arg0 arg1) ) ((>= arg3 1.0) - (set! (-> arg0 quad) (-> arg2 quad)) + (vector-copy! arg0 arg2) ) (else (let ((a1-2 (vector+float*! arg0 arg2 (vector-! (new 'stack-no-clear 'vector) arg1 arg2) (- 1.0 arg3)))) @@ -444,7 +444,7 @@ ) (init-vf0-vector) (set! (-> this vec 0 quad) (-> arg0 quad)) - (set! (-> this mat uvec quad) (-> arg1 quad)) + (vector-copy! (-> this mat uvec) arg1) (let ((v1-2 (new 'stack-no-clear 'trajectory))) (vector-! (-> v1-2 initial-velocity) arg2 arg0) (vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) 3.0) @@ -464,11 +464,11 @@ (.svf (&-> t1-7 quad) vf6) ) (vector-! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3) - (set! (-> this mat fvec quad) (-> v1-2 initial-position quad)) + (vector-copy! (-> this mat fvec) (-> v1-2 initial-position)) (vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) -2.0) (vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg1) (vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3) - (set! (-> this mat trans quad) (-> v1-2 initial-position quad)) + (vector-copy! (-> this mat trans) (-> v1-2 initial-position)) ) (dotimes (v1-5 4) (set! (-> this vec v1-5 w) 0.0) @@ -520,7 +520,7 @@ (cubic-curve-method-10 this (-> s5-0 initial-velocity) 0.0) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 initial-velocity) *color-red*) (dotimes (s3-0 s4-0) - (set! (-> s5-0 initial-position quad) (-> s5-0 initial-velocity quad)) + (vector-copy! (-> s5-0 initial-position) (-> s5-0 initial-velocity)) (let ((f0-2 (/ (+ 1.0 (the float s3-0)) (the float s4-0)))) (cubic-curve-method-10 this (-> s5-0 initial-velocity) f0-2) ) diff --git a/test/decompiler/reference/jak3/engine/process-drawable/focus_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/focus_REF.gc index 9d5ec7bf29d..bbb364a14d8 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/focus_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/focus_REF.gc @@ -11,7 +11,7 @@ (clear-focused (_type_) none) (collide-spec-match? (_type_ process-focusable) object) (reset-to-collide-spec (_type_ collide-spec) none) - (try-update-focus (_type_ process-focusable) symbol) + (focus-on! (_type_ process-focusable) symbol) ) ) @@ -55,8 +55,8 @@ ) ;; definition for method 12 of type focus -(defmethod try-update-focus ((this focus) (proc process-focusable)) - "Try to set the `handle` of this focus to the given process." +(defmethod focus-on! ((this focus) (proc process-focusable)) + "Set the `handle` of this focus to the given process. Return if the handle changed." (when (!= (handle->process (-> this handle)) proc) (set! (-> this handle) (process->handle proc)) #t diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc index a62b977e9dc..bb7a93f233e 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc @@ -478,7 +478,7 @@ ((-> jcontrol postbind-function) this joints jcontrol) ) (let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> this bounds quad)) + (vector-copy! a1-5 (-> this bounds)) (set! (-> a1-5 w) 1.0) (vector-norm-matrix*! (-> this origin) @@ -766,7 +766,7 @@ (set! (-> v1-35 origin-joint-index) (the-as uint (-> skelgroup origin-joint-index))) (set! (-> v1-35 shadow-joint-index) (the-as uint (-> skelgroup shadow-joint-index))) ) - (set! (-> s2-0 bounds quad) (-> skelgroup bounds quad)) + (vector-copy! (-> s2-0 bounds) (-> skelgroup bounds)) (let ((v1-37 (-> skelgroup shadow))) (when (and (> v1-37 0) (< v1-37 sv-20)) (let ((s0-0 (-> s1-0 data v1-37))) @@ -872,19 +872,17 @@ ) ) (else - (set! (-> s3-0 skeleton bones 0 transform trans quad) (-> (the-as vector (get-property-struct - (-> s3-0 jgeo extra) - 'trans-offset - 'interp - -1000000000.0 - *null-vector* - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - quad - ) - ) + (vector-copy! (-> s3-0 skeleton bones 0 transform trans) (the-as vector (get-property-struct + (-> s3-0 jgeo extra) + 'trans-offset + 'interp + -1000000000.0 + *null-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) ) ) ) @@ -2079,8 +2077,8 @@ (set! v1-0 (-> self entity)) ) (if arg1 - (set! (-> gp-0 quad) (-> arg1 quad)) - (set! (-> gp-0 quad) (-> v1-0 extra trans quad)) + (vector-copy! gp-0 arg1) + (vector-copy! gp-0 (-> v1-0 extra trans)) ) (let ((s5-0 (-> v1-0 extra perm task)) (s4-0 (new 'static 'fact-info)) diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc index 14c6dca0ce1..2b04e2f0297 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-focusable_REF.gc @@ -9,7 +9,7 @@ (focus-status focus-status) ) (:methods - (process-mask->search-info-flag (_type_) search-info-flag) + (get-search-info-flag (_type_) search-info-flag) (get-trans (_type_ int) vector) (get-quat (_type_ int) quaternion) (get-transv (_type_) vector) @@ -36,7 +36,8 @@ ;; definition for method 20 of type process-focusable ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this process-focusable)) +(defmethod get-search-info-flag ((this process-focusable)) + "Get search-info-flag for this process." (let ((search-flag (search-info-flag))) (let ((mask (-> this mask))) (if (logtest? (process-mask crate) mask) @@ -96,6 +97,7 @@ ;; definition for method 25 of type process-focusable ;; WARN: Return type mismatch int vs meters. (defmethod get-water-height ((this process-focusable)) + "Get the height of the water that we're in." (the-as meters 0) ) diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc index 440d4493a9d..fd18cddcbe3 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-taskable_REF.gc @@ -494,6 +494,7 @@ ;; definition for method 11 of type process-taskable (defmethod init-from-entity! ((this process-taskable) (entity entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (init-collision! this) (process-drawable-from-entity! this entity) diff --git a/test/decompiler/reference/jak3/engine/process-drawable/simple-focus_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/simple-focus_REF.gc index cf5a388c8ff..1941971f42e 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/simple-focus_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/simple-focus_REF.gc @@ -46,7 +46,7 @@ (case message (('move-trans) (let ((v0-0 (-> self root trans))) - (set! (-> v0-0 quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! v0-0 (the-as vector (-> block param 0))) v0-0 ) ) @@ -67,7 +67,3 @@ (set! (-> self event-hook) (-> (method-of-object self idle) event)) (go-virtual idle) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/process-drawable/simple-nav-sphere_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/simple-nav-sphere_REF.gc index ab8ad2e8844..178f53d294f 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/simple-nav-sphere_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/simple-nav-sphere_REF.gc @@ -120,7 +120,7 @@ (set! (-> s5-0 nav-radius) arg0) (set! (-> s5-0 root-prim local-sphere w) arg0) (if arg1 - (set! (-> s5-0 trans quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 trans) arg1) ) (vector-identity! (-> s5-0 scale)) (quaternion-identity! (-> s5-0 quat)) diff --git a/test/decompiler/reference/jak3/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak3/engine/ps2/pad_REF.gc index 2d453773f05..1432c8e1e1e 100644 --- a/test/decompiler/reference/jak3/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak3/engine/ps2/pad_REF.gc @@ -621,7 +621,7 @@ It's 32 bytes + type tag (ignored by C kernel)." "Update the mouse, and draw the cursor." (let ((mouse *mouse*)) (mouse-get-data mouse) - (set! (-> mouse pos 1 quad) (-> mouse pos 0 quad)) + (vector-copy! (-> mouse pos 1) (-> mouse pos 0)) (set! (-> mouse button0-abs 2) (-> mouse button0-abs 1)) (set! (-> mouse button0-abs 1) (-> mouse button0-shadow-abs 0)) (set! (-> mouse button0-rel 2) (-> mouse button0-rel 1)) diff --git a/test/decompiler/reference/jak3/engine/scene/scene_REF.gc b/test/decompiler/reference/jak3/engine/scene/scene_REF.gc index 87af2983b77..7d729d40528 100644 --- a/test/decompiler/reference/jak3/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak3/engine/scene/scene_REF.gc @@ -1091,12 +1091,10 @@ (apply-settings *setting-control*) ) (cond - ((and *target* - (zero? (-> self scene-index)) - (or (not (-> self scene)) - (!= (status-of-level-and-borrows *level* (-> gp-0 vis-nick) #f) 'active) - (logtest? (-> self scene scene-flags) (scene-flags scf5)) - ) + ((and *target* (zero? (-> self scene-index)) (or (not (-> self scene)) + (!= (level-status? *level* (-> gp-0 vis-nick) #f) 'active) + (logtest? (-> self scene scene-flags) (scene-flags scf5)) + ) ) (send-event *target* 'continue gp-0) ) @@ -1242,7 +1240,7 @@ (dotimes (s4-1 10) (when (not (or (not (-> gp-1 want s4-1 name)) (not (-> gp-1 want s4-1 display?)) - (= (status-of-level-and-borrows *level* (-> gp-1 want s4-1 name) 'all) 'active) + (= (level-status? *level* (-> gp-1 want s4-1 name) 'all) 'active) ) ) (set! v1-124 #t) @@ -1621,7 +1619,7 @@ (when (logtest? (-> self scene scene-flags) (scene-flags scf6)) (let ((v1-26 (handle->process (-> *target* pilot vehicle)))) (when v1-26 - (set! (-> self root trans quad) (-> (the-as process-drawable v1-26) root trans quad)) + (vector-copy! (-> self root trans) (-> (the-as process-drawable v1-26) root trans)) (quaternion-copy! (-> self root quat) (-> (the-as process-drawable v1-26) root quat)) ) ) diff --git a/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc index d082a129ee1..19db2661a9e 100644 --- a/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak3/engine/sound/gsound_REF.gc @@ -1061,7 +1061,7 @@ (set! (-> s5-1 time-base) -1) ) ) - (set! (-> s5-1 trans quad) (-> trans quad)) + (vector-copy! (-> s5-1 trans) trans) s5-1 ) ) @@ -1201,7 +1201,7 @@ ;; INFO: Used lq/sq (defmethod update-trans! ((this ambient-sound) (new-trans vector)) "Change the trans of the sound." - (set! (-> this trans quad) (-> new-trans quad)) + (vector-copy! (-> this trans) new-trans) 0 ) @@ -1435,7 +1435,7 @@ (vector-! (-> gp-0 0) (target-pos 0) sound-pos) (if *target* (vector-! (-> gp-0 1) sound-vel (-> *target* control transv)) - (set! (-> gp-0 1 quad) (-> sound-vel quad)) + (vector-copy! (-> gp-0 1) sound-vel) ) (vector-normalize! (-> gp-0 0) 1.0) (let ((f0-1 (/ 1228800.0 (fmax 0.1 (- 1228800.0 (vector-dot (-> gp-0 0) (-> gp-0 1))))))) diff --git a/test/decompiler/reference/jak3/engine/sound/speech_REF.gc b/test/decompiler/reference/jak3/engine/sound/speech_REF.gc index 06ab4b3df84..8926fcf3b9c 100644 --- a/test/decompiler/reference/jak3/engine/sound/speech_REF.gc +++ b/test/decompiler/reference/jak3/engine/sound/speech_REF.gc @@ -252,7 +252,7 @@ ) (logior! (-> this flags) (speech-channel-flag disable)) ) - (set! (-> this target-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this target-pos) (target-pos 0)) (when (not (logtest? (-> this flags) (speech-channel-flag disable))) (let ((s5-1 (-> this speech-table (-> this request speech-type)))) (cond diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/actor-hash_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/actor-hash_REF.gc index 604c79b2c91..33b799f9c37 100644 --- a/test/decompiler/reference/jak3/engine/spatial-hash/actor-hash_REF.gc +++ b/test/decompiler/reference/jak3/engine/spatial-hash/actor-hash_REF.gc @@ -173,7 +173,7 @@ ) ) (else - (set! (-> this tpos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this tpos) (target-pos 0)) (dotimes (v1-13 4) (set! (-> this data v1-13 length) 0) ) @@ -1362,7 +1362,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc index ed00ac5d44c..86661c0b224 100644 --- a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc @@ -144,7 +144,7 @@ O(n^2) 'check everybody against everybody' collision loop." (add-a-sphere-with-flag (_type_ vector int) int) (update-from-spheres (_type_) none) (sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none) - (find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol) + (check-sphere-blocked (_type_ vector int int) symbol) (add-sphere-with-mask-and-id (_type_ vector vector float int) symbol) (sphere-hash-method-32 (_type_ sphere int) symbol) ) diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash_REF.gc index a6644b1714d..825ceecff6c 100644 --- a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash_REF.gc +++ b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash_REF.gc @@ -223,7 +223,7 @@ (let ((v1-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-0 quad) (-> arg1 quad)) + (vector-copy! v1-0 arg1) (vector+! s2-0 arg1 arg2) (set! (-> v1-0 w) arg3) (set! (-> s2-0 w) arg3) @@ -815,10 +815,10 @@ (call-parent-method this) (new 'stack-no-clear 'vector) (let ((f30-0 6144.0)) - (set! (-> this work temp-box-min quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this work temp-box-min) (target-pos 0)) (+! (-> this work temp-box-min y) f30-0) ) - (set! (-> this work temp-box-max quad) (-> this work temp-box-min quad)) + (vector-copy! (-> this work temp-box-max) (-> this work temp-box-min)) (set! (-> this work visit-count) 0) (set! (-> this debug-draw) #t) (set! (-> this work add-object-time) (the-as uint 0)) @@ -977,7 +977,7 @@ (arg5 int) ) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-copy! v1-0 arg0) (set! (-> v1-0 w) 0.0) (fill-actor-list-for-box this v1-0 (the-as (pointer collide-shape) arg1) (the-as int arg2)) ) diff --git a/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc index e1d4b1faf74..17c99f82da2 100644 --- a/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc @@ -466,7 +466,7 @@ ((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere) ) (let ((v1-56 (new 'stack-no-clear 'vector))) - (set! (-> v1-56 quad) (-> self control trans quad)) + (vector-copy! v1-56 (-> self control trans)) (if (focus-test? self on-water) (set! (-> v1-56 y) (-> self water height)) ) diff --git a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc index 2bfe07731c2..d602169096d 100644 --- a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc @@ -116,7 +116,7 @@ ) ) (set-time! (-> self board spin-start-time)) - (set! (-> self board spin-start-dir quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-copy! (-> self board spin-start-dir) (-> self node-list data 3 bone transform fvec)) (vector-flatten! (-> self control turn-to-alt-heading) (-> self control c-R-w fvec) *up-vector*) (vector-normalize! (-> self control turn-to-alt-heading) 1.0) (rot->dir-targ! (-> self control)) @@ -429,15 +429,15 @@ ) (when (not (logtest? (-> self control old-status) (collide-status on-surface))) (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> self control trans quad)) + (vector-copy! gp-2 (-> self control trans)) (+! (-> gp-2 y) 2048.0) (cond ((logtest? (-> *part-group-id-table* 189 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-2 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-2) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 189)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-2 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-2) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 189)) ) ) @@ -993,15 +993,15 @@ (time-elapsed? (-> self board ride-time) (seconds 0.5)) ) (let ((s3-5 (new 'stack-no-clear 'vector))) - (set! (-> s3-5 quad) (-> self control trans quad)) + (vector-copy! s3-5 (-> self control trans)) (+! (-> s3-5 y) 2048.0) (cond ((logtest? (-> *part-group-id-table* 190 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s3-5 quad)) + (vector-copy! (-> *launch-matrix* trans) s3-5) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 190)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s3-5 quad)) + (vector-copy! (-> *launch-matrix* trans) s3-5) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 190)) ) ) @@ -1085,7 +1085,7 @@ (set! (-> self control unknown-float36) (fmax 0.0 (fmin 1.0 (* 0.00004359654 (+ -11468.8 (-> self control ctrl-xz-vel))))) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :exit target-board-exit :trans (behavior () @@ -1097,7 +1097,7 @@ ) ) (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) (set! (-> self board shock-offset) (* 0.8 (-> self board shock-offset))) ) :code (behavior ((arg0 meters) (arg1 meters) (arg2 symbol)) @@ -1382,7 +1382,7 @@ (cond ((< 0.7 (-> self control turn-to-magnitude)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control edge-grab-across-edge-dir quad)) + (vector-copy! gp-0 (-> self control edge-grab-across-edge-dir)) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 1.0) (if (< 0.7 (vector-dot (-> self control to-target-pt-xz) gp-0)) @@ -1572,10 +1572,10 @@ :event target-board-handler :enter (behavior ((arg0 vector) (arg1 float)) (sound-play "board-kick") - (set! (-> self control transv quad) (-> arg0 quad)) + (vector-copy! (-> self control transv) arg0) (vector-xz-normalize! (-> self control transv) (* 0.8 arg1)) (set! (-> self control unknown-word04) (the-as uint (fmax 81920.0 (* 0.8 arg1)))) - (set! (-> self control unknown-vector38 quad) (-> arg0 quad)) + (vector-copy! (-> self control unknown-vector38) arg0) (set! (-> self control transv y) 0.0) (vector-turn-to (vector-negate! (new 'stack-no-clear 'vector) (-> self control transv))) (set! (-> self control transv y) (- (sqrtf (* 24576.0 (-> self control dynam gravity-length))) @@ -1690,7 +1690,7 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (>= (-> self board flip-control) 0.0))) @@ -1843,7 +1843,7 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -2080,7 +2080,7 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((v1-0 (new 'stack-no-clear 'vector))) @@ -2211,7 +2211,7 @@ (set-time! (-> self board jump-land-time)) (go target-board-hit-ground) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (let ((gp-0 (>= (-> self board unk-float005) 0.0)) @@ -2624,7 +2624,7 @@ (logclear! (-> self control root-prim prim-core action) (collide-action can-ride)) (set! (-> self board ride-rot-old) (-> self board ride-rot)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (if (find-ground (-> self control) @@ -2639,7 +2639,7 @@ ) ) (if (< (-> self control trans y) (-> self control gspot-pos y)) - (set! (-> gp-0 quad) (-> self control gspot-pos quad)) + (vector-copy! gp-0 (-> self control gspot-pos)) ) (move-to-point! (-> self control) @@ -2878,7 +2878,7 @@ ) (set! (-> gp-2 timeout) (seconds 4)) (vector<-cspace! (-> gp-2 pos) a1-5) - (set! (-> gp-2 vel quad) (-> *zero-vector* quad)) + (vector-copy! (-> gp-2 vel) *zero-vector*) (spawn-projectile grenade gp-2 self *default-dead-pool*) ) (ja-no-eval :num! (seek!)) @@ -3002,7 +3002,7 @@ ) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :exit target-board-exit :code (behavior () @@ -3128,7 +3128,7 @@ ) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) ) :exit target-board-exit :code (behavior ((arg0 handle) (arg1 symbol)) @@ -3406,7 +3406,7 @@ (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) ) - (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (vector-copy! s5-0 (-> gp-0 vector)) (let ((f0-12 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -3430,13 +3430,13 @@ (cond ((= (-> self game mode) 'debug) (let ((s4-1 (new-stack-vector0))) - (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! s4-1 (-> self control last-trans-on-ground)) (ja-channel-set! 0) (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-stance) ) diff --git a/test/decompiler/reference/jak3/engine/target/board/board-util_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-util_REF.gc index ffc0a27e76a..f515d1a569d 100644 --- a/test/decompiler/reference/jak3/engine/target/board/board-util_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/board-util_REF.gc @@ -15,11 +15,11 @@ ;; WARN: Return type mismatch int vs none. (defbehavior board-post board () (let ((v1-0 (ppointer->process (-> self parent)))) - (set! (-> self root trans quad) (-> v1-0 board board-trans quad)) + (vector-copy! (-> self root trans) (-> v1-0 board board-trans)) (let ((a0-4 (-> v1-0 board board-quat quad))) (set! (-> self root quat quad) a0-4) ) - (set! (-> self root scale quad) (-> v1-0 board board-scale quad)) + (vector-copy! (-> self root scale) (-> v1-0 board board-scale)) (set! (-> self draw light-index) (-> v1-0 draw light-index)) (let ((a0-10 (-> v1-0 draw color-mult quad))) (set! (-> self draw color-mult quad) a0-10) diff --git a/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc index 2c59f0b9d8b..7655889103e 100644 --- a/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc @@ -513,7 +513,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector))) (cond (arg0 - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (set! (-> gp-0 w) 49152.0) ) (else @@ -782,7 +782,7 @@ (t9-2 vector-normalize!) (a0-2 (new-stack-vector0)) ) - (set! (-> a0-2 quad) (-> self control transv quad)) + (vector-copy! a0-2 (-> self control transv)) (let ((f30-0 (vector-dot s5-0 (t9-2 a0-2 1.0))) (s5-1 (-> self control transv-history)) (f26-0 -1000.0) @@ -1114,7 +1114,7 @@ ) (set-time! (-> self board smack-surface-time)) (set! (-> self board smack-speed) (-> self control ctrl-xz-vel)) - (set! (-> self board smack-normal quad) (-> self control wall-contact-normal quad)) + (vector-copy! (-> self board smack-normal) (-> self control wall-contact-normal)) #t ) ) @@ -1233,7 +1233,7 @@ "ltransv" (the-as rgba (new 'static 'rgba :g #xff :a #x80)) ) - (set! (-> s5-0 quad) (-> self control btransv quad)) + (vector-copy! s5-0 (-> self control btransv)) (vector-float*! s5-0 s5-0 0.5) (vector+! s5-0 s5-0 (-> self control trans)) (add-debug-text-sphere @@ -1517,7 +1517,7 @@ (let ((f30-0 0.5)) (if (time-elapsed? (-> self board unk-time-frame01) (seconds 0.3)) (+! (-> self board shock-offsetv) (* (- (-> arg0 y) (-> self control transv y)) f30-0)) - (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + (vector-copy! (-> self board up-vector 1) (-> self board up-vector 0)) ) (+! (-> self board shock-offsetv) (+ (* -10.0 (seconds-per-frame) (-> self board shock-offset)) @@ -1583,11 +1583,11 @@ (set! (-> self board shock-offsetv) 0.0) (cond ((logtest? (-> *part-group-id-table* 23 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 23)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 23)) ) ) @@ -1608,7 +1608,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-board-collision target () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control transv quad)) + (vector-copy! gp-0 (-> self control transv)) (when (focus-test? self halfpipe) (when (-> self control unknown-spool-anim00) *edge-grab-info* @@ -1667,12 +1667,12 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> self control wall-contact-normal quad)) + (vector-copy! s5-1 (-> self control wall-contact-normal)) (vector-normalize! s5-1 1.0) (let ((s3-0 (vector-reflect! (new 'stack-no-clear 'vector) gp-0 s5-1)) (s4-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-1 quad) (-> self control c-R-w fvec quad)) + (vector-copy! s4-1 (-> self control c-R-w fvec)) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (set! (-> s4-1 y) 0.0) @@ -1688,13 +1688,13 @@ (let ((v1-64 s2-1)) (set! (-> self board glance-speed) (sqrtf (+ (* (-> v1-64 x) (-> v1-64 x)) (* (-> v1-64 z) (-> v1-64 z))))) ) - (set! (-> self board glance-normal quad) (-> s5-1 quad)) - (set! (-> self board glance-in-transv quad) (-> gp-0 quad)) + (vector-copy! (-> self board glance-normal) s5-1) + (vector-copy! (-> self board glance-in-transv) gp-0) (set! (-> s3-1 y) (-> s2-1 y)) (vector-xz-normalize! s3-1 (-> self board glance-speed)) (vector-matrix*! (-> self control transv) s3-1 (-> self control c-R-w)) ) - (set! (-> self board glance-out-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board glance-out-transv) (-> self control transv)) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0) @@ -1739,8 +1739,8 @@ (vector-float*! (-> gp-3 move-dist) (-> self control dynam gravity-normal) -49152.0) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-3) 0.0) - (set! (-> self board probe-intersect quad) (-> gp-3 best-other-tri intersect quad)) - (set! (-> self board probe-normal quad) (-> gp-3 best-other-tri normal quad)) + (vector-copy! (-> self board probe-intersect) (-> gp-3 best-other-tri intersect)) + (vector-copy! (-> self board probe-normal) (-> gp-3 best-other-tri normal)) (set! (-> self board probe-pat) (-> gp-3 best-other-tri pat)) (set! (-> self board probe) #t) ) @@ -1766,7 +1766,7 @@ (let ((a1-0 (-> self node-list data 37 bone transform))) (matrix->transformq (the-as transformq (-> self board board-trans)) a1-0) ) - (set! (-> self board board-scale quad) (-> self control scale quad)) + (vector-copy! (-> self board board-scale) (-> self control scale)) (let ((a0-4 (-> *target-shadow-control* settings shadow-dir quad))) (set! (-> *board-shadow-control* settings shadow-dir quad) a0-4) ) @@ -1993,7 +1993,7 @@ ) ) ) - (set! (-> self board slow-transv quad) (-> self control transv quad)) + (vector-copy! (-> self board slow-transv) (-> self control transv)) (set! (-> self board turn-anim-duck-vel) 0.0) ) ) @@ -2129,7 +2129,7 @@ (mode-set! (-> self board main) (joint-mod-mode flex-blend)) (mode-set! (-> self board board 0 main) (joint-mod-mode flex-blend)) (let ((s5-3 (new 'stack-no-clear 'vector))) - (set! (-> s5-3 quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-copy! s5-3 (-> self node-list data 3 bone transform fvec)) (vector-rotate-y! s5-3 s5-3 15109.688) (if (not (and (-> self next-state) (let ((v1-160 (-> self next-state name))) @@ -2331,10 +2331,10 @@ (target-board-exit-check) (target-board-effect) (when (board-on-ground?) - (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) + (vector-copy! (-> self board up-vector 1) (-> self board up-vector 0)) (set! (-> self board up-vector 0 quad) (-> self control local-normal quad)) (if (= (-> self board roty-cum) 0.0) - (set! (-> self board ground-on-dir quad) (-> self node-list data 3 bone transform fvec quad)) + (vector-copy! (-> self board ground-on-dir) (-> self node-list data 3 bone transform fvec)) ) ) 0 @@ -2347,8 +2347,8 @@ (dotimes (s3-0 3) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (let ((v1-2 (-> arg0 collision-spheres s3-0))) - (set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad)) - (set! (-> s2-0 move-dist quad) (-> arg1 quad)) + (vector-copy! (-> s2-0 start-pos) (-> v1-2 prim-core world-sphere)) + (vector-copy! (-> s2-0 move-dist) arg1) (let ((a0-3 s2-0)) (set! (-> a0-3 radius) (/ (-> v1-2 prim-core world-sphere w) 2)) (set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with)) @@ -2378,9 +2378,9 @@ (let ((s4-0 *edge-grab-info*) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self control transv quad)) + (vector-copy! s5-0 (-> self control transv)) (when (not (edge-grab-info-method-9 s4-0)) (format #t "exit update~%") (send-event self 'end-mode 'ride #f) @@ -2416,12 +2416,12 @@ ) 1.0 ) - (set! (-> self control edge-grab-across-edge-dir quad) (-> s4-0 hanging-matrix rvec quad)) + (vector-copy! (-> self control edge-grab-across-edge-dir) (-> s4-0 hanging-matrix rvec)) (when (< (vector-dot (-> self control edge-grab-edge-dir) (-> self board ride-dir)) 0.0) (let ((s3-2 (new 'stack-no-clear 'vector))) - (set! (-> s3-2 quad) (-> s4-0 world-vertex 0 quad)) + (vector-copy! s3-2 (-> s4-0 world-vertex 0)) (set! (-> s4-0 world-vertex 0 quad) (-> s4-0 world-vertex 1 quad)) - (set! (-> s4-0 world-vertex 1 quad) (-> s3-2 quad)) + (vector-copy! (-> s4-0 world-vertex 1) s3-2) (vector-normalize! (vector-! (-> self control edge-grab-edge-dir) @@ -2430,9 +2430,9 @@ ) 1.0 ) - (set! (-> s3-2 quad) (-> s4-0 adjacent-edge-left-vertex quad)) - (set! (-> s4-0 adjacent-edge-left-vertex quad) (-> s4-0 adjacent-edge-right-vertex quad)) - (set! (-> s4-0 adjacent-edge-right-vertex quad) (-> s3-2 quad)) + (vector-copy! s3-2 (-> s4-0 adjacent-edge-left-vertex)) + (vector-copy! (-> s4-0 adjacent-edge-left-vertex) (-> s4-0 adjacent-edge-right-vertex)) + (vector-copy! (-> s4-0 adjacent-edge-right-vertex) s3-2) ) (let ((v1-70 (logtest? (-> s4-0 status) 2))) (if (logtest? (-> s4-0 status) 1) @@ -2446,13 +2446,13 @@ ) ) (dotimes (v1-75 3) - (set! (-> self board ride-vertex-old v1-75 quad) (-> self board ride-vertex v1-75 quad)) + (vector-copy! (-> self board ride-vertex-old v1-75) (-> self board ride-vertex v1-75)) ) - (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) - (set! (-> self board ride-segment-old quad) (-> self board ride-segment quad)) + (vector-copy! (-> self board ride-segment-old) (-> self board ride-segment)) + (vector-copy! (-> self board ride-segment-old) (-> self board ride-segment)) (set! (-> self board ride-vertex-length-old) (-> self board ride-vertex-length)) (set! (-> self board ride-vertex 0 quad) (-> s4-0 world-vertex 0 quad)) - (set! (-> self board ride-vertex 1 quad) (-> s4-0 world-vertex 1 quad)) + (vector-copy! (-> self board ride-vertex 1) (-> s4-0 world-vertex 1)) (set! (-> self board ride-vertex 2 quad) (the-as uint128 0)) (set! (-> self board ride-vertex-length) 1) (cond @@ -2461,7 +2461,7 @@ (vector-! (-> self control unknown-vector35) (-> s4-0 adjacent-edge-right-vertex) (-> s4-0 world-vertex 1)) 1.0 ) - (set! (-> self board ride-vertex 2 quad) (-> s4-0 adjacent-edge-right-vertex quad)) + (vector-copy! (-> self board ride-vertex 2) (-> s4-0 adjacent-edge-right-vertex)) (+! (-> self board ride-vertex-length) 1) 0 ) @@ -2486,7 +2486,7 @@ ) (+! s3-3 1) (dotimes (v1-114 3) - (set! (-> self board ride-vertex v1-114 quad) (-> self board ride-vertex-old v1-114 quad)) + (vector-copy! (-> self board ride-vertex v1-114) (-> self board ride-vertex-old v1-114)) ) (set! (-> self board ride-vertex-length) (-> self board ride-vertex-length-old)) (goto cfg-26) @@ -2698,12 +2698,12 @@ ) ) ) - (set! (-> self control to-target-pt-xz quad) (-> gp-1 quad)) + (vector-copy! (-> self control to-target-pt-xz) gp-1) ) ) ((logtest? s4-3 42) (move-to-point! (-> self control) gp-0) - (set! (-> self control transv quad) (-> s5-0 quad)) + (vector-copy! (-> self control transv) s5-0) ) ) (when (not (logtest? s4-3 64)) @@ -2838,9 +2838,9 @@ (pre-collide-setup) (seek! (-> self board cushion-offset) 1638.4 (* 16384.0 (seconds-per-frame))) (let ((s5-3 (new 'stack-no-clear 'vector))) - (set! (-> s5-3 quad) (-> self control transv quad)) + (vector-copy! s5-3 (-> self control transv)) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> self control trans quad)) + (vector-copy! s4-1 (-> self control trans)) (let ((a2-4 (new 'stack-no-clear 'collide-query)) (v1-83 (-> self control)) ) @@ -2861,9 +2861,10 @@ (else (logior! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) (dotimes (v1-102 2) - (set! (-> self board ride-touch-segment v1-102 quad) - (-> self board ride-vertex (+ (-> self board ride-vertex-base) v1-102) quad) - ) + (vector-copy! + (-> self board ride-touch-segment v1-102) + (-> self board ride-vertex (+ (-> self board ride-vertex-base) v1-102)) + ) ) (set! (-> *collide-edge-board-spec* touching-segment) (the-as symbol (-> self board ride-touch-segment))) ) @@ -2900,7 +2901,7 @@ (move-to-point! (-> self control) s3-0) ) ) - (set! (-> self control transv quad) (-> s5-3 quad)) + (vector-copy! (-> self control transv) s5-3) ) ) (target-board-physics s5-3) @@ -2922,7 +2923,7 @@ (if (< (vector-dot (-> self control local-normal) (-> self control dynam gravity-normal)) 0.0) (vector-negate! (-> self control local-normal) (-> self control local-normal)) ) - (set! (-> self control gspot-normal quad) (-> self control local-normal quad)) + (vector-copy! (-> self control gspot-normal) (-> self control local-normal)) (target-powerup-process) (target-board-exit-check) (target-board-effect) diff --git a/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc index 206c4d9231f..20a75d3546e 100644 --- a/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc @@ -28,7 +28,7 @@ ) ) (set! (-> arg0 vertex 0 quad) (-> arg1 sv-40 quad)) - (set! (-> arg0 vertex1 quad) (-> arg1 (mod (+ sv-40 1) 3) quad)) + (vector-copy! (-> arg0 vertex1) (-> arg1 (mod (+ sv-40 1) 3))) arg0 ) @@ -100,7 +100,7 @@ ) ) (set! (-> arg0 low-coverage-pat-next1) (-> s4-0 best-other-tri pat)) - (set! (-> arg0 low-coverage-norm-of-next1 quad) (-> s4-0 best-other-tri normal quad)) + (vector-copy! (-> arg0 low-coverage-norm-of-next1) (-> s4-0 best-other-tri normal)) 0 ) (vector+float*! (-> s4-0 start-pos) (-> arg1 best-other-tri intersect) (-> arg0 dynam gravity-normal) 819.2) @@ -113,7 +113,7 @@ (vector-vector-distance (-> s4-0 start-pos) (-> s4-0 best-other-tri intersect)) ) (set! (-> arg0 low-coverage-pat-next2) (-> s4-0 best-other-tri pat)) - (set! (-> arg0 low-coverage-norm-of-next2 quad) (-> s4-0 best-other-tri normal quad)) + (vector-copy! (-> arg0 low-coverage-norm-of-next2) (-> s4-0 best-other-tri normal)) 0 ) ) @@ -219,8 +219,8 @@ ) (set! sv-96 (collide-status)) (set! sv-104 (cshape-reaction-flags)) - (set! (-> sv-88 rvec quad) (-> arg3 quad)) - (set! (-> sv-88 uvec quad) (-> arg3 quad)) + (vector-copy! (-> sv-88 rvec) arg3) + (vector-copy! (-> sv-88 uvec) arg3) (let ((a1-3 (new 'stack-no-clear 'vector))) (vector-float*! a1-3 (-> arg1 move-dist) (-> arg1 best-dist)) (move-by-vector! arg0 a1-3) @@ -233,7 +233,7 @@ (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf05))) ) (let ((v1-24 (new 'stack-no-clear 'vector))) - (set! (-> v1-24 quad) (-> arg1 best-my-prim prim-core world-sphere quad)) + (vector-copy! v1-24 (-> arg1 best-my-prim prim-core world-sphere)) (vector-! sv-80 v1-24 (-> arg1 best-other-tri intersect)) ) (vector-normalize! sv-80 1.0) @@ -252,7 +252,7 @@ (if (= (-> arg1 best-dist) 0.0) (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0)) ) - (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! (-> arg0 poly-normal) (-> arg1 best-other-tri normal)) (collide-shape-moving-angle-set! arg0 sv-84 (-> sv-88 rvec)) (if (< (-> arg0 poly-angle) -0.2) (set! sv-96 (logior sv-96 (collide-status touch-ceiling))) @@ -284,7 +284,7 @@ (target-collision-low-coverage arg0 arg1 sv-84 (& sv-104) (& sv-96) (& sv-240)) ) (when (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) - (set! (-> arg0 transv-on-last-impact quad) (-> arg0 transv quad)) + (vector-copy! (-> arg0 transv-on-last-impact) (-> arg0 transv)) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (set! (-> arg0 normal-impact-vel) (- (vector-dot (-> arg0 transv) sv-84))) (set! sv-96 (logior sv-96 (collide-status impact-surface))) @@ -321,7 +321,7 @@ ((-> arg1 best-other-prim) (set! sv-96 (logior sv-96 (collide-status touch-actor))) (set! (-> arg0 actor-contact-pt quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> arg0 actor-contact-normal quad) (-> arg0 poly-normal quad)) + (vector-copy! (-> arg0 actor-contact-normal) (-> arg0 poly-normal)) (set! (-> arg0 actor-contact-handle) (process->handle (-> arg1 best-other-prim cshape process))) ) ((= (-> arg0 poly-pat material) (pat-material waterbottom)) @@ -336,8 +336,8 @@ (set! sv-96 (logior sv-96 (collide-status touch-wall))) (set! (-> arg0 cur-pat mode) 1) (set! (-> arg0 wall-contact-pt quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> arg0 wall-contact-poly-normal quad) (-> arg0 poly-normal quad)) - (set! (-> arg0 wall-contact-normal quad) (-> sv-84 quad)) + (vector-copy! (-> arg0 wall-contact-poly-normal) (-> arg0 poly-normal)) + (vector-copy! (-> arg0 wall-contact-normal) sv-84) (set! (-> arg0 wall-contact-pat) (-> arg1 best-other-tri pat)) (cond ((and (focus-test? (the-as process-focusable (-> arg0 process)) mech) @@ -374,7 +374,7 @@ ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) (not (logtest? sv-104 (cshape-reaction-flags csrf05))) - (not (logtest? (state-flags sf26) (-> arg0 process state-flags))) + (not (logtest? (state-flags hang) (-> arg0 process state-flags))) ) ) (set! sv-104 (logior sv-104 (cshape-reaction-flags csrf08))) @@ -393,7 +393,7 @@ (set! sv-96 (logior sv-96 (collide-status on-surface))) (set! (-> arg0 cur-pat mode) 0) (if (= (-> arg1 best-my-prim prim-id) 6) - (set! (-> arg0 local-normal quad) (-> sv-84 quad)) + (vector-copy! (-> arg0 local-normal) sv-84) ) (cond ((and (focus-test? (the-as process-focusable (-> arg0 process)) board) @@ -437,8 +437,8 @@ (set! (-> arg0 ground-touch-point w) 0.0) (when (not (logtest? sv-104 (cshape-reaction-flags csrf00 csrf01 csrf02 csrf03 csrf14))) (set! sv-96 (logior sv-96 (collide-status on-ground))) - (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) - (set! (-> arg0 ground-contact-normal quad) (-> sv-84 quad)) + (vector-copy! (-> arg0 ground-poly-normal) (-> arg0 poly-normal)) + (vector-copy! (-> arg0 ground-contact-normal) sv-84) (set! (-> arg0 ground-local-norm-dot-grav) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) (set-time! (-> arg0 list-time-on-ground)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) @@ -457,34 +457,33 @@ (+! (-> arg0 history-idx) 1) (let ((v1-271 (clear-record-tags! *history* (history-channel surface-normal) (-> arg0 history-idx) (the-as uint 2))) ) - (set! (-> v1-271 origin quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> v1-271 vector quad) (-> arg0 surface-normal quad)) + (vector-copy! (-> v1-271 origin) (-> arg1 best-other-tri intersect)) + (vector-copy! (-> v1-271 vector) (-> arg0 surface-normal)) ) (let ((v1-274 (clear-record-tags! *history* (history-channel local-normal) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-274 origin quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> v1-274 vector quad) (-> arg0 local-normal quad)) + (vector-copy! (-> v1-274 origin) (-> arg1 best-other-tri intersect)) + (vector-copy! (-> v1-274 vector) (-> arg0 local-normal)) + ) + (vector-copy! + (-> (clear-record-tags! *history* (history-channel intersect) (-> arg0 history-idx) (the-as uint 2)) vector) + (-> arg1 best-other-tri intersect) ) - (set! (-> (clear-record-tags! *history* (history-channel intersect) (-> arg0 history-idx) (the-as uint 2)) - vector - quad - ) - (-> arg1 best-other-tri intersect quad) - ) (let ((v1-280 (clear-record-tags! *history* (history-channel transv-out) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-280 origin quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> v1-280 vector quad) (-> arg2 quad)) + (vector-copy! (-> v1-280 origin) (-> arg1 best-other-tri intersect)) + (vector-copy! (-> v1-280 vector) arg2) ) (let ((v1-283 (clear-record-tags! *history* (history-channel transv-in) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-283 origin quad) (-> arg1 best-other-tri intersect quad)) - (set! (-> v1-283 vector quad) (-> sv-88 uvec quad)) + (vector-copy! (-> v1-283 origin) (-> arg1 best-other-tri intersect)) + (vector-copy! (-> v1-283 vector) (-> sv-88 uvec)) ) (let ((v1-286 (clear-record-tags! *history* (history-channel transv) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-286 origin quad) (-> arg0 trans quad)) - (set! (-> v1-286 vector quad) (-> arg0 transv quad)) + (vector-copy! (-> v1-286 origin) (-> arg0 trans)) + (vector-copy! (-> v1-286 vector) (-> arg0 transv)) + ) + (vector-copy! + (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector) + (-> arg0 trans) ) - (set! (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector quad) - (-> arg0 trans quad) - ) (let ((v1-292 (clear-record-tags! *history* (history-channel pat) (-> arg0 history-idx) (the-as uint 2)))) (set! (-> v1-292 vector x) (the-as float (-> arg0 cur-pat))) ) @@ -507,20 +506,21 @@ (when *debug-segment* (+! (-> arg0 history-idx) 1) (let ((v1-9 (clear-record-tags! *history* (history-channel transv-out) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-9 origin quad) (-> arg0 trans quad)) - (set! (-> v1-9 vector quad) (-> arg2 quad)) + (vector-copy! (-> v1-9 origin) (-> arg0 trans)) + (vector-copy! (-> v1-9 vector) arg2) ) (let ((v1-12 (clear-record-tags! *history* (history-channel transv-in) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-12 origin quad) (-> arg0 trans quad)) - (set! (-> v1-12 vector quad) (-> arg3 quad)) + (vector-copy! (-> v1-12 origin) (-> arg0 trans)) + (vector-copy! (-> v1-12 vector) arg3) ) (let ((v1-15 (clear-record-tags! *history* (history-channel transv) (-> arg0 history-idx) (the-as uint 2)))) - (set! (-> v1-15 origin quad) (-> arg0 trans quad)) - (set! (-> v1-15 vector quad) (-> arg0 transv quad)) + (vector-copy! (-> v1-15 origin) (-> arg0 trans)) + (vector-copy! (-> v1-15 vector) (-> arg0 transv)) + ) + (vector-copy! + (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector) + (-> arg0 trans) ) - (set! (-> (clear-record-tags! *history* (history-channel trans) (-> arg0 history-idx) (the-as uint 2)) vector quad) - (-> arg0 trans quad) - ) (let ((v1-21 (clear-record-tags! *history* (history-channel collide-status) (-> arg0 history-idx) (the-as uint 2))) ) (set! (-> v1-21 collide-status) (logior (-> arg0 status) (collide-status no-touch))) @@ -585,7 +585,7 @@ ) 1.0 ) - (set! (-> self control edge-grab-across-edge-dir quad) (-> gp-0 hanging-matrix rvec quad)) + (vector-copy! (-> self control edge-grab-across-edge-dir) (-> gp-0 hanging-matrix rvec)) (send-event self 'push-transv diff --git a/test/decompiler/reference/jak3/engine/target/flut/flut-racer_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/flut-racer_REF.gc index f11146d1fd1..3aee349d301 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/flut-racer_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/flut-racer_REF.gc @@ -95,34 +95,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -184,7 +184,7 @@ ) (when v1-9 (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self root trans quad)) + (vector-copy! a1-1 (-> self root trans)) (let ((a0-11 (-> (the-as process-drawable v1-9) root quat))) (new 'stack-no-clear 'vector) (+! (-> a1-1 y) 8192.0) @@ -373,7 +373,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (b! (not a0-5) cfg-20 :delay (nop!)) - (set! (-> gp-0 quad) (-> a0-5 extra trans quad)) + (vector-copy! gp-0 (-> a0-5 extra trans)) (let ((f0-0 (vector-vector-xz-distance gp-0 (-> self root trans))) (f30-0 (- (-> gp-0 y) (-> self root trans y))) ) @@ -382,7 +382,7 @@ ) (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-10 target-pos quad) (-> v1-9 quad)) + (vector-copy! (-> a0-10 target-pos) v1-9) ) 0 (when (and (< f0-0 40960.0) (< 24576.0 (+ -8192.0 f30-0))) @@ -441,21 +441,25 @@ ;; definition for method 97 of type flut-racer (defmethod jump-land-anim ((this flut-racer) (arg0 enemy-jump-info)) + "Play the landing anim" #f ) ;; definition for method 98 of type flut-racer (defmethod jump-wind-up-anim ((this flut-racer) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" #f ) ;; definition for method 102 of type flut-racer -(defmethod go-directed2 ((this flut-racer)) +(defmethod go-next-state-auto ((this flut-racer)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (go (method-of-object this race)) ) ;; definition for method 108 of type flut-racer -(defmethod enemy-method-108 ((this flut-racer) (arg0 process-focusable)) +(defmethod should-flee-from? ((this flut-racer) (arg0 process-focusable)) + "Return if this enemy should flee from the process." #t ) @@ -467,21 +471,23 @@ ;; definition for method 62 of type flut-racer (defmethod get-damage-from-attack ((this flut-racer) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." 0.0 ) ;; definition for method 122 of type flut-racer -(defmethod go-idle2 ((this flut-racer)) +(defmethod go-fallback-init ((this flut-racer)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this wait)) ) ;; definition for method 99 of type flut-racer ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 5. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod jump-anim-handler ((this flut-racer) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this flut-racer) (arg0 jump-stage) (arg1 enemy-jump-info)) (let ((v1-0 arg0)) (the-as symbol (cond - ((= v1-0 4) + ((= v1-0 (jump-stage touchdown)) (when (not (focus-test? this dangerous)) (let ((v0-0 (the-as object (logior (-> this focus-status) (focus-status dangerous))))) (set! (-> this focus-status) (the-as focus-status v0-0)) @@ -499,6 +505,7 @@ ;; definition for method 82 of type flut-racer (defmethod event-handler ((this flut-racer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('trigger) (if (and (-> this next-state) (= (-> this next-state name) 'wait)) @@ -581,7 +588,7 @@ ) (when (>= (* f1-2 f1-2) f0-10) (set! (-> this enemy-info attack-damage) 15) - (send-attack this s2-1 (the-as touching-shapes-entry #f) (-> this attack-id)) + (send-attack-from-tshape this s2-1 (the-as touching-shapes-entry #f) (-> this attack-id)) (set! (-> this enemy-info attack-damage) 0) 0 ) @@ -616,7 +623,7 @@ ) (when (>= (* f1-6 f1-6) f0-13) (set! (-> this enemy-info attack-damage) 15) - (send-attack this s4-2 (the-as touching-shapes-entry #f) (-> this attack-id)) + (send-attack-from-tshape this s4-2 (the-as touching-shapes-entry #f) (-> this attack-id)) (set! (-> this enemy-info attack-damage) 0) 0 ) @@ -632,12 +639,13 @@ ;; definition for method 121 of type flut-racer ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this flut-racer)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flut-racer" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flut-racer-enemy-info*) + (setup-enemy! this *flut-racer-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -719,6 +727,7 @@ ;; definition for method 120 of type flut-racer ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod init-enemy-collision! ((this flut-racer)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) diff --git a/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc index b2b3665f876..516e641be54 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/flut_REF.gc @@ -564,7 +564,7 @@ (set-yaw-angle-clear-roll-pitch! (-> self root) (res-lump-float arg0 'rotoffset)) ) (when arg1 - (set! (-> self root trans quad) (-> arg1 trans quad)) + (vector-copy! (-> self root trans) (-> arg1 trans)) (quaternion-copy! (-> self root quat) (-> arg1 quat)) ) (initialize-skeleton @@ -622,6 +622,7 @@ ;; definition for method 11 of type flut (defmethod init-from-entity! ((this flut) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (flut-init arg0 (the-as transformq #f) diff --git a/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc b/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc index 775de20fc43..84536871e3b 100644 --- a/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/flut/target-flut_REF.gc @@ -371,7 +371,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg3 quad)) + (vector-copy! s5-0 arg3) (let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y)))) (if (< 6144.0 f0-1) (set! f0-1 6144.0) @@ -569,7 +569,7 @@ (let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0))) (cond ((>= f30-0 0.0) - (set! (-> s1-0 quad) (-> gp-0 best-other-tri normal quad)) + (vector-copy! s1-0 (-> gp-0 best-other-tri normal)) (when (< 8192.0 (vector-vector-angle-safe *y-vector* s1-0)) (let* ((a1-16 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s1-0) 1.0)) (a2-14 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-16 8192.0)) @@ -592,13 +592,13 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-18 quad) vf6) ) - (set! (-> s3-0 user-position quad) (-> s2-0 quad)) - (set! (-> s3-0 user-normal quad) (-> s1-0 quad)) + (vector-copy! (-> s3-0 user-position) s2-0) + (vector-copy! (-> s3-0 user-normal) s1-0) ) (else (set! (-> s0-0 y) (-> (target-pos 0) y)) - (set! (-> s3-0 user-position quad) (-> s0-0 quad)) - (set! (-> s3-0 user-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> s3-0 user-position) s0-0) + (vector-copy! (-> s3-0 user-normal) *y-vector*) ) ) ) @@ -628,7 +628,7 @@ (defbehavior target-flut-post-post target () (vector+! (-> self flut flut-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat)) - (set! (-> self flut flut-scale quad) (-> self control scale quad)) + (vector-copy! (-> self flut flut-scale) (-> self control scale)) (let ((v1-8 (-> *target-shadow-control* settings shadow-dir quad))) (set! (-> *flut-shadow-control* settings shadow-dir quad) v1-8) ) @@ -1264,11 +1264,11 @@ ) (init-vf0-vector) (let ((gp-0 (ppointer->process (-> self parent)))) - (set! (-> self control trans quad) (-> (the-as target gp-0) flut flut-trans quad)) + (vector-copy! (-> self control trans) (-> (the-as target gp-0) flut flut-trans)) (let ((v1-5 (-> (the-as target gp-0) flut flut-quat quad))) (set! (-> self control quat quad) v1-5) ) - (set! (-> self control scale quad) (-> (the-as target gp-0) flut flut-scale quad)) + (vector-copy! (-> self control scale) (-> (the-as target gp-0) flut flut-scale)) (set! (-> self control ground-pat material) (the-as int (-> (the-as target gp-0) control ground-pat material)) ) @@ -2586,7 +2586,7 @@ (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (vector-copy! (-> self control dynam gravity) (-> self control standard-dynamics gravity)) ((-> target-flut-start exit)) ) :trans (behavior () @@ -2801,7 +2801,7 @@ (vector-xz-normalize! (-> s5-0 vector) (- (fabs (-> s5-0 shove-back)))) (set! (-> s5-0 vector y) (-> s5-0 shove-up)) ) - (set! (-> s4-0 quad) (-> s5-0 vector quad)) + (vector-copy! s4-0 (-> s5-0 vector)) (let ((f0-11 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -2825,13 +2825,13 @@ (cond ((= (-> self game mode) 'debug) (let ((s3-2 (new-stack-vector0))) - (set! (-> s3-2 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! s3-2 (-> self control last-trans-on-ground)) (ja-channel-set! 0) (suspend-for (seconds 1) ) (move-to-point! (-> self control) s3-2) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-flut-stance) ) @@ -2852,11 +2852,11 @@ (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -3055,11 +3055,11 @@ (sound-play "death-darkeco") (cond ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 62)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 62)) ) ) @@ -3078,11 +3078,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -3269,16 +3269,16 @@ :code (behavior ((arg0 handle)) (set! (-> self control mod-surface) *flut-walk-mods*) (set! (-> self control transv quad) (the-as uint128 0)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (logior! (-> self target-flags) (target-flags tf5 tf6)) (set-time! (-> self state-time)) (when (handle->process arg0) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self control trans quad)) + (vector-copy! s4-0 (-> self control trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self control trans quad)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector39)) (-> self control quat)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector40)) (-> self control quat-for-control)) + (vector-copy! s5-0 (-> self control trans)) + (quaternion-copy! (-> self control unknown-quat39) (-> self control quat)) + (quaternion-copy! (-> self control unknown-quat40) (-> self control quat-for-control)) (set! (-> self control unknown-word04) (the-as uint (-> self control draw-offset y))) (let* ((s2-0 (handle->process arg0)) (s3-0 (if (type? s2-0 process-drawable) @@ -3287,16 +3287,16 @@ ) ) (when s3-0 - (set! (-> s5-0 quad) (-> s3-0 root trans quad)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector40)) (-> s3-0 root quat)) + (vector-copy! s5-0 (-> s3-0 root trans)) + (quaternion-copy! (-> self control unknown-quat40) (-> s3-0 root quat)) (send-event s3-0 'trans (-> self flut flut-trans)) (quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> s3-0 root quat)) - (set! (-> self flut flut-scale quad) (-> s3-0 root scale quad)) + (vector-copy! (-> self flut flut-scale) (-> s3-0 root scale)) (set! (-> self control did-move-to-pole-or-max-jump-height) (-> self flut flut-trans y)) ) ) - (set! (-> self control unknown-vector37 quad) (-> s4-0 quad)) - (set! (-> self control unknown-vector38 quad) (-> s5-0 quad)) + (vector-copy! (-> self control unknown-vector37) s4-0) + (vector-copy! (-> self control unknown-vector38) s5-0) (let ((s4-1 #f)) (sound-play "uppercut") (ja-channel-push! 1 (seconds 0.05)) @@ -3320,9 +3320,9 @@ ) ) (when v1-66 - (set! (-> s5-0 quad) (-> v1-66 root trans quad)) - (set! (-> self control unknown-vector38 quad) (-> s5-0 quad)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector40)) (-> v1-66 root quat)) + (vector-copy! s5-0 (-> v1-66 root trans)) + (vector-copy! (-> self control unknown-vector38) s5-0) + (quaternion-copy! (-> self control unknown-quat40) (-> v1-66 root quat)) ) ) (when (and (not s4-1) (= (-> self skel root-channel 0) (-> self skel channel))) @@ -3374,8 +3374,8 @@ (move-to-point! (-> self control) gp-0) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) @@ -3479,7 +3479,7 @@ (rot->dir-targ! (-> self control)) (set! (-> self neck flex-blend) 0.0) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (ja-channel-push! 1 (seconds 0.1)) (let ((s5-0 (if (-> self flut as-daxter?) jakb-mech-dummy3-ja @@ -3541,7 +3541,7 @@ (rot->dir-targ! (-> self control)) (set! (-> self neck flex-blend) 0.0) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (ja-channel-push! 1 (seconds 0.1)) (case arg0 (('drown) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc index 0097298980c..2df001a9357 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc @@ -80,8 +80,8 @@ (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options po17)) (logclear! (-> s4-1 options) (projectile-options po14 po15 po16)) - (set! (-> s4-1 pos quad) (-> gp-0 fire-point quad)) - (set! (-> s4-1 vel quad) (-> s5-0 quad)) + (vector-copy! (-> s4-1 pos) (-> gp-0 fire-point)) + (vector-copy! (-> s4-1 vel) s5-0) (set! (-> s4-1 notify-handle) (the-as handle #f)) (set! (-> s4-1 owner-handle) (the-as handle #f)) (set! (-> s4-1 target-handle) (the-as handle #f)) @@ -159,7 +159,7 @@ ;; WARN: Return type mismatch float vs object. (defun get-dist-and-dot ((arg0 gun-blue-shot) (arg1 dist-dot-val)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> arg0 desired-target-pos quad)) + (vector-copy! s4-0 (-> arg0 desired-target-pos)) (let ((s5-0 (vector-normalize-copy! (-> arg1 current-dir-vec) (-> arg0 root transv) 1.0))) (let ((a0-2 (-> arg1 vec-to-target))) (vector-! a0-2 s4-0 (-> arg0 root trans)) @@ -194,7 +194,7 @@ (cond (s5-0 (let ((a0-9 (get-trans (the-as process-focusable a0-4) 3))) - (set! (-> arg0 desired-target-pos quad) (-> a0-9 quad)) + (vector-copy! (-> arg0 desired-target-pos) a0-9) ) ) ((= (-> arg0 track-mode) 1) @@ -249,7 +249,7 @@ ) ((or (= v1-40 1) (= v1-40 2)) (let ((s5-4 (new 'stack-no-clear 'vector))) - (set! (-> s5-4 quad) (-> arg0 root trans quad)) + (vector-copy! s5-4 (-> arg0 root trans)) (let ((f30-0 2.0) (f24-0 65536.0) ) @@ -275,7 +275,7 @@ ) (cond ((< 0.99 (-> s3-0 dot)) - (set! (-> s3-0 current-dir-vec quad) (-> s3-0 vec-to-target quad)) + (vector-copy! (-> s3-0 current-dir-vec) (-> s3-0 vec-to-target)) ) (else (let* ((s2-0 (new 'stack-no-clear 'vector)) @@ -294,7 +294,7 @@ ) ) ) - (set! (-> arg0 root transv quad) (-> s3-0 current-dir-vec quad)) + (vector-copy! (-> arg0 root transv) (-> s3-0 current-dir-vec)) (let* ((f0-26 (* 0.5 (+ 1.0 (-> s3-0 dot)))) (f0-27 (* f0-26 f0-26)) (f0-28 (lerp 122880.0 409600.0 f0-27)) @@ -321,7 +321,7 @@ ) (label cfg-70) (vector-! (-> arg0 root transv) (-> arg0 root trans) s5-4) - (set! (-> arg0 root trans quad) (-> s5-4 quad)) + (vector-copy! (-> arg0 root trans) s5-4) ) (vector-float*! (-> arg0 root transv) (-> arg0 root transv) (/ 1.0 (seconds-per-frame))) ) @@ -421,7 +421,7 @@ (set! (-> *blue-shot-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *blue-shot-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *blue-shot-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *blue-shot-trail* use-tape-mode?) #f) @@ -447,7 +447,7 @@ (set! (-> this vehicle-impulse-factor) 2.0) (logior! (-> this options) (projectile-options po13)) (set! (-> this track-mode) (the-as uint 0)) - (set! (-> this start-pos quad) (-> this root trans quad)) + (vector-copy! (-> this start-pos) (-> this root trans)) (let* ((f30-0 12288.0) (f28-0 28672.0) (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -560,7 +560,7 @@ (set! sv-1288 0) (set! sv-1296 (the-as float 0.0)) (set! sv-1300 (send-event *target* 'get-vehicle)) - (set! (-> sv-1280 quad) (-> sv-144 fire-point quad)) + (vector-copy! sv-1280 (-> sv-144 fire-point)) (set! (-> sv-1280 w) 163840.0) (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s5-0 (fill-actor-list-for-box *actor-hash* sv-1280 gp-0 384)) @@ -740,21 +740,19 @@ (vector+! gp-2 (-> sv-144 fire-point) s4-5) ) (let ((s4-6 (new 'stack-no-clear 'vector))) - (set! (-> s4-6 quad) (-> gp-2 quad)) + (vector-copy! s4-6 gp-2) (when s5-7 (let ((s3-6 s4-6) (s2-3 s5-7) ) - (set! (-> s3-6 quad) (-> (get-trans - (the-as process-focusable (if (type? s2-3 process-focusable) - (the-as process-focusable s2-3) - ) - ) - 3 - ) - quad - ) - ) + (vector-copy! s3-6 (get-trans + (the-as process-focusable (if (type? s2-3 process-focusable) + (the-as process-focusable s2-3) + ) + ) + 3 + ) + ) ) ) (let ((s3-7 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> sv-144 fire-dir-out) 2730.6667)) @@ -763,8 +761,8 @@ (s4-7 (new 'stack-no-clear 'vector)) ) (if (< (vector-dot s3-7 a0-114) (vector-dot v1-174 a0-114)) - (set! (-> s4-7 quad) (-> s3-7 quad)) - (set! (-> s4-7 quad) (-> v1-174 quad)) + (vector-copy! s4-7 s3-7) + (vector-copy! s4-7 v1-174) ) (vector-normalize! a0-114 1.0) (let* ((s3-8 vector-rotate-y!) @@ -789,11 +787,11 @@ (set! (-> sv-148 charge) 1.0) (set! (-> sv-148 options) (projectile-options)) (logclear! (-> sv-148 options) (projectile-options po14 po15 po16)) - (set! (-> sv-148 pos quad) (-> sv-144 fire-point quad)) + (vector-copy! (-> sv-148 pos) (-> sv-144 fire-point)) (set! (-> sv-148 notify-handle) (the-as handle #f)) (set! (-> sv-148 owner-handle) (the-as handle #f)) (set! (-> sv-148 target-handle) (process->handle s5-7)) - (set! (-> sv-148 target-pos quad) (-> gp-2 quad)) + (vector-copy! (-> sv-148 target-pos) gp-2) (set! (-> sv-148 ignore-handle) (process->handle (send-event self 'get-vehicle))) (let* ((v1-209 *game-info*) (a0-143 (+ (-> v1-209 attack-id) 1)) @@ -850,7 +848,7 @@ (s3-0 #f) ) (vector-! (-> s5-0 move-dist) arg1 arg0) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) 2.0) (let ((v1-5 s5-0)) (set! (-> v1-5 radius) 12288.0) @@ -884,10 +882,11 @@ (set! (-> a1-8 charge) 1.0) (set! (-> a1-8 options) (projectile-options)) (logclear! (-> a1-8 options) (projectile-options po14 po15 po16)) - (set! (-> a1-8 pos quad) (-> arg0 quad)) - (set! (-> a1-8 vel quad) - (-> (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) (/ 2.0 (seconds-per-frame))) quad) - ) + (vector-copy! (-> a1-8 pos) arg0) + (vector-copy! + (-> a1-8 vel) + (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) (/ 2.0 (seconds-per-frame))) + ) (set! (-> a1-8 notify-handle) (the-as handle #f)) (set! (-> a1-8 owner-handle) (process->handle *target*)) (set! (-> a1-8 target-handle) (the-as handle #f)) @@ -1668,7 +1667,7 @@ (dotimes (v1-31 (-> s3-0 num-active-spans)) (let ((a0-8 (-> s3-0 spans data v1-31))) (let ((a1-5 (-> s3-0 spans-internal data v1-31))) - (set! (-> s3-0 span-pts-start data v1-31 quad) (-> arg0 pts v1-31 quad)) + (vector-copy! (-> s3-0 span-pts-start data v1-31) (-> arg0 pts v1-31)) (set! (-> a0-8 random-offset-size-start) 0.0) (if (> v1-31 0) (set! (-> a0-8 random-offset-size-start) 8192.0) @@ -1679,9 +1678,10 @@ ) ) (let ((v1-37 (-> s3-0 spans data (-> s3-0 num-active-spans)))) - (set! (-> s3-0 span-pts-start data (-> s3-0 num-active-spans) quad) - (-> arg0 pts (-> s3-0 num-active-spans) quad) - ) + (vector-copy! + (-> s3-0 span-pts-start data (-> s3-0 num-active-spans)) + (-> arg0 pts (-> s3-0 num-active-spans)) + ) (set! (-> v1-37 random-offset-size-start) 0.0) ) (lightning-bolt-method-11 s3-0) @@ -1701,7 +1701,7 @@ (dotimes (v1-58 (-> s3-1 num-active-spans)) (let ((a0-24 (-> s3-1 spans data v1-58))) (let ((a1-16 (-> s3-1 spans-internal data v1-58))) - (set! (-> s3-1 span-pts-start data v1-58 quad) (-> arg0 pts v1-58 quad)) + (vector-copy! (-> s3-1 span-pts-start data v1-58) (-> arg0 pts v1-58)) (set! (-> a0-24 random-offset-size-start) 0.0) (if (> v1-58 0) (set! (-> a0-24 random-offset-size-start) 4096.0) @@ -1712,16 +1712,17 @@ ) ) (let ((v1-64 (-> s3-1 spans data (-> s3-1 num-active-spans)))) - (set! (-> s3-1 span-pts-start data (-> s3-1 num-active-spans) quad) - (-> arg0 pts (-> s3-1 num-active-spans) quad) - ) + (vector-copy! + (-> s3-1 span-pts-start data (-> s3-1 num-active-spans)) + (-> arg0 pts (-> s3-1 num-active-spans)) + ) (set! (-> v1-64 random-offset-size-start) 0.0) ) (lightning-bolt-method-11 s3-1) (lightning-bolt-method-12 s3-1) ) ) - (set! (-> this root trans quad) (-> arg0 pts (+ (-> arg0 num-pts) -1) quad)) + (vector-copy! (-> this root trans) (-> arg0 pts (+ (-> arg0 num-pts) -1))) (when (-> arg0 should-draw-terminal-sparks?) (when (time-elapsed? (-> this last-spark-time) (-> this spark-time-interval)) (set-time! (-> this last-spark-time)) @@ -1734,9 +1735,9 @@ (let ((s4-2 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 3) 3))) (let ((v1-90 (-> this lt-array 5))) (-> v1-90 spans data (-> v1-90 num-active-spans)) - (set! (-> arg0 terminal-spark-pos quad) (-> v1-90 span-pts-start data (-> v1-90 num-active-spans) quad)) + (vector-copy! (-> arg0 terminal-spark-pos) (-> v1-90 span-pts-start data (-> v1-90 num-active-spans))) ) - (set! (-> this root trans quad) (-> arg0 terminal-spark-pos quad)) + (vector-copy! (-> this root trans) (-> arg0 terminal-spark-pos)) (dotimes (s5-1 s4-2) (process-drawable-shock-effect-replace this @@ -1777,7 +1778,7 @@ ) ) :enter (behavior () - (set! (-> self prev-targ-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self prev-targ-pos) (target-pos 0)) (set-time! (-> self state-time)) (set-time! (-> self active-enter-time)) (set-time! (-> self last-deduct-ammo-time)) @@ -1786,7 +1787,7 @@ ) (set! (-> *blue-2-lightning-shape* num-knots) (the-as uint 12)) (let ((v1-17 (new 'stack-no-clear 'vector))) - (set! (-> v1-17 quad) (-> *target* gun fire-point quad)) + (vector-copy! v1-17 (-> *target* gun fire-point)) (let ((a0-9 (vector-float*! (new 'stack-no-clear 'vector) (-> *target* gun laser-dir) 24576.0))) (dotimes (a1-4 (the-as int (-> *blue-2-lightning-shape* num-knots))) (set! (-> *blue-2-lightning-shape* constraints a1-4 pt quad) (-> v1-17 quad)) @@ -2029,7 +2030,7 @@ (set! sv-32 (the-as process-drawable #f)) (set! sv-36 4096000.0) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> arg0 quad)) + (vector-copy! v1-1 arg0) (set! sv-40 v1-1) ) (set! (-> sv-40 w) 0.0) @@ -2094,7 +2095,7 @@ (set! sv-32 (the-as process-drawable #f)) (set! sv-36 16384.0) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> arg0 quad)) + (vector-copy! v1-1 arg0) (set! sv-40 v1-1) ) (set! (-> arg0 w) 16384.0) @@ -2215,7 +2216,7 @@ (when (>= f0-3 0.0) (vector-float*! (-> s3-0 move-dist) (-> s3-0 move-dist) f0-3) (vector+! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist)) - (set! (-> arg2 lightning-info terminal-spark-pos quad) (-> s4-0 quad)) + (vector-copy! (-> arg2 lightning-info terminal-spark-pos) s4-0) (set! (-> arg2 lightning-info num-pts) 1) (set! (-> arg2 lightning-info pts 0 quad) (-> s4-0 quad)) (set! (-> arg2 lightning-info should-draw-terminal-sparks?) #t) @@ -2257,7 +2258,7 @@ ) ) ) - (set! (-> this prev-targ-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this prev-targ-pos) (target-pos 0)) (set! sv-624 (-> *target* gun)) (set! sv-628 (-> *target* gun laser-dir)) (set! sv-632 (new 'stack-no-clear 'gun-blue-lightning-command)) @@ -2266,13 +2267,13 @@ (set! sv-656 (new 'static 'array int32 12 0 0 0 0 0 0 0 0 0 0 0 0)) (vector-normalize! sv-628 1.0) (set! (-> *blue-2-lightning-shape* constraints 0 pt quad) (-> sv-624 fire-point quad)) - (set! (-> *blue-2-lightning-shape* constraints 0 dir quad) (-> sv-628 quad)) + (vector-copy! (-> *blue-2-lightning-shape* constraints 0 dir) sv-628) (rope-constraint-method-9 *blue-2-lightning-shape* 0) (if (zero? (-> this last-probe-index)) (+! (-> this last-probe-index) 1) ) (dotimes (v1-22 12) - (set! (-> *lightning-pts-cache* v1-22 quad) (-> *blue-2-lightning-shape* constraints v1-22 pt quad)) + (vector-copy! (-> *lightning-pts-cache* v1-22) (-> *blue-2-lightning-shape* constraints v1-22 pt)) ) (if (not (gun-blue-2-lightning-tracker-method-26 this sv-628 (-> sv-624 fire-point) sv-632)) (return 0) @@ -2286,11 +2287,11 @@ ) (while (>= (the-as int s4-0) s5-3) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> *lightning-pts-cache* s5-3 quad)) + (vector-copy! s3-0 (-> *lightning-pts-cache* s5-3)) (let ((s2-0 (the-as process-drawable #f))) (let ((a0-19 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (set! (-> a0-19 quad) (-> s3-0 quad)) + (vector-copy! a0-19 s3-0) (set! (-> a0-19 w) 12288.0) (if (not (the-as symbol s2-0)) (set! s2-0 (find-gun-blue-2-target-old @@ -2308,8 +2309,8 @@ (set! (-> sv-656 s5-3) 1) (set! sv-640 (+ sv-640 1)) (set! sv-648 s5-3) - (set! (-> s3-0 quad) (-> (get-trans (the-as process-focusable s2-0) 3) quad)) - (set! (-> *lightning-pts-cache* s5-3 quad) (-> s3-0 quad)) + (vector-copy! s3-0 (get-trans (the-as process-focusable s2-0) 3)) + (vector-copy! (-> *lightning-pts-cache* s5-3) s3-0) (vector-! (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-3))) (-> *lightning-pts-cache* s5-3) @@ -2330,10 +2331,10 @@ (let ((s0-0 s3-0) (s1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s1-1 quad) (-> *lightning-pts-cache* (+ s5-3 -1) quad)) + (vector-copy! s1-1 (-> *lightning-pts-cache* (+ s5-3 -1))) (set! sv-1440 (the-as symbol #f)) (set! sv-1456 (new 'stack-no-clear 'collide-query)) - (set! (-> sv-1456 start-pos quad) (-> s1-1 quad)) + (vector-copy! (-> sv-1456 start-pos) s1-1) (vector-! (-> sv-1456 move-dist) s0-0 s1-1) (set! sv-1472 sv-1456) (set! (-> sv-1472 radius) 860.16) @@ -2359,14 +2360,14 @@ ) ) (else - (set! (-> sv-632 lightning-info terminal-spark-pos quad) (-> s0-0 quad)) + (vector-copy! (-> sv-632 lightning-info terminal-spark-pos) s0-0) ) ) ) ) (when (not s2-0) ) - (set! (-> *lightning-pts-cache* s5-3 quad) (-> s3-0 quad)) + (vector-copy! (-> *lightning-pts-cache* s5-3) s3-0) (+! (-> sv-632 lightning-info num-pts) 1) (let ((s3-1 fire-projectile-if-necessary) (a2-13 (if (< 1 sv-640) @@ -2396,7 +2397,7 @@ (set! (-> sv-632 lightning-info should-draw-terminal-sparks?) #f) ) (dotimes (s5-4 (-> sv-632 lightning-info num-pts)) - (set! (-> sv-632 lightning-info pts s5-4 quad) (-> *lightning-pts-cache* s5-4 quad)) + (vector-copy! (-> sv-632 lightning-info pts s5-4) (-> *lightning-pts-cache* s5-4)) (when (and (> s5-4 0) (zero? (-> sv-656 s5-4))) (let ((s4-1 (matrix-f-u-compose @@ -2470,25 +2471,25 @@ (return 0) ) (let ((v1-23 (new 'stack-no-clear 'vector))) - (set! (-> v1-23 quad) (-> sv-608 fire-point quad)) + (vector-copy! v1-23 (-> sv-608 fire-point)) (set! sv-768 v1-23) ) (set! sv-772 (vector+float*! (new 'stack-no-clear 'vector) (-> sv-608 fire-point) sv-612 409600.0)) (let ((v1-26 (new 'stack-no-clear 'vector))) - (set! (-> v1-26 quad) (-> sv-612 quad)) + (vector-copy! v1-26 sv-612) (set! sv-776 v1-26) ) (set! sv-784 0) (set! sv-792 -1) (set! sv-800 (new 'stack-no-clear 'vector)) - (set! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts) quad) (-> sv-768 quad)) + (vector-copy! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts)) sv-768) (+! (-> sv-616 lightning-info num-pts) 1) (vector-! sv-800 sv-772 sv-768) (dotimes (gp-0 8) (let ((f30-0 32768.0)) (set! sv-848 (new 'stack-no-clear 'vector)) (set! sv-852 (vector+float*! (new 'stack-no-clear 'vector) sv-768 sv-612 f30-0)) - (set! (-> sv-848 quad) (-> sv-852 quad)) + (vector-copy! sv-848 sv-852) (set! (-> sv-848 w) 20480.0) (let ((s5-0 (the-as process #f))) (let ((s4-0 #f)) @@ -2552,11 +2553,11 @@ ) ) ) - (set! (-> sv-776 quad) (-> sv-800 quad)) + (vector-copy! sv-776 sv-800) (let ((s5-3 (vector+float*! (new 'stack-no-clear 'vector) sv-768 sv-800 f30-0))) (let ((s4-3 #f)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> sv-768 quad)) + (vector-copy! (-> s3-1 start-pos) sv-768) (vector-! (-> s3-1 move-dist) s5-3 sv-768) (let ((v1-99 s3-1)) (set! (-> v1-99 radius) 40.96) @@ -2582,13 +2583,13 @@ ) ) (else - (set! (-> sv-616 lightning-info terminal-spark-pos quad) (-> s5-3 quad)) + (vector-copy! (-> sv-616 lightning-info terminal-spark-pos) s5-3) ) ) ) ) ) - (set! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts) quad) (-> s5-3 quad)) + (vector-copy! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts)) s5-3) (+! (-> sv-616 lightning-info num-pts) 1) (let ((s3-2 fire-projectile-if-necessary) (s2-3 sv-768) @@ -2601,7 +2602,7 @@ ) (s3-2 s2-3 s1-0 (the-as handle a2-7)) ) - (set! (-> sv-768 quad) (-> s5-3 quad)) + (vector-copy! sv-768 s5-3) (when s4-3 (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #t) (set! (-> sv-616 lightning-info should-draw-extension?) #f) @@ -2609,7 +2610,7 @@ (goto cfg-70) ) ) - (set! (-> sv-616 lightning-info terminal-spark-pos quad) (-> s5-3 quad)) + (vector-copy! (-> sv-616 lightning-info terminal-spark-pos) s5-3) ) ) ) @@ -2624,7 +2625,7 @@ (let ((gp-2 (vector+float*! (new 'stack-no-clear 'vector) s5-4 sv-800 409600.0)) (s4-4 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s4-4 start-pos quad) (-> s5-4 quad)) + (vector-copy! (-> s4-4 start-pos) s5-4) (vector-! (-> s4-4 move-dist) gp-2 s5-4) (let ((v1-154 s4-4)) (set! (-> v1-154 radius) 40.96) @@ -2644,7 +2645,7 @@ (vector+! gp-2 s5-4 (-> s4-4 move-dist)) ) ) - (set! (-> sv-616 lightning-info extension-end-point quad) (-> gp-2 quad)) + (vector-copy! (-> sv-616 lightning-info extension-end-point) gp-2) (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #t) (let ((a0-122 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-4 move-dist) 1.0))) (vector+float*! (-> sv-616 lightning-info terminal-spark-pos) gp-2 a0-122 -12288.0) @@ -2807,7 +2808,7 @@ ) (vector-rotate-y! s1-0 s1-0 16384.0) (vector+float*! s1-0 s5-0 s1-0 -8806.4) - (set! (-> s2-0 start-pos quad) (-> s1-0 quad)) + (vector-copy! (-> s2-0 start-pos) s1-0) (vector-float*! (-> s2-0 move-dist) (-> this root dynam gravity-normal) -81920.0) (let ((v1-15 s2-0)) (set! (-> v1-15 radius) 1228.8) @@ -2875,7 +2876,7 @@ ) (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) - (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (vector-copy! (-> a1-7 fvec) s2-0) (matrix->eul (the-as euler-angles s1-0) a1-7 21) (vector-negate! s3-2 s1-0) (let ((a0-14 s3-2)) @@ -2897,11 +2898,11 @@ ) (let ((v1-24 (cond ((logtest? (-> *part-group-id-table* 90 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 90)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 90)) ) ) @@ -2991,7 +2992,7 @@ (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) (move-by-vector! arg0 a1-1) ) - (set! (-> (the-as gun-blue-shot (-> arg0 process)) collide-normal quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! (-> (the-as gun-blue-shot (-> arg0 process)) collide-normal) (-> arg1 best-other-tri normal)) (let ((v0-1 4)) (logior! (-> arg0 status) v0-1) (the-as collide-status v0-1) @@ -3055,8 +3056,8 @@ (with-pp (+! (-> *game-info* shots-fired 2) 1.0) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> this init-pos quad) (-> this root trans quad)) - (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) + (vector-copy! (-> this init-dir) (-> this starting-dir)) (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) (set! (-> this attack-mode) 'eco-blue) (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) @@ -3078,8 +3079,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this gun-blue-shot-2)) (with-pp - (set! (-> this init-pos quad) (-> this root trans quad)) - (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) + (vector-copy! (-> this init-dir) (-> this starting-dir)) (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) (set! (-> this attack-mode) 'eco-blue) (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) @@ -3130,11 +3131,11 @@ (let ((v1-11 (cond ((logtest? (-> *part-group-id-table* 108 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 108)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 108)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc index 777b9d75a39..a3d9571ec32 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc @@ -168,8 +168,8 @@ (set! (-> gp-0 charge) (-> s5-0 fire-charge)) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s5-0 fire-point quad)) - (set! (-> gp-0 vel quad) (-> s5-0 fire-dir-out quad)) + (vector-copy! (-> gp-0 pos) (-> s5-0 fire-point)) + (vector-copy! (-> gp-0 vel) (-> s5-0 fire-dir-out)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -255,7 +255,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dark-3-sphere" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) (/ (-> arg0 size-x) METER_LENGTH) (/ (-> arg0 size-y) METER_LENGTH) 1.0 1.0) (go-virtual active) @@ -268,7 +268,7 @@ (case message (('set-pos-and-size) (let ((v1-2 (the-as gun-dark-3-sphere-init-params (-> block param 0)))) - (set! (-> self root trans quad) (-> v1-2 pos quad)) + (vector-copy! (-> self root trans) (-> v1-2 pos)) (set-vector! (-> self root scale) (/ (-> v1-2 size-x) METER_LENGTH) (/ (-> v1-2 size-y) METER_LENGTH) 1.0 1.0) (vector-float*! (-> self root scale) (-> self root scale) 1.7) (set! (-> self alpha-val) (-> v1-2 alpha-val)) @@ -453,7 +453,7 @@ (when (not (logtest? (-> this draw status) (draw-control-status no-draw))) (let ((s5-0 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) - (set! (-> s5-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) (spawn-from-mat (-> this part) s5-0) (init-with-mat! (-> this smoke-trail) s5-0) ) @@ -465,7 +465,7 @@ ;; INFO: Used lq/sq (defun gun-dark-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) (cshape-reaction-update-state arg0 arg1 arg3) - (set! (-> arg2 quad) (-> arg3 quad)) + (vector-copy! arg2 arg3) (cond ((logtest? (-> arg0 status) (collide-status touch-wall)) (send-event (-> arg0 process) 'impact-small) @@ -474,7 +474,7 @@ (< -0.3 f0-1) ) (let ((v1-9 (new 'stack-no-clear 'vector))) - (set! (-> v1-9 quad) (-> arg0 trans quad)) + (vector-copy! v1-9 (-> arg0 trans)) (+ 1228.8 (-> v1-9 y)) ) (vector-flatten! arg2 arg3 (-> arg0 surface-normal)) @@ -555,7 +555,7 @@ (set! (-> v1-19 attack-id) a0-15) (set! (-> this attack-id) a0-15) ) - (set! (-> this initial-velocity quad) (-> this root transv quad)) + (vector-copy! (-> this initial-velocity) (-> this root transv)) (set! (-> this start-y) (-> this root trans y)) (set! (-> this launch-impact-state) (method-of-object this impact-dud)) (set! (-> this y-vel-adjust) 0.0) @@ -589,9 +589,9 @@ ;; WARN: Return type mismatch symbol vs object. (defbehavior nuke-move gun-dark-3-nuke () (let ((gp-0 (-> self root))) - (set! (-> self pre-move-transv quad) (-> gp-0 transv quad)) + (vector-copy! (-> self pre-move-transv) (-> gp-0 transv)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ((-> self move) self) (projectile-method-39 self) (set! (-> self old-dist (-> self old-dist-count)) (* 0.0625 (vector-vector-distance s5-0 (-> gp-0 trans)))) @@ -840,11 +840,11 @@ (+! (-> v1-2 y) 409.6) (let ((v1-5 (cond ((logtest? (-> *part-group-id-table* 115 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 115)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 115)) ) ) @@ -882,7 +882,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-0 64) ) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) 1228800.0) (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s2-0 (fill-actor-list-for-box *actor-hash* s4-0 s3-0 384)) @@ -1024,7 +1024,7 @@ (go empty-state) ) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 0.0) (set! (-> gp-0 scale) 1.0) @@ -1209,11 +1209,11 @@ (let ((v1-23 (cond ((logtest? (-> *part-group-id-table* 114 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 114)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 114)) ) ) @@ -1391,11 +1391,11 @@ (let ((v1-30 (cond ((logtest? (-> *part-group-id-table* 110 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 110)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 110)) ) ) @@ -1406,11 +1406,11 @@ (let ((v1-61 (cond ((logtest? (-> *part-group-id-table* 111 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 111)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 111)) ) ) @@ -1419,7 +1419,7 @@ (send-event (ppointer->process v1-61) 'clock self) ) (let ((gp-4 (new 'stack-no-clear 'gun-dark-3-sphere-init-params))) - (set! (-> gp-4 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-4 pos) (-> self root trans)) (set! (-> gp-4 size-x) 1.0) (set! (-> gp-4 size-y) 1.0) (set! (-> self warp) @@ -1464,7 +1464,7 @@ ) ) (let ((v1-144 (new 'stack-no-clear 'gun-dark-3-sphere-init-params))) - (set! (-> v1-144 pos quad) (-> self mushroom-top-pos quad)) + (vector-copy! (-> v1-144 pos) (-> self mushroom-top-pos)) (set! (-> v1-144 size-x) f28-0) (set! (-> v1-144 size-y) f26-1) (set! (-> v1-144 alpha-val) (* f30-0 f30-0)) @@ -1566,15 +1566,15 @@ (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self gun fire-dir-out quad)) + (vector-copy! s4-0 (-> self gun fire-dir-out)) (set-last-fire-time 37) (sound-play "purple-3-shot" :position (-> gp-0 fire-point)) (set! (-> s5-0 ent) (-> self entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) (logclear! (-> s5-0 options) (projectile-options po14 po15 po16)) - (set! (-> s5-0 pos quad) (-> gp-0 fire-point quad)) - (set! (-> s5-0 vel quad) (-> (vector-float*! (new 'stack-no-clear 'vector) s4-0 81920.0) quad)) + (vector-copy! (-> s5-0 pos) (-> gp-0 fire-point)) + (vector-copy! (-> s5-0 vel) (vector-float*! (new 'stack-no-clear 'vector) s4-0 81920.0)) ) (set! (-> s5-0 notify-handle) (the-as handle #f)) (set! (-> s5-0 owner-handle) (the-as handle #f)) @@ -1745,27 +1745,26 @@ (t9-0) ) ) - (set! (-> self core-position quad) (-> self root trans quad)) + (vector-copy! (-> self core-position) (-> self root trans)) (let ((v1-10 (-> self core-velocity)) (a0-3 (-> self parent)) ) - (set! (-> v1-10 quad) (-> (the-as process-focusable (if a0-3 - (the-as process-focusable (-> a0-3 0 self)) - ) - ) - node-list - data - 13 - bone - transform - fvec - quad - ) - ) + (vector-copy! v1-10 (-> (the-as process-focusable (if a0-3 + (the-as process-focusable (-> a0-3 0 self)) + ) + ) + node-list + data + 13 + bone + transform + fvec + ) + ) ) (when (and *target* (focus-test? *target* in-head)) - (set! (-> self core-position quad) (-> (camera-pos) quad)) - (set! (-> self core-velocity quad) (-> (camera-matrix) fvec quad)) + (vector-copy! (-> self core-position) (camera-pos)) + (vector-copy! (-> self core-velocity) (-> (camera-matrix) fvec)) ) (set-vector! (-> self spin-vector) (-> self core-velocity z) 0.0 (- (-> self core-velocity x)) 1.0) (let ((f0-5 (vector-length (-> self spin-vector)))) @@ -1777,11 +1776,11 @@ (set-time! (-> self state-time)) (let ((v1-35 (cond ((logtest? (-> *part-group-id-table* 92 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 92)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 92)) ) ) @@ -1810,14 +1809,14 @@ ) (when s2-0 (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> (the-as process-focusable s2-0) root trans quad)) + (vector-copy! s3-1 (-> (the-as process-focusable s2-0) root trans)) (let ((a0-6 (if (type? s2-0 process-focusable) s2-0 ) ) ) (if a0-6 - (set! (-> s3-1 quad) (-> (get-trans (the-as process-focusable a0-6) 3) quad)) + (vector-copy! s3-1 (get-trans (the-as process-focusable a0-6) 3)) ) ) (let* ((s2-3 (vector-! (new 'stack-no-clear 'vector) s3-1 (-> self core-position))) @@ -1853,8 +1852,8 @@ (let ((f30-1 (/ f30-0 2))) (vector-normalize! (-> self spin-vector) f30-1) (vector-normalize! (-> self core-velocity) 7372.8) - (set! (-> s5-0 fvec quad) (-> s4-0 quad)) - (set! (-> s5-0 uvec quad) (-> self spin-vector quad)) + (vector-copy! (-> s5-0 fvec) s4-0) + (vector-copy! (-> s5-0 uvec) (-> self spin-vector)) (vector-float*! (-> s5-0 uvec) (-> s5-0 uvec) (/ 1.0 f30-1)) ) ) @@ -1941,7 +1940,7 @@ (a0-6 *sp-particle-system-2d*) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a2-4 trans) s4-0) (t9-5 a0-6 s1-0 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1950,7 +1949,7 @@ (a0-7 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a2-5 trans) s4-0) (t9-6 a0-7 s3-0 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1965,14 +1964,14 @@ (a1-13 gp-0) (a2-6 *launch-matrix*) ) - (set! (-> a2-6 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a2-6 trans) s4-0) (t9-8 a0-12 a1-13 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (let ((t9-9 sp-launch-particles-var) (a0-13 *sp-particle-system-2d*) (a2-7 *launch-matrix*) ) - (set! (-> a2-7 trans quad) (-> s5-0 quad)) + (vector-copy! (-> a2-7 trans) s5-0) (t9-9 a0-13 gp-0 a2-7 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -2014,7 +2013,7 @@ (a0-8 *sp-particle-system-2d*) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> self root trans quad)) + (vector-copy! (-> a2-3 trans) (-> self root trans)) (t9-5 a0-8 gp-0 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -2052,7 +2051,7 @@ (set! (-> s5-0 event-self) 'touched) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (let ((v1-16 (-> self root root-prim))) (set! (-> v1-16 prim-core collide-as) (collide-spec)) (set! (-> v1-16 prim-core collide-with) (collide-spec)) @@ -2128,16 +2127,16 @@ 0 (cond ((logtest? (-> *part-group-id-table* 93 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 93)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 93)) ) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (let ((gp-3 (the-as (array float) (new 'stack 'boxed-array float 16))) (a1-13 (new 'stack-no-clear 'event-message-block)) ) @@ -2485,7 +2484,7 @@ (a1-5 (-> *part-id-table* 398)) (a2-0 *launch-matrix*) ) - (set! (-> a2-0 trans quad) (-> v1-15 quad)) + (vector-copy! (-> a2-0 trans) v1-15) (t9-4 a0-9 a1-5 a2-0 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -2522,7 +2521,7 @@ (s4-0 (-> gp-1 process node-list)) (v1-5 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> (the-as process-focusable s3-0) root quat))) ) - (set! (-> v1-5 trans quad) (-> (the-as process-focusable s3-0) root trans quad)) + (vector-copy! (-> v1-5 trans) (-> (the-as process-focusable s3-0) root trans)) (when (nonzero? s4-0) (countdown (a0-7 (-> gp-1 total-prims)) (when (and (= (-> s5-0 transform-index) -2) (!= s5-0 (-> gp-1 root-prim))) @@ -2652,7 +2651,7 @@ (set! (-> self original-sphere-offset quad) (-> (the-as process-focusable gp-1) root root-prim local-sphere quad) ) - (set! (-> *gravity-origin-pos* quad) (-> (get-trans (the-as process-focusable gp-1) 3) quad)) + (vector-copy! *gravity-origin-pos* (get-trans (the-as process-focusable gp-1) 3)) (iterate-prims (-> (the-as process-focusable gp-1) root) (lambda :behavior gravity-spinner @@ -2684,7 +2683,7 @@ (s5-4 (vector-! (new 'stack-no-clear 'vector) v1-23 (the-as vector arg1))) (s4-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-1 quad) (-> v1-23 quad)) + (vector-copy! s4-1 v1-23) (let* ((f0-8 (- (-> s5-4 y))) (f0-9 (if (< f0-8 0.0) (fmax f0-8 (-> (the-as process-focusable gp-1) root root-prim local-sphere w)) @@ -2700,7 +2699,7 @@ (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-1) root transv) 1.0) ) (let ((a0-17 s5-4)) - (set! (-> a0-17 quad) (-> s5-4 quad)) + (vector-copy! a0-17 s5-4) (set! (-> a0-17 y) 0.0) (vector-normalize! a0-17 1.0) ) @@ -2775,7 +2774,7 @@ (set! sv-144 (new 'stack 'sphere)) (set! sv-148 (the-as process (send-event *target* 'get-vehicle))) (let ((v1-7 (new 'stack-no-clear 'vector))) - (set! (-> v1-7 quad) (-> (the-as process-focusable s5-0) root transv quad)) + (vector-copy! v1-7 (-> (the-as process-focusable s5-0) root transv)) (set! sv-152 v1-7) ) (set! sv-156 (the-as float 0.0)) @@ -2825,7 +2824,7 @@ ) (when (< f0-12 f30-0) (let ((a1-19 (new 'stack 'collide-query))) - (set! (-> a1-19 start-pos quad) (-> sv-144 quad)) + (vector-copy! (-> a1-19 start-pos) sv-144) (vector-! (-> a1-19 move-dist) sv-1728 (-> a1-19 start-pos)) (let ((v1-53 a1-19)) (set! (-> v1-53 radius) (* 0.8 (-> (the-as process-focusable s5-0) root root-prim prim-core world-sphere w))) @@ -2888,7 +2887,7 @@ ) (when (< f0-28 f30-1) (let ((a1-29 (new 'stack 'collide-query))) - (set! (-> a1-29 start-pos quad) (-> sv-144 quad)) + (vector-copy! (-> a1-29 start-pos) sv-144) (vector-! (-> a1-29 move-dist) sv-2304 (-> a1-29 start-pos)) (let ((v1-103 a1-29)) (set! (-> v1-103 radius) (* 0.8 (-> (the-as process-focusable s5-0) root root-prim prim-core world-sphere w))) @@ -2922,7 +2921,7 @@ ) (when sv-168 (let ((v0-1 (-> (the-as process-focusable s5-0) root transv))) - (set! (-> v0-1 quad) (-> sv-164 quad)) + (vector-copy! v0-1 sv-164) v0-1 ) ) @@ -2997,7 +2996,7 @@ (cond ((< (current-time) (+ (-> this end-time) (seconds -0.2))) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this rotation-accel quad)) + (vector-copy! s5-1 (-> this rotation-accel)) 0.0 (let* ((f0-1 (vector-normalize-ret-len! s5-1 1.0)) (f0-2 (* 182.04445 f0-1)) @@ -3030,7 +3029,7 @@ (f30-1 (* 4.0 (seconds-per-frame))) ) (let ((a0-18 s2-0)) - (set! (-> a0-18 quad) (-> s2-0 quad)) + (vector-copy! a0-18 s2-0) (set! (-> a0-18 y) 0.0) (vector-normalize! a0-18 1.0) ) @@ -3180,12 +3179,13 @@ (* 3.0 (seconds-per-frame)) ) ) - (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) (-> s4-2 quad)) + (vector-copy! (-> (the-as process-focusable s5-0) root root-prim local-sphere) s4-2) ) (if (>= (+ (current-time) (seconds -1)) time) - (set! (-> (the-as process-focusable s5-0) root root-prim local-sphere quad) - (-> self original-sphere-offset quad) - ) + (vector-copy! + (-> (the-as process-focusable s5-0) root root-prim local-sphere) + (-> self original-sphere-offset) + ) ) ) ) @@ -3418,13 +3418,14 @@ ) ) (when gp-2 - (set! (-> (the-as process-focusable gp-2) root root-prim local-sphere quad) - (-> self original-sphere-offset quad) - ) + (vector-copy! + (-> (the-as process-focusable gp-2) root root-prim local-sphere) + (-> self original-sphere-offset) + ) (let ((s5-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as process-focusable gp-2) root quat)))) (new 'stack-no-clear 'vector) (let ((a0-67 s5-2)) - (set! (-> a0-67 quad) (-> s5-2 quad)) + (vector-copy! a0-67 s5-2) (set! (-> a0-67 y) 0.0) (vector-normalize! a0-67 1.0) ) @@ -3509,7 +3510,7 @@ ;; INFO: Used lq/sq (defbehavior gravity-ring-init-by-other gravity-ring ((arg0 vector) (arg1 symbol) (arg2 float) (arg3 float) (arg4 float) (arg5 time-frame)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (initialize-skeleton self @@ -3570,9 +3571,9 @@ (s4-1 0) ) (cond - ((or (= (status-of-level-and-borrows *level* 'desert #f) 'active) - (= (status-of-level-and-borrows *level* 'waswide #f) 'active) - (= (status-of-level-and-borrows *level* 'wasdoors #f) 'active) + ((or (= (level-status? *level* 'desert #f) 'active) + (= (level-status? *level* 'waswide #f) 'active) + (= (level-status? *level* 'wasdoors #f) 'active) ) (set-vector! s5-1 0.85 1.1 1.1 0.25) ) @@ -3720,7 +3721,7 @@ ;; INFO: Used lq/sq (defbehavior gun-gravity-init-by-other gun-gravity ((arg0 vector) (arg1 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (let ((s4-0 (new 'stack-no-clear 'collide-query))) 0.0 (vector+float*! (-> s4-0 start-pos) (-> self root trans) *up-vector* 24576.0) @@ -3745,7 +3746,7 @@ (s3-0 (-> self root quat)) (a0-12 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-12 quad) (-> arg1 quad)) + (vector-copy! a0-12 arg1) (set! (-> a0-12 y) 0.0) (s4-1 s3-0 (vector-normalize! a0-12 1.0) *up-vector*) ) @@ -3754,7 +3755,7 @@ (if (logtest? (game-secrets gun-upgrade-dark-2) (-> *game-info* secrets)) (set! (-> self total-time) (* 1.5 (-> self total-time))) ) - (set! (-> self start-pos quad) (-> arg0 quad)) + (vector-copy! (-> self start-pos) arg0) (set! (-> self ring-closest) (the-as handle #f)) (set! (-> self ring-furthest) (the-as handle #f)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 118) self)) @@ -3846,7 +3847,7 @@ (let ((f30-2 (-> s4-2 best-other-tri intersect y)) (a1-7 (matrix-identity! (new 'stack-no-clear 'matrix))) ) - (set! (-> a1-7 trans quad) (-> s4-2 start-pos quad)) + (vector-copy! (-> a1-7 trans) (-> s4-2 start-pos)) (set! (-> a1-7 trans y) f30-2) (spawn-from-mat (-> self part) a1-7) ) @@ -3933,7 +3934,7 @@ (f30-0 0.0) (f28-0 (-> this current-radius)) ) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (when arg0 (let ((v1-5 (handle->process (-> this ring-closest)))) (if v1-5 @@ -4041,11 +4042,11 @@ (set-last-fire-time 36) (cond ((logtest? (-> *part-group-id-table* 120 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self gun fire-point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self gun fire-point)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 120)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self gun fire-point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self gun fire-point)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 120)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc index 7c7e7f7c55d..f0451bfc553 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc @@ -948,7 +948,7 @@ gun (set! (-> *red-shot-3-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *red-shot-3-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *red-shot-3-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *red-shot-3-trail* use-tape-mode?) #f) @@ -1182,7 +1182,7 @@ gun (set! (-> *yellow-shot-2-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *yellow-shot-2-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *yellow-shot-2-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *yellow-shot-2-trail* use-tape-mode?) #f) @@ -4080,7 +4080,7 @@ gun (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack 'vector4w)) ) - (set! (-> s3-0 quad) (-> *target* gun fire-point quad)) + (vector-copy! s3-0 (-> *target* gun fire-point)) (set! (-> s5-0 x) (- (-> arg2 x) (-> s3-0 x))) (set! (-> s5-0 y) (- (-> arg2 y) (-> s3-0 y))) (set! (-> s5-0 z) (- (-> arg2 z) (-> s3-0 z))) @@ -4132,7 +4132,7 @@ gun ) (vector-normalize! s4-0 (lerp 10240.0 0.0 f0-5)) ) - (set! (-> s5-0 quad) (-> *target* gun fire-point quad)) + (vector-copy! s5-0 (-> *target* gun fire-point)) (set! (-> arg2 x) (+ (-> s4-0 x) (-> s5-0 x))) (set! (-> arg2 y) (+ (-> s4-0 y) (-> s5-0 y))) (set! (-> arg2 z) (+ (-> s4-0 z) (-> s5-0 z))) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc index 4ca43950596..09d18cd12be 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc @@ -177,7 +177,7 @@ (set! (-> v1-15 y) 2.5) (set! (-> v1-15 z) 2.5) (set! (-> v1-15 w) 1.0) - (set! (-> this root scale quad) (-> v1-15 quad)) + (vector-copy! (-> this root scale) v1-15) ) (set! (-> this immediate-detonation?) #f) (let ((s5-2 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) @@ -267,7 +267,7 @@ (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'get-vehicle) (let ((s4-0 (send-event-function *target* a1-0))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) (-> this blast-radius)) (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s2-0 (fill-actor-list-for-box *actor-hash* s5-0 s3-0 384)) @@ -407,7 +407,7 @@ (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'get-vehicle) (let ((s3-0 (send-event-function *target* a1-0))) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) (* 0.6666667 (-> this blast-radius))) (let ((s2-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s1-0 (fill-actor-list-for-box *actor-hash* s4-0 s2-0 384)) @@ -697,7 +697,7 @@ ;; WARN: Return type mismatch float vs none. (defun part-tracker-move-to-target-gun ((arg0 part-tracker)) (when *target* - (set! (-> arg0 root trans quad) (-> *target* gun fire-point quad)) + (vector-copy! (-> arg0 root trans) (-> *target* gun fire-point)) (set! (-> arg0 root trans y) (+ 6553.6 (-> *target* control trans y))) ) (none) @@ -730,7 +730,7 @@ (set! (-> self charge-part-tracker) (ppointer->handle (cond ((logtest? (-> *part-group-id-table* 109 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self origin quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self origin)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -739,7 +739,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self origin quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self origin)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -778,7 +778,7 @@ ) (init-vf0-vector) (set! sv-32 (new 'stack-no-clear 'vector)) - (set! (-> sv-32 quad) (-> this origin quad)) + (vector-copy! sv-32 (-> this origin)) (set! (-> sv-32 w) (-> this current-radius)) (let ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* sv-32 s5-0 384)) @@ -826,7 +826,7 @@ ) (else (set! sv-2720 (new 'stack-no-clear 'collide-query)) - (set! (-> sv-2720 start-pos quad) (-> this origin quad)) + (vector-copy! (-> sv-2720 start-pos) (-> this origin)) (set! sv-2704 (-> sv-2720 move-dist)) (let ((v1-35 (get-trans (the-as process-focusable s3-1) 3)) (a0-26 (-> this origin)) @@ -906,7 +906,7 @@ ) (else (let ((s1-2 (new 'stack-no-clear 'collide-query))) - (set! (-> s1-2 start-pos quad) (-> this origin quad)) + (vector-copy! (-> s1-2 start-pos) (-> this origin)) (vector-! (-> s1-2 move-dist) (get-trans s5-1 3) (-> this origin)) (let ((v1-80 s1-2)) (set! (-> v1-80 radius) 40.96) @@ -1327,7 +1327,7 @@ ;; WARN: Return type mismatch float vs none. (defmethod adjust-height-and-radius ((this gun-red-2-shockwave)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> this origin quad)) + (vector-copy! (-> a1-0 start-pos) (-> this origin)) (set-vector! (-> a1-0 move-dist) 0.0 (* -1.0 (-> this max-radius)) 0.0 1.0) (let ((v1-2 a1-0)) (set! (-> v1-2 radius) 40.96) @@ -1437,7 +1437,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (go-virtual active) ) @@ -1483,7 +1483,7 @@ (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> this origin quad)) + (vector-copy! s4-0 (-> this origin)) (set-vector! s3-0 (cos f26-0) 0.0 (sin f26-0) 1.0) (vector-normalize! s3-0 (* 0.9 (-> this max-ground-radius))) (let ((f30-0 (-> this origin y)) @@ -1506,13 +1506,13 @@ (set! f24-0 f0-9) (set! f30-0 (-> sv-176 collision-pt y)) (set! s0-0 (logior s0-0 1)) - (set! (-> s2-1 quad) (-> sv-176 normal quad)) + (vector-copy! s2-1 (-> sv-176 normal)) ) ((and (>= f0-9 0.0) (< f0-9 f22-0)) (set! f22-0 f0-9) (set! f28-0 (-> sv-176 collision-pt y)) (set! s0-0 (logior s0-0 2)) - (set! (-> s1-0 quad) (-> sv-176 normal quad)) + (vector-copy! s1-0 (-> sv-176 normal)) ) ) ) @@ -1543,7 +1543,7 @@ (vector-normalize! s3-0 1.0) (let ((s2-3 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose s2-3 s3-0 *up-vector*) - (set! (-> s2-3 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s2-3 trans) s4-0) (launch-particles (-> *part-id-table* 353) s2-3 :origin-is-matrix #t) ) ) @@ -1681,12 +1681,12 @@ ;; WARN: Return type mismatch int vs none. (defmethod spawn-ring ((this gun-red-2-shockwave)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> this origin quad)) + (vector-copy! v1-0 (-> this origin)) (set! (-> v1-0 y) (- (-> v1-0 y) (-> this height-off-ground))) (+! (-> v1-0 y) 2048.0) (+! (-> v1-0 y) -1433.6) (let ((s5-0 (new 'stack-no-clear 'red-2-ring-init-params))) - (set! (-> s5-0 pos quad) (-> v1-0 quad)) + (vector-copy! (-> s5-0 pos) v1-0) (let ((v1-3 (process-spawn red-2-ring s5-0 :name "red-2-ring" :to this))) (if v1-3 (set! (-> this explosion-1) (ppointer->handle v1-3)) @@ -1837,7 +1837,7 @@ (set! (-> *last-player-pos* z) (-> *target* gun fire-point z)) (when #t (let ((s5-0 (new 'stack-no-clear 'gun-red-2-shockwave-init-params))) - (set! (-> s5-0 pos quad) (-> v1-1 quad)) + (vector-copy! (-> s5-0 pos) v1-1) (let ((v1-4 (process-spawn gun-red-2-shockwave s5-0 @@ -1914,7 +1914,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-red-sphere" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (go-virtual active) ) @@ -1927,18 +1927,7 @@ (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) ) :trans (behavior () - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (math-camera-matrix)) - (v1-0 (-> a2-0 rvec quad)) - (a0-0 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-0) - (set! (-> gp-0 uvec quad) a0-0) - (set! (-> gp-0 fvec quad) a1-0) - (set! (-> gp-0 trans quad) a2-1) - ) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) (-> gp-0 fvec) (-> gp-0 rvec) (matrix->quat gp-0 (-> self root quat)) @@ -1994,11 +1983,11 @@ (vector-normalize! sv-20 1.0) (let ((v1-17 (cond ((logtest? (-> *part-group-id-table* 86 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-16 fire-point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> sv-16 fire-point)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 86)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-16 fire-point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> sv-16 fire-point)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 86)) ) ) @@ -2008,7 +1997,7 @@ ) (set! sv-144 (new 'stack-no-clear 'vector)) (let ((v1-42 (new 'stack-no-clear 'vector))) - (set! (-> v1-42 quad) (-> sv-20 quad)) + (vector-copy! v1-42 sv-20) (set! sv-148 v1-42) ) (set! (-> sv-148 y) 0.0) @@ -2107,7 +2096,7 @@ ) (when (or (not s5-0) (logtest? (process-mask enemy guard) (-> s3-1 mask))) (let ((s1-2 (new 'stack-no-clear 'vector))) - (set! (-> s1-2 quad) (-> (get-trans s3-1 0) quad)) + (vector-copy! s1-2 (get-trans s3-1 0)) (let ((s2-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) sv-148 1.0)) (s4-1 (new 'stack-no-clear 'vector)) ) @@ -2130,7 +2119,7 @@ ) (when gp-2 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> (get-trans gp-2 3) quad)) + (vector-copy! s5-1 (get-trans gp-2 3)) (let ((f0-10 (vector-vector-xz-distance s5-1 (-> sv-16 fire-point))) (f1-13 (fabs (- (-> s5-1 y) (-> sv-16 fire-point y)))) ) @@ -2150,8 +2139,8 @@ (set! (-> a1-33 charge) 1.0) (set! (-> a1-33 options) (projectile-options)) (logclear! (-> a1-33 options) (projectile-options po14 po15 po16)) - (set! (-> a1-33 pos quad) (-> sv-24 quad)) - (set! (-> a1-33 vel quad) (-> (vector-float*! (new 'stack-no-clear 'vector) sv-20 sv-28) quad)) + (vector-copy! (-> a1-33 pos) sv-24) + (vector-copy! (-> a1-33 vel) (vector-float*! (new 'stack-no-clear 'vector) sv-20 sv-28)) (set! (-> a1-33 notify-handle) (the-as handle #f)) (set! (-> a1-33 owner-handle) (process->handle self)) (set! (-> a1-33 target-handle) (the-as handle #f)) @@ -2214,7 +2203,7 @@ ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 0.0) (set! (-> gp-0 scale) 1.0) @@ -2273,17 +2262,17 @@ (set-time! (-> self state-time)) (when (not (-> self immediate-detonation?)) (let ((gp-1 (new 'stack-no-clear 'red-3-sphere-init-params))) - (set! (-> gp-1 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 pos) (-> self root trans)) (process-spawn red-3-sphere gp-1 :name "red-3-sphere" :to self) ) ) (cond ((logtest? (-> *part-group-id-table* 88 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 88)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 88)) ) ) @@ -2545,8 +2534,8 @@ (s4-1 (new 'stack-no-clear 'vector)) ) (if a0-2 - (set! (-> s4-1 quad) (-> (get-trans a0-2 3) quad)) - (set! (-> s4-1 quad) (-> arg0 root-prim prim-core world-sphere quad)) + (vector-copy! s4-1 (get-trans a0-2 3)) + (vector-copy! s4-1 (-> arg0 root-prim prim-core world-sphere)) ) (vector-! s4-1 s4-1 (-> this start-pos)) (vector-normalize! s4-1 1.0) @@ -2568,7 +2557,7 @@ ) ) ) - (set! (-> this probe-dir s5-0 quad) (-> s4-1 quad)) + (vector-copy! (-> this probe-dir s5-0) s4-1) ) (set! (-> this probe-count) (+ s5-0 1)) ) @@ -2586,7 +2575,7 @@ (vf3 :class vf) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this start-dir quad)) + (vector-copy! s5-0 (-> this start-dir)) (vector-float*! s5-0 s5-0 43417.6) (vector+! s5-0 s5-0 (-> this start-pos)) (set! (-> s5-0 w) 43827.2) @@ -2727,7 +2716,7 @@ (init-vf0-vector) (let ((gp-0 (-> this root))) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> gp-0 trans quad) (-> this start-pos quad)) + (vector-copy! (-> gp-0 trans) (-> this start-pos)) (vector-float*! (-> gp-0 transv) arg0 61440.0) (let ((a1-1 v1-0)) (set! (-> a1-1 radius) (-> gp-0 root-prim local-sphere w)) @@ -2739,8 +2728,8 @@ ) (set! (-> a1-1 action-mask) (collide-action solid)) ) - (set! (-> v1-0 start-pos quad) (-> gp-0 trans quad)) - (set! (-> v1-0 move-dist quad) (-> gp-0 transv quad)) + (vector-copy! (-> v1-0 start-pos) (-> gp-0 trans)) + (vector-copy! (-> v1-0 move-dist) (-> gp-0 transv)) (fill-using-line-sphere *collide-cache* v1-0) ) (let ((v1-2 (-> gp-0 transv))) @@ -2851,8 +2840,8 @@ ;; definition for function gun-red-shot-init-by-other ;; INFO: Used lq/sq (defbehavior gun-red-shot-init-by-other gun-red-shot ((arg0 vector) (arg1 vector)) - (set! (-> self start-pos quad) (-> arg0 quad)) - (set! (-> self start-dir quad) (-> arg1 quad)) + (vector-copy! (-> self start-pos) arg0) + (vector-copy! (-> self start-dir) arg1) (rot-zxy-from-vector! (-> self start-rot) arg1) (let* ((v1-2 *game-info*) (a0-7 (+ (-> v1-2 attack-id) 1)) @@ -2889,7 +2878,7 @@ (set! (-> self root) s5-0) ) (let ((s5-1 (-> self root))) - (set! (-> s5-1 trans quad) (-> arg0 quad)) + (vector-copy! (-> s5-1 trans) arg0) (quaternion-copy! (-> s5-1 quat) (-> self parent 0 root quat)) (vector-identity! (-> s5-1 scale)) ) @@ -2901,11 +2890,11 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (let ((v1-39 (cond ((logtest? (-> *part-group-id-table* 84 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self start-pos quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self start-pos)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 84)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self start-pos quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self start-pos)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 84)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-util_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-util_REF.gc index a6243da91a5..e7bfa592277 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-util_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-util_REF.gc @@ -261,7 +261,7 @@ ;; WARN: Return type mismatch int vs none. (defun draw-beam ((arg0 sparticle-launcher) (arg1 vector) (arg2 vector) (arg3 symbol)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-0 1 quad) (-> arg2 quad)) + (vector-copy! (-> s5-0 1) arg2) (let ((v1-2 (get-field-spec-by-id arg0 (sp-field-id spt-scale-y)))) (when v1-2 (let ((f30-0 (-> v1-2 initial-valuef))) @@ -284,7 +284,7 @@ (a1-9 arg0) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> s3-1 quad)) + (vector-copy! (-> a2-2 trans) s3-1) (t9-5 a0-12 a1-9 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (dotimes (s5-1 2) @@ -294,7 +294,7 @@ (a1-11 arg0) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> s3-1 quad)) + (vector-copy! (-> a2-4 trans) s3-1) (t9-7 a0-14 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -343,11 +343,11 @@ (target-gun-compute-pos) (set! self s5-0) ) - (set! (-> self root trans quad) (-> (the-as target gp-0) gun gun-pos trans quad)) + (vector-copy! (-> self root trans) (-> (the-as target gp-0) gun gun-pos trans)) (let ((v1-6 (-> (the-as target gp-0) gun gun-pos quat quad))) (set! (-> self root quat quad) v1-6) ) - (set! (-> self root scale quad) (-> (the-as target gp-0) gun gun-pos scale quad)) + (vector-copy! (-> self root scale) (-> (the-as target gp-0) gun gun-pos scale)) (when (-> self read-scale) (let ((s5-1 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -439,8 +439,8 @@ (set! (-> s5-2 charge) 1.0) (set! (-> s5-2 options) (projectile-options)) (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) - (set! (-> s5-2 pos quad) (-> s3-0 quad)) - (set! (-> s5-2 vel quad) (-> s4-1 quad)) + (vector-copy! (-> s5-2 pos) s3-0) + (vector-copy! (-> s5-2 vel) s4-1) ) (set! (-> s5-2 notify-handle) (the-as handle #f)) (set! (-> s5-2 owner-handle) (the-as handle #f)) @@ -877,7 +877,7 @@ ) ) (vector<-cspace! (-> (the-as target gp-0) gun fire-point) (joint-node gun-lod0-jg muzzle)) - (set! (-> (the-as target gp-0) gun unk-vec quad) (-> (the-as target gp-0) gun fire-dir quad)) + (vector-copy! (-> (the-as target gp-0) gun unk-vec) (-> (the-as target gp-0) gun fire-dir)) (cond ((and (handle->process (-> (the-as target gp-0) gun track-target 0 handle)) (logtest? (surface-flag gun-direct) (-> (the-as target gp-0) control current-surface flags)) @@ -888,7 +888,7 @@ (-> (the-as target gp-0) gun fire-point) ) (vector-normalize! (-> (the-as target gp-0) gun fire-dir) 1.0) - (set! (-> (the-as target gp-0) gun fire-dir-out quad) (-> (the-as target gp-0) gun fire-dir quad)) + (vector-copy! (-> (the-as target gp-0) gun fire-dir-out) (-> (the-as target gp-0) gun fire-dir)) ) (else (vector-normalize-copy! @@ -897,9 +897,10 @@ 1.0 ) (if s5-0 - (set! (-> (the-as target gp-0) gun fire-dir-out quad) - (-> (the-as target gp-0) node-list data 4 bone transform fvec quad) - ) + (vector-copy! + (-> (the-as target gp-0) gun fire-dir-out) + (-> (the-as target gp-0) node-list data 4 bone transform fvec) + ) ) (vector-rotate-y! (-> (the-as target gp-0) gun fire-dir-out) @@ -909,12 +910,13 @@ ) ) (vector<-cspace! (-> (the-as target gp-0) gun laser-point) (joint-node gun-lod0-jg laser)) - (set! (-> (the-as target gp-0) gun unk-vec00 quad) (-> (the-as target gp-0) gun laser-dir quad)) - (set! (-> (the-as target gp-0) gun laser-dir quad) (-> (the-as target gp-0) gun fire-dir-out quad)) + (vector-copy! (-> (the-as target gp-0) gun unk-vec00) (-> (the-as target gp-0) gun laser-dir)) + (vector-copy! (-> (the-as target gp-0) gun laser-dir) (-> (the-as target gp-0) gun fire-dir-out)) (if s5-0 - (set! (-> (the-as target gp-0) gun laser-dir quad) - (-> (the-as target gp-0) node-list data 4 bone transform fvec quad) - ) + (vector-copy! + (-> (the-as target gp-0) gun laser-dir) + (-> (the-as target gp-0) node-list data 4 bone transform fvec) + ) ) ) (let ((s5-1 self)) @@ -941,7 +943,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (vector-float*! s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self parent 0 control quat)) @@ -952,8 +954,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s4-0 quad)) - (set! (-> gp-0 vel quad) (-> s5-0 quad)) + (vector-copy! (-> gp-0 pos) s4-0) + (vector-copy! (-> gp-0 vel) s5-0) ) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) @@ -1053,7 +1055,7 @@ (s1-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 start-pos)) 1638.4)) (s2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-1 quad) (-> s4-0 start-pos quad)) + (vector-copy! s2-1 (-> s4-0 start-pos)) (cond ((and s0-0 (or (logtest? (process-mask enemy guard) (-> s0-0 cshape process mask)) @@ -1077,16 +1079,16 @@ ) ) ) - (set! (-> this laser-hit-point quad) (-> s4-0 start-pos quad)) + (vector-copy! (-> this laser-hit-point) (-> s4-0 start-pos)) (let ((s1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (camera-pos) s5-0) 1.0)) (t9-10 vector-normalize!) (a0-37 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-37 quad) (-> s3-0 quad)) + (vector-copy! a0-37 s3-0) (let ((s2-3 (t9-10 a0-37 1.0)) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> s5-0 quad)) + (vector-copy! s3-1 s5-0) (let ((v1-47 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-3 327.68)) (f28-1 (vector-dot s1-3 s2-3)) ) @@ -1146,7 +1148,7 @@ (a0-3 (vector+float*! (new 'stack-no-clear 'vector) arg0 v1-0 -7372.8)) (gp-1 (new 'stack-no-clear 'collide-query)) ) - (set! (-> gp-1 start-pos quad) (-> a0-3 quad)) + (vector-copy! (-> gp-1 start-pos) a0-3) (vector-float*! (-> gp-1 move-dist) v1-0 40960.0) (let ((v1-1 gp-1)) (set! (-> v1-1 radius) 40.96) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc index c3b4c4347db..99390ddfbc7 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc @@ -241,7 +241,7 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (vector-normalize! s5-2 1.0) - (set! (-> s3-0 quad) (-> s5-2 quad)) + (vector-copy! s3-0 s5-2) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1228.8) (vector+! s3-0 (-> this root trans) s3-0) @@ -251,7 +251,7 @@ (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options)) (logclear! (-> s4-1 options) (projectile-options po14 po15 po16)) - (set! (-> s4-1 pos quad) (-> s3-0 quad)) + (vector-copy! (-> s4-1 pos) s3-0) (set! (-> s4-1 notify-handle) (the-as handle #f)) (set! (-> s4-1 owner-handle) (the-as handle #f)) (set! (-> s4-1 target-handle) (the-as handle #f)) @@ -318,7 +318,7 @@ (set! sv-1076 (new 'stack-no-clear 'inline-array 'target-quality-info-saucer 66)) (set! sv-1080 0) (set! sv-1088 (the-as float 0.0)) - (set! (-> sv-1072 quad) (-> this root trans quad)) + (vector-copy! sv-1072 (-> this root trans)) (set! (-> sv-1072 w) 143360.0) (let ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* sv-1072 s5-0 384)) @@ -343,7 +343,7 @@ ) ) (let ((s2-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s2-1 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s2-1 start-pos) (-> this root trans)) (vector-! (-> s2-1 move-dist) (get-trans (the-as process-focusable s3-1) 3) (-> this root trans)) (let ((v1-47 s2-1)) (set! (-> v1-47 radius) 40.96) @@ -394,7 +394,7 @@ ) ) (let ((s4-3 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-3 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-3 start-pos) (-> this root trans)) (vector-! (-> s4-3 move-dist) (get-trans s5-1 3) (-> this root trans)) (let ((v1-94 s4-3)) (set! (-> v1-94 radius) 40.96) @@ -464,7 +464,7 @@ (s3-4 (method-of-object s4-5 spawn-shot)) (s2-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-2 quad) (-> (get-trans (the-as process-focusable a0-95) 0) quad)) + (vector-copy! s2-2 (get-trans (the-as process-focusable a0-95) 0)) (s3-4 s4-5 s2-2) ) ) @@ -711,11 +711,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 97 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 97)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 97)) ) ) @@ -738,7 +738,7 @@ (the-as vector a2-10) (the-as vector a3-4) ) - (set! (-> gp-3 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-3 trans) (-> self root trans)) (let ((gp-4 (ppointer->handle (if (logtest? (-> *part-group-id-table* 96 flags) (sp-group-flag sp13)) @@ -856,7 +856,7 @@ :code (behavior () (set! (-> self firing?) #t) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 0.0) (set! (-> gp-0 scale) 1.0) @@ -963,7 +963,7 @@ (gp-0 (new 'stack-no-clear 'collide-query)) ) (-> v1-19 root-prim) - (set! (-> gp-0 start-pos quad) (-> v1-19 trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> v1-19 trans)) (vector-normalize-copy! (-> gp-0 move-dist) (-> v1-19 transv) 40960.0) (let ((v1-20 gp-0)) (set! (-> v1-20 radius) 0.01) @@ -1094,8 +1094,8 @@ (set! (-> s3-2 charge) 1.0) (set! (-> s3-2 options) (projectile-options po13)) (logclear! (-> s3-2 options) (projectile-options po14 po15 po16)) - (set! (-> s3-2 pos quad) (-> s4-0 quad)) - (set! (-> s3-2 vel quad) (-> (vector-float*! (new 'stack-no-clear 'vector) s5-0 f30-0) quad)) + (vector-copy! (-> s3-2 pos) s4-0) + (vector-copy! (-> s3-2 vel) (vector-float*! (new 'stack-no-clear 'vector) s5-0 f30-0)) (set! (-> s3-2 notify-handle) (the-as handle #f)) (set! (-> s3-2 owner-handle) (the-as handle #f)) (set! (-> s3-2 target-handle) (the-as handle #f)) @@ -1116,13 +1116,13 @@ ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> self gun fire-dir-out quad)) + (vector-copy! s4-1 (-> self gun fire-dir-out)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) (draw-beam (-> *part-id-table* 297) (-> gp-0 fire-point) s4-1 #f) (let ((s5-1 (new 'stack-no-clear 'matrix))) (matrix-f-compose s5-1 s4-1) - (set! (-> s5-1 trans quad) (-> gp-0 fire-point quad)) + (vector-copy! (-> s5-1 trans) (-> gp-0 fire-point)) (let ((v1-62 (if (logtest? (-> *part-group-id-table* 100 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -1153,7 +1153,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s5-0 fire-point quad)) + (vector-copy! (-> gp-0 pos) (-> s5-0 fire-point)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1185,7 +1185,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s5-0 fire-point quad)) + (vector-copy! (-> gp-0 pos) (-> s5-0 fire-point)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1256,7 +1256,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po13 po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1322,7 +1322,7 @@ (f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 gp-1 *up-vector*) - (set! (-> s3-1 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s3-1 trans) s4-0) (gun-yellow-shot-method-42 this f30-1 f28-0 s3-1) ) ) @@ -1370,21 +1370,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 102 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 102)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 102)) ) ) ) ((logtest? (-> *part-group-id-table* 101 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 101)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 101)) ) ) @@ -1514,7 +1514,7 @@ (let ((v1-14 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-5 (-> arg0 hit-pos)) ) - (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector-copy! a1-5 (-> s5-0 trans)) (vector+! a1-5 a1-5 v1-14) (move-to-point! (-> arg0 root) a1-5) ) @@ -1565,7 +1565,7 @@ (when (and (time-elapsed? (-> sv-36 last-collide-time) (seconds 0.05)) (rand-vu-percent? 0.75)) (set! sv-80 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 204800.0)) (set! sv-84 (new 'stack-no-clear 'vector)) - (set! (-> sv-84 quad) (-> s4-0 root trans quad)) + (vector-copy! sv-84 (-> s4-0 root trans)) (vector+! sv-84 sv-84 sv-80) (set! (-> sv-84 w) 409600.0) (set! (-> sv-80 y) 0.0) @@ -1611,7 +1611,7 @@ (when (or (< (the float sv-120) sv-1716) (and (< 0.707 sv-1716) (= sv-136 *last-hit-deflect-target-handle*))) (set! sv-116 sv-1720) (set! sv-120 (the int sv-1716)) - (set! (-> sv-112 quad) (-> sv-1680 quad)) + (vector-copy! sv-112 sv-1680) (set! sv-128 (logtest? (process-mask enemy) (-> s1-1 mask))) (set! sv-136 (process->handle s1-1)) ) @@ -1650,7 +1650,7 @@ (when (or (< (the float sv-120) sv-1748) (and (< 0.707 sv-1748) (= sv-136 *last-hit-deflect-target-handle*))) (set! sv-116 sv-1752) (set! sv-120 (the int sv-1748)) - (set! (-> sv-112 quad) (-> sv-1724 quad)) + (vector-copy! sv-112 sv-1724) (set! sv-128 (logtest? (process-mask enemy) (-> s3-1 mask))) (set! sv-136 (process->handle s3-1)) ) @@ -1847,7 +1847,7 @@ (a1-7 (-> arg0 root transv)) (a2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-1 quad) (-> arg0 root transv quad)) + (vector-copy! a2-1 (-> arg0 root transv)) (t9-4 a0-23 a1-7 a2-1 (-> arg0 delay-norm)) ) ) @@ -1857,7 +1857,7 @@ (let ((v1-57 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-10 (-> arg0 hit-pos)) ) - (set! (-> a1-10 quad) (-> s5-0 trans quad)) + (vector-copy! a1-10 (-> s5-0 trans)) (vector+! a1-10 a1-10 v1-57) (move-to-point! (-> arg0 root) a1-10) ) @@ -1870,7 +1870,7 @@ (launch-particles (-> *part-id-table* 272) (-> arg0 hit-pos)) (launch-particles (-> *part-id-table* 273) (-> arg0 hit-pos)) (let ((a0-32 (new 'stack-no-clear 'vector))) - (set! (-> a0-32 quad) (-> arg0 root transv quad)) + (vector-copy! a0-32 (-> arg0 root transv)) (vector-normalize! a0-32 65536.0) ) (vector+! (-> arg0 tail-pos) (-> arg0 root trans) (-> arg0 root transv)) @@ -1889,7 +1889,7 @@ (defmethod init-proj-settings! ((this gun-yellow-shot)) (+! (-> *game-info* shots-fired 0) 1.0) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 819200.0) @@ -2030,11 +2030,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 102 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 102)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 102)) ) ) @@ -2117,7 +2117,7 @@ (defmethod init-proj-settings! ((this gun-yellow-shot-3)) (+! (-> *game-info* shots-fired 0) 1.0) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (let ((f0-2 (vector-vector-xz-distance (target-pos 0) (-> this root trans)))) (cpad-set-buzz! (-> *cpad-list* cpads 0) @@ -2300,7 +2300,7 @@ (f28-0 (-> *part-id-table* 267 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 s4-1 *up-vector*) - (set! (-> s3-1 trans quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 trans) s5-0) (gun-yellow-shot-method-42 this f30-1 f28-0 s3-1) ) ) @@ -2343,21 +2343,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 99 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 99)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 99)) ) ) ) ((logtest? (-> *part-group-id-table* 98 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 98)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 98)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/indax/target-indax-hang_REF.gc b/test/decompiler/reference/jak3/engine/target/indax/target-indax-hang_REF.gc index 880fb0950ad..ba770e606f3 100644 --- a/test/decompiler/reference/jak3/engine/target/indax/target-indax-hang_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/indax/target-indax-hang_REF.gc @@ -133,7 +133,7 @@ ) (set! (-> v1-0 action-mask) (collide-action solid)) ) - (set! (-> gp-0 start-pos quad) (-> self control trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> self control trans)) (vector-reset! (-> gp-0 move-dist)) (set! (-> gp-0 move-dist y) 40960.0) (when (not (and (>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) @@ -245,7 +245,7 @@ ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (let ((a0-0 (-> self state parent))) (when a0-0 (let ((t9-0 (-> a0-0 post))) @@ -287,9 +287,10 @@ (go target-indax-hang-dodge) ) (when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3))) - (set! (-> self control transv quad) - (-> self control transv-history (-> self control idx-of-fastest-xz-vel) quad) - ) + (vector-copy! + (-> self control transv) + (-> self control transv-history (-> self control idx-of-fastest-xz-vel)) + ) (set! (-> self control transv w) 1.0) (go target-indax-hang-turn-around) ) @@ -517,7 +518,3 @@ (go target-indax-hang-walk) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/indax/target-indax_REF.gc b/test/decompiler/reference/jak3/engine/target/indax/target-indax_REF.gc index ec102a3ee75..164ecc572d4 100644 --- a/test/decompiler/reference/jak3/engine/target/indax/target-indax_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/indax/target-indax_REF.gc @@ -1439,7 +1439,7 @@ (else (set! (-> self control unknown-word04) (the-as uint (-> v1-2 root trans y))) (vector+! (-> self control unknown-vector38) (-> v1-2 root trans) (new 'static 'vector :y 4505.6 :w 1.0)) - (set! (-> self control unknown-vector40 quad) (-> v1-2 root quat quad)) + (set! (-> self control unknown-quat40 quad) (-> v1-2 root quat quad)) ) ) ) @@ -1447,13 +1447,13 @@ :code (behavior () (sound-play "dax-jump" :vol 70) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (let ((gp-1 daxter-indax-jump-ja)) (ja-channel-push! 1 (seconds 0.05)) (set! (-> self control mod-surface) *empty-mods*) (set! (-> self neck flex-blend) 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) (ja :group! gp-1 :num! (seek!) :frame-num 0.0) ) (until (ja-done? 0) @@ -1473,20 +1473,20 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) (rot->dir-targ! (-> self control)) (suspend) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (set! (-> self alt-cam-pos y) (the-as float (-> self control unknown-word04))) (ja :num! (seek!)) ) (do-effect (-> self skel effect) "effect-land" 0.0 -1) (let ((a1-11 (new 'stack-no-clear 'vector))) - (set! (-> a1-11 quad) (-> self control trans quad)) + (vector-copy! a1-11 (-> self control trans)) (set! (-> a1-11 y) (the-as float (-> self control unknown-word04))) (move-to-point! (-> self control) a1-11) ) @@ -1568,7 +1568,7 @@ (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) ) - (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (vector-copy! s5-0 (-> gp-0 vector)) (let ((f0-12 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -1592,13 +1592,13 @@ (cond ((= (-> self game mode) 'debug) (let ((s4-1 (new-stack-vector0))) - (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! s4-1 (-> self control last-trans-on-ground)) (ja-channel-set! 0) (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-indax-stance) ) @@ -1809,11 +1809,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 233 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 233)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 233)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/lightjak-wings_REF.gc b/test/decompiler/reference/jak3/engine/target/lightjak-wings_REF.gc index 9d852cf315f..a51b4fb840f 100644 --- a/test/decompiler/reference/jak3/engine/target/lightjak-wings_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/lightjak-wings_REF.gc @@ -788,7 +788,7 @@ ;; WARN: Return type mismatch vector vs none. (defmethod ragdoll-method-19 ((this wings-ragdoll) (arg0 vector) (arg1 int) (arg2 object) (arg3 matrix)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this gravity quad)) + (vector-copy! s3-0 (-> this gravity)) (let ((s1-0 (-> this ragdoll-joints arg1)) (f30-0 1.0) ) @@ -831,7 +831,7 @@ ) ) ) - (set! (-> this gravity quad) (-> s3-0 quad)) + (vector-copy! (-> this gravity) s3-0) ) (if (and (= (-> this ragdoll-joints arg1 parent-joint) -1) (= (-> this ragdoll-joints (+ arg1 -1) parent-joint) -1) diff --git a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc index 46b6b530bd3..e55eb2016b3 100644 --- a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc @@ -42,9 +42,9 @@ ) (matrix-transpose! (-> self control w-R-c) (-> self control c-R-w)) (vector-matrix*! (-> self control transv-ctrl) arg0 (-> self control w-R-c)) - (set! (-> self control last-gravity-normal quad) (-> self control gravity-normal quad)) + (vector-copy! (-> self control last-gravity-normal) (-> self control gravity-normal)) (let ((v0-7 (-> self control gravity-normal))) - (set! (-> v0-7 quad) (-> self control dynam gravity-normal quad)) + (vector-copy! v0-7 (-> self control dynam gravity-normal)) v0-7 ) ) @@ -679,7 +679,7 @@ ;; INFO: Used lq/sq (defbehavior read-pad target ((arg0 vector)) (when (!= (-> self control time-of-last-pad-read) (-> *display* real-clock frame-counter)) - (set! (-> self control last-pad-xz-dir quad) (-> self control pad-xz-dir quad)) + (vector-copy! (-> self control last-pad-xz-dir) (-> self control pad-xz-dir)) (set! (-> self control last-pad-magnitude) (-> self control pad-magnitude)) (set! (-> self control time-of-last-pad-read) (-> *display* real-clock frame-counter)) ) @@ -687,22 +687,11 @@ (set! (-> arg0 y) 0.0) (set! (-> arg0 z) (cos (-> self control cpad stick0-dir))) (set! (-> arg0 w) 0.0) - (set! (-> self control pad-xz-dir quad) (-> arg0 quad)) + (vector-copy! (-> self control pad-xz-dir) arg0) (set! (-> self control pad-magnitude) (-> self control cpad stick0-speed)) - (when (< (-> self control update-cam-R-w-start-time) (current-time)) - (let* ((s5-0 (-> self control cam-R-w)) - (a2-0 (matrix-local->world #t #f)) - (v1-24 (-> a2-0 rvec quad)) - (a0-14 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-24) - (set! (-> s5-0 uvec quad) a0-14) - (set! (-> s5-0 fvec quad) a1-1) - (set! (-> s5-0 trans quad) a2-1) + (if (< (-> self control update-cam-R-w-start-time) (current-time)) + (matrix-copy! (-> self control cam-R-w) (matrix-local->world #t #f)) ) - ) (vector-matrix*! arg0 arg0 (-> self control cam-R-w)) ) @@ -716,16 +705,8 @@ ;; definition for function warp-vector-into-surface! ;; INFO: Used lq/sq (defun warp-vector-into-surface! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 matrix)) - (let ((t9-0 matrix-from-two-vectors!) - (a0-1 (new 'stack-no-clear 'matrix)) - ) - (set! (-> a0-1 rvec quad) (the-as uint128 0)) - (set! (-> a0-1 uvec quad) (the-as uint128 0)) - (set! (-> a0-1 fvec quad) (the-as uint128 0)) - (set! (-> a0-1 trans quad) (the-as uint128 0)) - (let ((a2-1 (t9-0 a0-1 (-> arg3 uvec) arg2))) - (vector-matrix*! arg0 arg1 a2-1) - ) + (let ((a2-1 (matrix-from-two-vectors! (new-stack-matrix0) (-> arg3 uvec) arg2))) + (vector-matrix*! arg0 arg1 a2-1) ) ) @@ -781,7 +762,7 @@ (t9-2 vector-normalize!) (a0-2 (new-stack-vector0)) ) - (set! (-> a0-2 quad) (-> self control transv quad)) + (vector-copy! a0-2 (-> self control transv)) (let ((f0-1 (vector-dot gp-0 (t9-2 a0-2 1.0))) (a1-3 (-> self control transv-history)) (f2-0 -1000.0) @@ -879,7 +860,7 @@ (set! (-> gp-0 ignore-pat) (-> self control pat-ignore-mask)) (fill-using-bounding-box *collide-cache* gp-0) (dotimes (s5-0 3) - (set! (-> gp-0 start-pos quad) (-> self control collision-spheres s5-0 prim-core world-sphere quad)) + (vector-copy! (-> gp-0 start-pos) (-> self control collision-spheres s5-0 prim-core world-sphere)) (vector-float*! (-> gp-0 move-dist) (-> self control wall-contact-normal) -8192.0) (let ((v1-49 gp-0)) (set! (-> v1-49 radius) 4.096) @@ -913,7 +894,7 @@ (defbehavior target-log-trans target () (let ((v1-1 (-> self control trans-log-idx))) (set-time! (-> self control trans-log-times v1-1)) - (set! (-> self control trans-log-trans v1-1 quad) (-> self control trans quad)) + (vector-copy! (-> self control trans-log-trans v1-1) (-> self control trans)) (set! (-> self control trans-log-idx) (logand (+ v1-1 1) 127)) ) 0 @@ -959,8 +940,8 @@ (warp-vector-into-surface! gp-0 arg0 (-> self control local-normal) (-> self control cam-R-w)) (set! (-> self control last-turn-to-magnitude) (-> self control turn-to-magnitude)) (set! (-> self control last-turn-to-angle) (-> self control turn-to-angle)) - (set! (-> self control last-to-target-pt-xz quad) (-> self control to-target-pt-xz quad)) - (set! (-> self control last-turn-to-target quad) (-> self control turn-to-target quad)) + (vector-copy! (-> self control last-to-target-pt-xz) (-> self control to-target-pt-xz)) + (vector-copy! (-> self control last-turn-to-target) (-> self control turn-to-target)) (vector-float*! (-> self control turn-to-target) gp-0 arg1) (if (< 0.0 arg1) (warp-vector-into-surface! (-> self control to-target-pt-xz) arg0 *up-vector* (-> self control cam-R-w)) @@ -976,7 +957,7 @@ (set! (-> self control turn-to-angle) f0-6) ) (let ((f0-8 (* arg1 (-> self control current-surface target-speed)))) - (set! (-> self control target-transv quad) (-> (vector-normalize! gp-0 f0-8) quad)) + (vector-copy! (-> self control target-transv) (vector-normalize! gp-0 f0-8)) ) ) (let ((gp-1 (new-stack-vector0))) @@ -1056,7 +1037,7 @@ (let ((t9-5 vector-xz-normalize!) (a0-10 (new-stack-vector0)) ) - (set! (-> a0-10 quad) (-> arg0 quad)) + (vector-copy! a0-10 arg0) (let ((v1-18 (t9-5 a0-10 1.0))) (set! (-> v1-18 y) 0.0) (let* ((f0-10 (vector-dot s5-1 v1-18)) @@ -1084,18 +1065,18 @@ (gp-0 (-> self control transv-ctrl)) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self control target-transv quad)) + (vector-copy! s4-0 (-> self control target-transv)) (target-bend-vel-turn gp-0) (target-add-slide-factor s5-0) (let ((t9-2 vector-xz-normalize!) (a0-2 (new-stack-vector0)) ) - (set! (-> a0-2 quad) (-> s5-0 quad)) + (vector-copy! a0-2 s5-0) (let ((s3-0 (t9-2 a0-2 1.0))) (let ((t9-3 vector-xz-normalize!) (a0-3 (new-stack-vector0)) ) - (set! (-> a0-3 quad) (-> gp-0 quad)) + (vector-copy! a0-3 gp-0) (let ((v1-9 (t9-3 a0-3 1.0))) (set! (-> s3-0 y) 0.0) (set! (-> v1-9 y) 0.0) @@ -1223,7 +1204,7 @@ "ltransv" (the-as rgba (new 'static 'rgba :g #xff :a #x80)) ) - (set! (-> gp-1 quad) (-> self control btransv quad)) + (vector-copy! gp-1 (-> self control btransv)) (vector-float*! gp-1 gp-1 0.5) (vector+! gp-1 gp-1 (-> self control trans)) (add-debug-text-sphere @@ -1450,7 +1431,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg3 quad)) + (vector-copy! s5-0 arg3) (let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y)))) (if (< 1228.8 f0-1) (set! f0-1 1228.8) @@ -1588,8 +1569,8 @@ ) (enable-set! (-> self leg-ik s5-0) a1-4) ) - (set! (-> self foot s5-0 twist-max quad) (-> self control ground-contact-normal quad)) - (set! (-> self foot s5-0 trans quad) (-> self control gspot-pos quad)) + (vector-copy! (-> self foot s5-0 twist-max) (-> self control ground-contact-normal)) + (vector-copy! (-> self foot s5-0 trans) (-> self control gspot-pos)) (vector-y-quaternion! (-> self foot s5-0 target) (-> self control quat-for-control)) (set! (-> self foot s5-0 flex-blend) (if (if (zero? s5-0) (logtest? (target-flags lleg-no-ik) (-> self target-flags)) @@ -1604,7 +1585,7 @@ (s2-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s1-0 quad) (-> *y-vector* quad)) + (vector-copy! s1-0 *y-vector*) (let ((s3-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) @@ -1671,7 +1652,7 @@ (let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0))) (cond ((and (>= f30-0 0.0) (< 0.5 (-> gp-0 best-other-tri normal y))) - (set! (-> s4-0 quad) (-> gp-0 best-other-tri normal quad)) + (vector-copy! s4-0 (-> gp-0 best-other-tri normal)) (when (< 8192.0 (vector-vector-angle-safe *y-vector* s4-0)) (let* ((a1-17 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s4-0) 1.0)) (a2-18 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-17 8192.0)) @@ -1694,14 +1675,14 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-19 quad) vf6) ) - (set! (-> self leg-ik s5-0 user-position quad) (-> s3-0 quad)) - (set! (-> self leg-ik s5-0 user-normal quad) (-> s4-0 quad)) - (set! (-> self foot s5-0 twist-max quad) (-> s4-0 quad)) + (vector-copy! (-> self leg-ik s5-0 user-position) s3-0) + (vector-copy! (-> self leg-ik s5-0 user-normal) s4-0) + (vector-copy! (-> self foot s5-0 twist-max) s4-0) ) (else - (set! (-> self leg-ik s5-0 user-position quad) (-> s2-0 quad)) - (set! (-> self leg-ik s5-0 user-normal quad) (-> *y-vector* quad)) - (set! (-> self foot s5-0 twist-max quad) (-> *y-vector* quad)) + (vector-copy! (-> self leg-ik s5-0 user-position) s2-0) + (vector-copy! (-> self leg-ik s5-0 user-normal) *y-vector*) + (vector-copy! (-> self foot s5-0 twist-max) *y-vector*) ) ) ) @@ -1748,8 +1729,8 @@ ) ) ) - (set! (-> self control collide-extra-velocity quad) (-> self control additional-decaying-velocity quad)) - (set! (-> self control pre-collide-local-normal quad) (-> self control local-normal quad)) + (vector-copy! (-> self control collide-extra-velocity) (-> self control additional-decaying-velocity)) + (vector-copy! (-> self control pre-collide-local-normal) (-> self control local-normal)) 0 (none) ) @@ -1791,26 +1772,26 @@ ) ) (level-setup) - (set! (-> self control last-transv quad) (-> self control transv quad)) + (vector-copy! (-> self control last-transv) (-> self control transv)) (quaternion-copy! (-> self control last-quat-for-control) (-> self control quat-for-control)) ((-> self control current-surface active-hook)) (cond ((logtest? (-> self control status) (collide-status on-surface)) (set-time! (-> self control last-time-on-surface)) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (if (and (>= (-> self control coverage) 1.0) (not (logtest? (-> self control status) (collide-status touch-actor on-water))) (logtest? (-> self control status) (collide-status on-ground)) ) - (set! (-> self control last-trans-on-ground quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-on-ground) (-> self control trans)) ) ((-> self control current-surface touch-hook)) ) (else (let ((v1-49 (-> self control trans))) (when (logtest? (-> self control old-status) (collide-status on-surface)) - (set! (-> self control last-trans-leaving-surf quad) (-> self control last-trans-any-surf quad)) - (set! (-> self control highest-jump-mark quad) (-> self control last-trans-any-surf quad)) + (vector-copy! (-> self control last-trans-leaving-surf) (-> self control last-trans-any-surf)) + (vector-copy! (-> self control highest-jump-mark) (-> self control last-trans-any-surf)) ) (set! (-> self control highest-jump-mark x) (-> v1-49 x)) (set! (-> self control highest-jump-mark z) (-> v1-49 z)) @@ -1939,7 +1920,7 @@ ) ) (let ((a1-44 (new 'stack-no-clear 'vector))) - (set! (-> a1-44 quad) (-> self control trans quad)) + (vector-copy! a1-44 (-> self control trans)) (let ((v1-190 (new-stack-vector0)) (f0-13 (vector-dot (-> self control dynam gravity-normal) a1-44)) ) @@ -2132,7 +2113,7 @@ ) (seek! (-> self control bend-amount) f0-1 (* (-> self control bend-speed) (seconds-per-frame))) ) - (set! (-> self control dynam gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) + (vector-copy! (-> self control dynam gravity-normal) (-> self control standard-dynamics gravity-normal)) (vector-float*! (-> self control dynam gravity) (-> self control dynam gravity-normal) @@ -2219,24 +2200,13 @@ (cond ((send-event (handle->process (-> s5-0 pilot-edge-grab handle)) 'pilot-edge-grab s5-0) (let ((a0-7 (handle->process (-> s5-0 pilot-edge-grab handle)))) - (set! (-> s5-0 center-hold-old quad) (-> s5-0 center-hold quad)) + (vector-copy! (-> s5-0 center-hold-old) (-> s5-0 center-hold)) (let ((gp-0 (new 'stack-no-clear 'bone))) - (let* ((v1-13 (-> gp-0 transform)) - (a3-0 (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) - (a0-12 (-> a3-0 rvec quad)) - (a1-4 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-13 rvec quad) a0-12) - (set! (-> v1-13 uvec quad) a1-4) - (set! (-> v1-13 fvec quad) a2-1) - (set! (-> v1-13 trans quad) a3-1) - ) + (matrix-copy! (-> gp-0 transform) (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) (vector-matrix*! (-> gp-0 scale) (the-as vector (-> s5-0 pilot-edge-grab)) (-> gp-0 transform)) (vector-rotate*! (the-as vector (&+ gp-0 80)) (-> s5-0 pilot-edge-grab local-dir) (-> gp-0 transform)) - (set! (-> s5-0 center-hold quad) (-> gp-0 scale quad)) - (set! (-> self control edge-grab-edge-dir quad) (-> (&+ gp-0 80) transform rvec quad)) + (vector-copy! (-> s5-0 center-hold) (-> gp-0 scale)) + (vector-copy! (-> self control edge-grab-edge-dir) (-> (&+ gp-0 80) transform rvec)) ) ) ) @@ -2325,7 +2295,7 @@ (move-to-point! (-> self control) s3-1) ) (set! (-> self control hand-to-edge-dist) 0.0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) ) (else (vector-normalize! s4-1 1638.4) @@ -2351,7 +2321,7 @@ (move-to-point! (-> self control) a1-23) ) (set! (-> self control hand-to-edge-dist) 0.0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (set-time! (-> self control last-successful-compute-edge-time)) ) ) @@ -2375,24 +2345,13 @@ (cond ((send-event (handle->process (-> gp-0 pilot-edge-grab handle)) 'pilot-edge-grab gp-0) (let ((a0-7 (handle->process (-> gp-0 pilot-edge-grab handle)))) - (set! (-> gp-0 center-hold-old quad) (-> gp-0 center-hold quad)) + (vector-copy! (-> gp-0 center-hold-old) (-> gp-0 center-hold)) (let ((s5-0 (new 'stack-no-clear 'bone))) - (let* ((v1-13 (-> s5-0 transform)) - (a3-0 (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) - (a0-12 (-> a3-0 rvec quad)) - (a1-4 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-13 rvec quad) a0-12) - (set! (-> v1-13 uvec quad) a1-4) - (set! (-> v1-13 fvec quad) a2-1) - (set! (-> v1-13 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 transform) (-> (the-as process-drawable a0-7) node-list data 0 bone transform)) (vector-matrix*! (-> s5-0 scale) (the-as vector (-> gp-0 pilot-edge-grab)) (-> s5-0 transform)) (vector-rotate*! (the-as vector (&+ s5-0 80)) (-> gp-0 pilot-edge-grab local-dir) (-> s5-0 transform)) - (set! (-> gp-0 center-hold quad) (-> s5-0 scale quad)) - (set! (-> self control edge-grab-edge-dir quad) (-> (&+ s5-0 80) transform rvec quad)) + (vector-copy! (-> gp-0 center-hold) (-> s5-0 scale)) + (vector-copy! (-> self control edge-grab-edge-dir) (-> (&+ s5-0 80) transform rvec)) ) ) ) @@ -2441,7 +2400,7 @@ (let* ((s2-0 (the-as swingpole (handle->process (-> self control anim-handle)))) (gp-0 (-> s2-0 dir)) ) - (set! (-> self control edge-grab-edge-dir quad) (-> gp-0 quad)) + (vector-copy! (-> self control edge-grab-edge-dir) gp-0) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s1-0 (get-trans s2-0)) (s4-1 (vector+float*! (new 'stack-no-clear 'vector) s1-0 gp-0 (the-as float (-> s2-0 edge-length)))) @@ -2504,7 +2463,7 @@ (-> self control) (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self control ctrl-to-hands-offset)) ) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) ) ) ) @@ -2543,13 +2502,13 @@ ) ) ) - (set! (-> self control camera-pos quad) (-> s5-0 quad)) + (vector-copy! (-> self control camera-pos) s5-0) ) ((logtest? (target-flags tf26) (-> self target-flags)) (vector+! (-> self control camera-pos) (-> self control trans) (new 'static 'vector :y -8192.0 :w 1.0)) ) ((focus-test? self board pilot mech indax) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) ) ((or (logtest? (-> self control status) (collide-status on-water)) (let ((v1-28 (-> self water flags))) @@ -2569,7 +2528,7 @@ (vector<-cspace! gp-0 (joint-node jakb-lod0-jg chest)) (cond ((>= (+ (current-time) (seconds -2)) (-> self control unknown-time-frame26)) - (set! (-> self control camera-pos quad) (-> s5-0 quad)) + (vector-copy! (-> self control camera-pos) s5-0) ) ((not (and (logtest? (-> self water flags) (water-flag under-water)) (not (logtest? (-> self water flags) (water-flag swim-ground))) @@ -2602,10 +2561,10 @@ (set! (-> self control camera-pos y) (-> self water base-height)) ) ((focus-test? self tube) - (set! (-> self control camera-pos quad) (-> self control gspot-pos quad)) + (vector-copy! (-> self control camera-pos) (-> self control gspot-pos)) ) ((logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp)) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) ) (else (vector<-cspace! (-> self control camera-pos) (the-as cspace (-> self node-list data))) @@ -2728,8 +2687,8 @@ (not (and (-> self next-state) (= (-> self next-state name) 'target-flop))) (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds))) ) - (set! (-> self control gspot-pos quad) (-> self control trans quad)) - (set! (-> self control gspot-normal quad) (-> self control ground-poly-normal quad)) + (vector-copy! (-> self control gspot-pos) (-> self control trans)) + (vector-copy! (-> self control gspot-normal) (-> self control ground-poly-normal)) (set! (-> self control gspot-pat-surfce) (-> self control ground-pat)) ) (else @@ -3002,12 +2961,13 @@ (let ((gp-2 (-> self control))) (+! (-> gp-2 history-idx) 1) (let ((v1-25 (clear-record-tags! *history* (history-channel transv) (-> gp-2 history-idx) (the-as uint 2)))) - (set! (-> v1-25 origin quad) (-> gp-2 trans quad)) - (set! (-> v1-25 vector quad) (-> gp-2 transv quad)) + (vector-copy! (-> v1-25 origin) (-> gp-2 trans)) + (vector-copy! (-> v1-25 vector) (-> gp-2 transv)) + ) + (vector-copy! + (-> (clear-record-tags! *history* (history-channel trans) (-> gp-2 history-idx) (the-as uint 2)) vector) + (-> gp-2 trans) ) - (set! (-> (clear-record-tags! *history* (history-channel trans) (-> gp-2 history-idx) (the-as uint 2)) vector quad) - (-> gp-2 trans quad) - ) (let ((v1-31 (clear-record-tags! *history* (history-channel collide-status) (-> gp-2 history-idx) (the-as uint 2))) ) (set! (-> v1-31 collide-status) (logior (-> gp-2 status) (collide-status no-touch))) @@ -3049,7 +3009,7 @@ (quaternion-identity! (-> self control quat-for-control)) (quaternion-identity! (-> self control dir-targ)) (set! (-> self control transv quad) (the-as uint128 0)) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) ) (target-exit) (target-timed-invulnerable-off self 0) @@ -3057,7 +3017,7 @@ (set! (-> self control status) (collide-status)) (set! (-> self control standard-dynamics) *standard-dynamics*) (set! (-> self control surf) *standard-ground-surface*) - (set! (-> self control bent-gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) + (vector-copy! (-> self control bent-gravity-normal) (-> self control standard-dynamics gravity-normal)) (quaternion-identity! (-> self control override-quat)) (set! (-> self control override-quat-alpha) 0.0) (set-time! (-> self control last-time-on-surface)) @@ -3215,7 +3175,7 @@ (set! (-> v1-96 event-self) 'touched) ) (move-to-point! (-> this control) (-> arg0 trans)) - (set! (-> this control camera-pos quad) (-> arg0 trans quad)) + (vector-copy! (-> this control camera-pos) (-> arg0 trans)) (set! (-> this focus-search) (new 'process 'boxed-array collide-shape 128)) (set! (-> this focus-search length) 0) (set! (-> this handle-search) (new 'process 'boxed-array handle 128)) @@ -3321,7 +3281,7 @@ (set! (-> this water) (new 'process 'water-control this 10 0.0 8192.0 2048.0)) (set! (-> this water flags) (water-flag swim-ground part-splash part-drip part-rings part-water find-water)) (reset-target-state #t) - (set! (-> this control last-trans-any-surf quad) (-> this control trans quad)) + (vector-copy! (-> this control last-trans-any-surf) (-> this control trans)) (+! (-> this control last-trans-any-surf y) -819200.0) (set! (-> this align) (new 'process 'align-control this)) (set! (-> this manipy) (the-as (pointer manipy) #f)) diff --git a/test/decompiler/reference/jak3/engine/target/mech/carry-h_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/carry-h_REF.gc index 00651e98331..9431c154231 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/carry-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/carry-h_REF.gc @@ -109,8 +109,8 @@ ) (set! (-> gp-0 max-angle) arg4) (set! (-> gp-0 max-distance) 8192.0) - (set! (-> gp-0 local-point quad) (-> arg2 quad)) - (set! (-> gp-0 local-normal quad) (-> arg3 quad)) + (vector-copy! (-> gp-0 local-point) arg2) + (vector-copy! (-> gp-0 local-normal) arg3) (let* ((s5-1 (-> arg0 root)) (v1-7 (if (type? s5-1 collide-shape) (the-as collide-shape s5-1) @@ -250,7 +250,7 @@ (vector-rotate-y! s4-3 s4-3 (- (deg-diff f30-0 f28-0))) (vector+! s4-3 s4-3 (-> arg0 process 0 control trans)) (vector-matrix*! s4-3 s4-3 s3-2) - (set! (-> arg0 grab-trans quad) (-> s4-3 quad)) + (vector-copy! (-> arg0 grab-trans) s4-3) ) ) (set! (-> arg0 hold-trans x) @@ -354,18 +354,10 @@ (s3-2 (vector-! (new 'stack-no-clear 'vector) v1-10 (-> this process 0 control trans))) ) (when s4-0 - (let ((s5-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-3 (-> s4-0 process 0 node-list data (-> s4-0 joint) bone transform)) - (v1-16 (-> a2-3 rvec quad)) - (a0-16 (-> a2-3 uvec quad)) - (a1-3 (-> a2-3 fvec quad)) - (a2-4 (-> a2-3 trans quad)) - ) - (set! (-> s5-1 rvec quad) v1-16) - (set! (-> s5-1 uvec quad) a0-16) - (set! (-> s5-1 fvec quad) a1-3) - (set! (-> s5-1 trans quad) a2-4) - ) + (let ((s5-1 + (matrix-copy! (new 'stack-no-clear 'matrix) (-> s4-0 process 0 node-list data (-> s4-0 joint) bone transform)) + ) + ) (vector-normalize! (-> s5-1 rvec) 1.0) (vector-normalize! (-> s5-1 uvec) 1.0) (vector-normalize! (-> s5-1 fvec) 1.0) @@ -377,7 +369,7 @@ ) (cond ((time-elapsed? (-> this pickup-time) (seconds 1)) - (set! (-> this process 0 control trans quad) (-> v1-19 quad)) + (vector-copy! (-> this process 0 control trans) v1-19) (quaternion-copy! (-> this process 0 control quat) s5-3) ) (else @@ -424,8 +416,8 @@ ) ) (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) - (set! (-> arg0 grab-trans quad) (-> arg0 process 0 control trans quad)) - (set! (-> arg0 hold-trans quad) (-> this process 0 control trans quad)) + (vector-copy! (-> arg0 grab-trans) (-> arg0 process 0 control trans)) + (vector-copy! (-> arg0 hold-trans) (-> this process 0 control trans)) (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> this point) (-> arg0 point)))) (vector-xz-normalize! s2-2 (-> arg0 max-pull)) (vector+! s2-2 s2-2 (-> arg0 point)) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc index 679c080b80d..1b3a5cfa3ec 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-part_REF.gc @@ -178,7 +178,7 @@ (a1-7 (-> arg0 part-thruster)) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> s0-0 quad)) + (vector-copy! (-> a2-4 trans) s0-0) (t9-4 (the-as sparticle-system a0-6) a1-7 diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc index fed1d6673d4..78afc58ee7d 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech-states_REF.gc @@ -531,11 +531,11 @@ (when (or (not s5-2) (= (-> self control send-attack-time) (current-time))) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (the-as collide-query gp-1) best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as collide-query gp-1) best-other-tri intersect)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (the-as collide-query gp-1) best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as collide-query gp-1) best-other-tri intersect)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -1013,7 +1013,7 @@ (vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back)))) (set! (-> gp-0 vector y) (-> gp-0 shove-up)) ) - (set! (-> s5-0 quad) (-> gp-0 vector quad)) + (vector-copy! s5-0 (-> gp-0 vector)) (let ((f0-10 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-0 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -1037,13 +1037,13 @@ (cond ((= (-> self game mode) 'debug) (let ((s4-1 (new-stack-vector0))) - (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! s4-1 (-> self control last-trans-on-ground)) (ja-channel-set! 0) (suspend-for (seconds 1) ) (move-to-point! (-> self control) s4-1) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-mech-stance) ) @@ -1233,11 +1233,11 @@ (sound-play "mech-eject") (cond ((logtest? (-> *part-group-id-table* 236 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 236)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 236)) ) ) @@ -1271,7 +1271,7 @@ ) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (set! (-> self post-hook) target-no-move-post) (ja-channel-set! 1) (ja-no-eval :group! jakb-death-painful-land-ja :num! (seek!) :frame-num 0.0) @@ -1625,7 +1625,7 @@ (let ((a0-8 (the-as carry-info (send-event-function (handle->process (-> self carry other)) a1-1)))) (when a0-8 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> a0-8 point quad)) + (vector-copy! s5-1 (-> a0-8 point)) (set! (-> s5-1 y) (- (-> s5-1 y) (-> a0-8 process 0 control root-prim prim-core world-sphere w))) (let ((s4-0 (new-stack-vector0)) (f28-0 (vector-dot (-> self control local-normal) s5-1)) @@ -2463,10 +2463,10 @@ (set! (-> self control mod-surface) *empty-mods*) (send-event (ppointer->process (-> self manipy)) 'draw #t) (set! (-> self neck flex-blend) 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector38 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) - (set! (-> self control unknown-vector40 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (vector-copy! (-> self control unknown-vector38) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) + (set! (-> self control unknown-quat40 quad) (-> self control quat quad)) (let* ((gp-1 (handle->process arg0)) (v1-23 (if (type? gp-1 process-drawable) gp-1 @@ -2474,16 +2474,13 @@ ) ) (when v1-23 - (set! (-> self control unknown-vector38 quad) (-> (the-as process-drawable v1-23) root trans quad)) - (set! (-> self control unknown-vector40 quad) (-> (the-as process-drawable v1-23) root quat quad)) + (vector-copy! (-> self control unknown-vector38) (-> (the-as process-drawable v1-23) root trans)) + (set! (-> self control unknown-quat40 quad) (-> (the-as process-drawable v1-23) root quat quad)) ) ) - (set! (-> self mech mech-trans quad) (-> self control unknown-vector38 quad)) - (quaternion-copy! - (the-as quaternion (-> self mech mech-quat)) - (the-as quaternion (-> self control unknown-vector40)) - ) - (set! (-> self mech mech-scale quad) (-> self control scale quad)) + (vector-copy! (-> self mech mech-trans) (-> self control unknown-vector38)) + (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control unknown-quat40)) + (vector-copy! (-> self mech mech-scale) (-> self control scale)) (set! (-> self mech stick-off) (the-as basic #t)) (ja-no-eval :group! jakb-mech-get-on-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -2501,13 +2498,13 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) (rot->dir-targ! (-> self control)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (suspend) (ja :num! (seek!)) ) @@ -2534,10 +2531,10 @@ (set! (-> self control mod-surface) *empty-mods*) (send-event (ppointer->process (-> self manipy)) 'draw #t) (set! (-> self neck flex-blend) 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector38 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) - (set! (-> self control unknown-vector40 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (vector-copy! (-> self control unknown-vector38) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) + (set! (-> self control unknown-quat40 quad) (-> self control quat quad)) (let* ((gp-1 (handle->process arg0)) (v1-23 (if (type? gp-1 process-drawable) gp-1 @@ -2545,16 +2542,13 @@ ) ) (when v1-23 - (set! (-> self control unknown-vector38 quad) (-> (the-as process-drawable v1-23) root trans quad)) - (set! (-> self control unknown-vector40 quad) (-> (the-as process-drawable v1-23) root quat quad)) + (vector-copy! (-> self control unknown-vector38) (-> (the-as process-drawable v1-23) root trans)) + (set! (-> self control unknown-quat40 quad) (-> (the-as process-drawable v1-23) root quat quad)) ) ) - (set! (-> self mech mech-trans quad) (-> self control unknown-vector38 quad)) - (quaternion-copy! - (the-as quaternion (-> self mech mech-quat)) - (the-as quaternion (-> self control unknown-vector40)) - ) - (set! (-> self mech mech-scale quad) (-> self control scale quad)) + (vector-copy! (-> self mech mech-trans) (-> self control unknown-vector38)) + (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control unknown-quat40)) + (vector-copy! (-> self mech mech-scale) (-> self control scale)) (set! (-> self mech stick-off) (the-as basic #t)) (ja-no-eval :group! jakb-mech-get-on-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -2572,13 +2566,13 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) (rot->dir-targ! (-> self control)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (suspend) (ja :num! (seek!)) ) @@ -2767,7 +2761,7 @@ :post (behavior () (vector+! (-> self mech mech-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control quat)) - (set! (-> self mech mech-scale quad) (-> self control scale quad)) + (vector-copy! (-> self mech mech-scale) (-> self control scale)) (target-no-ja-move-post) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/mech/mech_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/mech_REF.gc index 4129d885dae..85d098703da 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/mech_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/mech_REF.gc @@ -340,7 +340,7 @@ (set-yaw-angle-clear-roll-pitch! (-> self root) (res-lump-float arg0 'rotoffset)) ) (when arg1 - (set! (-> self root trans quad) (-> arg1 vector 0 quad)) + (vector-copy! (-> self root trans) (-> arg1 vector 0)) (quaternion-copy! (-> self root quat) (the-as quaternion (-> arg1 vector 1))) ) (initialize-skeleton @@ -382,6 +382,7 @@ ;; definition for method 11 of type mech (defmethod init-from-entity! ((this mech) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (mech-init arg0 (the-as matrix3 #f) (the-as handle #f) 100.0) ) @@ -508,7 +509,7 @@ ) (label cfg-12) (set! (-> self root) (the-as collide-shape-moving (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (set! (-> self root scale x) 0.0) (set! (-> self root scale y) 0.0) diff --git a/test/decompiler/reference/jak3/engine/target/mech/target-mech_REF.gc b/test/decompiler/reference/jak3/engine/target/mech/target-mech_REF.gc index 4b8d23da38a..9b686e4bdef 100644 --- a/test/decompiler/reference/jak3/engine/target/mech/target-mech_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/mech/target-mech_REF.gc @@ -27,7 +27,7 @@ (set! (-> self sphere-size) (-> arg0 sphere-size)) (set! (-> self owner) (-> arg0 owner)) (set! (-> self track-joint) (-> arg0 track-joint)) - (set! (-> self offset-vec quad) (-> arg0 offset-vec quad)) + (vector-copy! (-> self offset-vec) (-> arg0 offset-vec)) (init-collision! self) (initialize-skeleton self @@ -537,7 +537,7 @@ (a0-12 *sp-particle-system-2d*) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> self root trans quad)) + (vector-copy! (-> a2-3 trans) (-> self root trans)) (t9-6 a0-12 s5-2 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -551,7 +551,7 @@ (a0-15 *sp-particle-system-2d*) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> self root trans quad)) + (vector-copy! (-> a2-4 trans) (-> self root trans)) (t9-8 a0-15 s5-3 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -572,7 +572,7 @@ (a0-21 *sp-particle-system-2d*) (a2-6 *launch-matrix*) ) - (set! (-> a2-6 trans quad) (-> s4-2 quad)) + (vector-copy! (-> a2-6 trans) s4-2) (t9-13 a0-21 s5-4 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -923,7 +923,7 @@ ) (not (logtest? (-> self focus-status) (focus-status dead hit))) ) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (target-timed-invulnerable (seconds 0.1) self 1) (cond ((focus-test? self carry) @@ -962,7 +962,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg3 quad)) + (vector-copy! s5-0 arg3) (let ((f0-1 (- (-> arg3 y) (-> (target-pos 0) y)))) (if (< 6144.0 f0-1) (set! f0-1 6144.0) @@ -1156,7 +1156,7 @@ (let ((f30-0 (probe-using-line-sphere *collide-cache* gp-0))) (cond ((>= f30-0 0.0) - (set! (-> s1-0 quad) (-> gp-0 best-other-tri normal quad)) + (vector-copy! s1-0 (-> gp-0 best-other-tri normal)) (when (< 8192.0 (vector-vector-angle-safe *y-vector* s1-0)) (let* ((a1-14 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) *y-vector* s1-0) 1.0)) (a2-14 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-14 8192.0)) @@ -1179,13 +1179,13 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-16 quad) vf6) ) - (set! (-> s3-0 user-position quad) (-> s2-0 quad)) - (set! (-> s3-0 user-normal quad) (-> s1-0 quad)) + (vector-copy! (-> s3-0 user-position) s2-0) + (vector-copy! (-> s3-0 user-normal) s1-0) ) (else (set! (-> s0-0 y) (-> (target-pos 0) y)) - (set! (-> s3-0 user-position quad) (-> s0-0 quad)) - (set! (-> s3-0 user-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> s3-0 user-position) s0-0) + (vector-copy! (-> s3-0 user-normal) *y-vector*) ) ) ) @@ -1337,11 +1337,11 @@ (lambda :behavior target () (let ((v1-0 (ppointer->process (-> self parent)))) - (set! (-> self control trans quad) (-> (the-as target v1-0) mech mech-trans quad)) + (vector-copy! (-> self control trans) (-> (the-as target v1-0) mech mech-trans)) (let ((a0-4 (-> (the-as target v1-0) mech mech-quat quad))) (set! (-> self control quat quad) a0-4) ) - (set! (-> self control scale quad) (-> (the-as target v1-0) mech mech-scale quad)) + (vector-copy! (-> self control scale) (-> (the-as target v1-0) mech mech-scale)) (set! (-> self draw light-index) (-> (the-as target v1-0) draw light-index)) (let ((a0-10 (-> (the-as target v1-0) draw color-mult quad))) (set! (-> self draw color-mult quad) a0-10) @@ -1426,7 +1426,7 @@ (set! (-> s4-3 shield-strength) 8) (set! (-> s4-3 shield-type) (shield-type shield-type-0)) (if (new 'static 'vector :z -4096.0 :w 1.0) - (set! (-> s4-3 offset-vec quad) (-> (new 'static 'vector :z -4096.0 :w 1.0) quad)) + (vector-copy! (-> s4-3 offset-vec) (new 'static 'vector :z -4096.0 :w 1.0)) (vector-reset! (-> s4-3 offset-vec)) ) (let ((s3-1 (the-as process #f))) @@ -1560,18 +1560,18 @@ (let ((s5-0 (-> self control target-transv)) (gp-0 (-> self control transv-ctrl)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self control target-transv quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self control target-transv)) (target-bend-vel-turn gp-0) (target-add-slide-factor s5-0) (let ((t9-2 vector-xz-normalize!) (a0-5 (new-stack-vector0)) ) - (set! (-> a0-5 quad) (-> s5-0 quad)) + (vector-copy! a0-5 s5-0) (let ((s4-0 (t9-2 a0-5 1.0))) (let ((t9-3 vector-xz-normalize!) (a0-6 (new-stack-vector0)) ) - (set! (-> a0-6 quad) (-> gp-0 quad)) + (vector-copy! a0-6 gp-0) (let ((v1-7 (t9-3 a0-6 1.0))) (set! (-> s4-0 y) 0.0) (set! (-> v1-7 y) 0.0) @@ -1655,8 +1655,8 @@ (let ((s3-0 (send-event-function (handle->process (-> self carry other)) a1-0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> self control trans quad)) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self control transv quad)) + (vector-copy! s4-0 (-> self control trans)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self control transv)) (let ((a2-1 (new 'stack-no-clear 'collide-query)) (v1-18 (-> self control)) ) @@ -1763,8 +1763,8 @@ (set! (-> v1-61 y) 0.0) (when (< (vector-dot v1-61 (-> self control c-R-w fvec)) 0.0) (set-time! (-> self mech back-touch-time)) - (set! (-> self mech back-touch-point quad) (-> self control wall-contact-pt quad)) - (set! (-> self mech back-touch-trans quad) (-> self control trans quad)) + (vector-copy! (-> self mech back-touch-point) (-> self control wall-contact-pt)) + (vector-copy! (-> self mech back-touch-trans) (-> self control trans)) ) ) ) @@ -1860,7 +1860,7 @@ (target-powerup-process) (vector+! (-> self mech mech-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self mech mech-quat)) (-> self control quat)) - (set! (-> self mech mech-scale quad) (-> self control scale quad)) + (vector-copy! (-> self mech mech-scale) (-> self control scale)) (vector+! (-> self alt-cam-pos) (-> self control camera-pos) (new 'static 'vector :y 4096.0 :w 1.0)) (set-time! (-> self mech mech-time)) (target-mech-effect) diff --git a/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc b/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc index a158a32d0f1..372b5513e01 100644 --- a/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/pilot-states_REF.gc @@ -250,13 +250,13 @@ ) (#t (let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 10))) - (set! (-> gp-0 accel-array 7 quad) (-> gp-0 accel-array 6 quad)) - (set! (-> gp-0 accel-array 6 quad) (-> gp-0 accel-array 5 quad)) - (set! (-> gp-0 accel-array 5 quad) (-> gp-0 accel-array 4 quad)) - (set! (-> gp-0 accel-array 4 quad) (-> gp-0 accel-array 3 quad)) - (set! (-> gp-0 accel-array 3 quad) (-> gp-0 accel-array 2 quad)) - (set! (-> gp-0 accel-array 2 quad) (-> gp-0 accel-array 1 quad)) - (set! (-> gp-0 accel-array 1 quad) (-> gp-0 accel-array 0 quad)) + (vector-copy! (-> gp-0 accel-array 7) (-> gp-0 accel-array 6)) + (vector-copy! (-> gp-0 accel-array 6) (-> gp-0 accel-array 5)) + (vector-copy! (-> gp-0 accel-array 5) (-> gp-0 accel-array 4)) + (vector-copy! (-> gp-0 accel-array 4) (-> gp-0 accel-array 3)) + (vector-copy! (-> gp-0 accel-array 3) (-> gp-0 accel-array 2)) + (vector-copy! (-> gp-0 accel-array 2) (-> gp-0 accel-array 1)) + (vector-copy! (-> gp-0 accel-array 1) (-> gp-0 accel-array 0)) (get-linear-accel! s5-0 (the-as vector (-> gp-0 accel-array))) (vector-reset! (-> s4-0 0)) (vector+float*! (-> s4-0 0) (-> s4-0 0) (the-as vector (-> gp-0 accel-array)) 1.0) @@ -423,7 +423,7 @@ (let ((f0-0 v1-1) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> gp-0 local-accel quad)) + (vector-copy! s5-0 (-> gp-0 local-accel)) (set! (-> s5-0 x) (* 4.0 (-> s5-0 x))) (vector-float*! s5-0 s5-0 (/ 1.0 (sqrtf f0-0))) (let ((s4-0 (cond @@ -661,7 +661,7 @@ ) (else (vehicle-method-66 (the-as vehicle gp-0) (-> self control unknown-vector38) (-> self pilot seat-index)) - (set! (-> self control unknown-vector40 quad) (-> (the-as vehicle gp-0) root quat quad)) + (set! (-> self control unknown-quat40 quad) (-> (the-as vehicle gp-0) root quat quad)) ) ) ) @@ -669,7 +669,7 @@ :code (behavior () (logior! (-> self focus-status) (focus-status pilot)) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (sound-play "jump") (let ((gp-1 (if (zero? (-> self pilot stance)) jakb-pilot-bike-get-on-ja @@ -681,8 +681,8 @@ (set! (-> self control mod-surface) *pilot-get-on-mods*) (send-event (ppointer->process (-> self manipy)) 'draw #t) (set! (-> self neck flex-blend) 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) (ja :group! gp-1 :num! (seek!) :frame-num 0.0) ) (until (ja-done? 0) @@ -700,8 +700,8 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) @@ -712,7 +712,7 @@ (suspend) (let ((a1-8 (handle->process (-> self pilot vehicle)))) (if a1-8 - (set! (-> self alt-cam-pos quad) (-> (the-as vehicle a1-8) rbody position quad)) + (vector-copy! (-> self alt-cam-pos) (-> (the-as vehicle a1-8) rbody position)) ) ) (ja :num! (seek!)) @@ -807,8 +807,8 @@ (let ((v1-37 (camera-matrix)) (gp-2 (new 'stack-no-clear 'matrix)) ) - (set! (-> gp-2 rvec quad) (-> v1-37 rvec quad)) - (set! (-> gp-2 uvec quad) (-> v1-37 fvec quad)) + (vector-copy! (-> gp-2 rvec) (-> v1-37 rvec)) + (vector-copy! (-> gp-2 uvec) (-> v1-37 fvec)) (set! (-> gp-2 uvec y) 0.0) (vector-normalize! (-> gp-2 uvec) 1.0) (vector-reset! (-> gp-2 fvec)) @@ -917,7 +917,7 @@ :post (behavior () (vector+! (-> self pilot pilot-trans) (-> self control trans) (-> self control cspace-offset)) (quaternion-copy! (the-as quaternion (-> self pilot pilot-quat)) (-> self control quat)) - (set! (-> self pilot pilot-scale quad) (-> self control scale quad)) + (vector-copy! (-> self pilot pilot-scale) (-> self control scale)) (target-no-ja-move-post) ) ) @@ -930,7 +930,7 @@ (let ((gp-0 *edge-grab-info*)) (mem-copy! (the-as pointer (-> gp-0 pilot-edge-grab)) (the-as pointer arg0) 40) (set! (-> gp-0 pilot-grab-interp) 0.0) - (set! (-> gp-0 pilot-start-grab-pos quad) (-> self control trans quad)) + (vector-copy! (-> gp-0 pilot-start-grab-pos) (-> self control trans)) (set! (-> gp-0 actor-handle) (-> arg0 handle)) ((-> target-edge-grab enter)) (let* ((s5-1 (handle->process (-> gp-0 actor-handle))) @@ -1041,11 +1041,11 @@ (sound-play "death-darkeco") (cond ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 62)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 62)) ) ) @@ -1054,11 +1054,11 @@ (sound-play "explosion") (cond ((logtest? (-> *part-group-id-table* 65 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 65)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 65)) ) ) @@ -1067,11 +1067,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc index 8a5b01339ec..0db6a3a65a3 100644 --- a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc @@ -150,11 +150,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 77 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s2-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s2-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 77)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s2-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s2-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 77)) ) ) @@ -246,7 +246,7 @@ (v1-20 (new 'stack-no-clear 'vector)) (f30-0 (/ (-> arg0 root root-prim local-sphere w) 2)) ) - (set! (-> v1-20 quad) (-> arg0 root trans quad)) + (vector-copy! v1-20 (-> arg0 root trans)) (vector+float*! (-> s5-0 start-pos) v1-20 *up-vector* 0.0) (set! (-> s5-0 move-dist quad) (the-as uint128 0)) (set! (-> s5-0 move-dist y) (- f30-0)) @@ -289,11 +289,11 @@ (sound-play "djak-strike-hit") (cond ((logtest? (-> *part-group-id-table* 76 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 76)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 76)) ) ) @@ -466,7 +466,7 @@ (set! (-> this trail) (create-launch-control (-> *part-group-id-table* 173) this)) (set! (-> this impact?) #f) (set! (-> this max-hits) 1000) - (set! (-> this fire-point quad) (-> this root trans quad)) + (vector-copy! (-> this fire-point) (-> this root trans)) (set! (-> this bolts) (new 'process 'boxed-array lightning-bolt 3)) (dotimes (s5-0 (-> this bolts length)) (set! (-> this bolts s5-0) (new 'process 'lightning-bolt)) @@ -474,7 +474,7 @@ ) (set! (-> this fire-sound) (new-sound-id)) (let ((a0-13 (-> this root transv))) - (set! (-> a0-13 quad) (-> this root transv quad)) + (vector-copy! a0-13 (-> this root transv)) (set! (-> a0-13 y) 0.0) (vector-normalize! a0-13 1.0) ) @@ -513,7 +513,7 @@ (set! (-> s2-0 span-pts-start data 0 quad) (-> arg0 quad)) ) (if arg1 - (set! (-> s2-0 span-pts-start data 1 quad) (-> arg1 quad)) + (vector-copy! (-> s2-0 span-pts-start data 1) arg1) ) (set! (-> s2-0 spans-internal data 1 num-inner-points) 0) (lightning-bolt-method-11 s2-0) @@ -656,17 +656,17 @@ (set! (-> *part-id-table* 624 init-specs 11 initial-valuef) (the-as float #x1)) (spawn (-> this ball1) s4-0) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> this root trans quad)) + (vector-copy! s3-1 (-> this root trans)) (let ((s2-0 matrix-f-u-compose) (s1-0 (new 'stack-no-clear 'matrix)) (a0-21 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-21 quad) (-> this root transv quad)) + (vector-copy! a0-21 (-> this root transv)) (set! (-> a0-21 y) 0.0) (let ((a1-10 (s2-0 s1-0 (vector-normalize! a0-21 1.0) *up-vector*))) (set! (-> s3-1 y) (-> this last-ground-height)) (+! (-> s3-1 y) 1638.4) - (set! (-> a1-10 trans quad) (-> s3-1 quad)) + (vector-copy! (-> a1-10 trans) s3-1) (spawn-from-mat (-> this trail) a1-10) ) ) @@ -1580,11 +1580,11 @@ (when (= (-> gp-3 best-other-tri pat mode) (pat-mode wall)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-3 best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> gp-3 best-other-tri intersect)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-3 best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> gp-3 best-other-tri intersect)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -1859,9 +1859,10 @@ (set! (-> s4-2 charge) 1.0) (set! (-> s4-2 options) (projectile-options)) (logclear! (-> s4-2 options) (projectile-options po14 po15 po16)) - (set! (-> s4-2 pos quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_rhand)) quad) - ) + (vector-copy! + (-> s4-2 pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_rhand)) + ) (set! (-> s4-2 notify-handle) (the-as handle #f)) (set! (-> s4-2 owner-handle) (the-as handle #f)) (set! (-> s4-2 target-handle) (the-as handle #f)) @@ -2051,7 +2052,7 @@ (set! (-> self darkjak stage) (-> self darkjak want-stage)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *roll-flip-mods*) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (set! sv-16 (the-as float 0.0)) (set! sv-20 (the-as float 1.0)) (ja-channel-push! 1 (seconds 0.15)) @@ -2187,11 +2188,11 @@ (set! (-> sv-160 y) (-> self control root-prim prim-core world-sphere y)) (cond ((logtest? (-> *part-group-id-table* 71 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-160 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-160) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 71)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-160 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-160) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 71)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc index 391d5e16a95..83412035b74 100644 --- a/test/decompiler/reference/jak3/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-death_REF.gc @@ -62,7 +62,7 @@ (a2-0 (find-nearest-entity (-> arg0 trans) warp-gate)) ) (when a2-0 - (set! (-> s5-1 quad) (-> a2-0 extra trans quad)) + (vector-copy! s5-1 (-> a2-0 extra trans)) (+! (-> s5-1 y) 9011.2) (go target-warp-in s5-1 (-> arg0 trans) a2-0) ) @@ -268,7 +268,7 @@ (set! (-> s2-0 z) (* 4096.0 (the float (-> s0-0 user-int16 1)))) (set! sv-1328 (new 'stack-no-clear 'collide-query)) (set-vector! (-> sv-1328 move-dist) 0.0 -204800.0 0.0 1.0) - (set! (-> sv-1328 start-pos quad) (-> s2-0 quad)) + (vector-copy! (-> sv-1328 start-pos) s2-0) (+! (-> sv-1328 start-pos y) 102400.0) (let ((v1-20 sv-1328)) (set! (-> v1-20 radius) 409.6) @@ -310,7 +310,7 @@ (set! (-> s3-0 z) (* 4096.0 (the float (-> s0-0 user-int16 3)))) (let ((s1-1 (new 'stack-no-clear 'collide-query))) (set-vector! (-> s1-1 move-dist) 0.0 -204800.0 0.0 1.0) - (set! (-> s1-1 start-pos quad) (-> s3-0 quad)) + (vector-copy! (-> s1-1 start-pos) s3-0) (+! (-> s1-1 start-pos y) 102400.0) (let ((v1-33 s1-1)) (set! (-> v1-33 radius) 409.6) @@ -348,7 +348,7 @@ ) ) ) - (set! (-> arg0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> arg0 trans) s3-0) (vector-! s4-0 s3-0 s2-0) (set! (-> s4-0 y) 16384.0) (vector+! (-> arg0 camera-trans) s4-0 s3-0) @@ -389,7 +389,7 @@ ) (move-to-point! (-> self control) (-> arg0 trans)) (rot->dir-targ! (-> self control)) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) ) (else (format 0 "ERROR: failed to find '~S' for pos-from-entity~%" (-> arg0 on-goto)) @@ -506,9 +506,9 @@ ) :exit (behavior () (set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad)) - (set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad)) + (vector-copy! (-> *level* camera-pos 1) (-> *level* camera-pos 0)) (set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad)) - (set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad)) + (vector-copy! (-> *level* target-pos 1) (-> *level* target-pos 0)) (set! (-> *setting-control* user-default border-mode) (-> *level* play?)) (set! (-> *setting-control* user-default region-mode) #t) (kill-persister *setting-control* (the-as engine-pers 'title-control) 'render) @@ -534,7 +534,7 @@ (logclear! (-> self focus-status) (focus-status teleporting)) (set! (-> self mode-cache) #f) (set-time! (-> self teleport-time)) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (set! (-> self game kiosk-timeout) (-> *display* game-clock frame-counter)) 0 ) @@ -614,7 +614,7 @@ ) (move-to-point! (-> self control) (-> arg0 trans)) (rot->dir-targ! (-> self control)) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (vector-reset! (-> self control transv)) (if (not (string= (-> arg0 name) "default")) (set! *external-cam-mode* #f) @@ -653,7 +653,7 @@ (dotimes (s5-0 (-> arg0 want-count)) (when (not (or (not (-> arg0 want s5-0 name)) (not (-> arg0 want s5-0 display?)) - (= (status-of-level-and-borrows *level* (-> arg0 want s5-0 name) #f) 'active) + (= (level-status? *level* (-> arg0 want s5-0 name) #f) 'active) ) ) (set! v1-126 #t) @@ -664,7 +664,7 @@ (dotimes (s4-0 10) (when (not (or (not (-> s5-1 want s4-0 name)) (not (-> s5-1 want s4-0 display?)) - (= (status-of-level-and-borrows *level* (-> s5-1 want s4-0 name) #f) 'active) + (= (level-status? *level* (-> s5-1 want s4-0 name) #f) 'active) ) ) (set! v1-126 #t) @@ -731,7 +731,7 @@ (cam-start #t) (suspend) (when (not (string= (-> arg0 name) "default")) - (set! (-> *camera-combiner* trans quad) (-> arg0 camera-trans quad)) + (vector-copy! (-> *camera-combiner* trans) (-> arg0 camera-trans)) (let ((s5-4 (-> *camera-combiner* inv-camera-rot)) (s4-1 (-> arg0 camera-rot)) ) @@ -941,7 +941,7 @@ (gp-1 (vector-! (new 'stack-no-clear 'vector) arg0 v1-1)) ) (set! (-> gp-1 y) 0.0) - (set! (-> self control force-turn-to-direction quad) (-> gp-1 quad)) + (vector-copy! (-> self control force-turn-to-direction) gp-1) (vector-xz-normalize! (-> self control force-turn-to-direction) 1.0) (set! (-> self control force-turn-to-speed) 1.0) (set! (-> self control unknown-floatiujh1bnb2n3i1) arg1) @@ -956,27 +956,25 @@ (defbehavior target-hit-effect target ((arg0 attack-info)) (cond ((logtest? (-> *part-group-id-table* 10 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) - (-> arg0 intersection) - (the-as vector (-> self control root-prim prim-core)) - ) - ) - quad + (vector-copy! + (-> *launch-matrix* trans) + (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (the-as vector (-> self control root-prim prim-core)) + ) ) - ) + ) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 10)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) - (-> arg0 intersection) - (the-as vector (-> self control root-prim prim-core)) - ) - ) - quad + (vector-copy! + (-> *launch-matrix* trans) + (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection)) + (-> arg0 intersection) + (the-as vector (-> self control root-prim prim-core)) + ) ) - ) + ) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 10)) ) ) @@ -1319,7 +1317,7 @@ ) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> self control trans quad)) + (vector-copy! s3-0 (-> self control trans)) (let ((s2-1 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (+ 32768.0 (vector-y-angle (-> arg0 vector))))) (f30-1 0.0) ) @@ -1443,7 +1441,7 @@ (set! (-> sv-32 damage) (fmax 1.0 (ceil (/ (-> sv-32 damage) 2)))) 0 ) - (set! (-> sv-36 quad) (-> sv-32 vector quad)) + (vector-copy! sv-36 (-> sv-32 vector)) (let ((f0-19 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) sv-36 1.0) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat-for-control)) @@ -1468,13 +1466,13 @@ (cond ((= (-> self game mode) 'debug) (let ((gp-1 (new-stack-vector0))) - (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) + (vector-copy! gp-1 (-> self control last-trans-on-ground)) (ja-channel-set! 0) (suspend-for (seconds 1) ) (move-to-point! (-> self control) gp-1) ) - (set! (-> self control camera-pos quad) (-> self control trans quad)) + (vector-copy! (-> self control camera-pos) (-> self control trans)) (send-event *camera* 'teleport) (go target-stance) ) @@ -1494,11 +1492,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -1515,11 +1513,11 @@ (sound-play "death-melt") (cond ((logtest? (-> *part-group-id-table* 64 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 64)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 64)) ) ) @@ -1831,7 +1829,7 @@ (defun kill-nearby-enemies ((arg0 vector) (arg1 float)) (let ((v1-0 *kill-nearby-enemies-info*)) (set! (-> v1-0 dist) arg1) - (set! (-> v1-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 pos) arg0) ) (iterate-process-tree *entity-pool* @@ -2312,11 +2310,11 @@ (sound-play "death-darkeco") (cond ((logtest? (-> *part-group-id-table* 62 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 62)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 62)) ) ) @@ -2350,11 +2348,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 65 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 65)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 65)) ) ) @@ -2527,11 +2525,11 @@ ((or (= v1-61 'burn) (= v1-61 'burnup)) (cond ((logtest? (-> *part-group-id-table* 66 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 66)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 66)) ) ) @@ -2550,18 +2548,18 @@ ) (cond ((logtest? (-> gp-1 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group gp-1) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group gp-1) ) ) ) (let ((f30-0 (-> self control trans y))) (logior! (-> self target-flags) (target-flags tf6)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (logclear! (-> self water flags) (water-flag swim-ground)) (let ((v1-38 (new-stack-vector0))) (let ((f0-2 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) diff --git a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc index bbf0e6345a3..4eabf8c9b7b 100644 --- a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc @@ -1577,21 +1577,18 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-gun-build-track-list target () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self control trans quad)) + (vector-copy! gp-0 (-> self control trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (-> self gun track-dir))) - (set! (-> s4-0 quad) - (-> (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + (vector-copy! s4-0 (if (and (or (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (logtest? (surface-flag gun-strafe) (-> self control current-surface flags)) + ) + (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + ) + (-> self gun fire-dir) + (-> self control to-target-pt-xz) ) - (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) - ) - (-> self gun fire-dir) - (-> self control to-target-pt-xz) ) - quad - ) - ) (vector-flatten! s4-0 s4-0 (-> self control c-R-w uvec)) (vector-normalize! s4-0 1.0) (+! (-> gp-0 y) 6144.0) @@ -1696,15 +1693,15 @@ (gp-0 (set! (-> self gun track-target-hold-time) 0) (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) - (set! (-> self gun track-trans quad) (-> (get-trans gp-0 3) quad)) - (when ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) gp-0) + (vector-copy! (-> self gun track-trans) (get-trans gp-0 3)) + (when ((method-of-type focus focus-on!) (the-as focus (-> self gun track-target)) gp-0) (set-time! (-> self gun track-start-time)) (if (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) (set-time! (-> self gun track-press-start-time)) ) ) - (if (logtest? (process-mask->search-info-flag gp-0) (search-info-flag guard enemy attackable-priority)) - (try-update-focus (-> self gun track-target 1) gp-0) + (if (logtest? (get-search-info-flag gp-0) (search-info-flag guard enemy attackable-priority)) + (focus-on! (-> self gun track-target 1) gp-0) ) ) (else @@ -1743,7 +1740,7 @@ 0.5 ) ) - (logtest? (process-mask->search-info-flag (the-as process-focusable s5-2)) (search-info-flag abort)) + (logtest? (get-search-info-flag (the-as process-focusable s5-2)) (search-info-flag abort)) ) ) ) @@ -1752,16 +1749,16 @@ ((method-of-type focus clear-focused) (the-as focus (-> self gun track-target))) ) (else - (let ((a0-67 (process-mask->search-info-flag (the-as process-focusable s5-2)))) + (let ((a0-67 (get-search-info-flag (the-as process-focusable s5-2)))) (cond ((and (not (not (or (zero? a0-67) (logtest? a0-67 (search-info-flag abort))))) (zero? (-> self gun track-target-hold-time)) ) (logclear! (-> self gun track?) (gun-track-flags gutflags-2)) - (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) + (vector-copy! (-> self gun track-trans) (get-trans (the-as process-focusable s5-2) 3)) ) (else - (set! (-> self gun track-trans quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) + (vector-copy! (-> self gun track-trans) (get-trans (the-as process-focusable s5-2) 3)) ) ) ) @@ -1779,7 +1776,7 @@ (let ((s4-7 (get-trans (the-as process-focusable s5-3) 3))) (let ((s3-1 (new 'stack-no-clear 'vector4w))) (cond - ((and (logtest? (process-mask->search-info-flag (the-as process-focusable s5-3)) + ((and (logtest? (get-search-info-flag (the-as process-focusable s5-3)) (search-info-flag guard enemy attackable-priority) ) (transform-point-qword! s3-1 s4-7) @@ -2012,9 +2009,9 @@ gp-0 (current-time) ) - ((method-of-type focus try-update-focus) (the-as focus (-> self gun track-target)) gp-0) - (try-update-focus (-> self gun track-target 1) gp-0) - (set! (-> self gun track-trans quad) (-> (get-trans gp-0 3) quad)) + ((method-of-type focus focus-on!) (the-as focus (-> self gun track-target)) gp-0) + (focus-on! (-> self gun track-target 1) gp-0) + (vector-copy! (-> self gun track-trans) (get-trans gp-0 3)) (set! (-> self gun track?) (gun-track-flags gutflags-0 gutflags-1 gutflags-2)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) @@ -2197,15 +2194,15 @@ ) ) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self control trans quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self control trans)) (if (logtest? (surface-flag gun-no-twist) (-> self control current-surface flags)) (set! (-> self upper-body flex-blend) 0.0) (seek! (-> self upper-body flex-blend) 1.0 (* 8.0 (seconds-per-frame))) ) (when (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) - (set! (-> self gun top-anim-look-at quad) (-> self gun track-trans quad)) + (vector-copy! (-> self gun top-anim-look-at) (-> self gun track-trans)) (let ((gp-6 (new 'stack-no-clear 'vector))) - (set! (-> gp-6 quad) (-> self gun top-anim-look-at quad)) + (vector-copy! gp-6 (-> self gun top-anim-look-at)) (case (gun->eco (-> self gun gun-type)) (((pickup-type eco-yellow)) (+! (-> gp-6 y) -409.6) @@ -2243,9 +2240,7 @@ ) (cond ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) - (logtest? (process-mask->search-info-flag - (the-as process-focusable (handle->process (-> self gun track-target 0 handle))) - ) + (logtest? (get-search-info-flag (the-as process-focusable (handle->process (-> self gun track-target 0 handle)))) (search-info-flag guard enemy attackable-priority) ) ) @@ -2604,7 +2599,7 @@ ) (matrix-lerp! gp-0 a1-0 a2-0 (-> self gun gun-daxter)) (matrix->transformq (-> self gun gun-pos) gp-0) - (set! (-> self gun gun-pos scale quad) (-> self control scale quad)) + (vector-copy! (-> self gun gun-pos scale) (-> self control scale)) (when (and (using-gun? self) (and (focus-test? self edge-grab) (let ((v1-18 (ja-group))) (and v1-18 (or (= v1-18 jakb-jump-loop-ja) @@ -3488,9 +3483,9 @@ ;; WARN: Return type mismatch object vs none. (defun camera-rotate-to-vector ((arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (camera-matrix) fvec quad)) + (vector-copy! s4-0 (-> (camera-matrix) fvec)) (vector-flatten! s5-0 s5-0 arg1) (vector-normalize! s5-0 1.0) (vector-flatten! s4-0 s4-0 arg1) diff --git a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc index 036e5c28277..682e7087fc8 100644 --- a/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-handler_REF.gc @@ -142,27 +142,25 @@ ) (cond ((logtest? (-> *part-group-id-table* 10 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) - (-> self attack-info-rec intersection) - (the-as vector (-> self control root-prim prim-core)) - ) - ) - quad + (vector-copy! + (-> *launch-matrix* trans) + (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (the-as vector (-> self control root-prim prim-core)) + ) ) - ) + ) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 10)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) - (-> self attack-info-rec intersection) - (the-as vector (-> self control root-prim prim-core)) - ) - ) - quad + (vector-copy! + (-> *launch-matrix* trans) + (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection)) + (-> self attack-info-rec intersection) + (the-as vector (-> self control root-prim prim-core)) + ) ) - ) + ) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 10)) ) ) @@ -387,7 +385,7 @@ ) (when sv-96 (let ((v1-17 (new 'stack-no-clear 'vector))) - (set! (-> v1-17 quad) (-> self control trans quad)) + (vector-copy! v1-17 (-> self control trans)) (set! sv-128 v1-17) ) (set! sv-132 (if arg2 @@ -495,11 +493,11 @@ ((1) (cond ((logtest? (-> *part-group-id-table* 11 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 11)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 11)) ) ) @@ -536,11 +534,11 @@ (when (or (zero? v1-105) (= v1-105 1)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -570,11 +568,11 @@ (when (or (zero? v1-147) (= v1-147 1)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -627,11 +625,11 @@ (when (or (zero? v1-199) (= v1-199 1)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-128 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-128) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -864,7 +862,7 @@ (('trans) (case (-> arg3 param 0) (('save) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (logior! (-> self target-flags) (target-flags tf12)) (mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48) ) @@ -916,7 +914,7 @@ (cond ((-> arg3 param 1) (logior! (-> self target-flags) (target-flags tf13)) - (set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! (-> self alt-neck-pos) (the-as vector (-> arg3 param 1))) (look-at! (-> self neck) (-> self alt-neck-pos) 'force arg0) ) (else @@ -1072,7 +1070,7 @@ (set! (-> self water drip-wetness) 0.0) ) (('reset-height) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) #f ) (('draw) @@ -1220,7 +1218,7 @@ #t ) ((= v1-0 'push-transv) - (set! (-> self control additional-decaying-velocity quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self control additional-decaying-velocity) (the-as vector (-> arg3 param 0))) (set-time! (-> self control additional-decaying-velocity-end-time)) (set! (-> self control additional-decaying-velocity-decay-start-time) (+ (current-time) (the-as time-frame (-> arg3 param 1))) @@ -1228,7 +1226,7 @@ #t ) ((= v1-0 'launch) - (set! (-> self control transv quad) (-> (the-as vector (-> arg3 param 3)) quad)) + (vector-copy! (-> self control transv) (the-as vector (-> arg3 param 3))) (go target-jump (the-as float (-> arg3 param 0)) @@ -1238,7 +1236,7 @@ ) ((= v1-0 'launch-dir) (when (not (focus-test? self board)) - (set! (-> self control unknown-vector37 quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self control unknown-vector37) (the-as vector (-> arg3 param 0))) (set! (-> self control sliding-start-time) (the-as time-frame (-> arg3 param 1))) (set! (-> self control unknown-word04) (the-as uint (the-as float (-> arg3 param 2)))) (go target-launch-dir) @@ -1353,7 +1351,7 @@ (set! (-> s4-0 guard-type) (the-as uint 11)) (set! (-> s4-0 entity) #f) (vector-reset! (-> s4-0 velocity)) - (set! (-> s4-0 position quad) (-> self control trans quad)) + (vector-copy! (-> s4-0 position) (-> self control trans)) (quaternion-copy! (-> s4-0 rotation) (-> self control quat)) (set! (-> s4-0 id) (the-as uint 0)) (let ((v1-101 (vehicle-spawn (the-as vehicle-type (-> arg3 param 2)) s4-0))) @@ -1806,7 +1804,7 @@ ) (not (logtest? (-> self focus-status) (focus-status dead hit))) ) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (target-timed-invulnerable (seconds 0.1) self 1) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc index 58b8b7c39fd..b1d6d997114 100644 --- a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc @@ -38,7 +38,7 @@ (if (and (focus-test? self dark) (nonzero? (-> self darkjak))) (send-event self 'end-mode 'lightjak) ) - (set! (-> self invisible-shadow-dir-backup quad) (-> self draw shadow-ctrl settings shadow-dir quad)) + (vector-copy! (-> self invisible-shadow-dir-backup) (-> self draw shadow-ctrl settings shadow-dir)) 0 (none) ) @@ -191,7 +191,7 @@ ) (when (= (-> self invisible-interp) 1.0) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (math-camera-pos) quad)) + (vector-copy! gp-0 (math-camera-pos)) (dotimes (s5-0 (-> *invis-joint-list* length)) (when (-> *invis-joint-list* s5-0 spawn?) (let ((v1-22 (-> *invis-joint-list* s5-0 joint)) @@ -461,7 +461,7 @@ (let ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 5324.8)) (a1-2 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) ) - (set! (-> a1-2 trans quad) (-> s5-1 quad)) + (vector-copy! (-> a1-2 trans) s5-1) (if (and (nonzero? (-> self part)) (not gp-0)) (spawn-from-mat (-> self part) a1-2) ) @@ -488,11 +488,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 182 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 182)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 182)) ) ) @@ -526,7 +526,7 @@ (let ((gp-2 (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 5324.8)) (a1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) ) - (set! (-> a1-4 trans quad) (-> gp-2 quad)) + (vector-copy! (-> a1-4 trans) gp-2) (spawn-from-mat (-> self part) a1-4) ) ) @@ -536,6 +536,7 @@ ;; definition for method 11 of type dark-maker-idol (defmethod init-from-entity! ((this dark-maker-idol) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) diff --git a/test/decompiler/reference/jak3/engine/target/target-ladder_REF.gc b/test/decompiler/reference/jak3/engine/target/target-ladder_REF.gc index 278ea720e0e..ea3832e1ba0 100644 --- a/test/decompiler/reference/jak3/engine/target/target-ladder_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-ladder_REF.gc @@ -134,10 +134,10 @@ ) (set! (-> s5-0 z) (* -1597.44 (-> self ladder interp))) (vector-matrix*! (-> self control trans) s5-0 gp-2) - (set! (-> self control turn-to-alt-heading quad) (-> gp-2 fvec quad)) - (set! (-> self control local-normal quad) (-> gp-2 uvec quad)) - (set! (-> self control bent-gravity-normal quad) (-> gp-2 uvec quad)) - (set! (-> self control gspot-normal quad) (-> gp-2 uvec quad)) + (vector-copy! (-> self control turn-to-alt-heading) (-> gp-2 fvec)) + (vector-copy! (-> self control local-normal) (-> gp-2 uvec)) + (vector-copy! (-> self control bent-gravity-normal) (-> gp-2 uvec)) + (vector-copy! (-> self control gspot-normal) (-> gp-2 uvec)) ) ) (update-transforms (-> self control)) @@ -164,24 +164,13 @@ (set! (-> self ladder ladder) arg0) (set! (-> self ladder flip) -1.0) (set! (-> self ladder interp) 0.0) - (let* ((v1-10 (-> self ladder start-mat)) - (a3-0 (-> self node-list data 0 bone transform)) - (a0-4 (-> a3-0 rvec quad)) - (a1-1 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-10 rvec quad) a0-4) - (set! (-> v1-10 uvec quad) a1-1) - (set! (-> v1-10 fvec quad) a2-0) - (set! (-> v1-10 trans quad) a3-1) - ) + (matrix-copy! (-> self ladder start-mat) (-> self node-list data 0 bone transform)) (set! (-> self control bend-target) 1.0) (set-time! (-> self state-time)) (set! (-> self control mod-surface) *ladder-mods*) (logior! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) (target-collide-set! 'pole 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control transv)) (set! (-> self control transv quad) (the-as uint128 0)) ) :code (behavior ((arg0 handle)) diff --git a/test/decompiler/reference/jak3/engine/target/target-launch_REF.gc b/test/decompiler/reference/jak3/engine/target/target-launch_REF.gc index 286a5c7a069..d5e2299f96e 100644 --- a/test/decompiler/reference/jak3/engine/target/target-launch_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-launch_REF.gc @@ -23,7 +23,7 @@ (set! (-> self control unknown-vector37 y) (- (-> self control unknown-vector37 y) (* 0.5 (the-as float (-> self control unknown-word04)))) ) - (set! (-> self control unknown-vector39 quad) (-> self control trans quad)) + (set! (-> self control unknown-quat39 quad) (-> self control trans quad)) ) :exit (behavior () (target-state-hook-exit) @@ -32,7 +32,7 @@ (cond ((not (time-elapsed? (-> self state-time) (-> self control sliding-start-time))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self control unknown-vector37 quad)) + (vector-copy! s5-0 (-> self control unknown-vector37)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (set! (-> gp-0 quad) (-> self control unknown-vector37 quad)) (set! (-> gp-0 y) 0.0) @@ -54,13 +54,13 @@ (let ((f0-6 (- 1.0 f0-5))) (vector+float*! (-> self control trans) - (-> self control unknown-vector39) + (the-as vector (-> self control unknown-quat39)) (-> self control unknown-vector37) f0-6 ) (+! (-> self control trans y) (* (/ f0-6 2) f0-6 (the-as float (-> self control unknown-word04)))) (set! (-> self control transv quad) (the-as uint128 0)) - (set! (-> self control transv quad) (-> self control unknown-vector37 quad)) + (vector-copy! (-> self control transv) (-> self control unknown-vector37)) (+! (-> self control transv y) (* f0-6 (the-as float (-> self control unknown-word04)))) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc index ab2450448b2..ef1690d581b 100644 --- a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc @@ -705,7 +705,7 @@ (vector-! s4-0 (camera-pos) (target-pos 0)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (set! (-> s5-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s5-0 (target-pos 0)) (reverse-transform-point! arg0 s5-0 s4-0 s3-0) ) arg0 @@ -1987,7 +1987,7 @@ (set! (-> self control mod-surface) *lightjak-swoop-mods*) (set-setting! 'string-min-height 'low (meters 1) 0) (set-setting! 'string-max-height 'low (meters 10) 0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) ) :exit (behavior () (remove-setting! 'board) @@ -2369,7 +2369,7 @@ (let ((f0-4 (* 0.00013563369 (tan (/ (-> *math-camera* fov) 2)) f30-0))) (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) ) - (set! (-> gp-0 quad) (-> (camera-pos) quad)) + (vector-copy! gp-0 (camera-pos)) (vector-normalize-copy! s5-0 (-> s3-0 fvec) 1.0) (matrix->quaternion (-> this root quat) s3-0) (let ((v1-10 (-> this root trans))) @@ -2394,7 +2394,7 @@ (defbehavior freeze-screen-init freeze-screen ((arg0 vector) (arg1 quaternion) (arg2 entity)) (process-entity-set! self arg2) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self @@ -2760,7 +2760,7 @@ :code (behavior () (send-event (handle->process (-> self notify)) 'notify 'attack 27) (set! (-> self neck flex-blend) 0.0) - (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> self control trans)) (if (logtest? (-> *part-group-id-table* 180 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -2795,15 +2795,17 @@ ) (cond ((logtest? (-> *part-group-id-table* 181 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) + ) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 181)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand)) + ) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 181)) ) ) @@ -2906,7 +2908,7 @@ ) ) (set! (-> self control dynam gravity-length) 122880.0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) (let ((gp-0 jakb-lightjak-shield-ja)) (quaternion-rotate-y! (-> self control quat-for-control) (-> self control quat-for-control) -1365.3334) (ja-channel-push! 1 (seconds 0.05)) @@ -3034,11 +3036,11 @@ (ppointer->handle (cond ((logtest? (-> *part-group-id-table* 177 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 177)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self control trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self control trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 177)) ) ) @@ -3168,7 +3170,7 @@ (let ((f0-0 3.0)) (set-vector! (-> self root scale) f0-0 f0-0 f0-0 1.0) ) - (set! (-> gp-1 quad) (-> (get-trans s3-0 5) quad)) + (vector-copy! gp-1 (get-trans s3-0 5)) (vector-normalize-copy! s5-0 (-> s4-0 fvec) 0.0) (matrix->quaternion (-> self root quat) s4-0) (let ((v1-11 (-> self root trans))) diff --git a/test/decompiler/reference/jak3/engine/target/target-part_REF.gc b/test/decompiler/reference/jak3/engine/target/target-part_REF.gc index c0aa67174ef..f37aa48da89 100644 --- a/test/decompiler/reference/jak3/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-part_REF.gc @@ -22,11 +22,7 @@ (defun birth-func-copy-target-y-rot ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((v1-0 *target*)) (when v1-0 - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (the-as uint128 0)) - (set! (-> s5-0 uvec quad) (the-as uint128 0)) - (set! (-> s5-0 fvec quad) (the-as uint128 0)) - (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((s5-0 (new-stack-matrix0))) (let ((f0-1 (+ -16384.0 (y-angle (-> v1-0 control))))) (matrix-rotate-y! s5-0 f0-1) ) @@ -52,7 +48,7 @@ (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-0 *target*) ) - (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (vector-copy! (-> s4-0 start-pos) (-> arg2 launchrot)) (set-vector! (-> s4-0 move-dist) 0.0 -20480.0 0.0 1.0) (+! (-> s4-0 start-pos y) 4096.0) (let ((v1-3 s4-0)) @@ -2673,7 +2669,7 @@ (a1-7 (-> *part-id-table* 157)) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> v1-13 quad)) + (vector-copy! (-> a2-3 trans) v1-13) (t9-7 a0-18 a1-7 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (suspend) @@ -3080,13 +3076,13 @@ (set! sv-768 (new 'stack-no-clear 'collide-query)) (set! sv-784 (the-as symbol #f)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> *up-vector* quad)) + (vector-copy! gp-0 *up-vector*) (when (nonzero? arg3) (set! sv-736 arg3) sv-736 ) (if (= arg3 256) - (set! (-> sv-768 start-pos quad) (-> arg0 root trans quad)) + (vector-copy! (-> sv-768 start-pos) (-> arg0 root trans)) (vector<-cspace! (-> sv-768 start-pos) (-> arg0 node-list data sv-736)) ) (set! sv-800 (-> sv-768 move-dist)) @@ -3113,9 +3109,9 @@ (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-768) 0.0) (set-time! (-> s5-0 last-valid-time)) (set! (-> s5-0 src-joint-index) (the-as uint sv-736)) - (set! (-> s5-0 end-pos quad) (-> sv-768 best-other-tri intersect quad)) + (vector-copy! (-> s5-0 end-pos) (-> sv-768 best-other-tri intersect)) (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-768 start-pos))) - (set! (-> gp-0 quad) (-> sv-768 best-other-tri normal quad)) + (vector-copy! gp-0 (-> sv-768 best-other-tri normal)) (set! sv-784 #t) (goto cfg-15) ) @@ -3161,7 +3157,7 @@ ) ) (let ((s4-1 (matrix-u-compose (new 'stack-no-clear 'matrix) gp-0 (the-as vector a2-2) (the-as vector a3-1)))) - (set! (-> s4-1 trans quad) (-> s5-0 end-pos quad)) + (vector-copy! (-> s4-1 trans) (-> s5-0 end-pos)) (vector+float*! (-> s4-1 trans) (-> s4-1 trans) gp-0 409.6) (if (logtest? (-> *part-group-id-table* 70 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -3223,7 +3219,7 @@ sv-656 ) (if (= arg4 256) - (set! (-> sv-688 start-pos quad) (-> arg0 root trans quad)) + (vector-copy! (-> sv-688 start-pos) (-> arg0 root trans)) (vector<-cspace! (-> sv-688 start-pos) (-> arg0 node-list data sv-656)) ) (set! sv-720 (-> sv-688 move-dist)) @@ -3250,7 +3246,7 @@ (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) (set-time! (-> s5-0 last-valid-time)) (set! (-> s5-0 src-joint-index) (the-as uint sv-656)) - (set! (-> s5-0 end-pos quad) (-> sv-688 best-other-tri intersect quad)) + (vector-copy! (-> s5-0 end-pos) (-> sv-688 best-other-tri intersect)) (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-688 start-pos))) (set! sv-704 #t) (goto cfg-21) @@ -3293,7 +3289,7 @@ (a0-30 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (vector-copy! (-> a2-5 trans) (-> s5-0 end-pos)) (t9-14 a0-30 arg3 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -3351,14 +3347,14 @@ (a1-14 arg4) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> sv-64 quad)) + (vector-copy! (-> a2-4 trans) sv-64) (t9-8 a0-20 a1-14 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (let ((t9-9 sp-launch-particles-var) (a0-21 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> sv-68 quad)) + (vector-copy! (-> a2-5 trans) sv-68) (t9-9 a0-21 arg4 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -3566,7 +3562,7 @@ (vector-normalize! sv-464 1.0) (quaternion-from-two-vectors! sv-480 s0-2 sv-464) (vector-orient-by-quat! s1-2 sv-448 sv-480) - (set! (-> s1-2 quad) (-> sv-448 quad)) + (vector-copy! s1-2 sv-448) (let ((a1-40 s2-1)) (let ((v1-56 sv-640)) (let ((a0-47 s1-2)) @@ -3591,10 +3587,10 @@ (+! (-> s4-1 state points-to-draw) 1) (set-point! s4-1 (-> s4-1 state points-to-draw) s2-1) (+! (-> s4-1 state points-to-draw) 1) - (set! (-> s3-1 quad) (-> s2-1 quad)) - (set! (-> s0-2 quad) (-> sv-464 quad)) - (set! (-> sv-448 quad) (-> s1-2 quad)) - (set! (-> sv-432 quad) (-> sv-640 quad)) + (vector-copy! s3-1 s2-1) + (vector-copy! s0-2 sv-464) + (vector-copy! sv-448 s1-2) + (vector-copy! sv-432 sv-640) (set! sv-576 (+ sv-576 1)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-pilot_REF.gc b/test/decompiler/reference/jak3/engine/target/target-pilot_REF.gc index a361ddaa313..e5a132b824e 100644 --- a/test/decompiler/reference/jak3/engine/target/target-pilot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-pilot_REF.gc @@ -424,7 +424,7 @@ ) (when s5-0 (vehicle-method-66 (the-as vehicle s5-0) (-> self control trans) (-> gp-2 seat-index)) - (set! (-> self control transv quad) (-> (the-as vehicle s5-0) root transv quad)) + (vector-copy! (-> self control transv) (-> (the-as vehicle s5-0) root transv)) (quaternion-copy! (-> self control quat) (-> (the-as vehicle s5-0) root quat)) (quaternion-copy! (-> self control quat-for-control) (-> self control quat)) (quaternion-copy! (-> self control dir-targ) (-> self control quat)) @@ -434,7 +434,7 @@ (set! (-> s3-0 vec 2 x) 0.0) (set! (-> s3-0 vec 2 y) 20480.0) (let ((a0-18 (-> self node-list data 0 bone transform))) - (set! (-> s3-0 vec 1 quad) (-> a0-18 fvec quad)) + (vector-copy! (-> s3-0 vec 1) (-> a0-18 fvec)) ) (set! (-> s3-0 vec 1 y) 0.0) (vector-rotate90-around-y! (-> s3-0 vec 1) (-> s3-0 vec 1)) @@ -452,7 +452,7 @@ ) (set! (-> v1-48 action-mask) (collide-action solid)) ) - (set! (-> s3-0 cquery start-pos quad) (-> s3-0 vec 0 quad)) + (vector-copy! (-> s3-0 cquery start-pos) (-> s3-0 vec 0)) (vector-float*! (-> s3-0 cquery move-dist) (-> s3-0 vec 1) (-> s3-0 vec 2 y)) (let ((f0-10 (fill-and-probe-using-line-sphere *collide-cache* (-> s3-0 cquery)))) (when (and (>= f0-10 0.0) (= (-> s3-0 cquery best-other-tri pat mode) (pat-mode wall))) diff --git a/test/decompiler/reference/jak3/engine/target/target-tube_REF.gc b/test/decompiler/reference/jak3/engine/target/target-tube_REF.gc index 5de354bc1aa..8d56e43b7f7 100644 --- a/test/decompiler/reference/jak3/engine/target/target-tube_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-tube_REF.gc @@ -279,15 +279,15 @@ ) (vector-matrix*! s4-1 s4-1 (-> self control w-R-c)) (let ((f0-11 (-> self control transv-ctrl y))) - (set! (-> self control transv-ctrl quad) (-> s4-1 quad)) + (vector-copy! (-> self control transv-ctrl) s4-1) (set! (-> self control transv-ctrl y) f0-11) ) ) ) (let ((s4-2 (new 'stack-no-clear 'vector))) - (set! (-> s4-2 quad) (-> self tube downtube quad)) + (vector-copy! s4-2 (-> self tube downtube)) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> self tube sidetube quad)) + (vector-copy! s3-1 (-> self tube sidetube)) (vector-flatten! s3-1 s3-1 (-> self control local-normal)) (add-debug-vector *display-target-marks* @@ -382,7 +382,7 @@ (update-rates! (-> self clock) (/ f30-0 (the float gp-1))) (while (nonzero? gp-1) (+! gp-1 -1) - (set! (-> self tube old-transv quad) (-> self control transv quad)) + (vector-copy! (-> self tube old-transv) (-> self control transv)) (flag-setup) (build-conversions (-> self control transv)) (if (logtest? (-> self target-flags) (target-flags tinvuln1)) @@ -987,7 +987,7 @@ (t9-14 vector-normalize!) (a0-71 (new-stack-vector0)) ) - (set! (-> a0-71 quad) (-> self control transv quad)) + (vector-copy! a0-71 (-> self control transv)) (s5-2 s4-1 (t9-14 a0-71 1.0) (vector-y-quaternion! (new-stack-vector0) (-> self control dir-targ))) ) (if (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact health))) @@ -1134,9 +1134,9 @@ (set! f28-0 (+ 0.01 f28-0)) ) (distance-from-tangent (-> self path) f30-0 s4-0 s5-0 gp-0 arg0) - (set! (-> self trans quad) (-> s4-0 quad)) - (set! (-> self rot quad) (-> s5-0 quad)) - (set! (-> self side quad) (-> gp-0 quad)) + (vector-copy! (-> self trans) s4-0) + (vector-copy! (-> self rot) s5-0) + (vector-copy! (-> self side) gp-0) (set! (-> self pos) f30-0) ) ) @@ -1232,6 +1232,7 @@ ;; definition for method 11 of type slide-control (defmethod init-from-entity! ((this slide-control) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/jak3/engine/target/target-turret-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/target-turret-shot_REF.gc index 99d968e0e2f..5617d4352c5 100644 --- a/test/decompiler/reference/jak3/engine/target/target-turret-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-turret-shot_REF.gc @@ -303,7 +303,7 @@ (f28-1 (-> *part-id-table* 1021 init-specs 4 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 1021 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 1021 init-specs 4 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 1021) s4-1 :origin-is-matrix #t) @@ -324,15 +324,15 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector-copy! v1-2 (-> gp-0 trans)) (vector+! v1-2 v1-2 a0-3) (cond ((logtest? (-> *part-group-id-table* 234 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 234)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 234)) ) ) @@ -362,7 +362,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch projectile-options vs none. (defmethod init-proj-settings! ((this turret-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 1228800.0) diff --git a/test/decompiler/reference/jak3/engine/target/target-turret_REF.gc b/test/decompiler/reference/jak3/engine/target/target-turret_REF.gc index 691eec6b856..abab81e83e6 100644 --- a/test/decompiler/reference/jak3/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-turret_REF.gc @@ -1214,15 +1214,15 @@ ) ) (let ((v1-10 (new 'stack-no-clear 'vector))) - (set! (-> v1-10 quad) (-> this root trans quad)) + (vector-copy! v1-10 (-> this root trans)) (+! (-> v1-10 y) 8192.0) (cond ((logtest? (-> *part-group-id-table* 235 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-10) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 235)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-10) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 235)) ) ) @@ -1393,7 +1393,7 @@ (while (< sv-592 s0-0) (vector+! s5-0 s1-0 s3-0) (vector-rotate-y! s3-0 s3-0 f30-0) - (set! (-> s2-0 start-pos quad) (-> s5-0 quad)) + (vector-copy! (-> s2-0 start-pos) s5-0) (set-vector! (-> s2-0 move-dist) 0.0 -24576.0 0.0 0.0) (+! (-> s2-0 start-pos y) 2048.0) (let ((v1-9 s2-0)) @@ -1406,7 +1406,7 @@ ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) (set! (-> s5-0 y) (+ 4096.0 (-> s2-0 best-other-tri intersect y))) - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) (return #t) ) (set! sv-592 (+ sv-592 1)) @@ -1424,8 +1424,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po13 po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg0 quad)) - (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1228800.0) quad)) + (vector-copy! (-> gp-0 pos) arg0) + (vector-copy! (-> gp-0 vel) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1228800.0)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1448,7 +1448,7 @@ ;; INFO: Used lq/sq (defmethod target-turret-method-49 ((this target-turret) (arg0 vector) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-normalize-copy! (-> s5-0 move-dist) arg1 arg2) (let ((v1-1 s5-0)) (set! (-> v1-1 radius) 2048.0) @@ -1524,6 +1524,7 @@ ;; definition for method 11 of type target-turret ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this target-turret) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (target-turret-method-36 this) (when arg0 @@ -1618,7 +1619,7 @@ :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 @@ -1679,7 +1680,7 @@ ) ) (if a0-16 - (set! (-> self alt-cam-pos quad) (-> (the-as process-drawable a0-16) root trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> (the-as process-drawable a0-16) root trans)) ) ) (vector-lerp! @@ -1694,8 +1695,8 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-1 ) ) @@ -1725,14 +1726,14 @@ ) ) (if a0-12 - (set! (-> self alt-cam-pos quad) (-> (the-as process-drawable a0-12) root trans quad)) + (vector-copy! (-> self alt-cam-pos) (-> (the-as process-drawable a0-12) root trans)) ) ) (vector+float*! (-> self control trans) (-> self control unknown-vector37) gp-1 f30-0) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-0 ) ) @@ -1759,8 +1760,8 @@ ((< (ja-aframe-num 0) 76.0) (send-event (handle->process (-> self turret handle)) 'player-quat (-> self control dir-targ)) (set-quaternion! (-> self control) (-> self control dir-targ)) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector39)) (-> self control quat-for-control)) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (quaternion-copy! (-> self control unknown-quat39) (-> self control quat-for-control)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) ) (else (let ((f30-1 (sin (lerp-scale 0.0 16384.0 (ja-aframe-num 0) 76.0 95.0)))) @@ -1777,8 +1778,8 @@ ) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f30-1 ) ) @@ -1813,8 +1814,8 @@ (suspend) (ja :num! (seek! max 1.2)) ) - (quaternion-copy! (the-as quaternion (-> self control unknown-vector39)) (-> self control quat-for-control)) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (quaternion-copy! (-> self control unknown-quat39) (-> self control quat-for-control)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector38) (-> self control unknown-vector37)) ) @@ -1829,8 +1830,8 @@ (vector+float*! (-> self control trans) (-> self control unknown-vector37) gp-1 f0-11) (quaternion-slerp! (-> self control quat-for-control) - (the-as quaternion (-> self control unknown-vector39)) - (the-as quaternion (-> self control unknown-vector40)) + (-> self control unknown-quat39) + (-> self control unknown-quat40) f0-11 ) ) @@ -2272,11 +2273,11 @@ (set! (-> self neck flex-blend) 0.0) (logior! (-> self target-flags) (target-flags tf2 tf5 lleg-still rleg-still lleg-no-ik rleg-no-ik)) (logior! (-> self focus-status) (focus-status disable grabbed)) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) - (set! (-> self control unknown-vector39 quad) (-> self control quat quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) + (set! (-> self control unknown-quat39 quad) (-> self control quat quad)) (send-event (handle->process arg0) 'player-pos (-> self control unknown-vector38)) - (send-event (handle->process arg0) 'player-quat (-> self control unknown-vector40)) - (set! (-> self alt-cam-pos quad) (-> self control camera-pos quad)) + (send-event (handle->process arg0) 'player-quat (-> self control unknown-quat40)) + (vector-copy! (-> self alt-cam-pos) (-> self control camera-pos)) (sound-play "jump" :vol 70) (case (-> self turret turret-type) (('turret) @@ -2295,7 +2296,7 @@ ) ) (send-event (handle->process arg0) 'change-mode) - (set! (-> self turret trans quad) (-> self control trans quad)) + (vector-copy! (-> self turret trans) (-> self control trans)) (set! (-> self turret turret) (the-as (pointer process) #f)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *empty-mods*) @@ -2319,7 +2320,7 @@ (rot->dir-targ! (-> self control)) (set! (-> self neck flex-blend) 0.0) (send-event (handle->process (-> self turret handle)) 'player-pos (-> self turret trans)) - (set! (-> self control unknown-vector40 quad) (-> self control quat quad)) + (set! (-> self control unknown-quat40 quad) (-> self control quat quad)) (case (-> self turret turret-type) (('turret 'scorpion) (target-turret-get-off-play) @@ -2328,8 +2329,8 @@ (target-for-turret-get-off-play) ) (else - (set! (-> self control trans quad) (-> self control unknown-vector38 quad)) - (quaternion-copy! (-> self control quat-for-control) (the-as quaternion (-> self control unknown-vector40))) + (vector-copy! (-> self control trans) (-> self control unknown-vector38)) + (quaternion-copy! (-> self control quat-for-control) (-> self control unknown-quat40)) (rot->dir-targ! (-> self control)) (logior! (-> self skel status) (joint-control-status sync-math)) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc index 379c58cc4e5..7bd1db52233 100644 --- a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc @@ -635,7 +635,7 @@ (-> *TARGET-bank* spin-offset) (+ 8192.0 (-> *TARGET-bank* spin-radius)) ) - (set! (-> self control root-prim local-sphere quad) (-> s4-0 local-sphere quad)) + (vector-copy! (-> self control root-prim local-sphere) (-> s4-0 local-sphere)) ) (('spin 'spin-air 'get-on) (sphere<-vector+r! @@ -1336,7 +1336,7 @@ (defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> arg2 quad)) + (vector-copy! s2-0 arg2) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) (let* ((s3-0 (-> this control c-R-w)) @@ -1450,7 +1450,7 @@ ;; INFO: Used lq/sq (defun find-collision-below ((arg0 vector) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 start-pos) arg1) (set-vector! (-> s5-0 move-dist) 0.0 (- arg2) 0.0 1.0) (let ((v1-2 s5-0)) (set! (-> v1-2 radius) 40.96) @@ -1463,7 +1463,7 @@ (set! (-> v1-2 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) - (set! (-> arg0 quad) (-> s5-0 best-other-tri intersect quad)) + (vector-copy! arg0 (-> s5-0 best-other-tri intersect)) #t ) ) @@ -1894,7 +1894,7 @@ ) (cond ((logtest? (attack-mask attacker-velocity) (-> this mask)) - (set! (-> arg0 attacker-velocity quad) (-> this attacker-velocity quad)) + (vector-copy! (-> arg0 attacker-velocity) (-> this attacker-velocity)) (vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0) ) (v1-0 @@ -1902,13 +1902,13 @@ (s5-0 (vector-! (-> arg0 trans) (-> v1-0 root trans) (-> s5-0 root trans)) (vector-normalize! (-> arg0 trans) 1.0) - (set! (-> arg0 attacker-velocity quad) (-> arg0 trans quad)) + (vector-copy! (-> arg0 attacker-velocity) (-> arg0 trans)) ) (else (vector-z-quaternion! (-> arg0 trans) (-> v1-0 root quat)) (vector-negate-in-place! (-> arg0 trans)) (vector-normalize! (-> arg0 trans) 1.0) - (set! (-> arg0 attacker-velocity quad) (-> arg0 trans quad)) + (vector-copy! (-> arg0 attacker-velocity) (-> arg0 trans)) ) ) ) @@ -1919,8 +1919,8 @@ ) ) (if s5-0 - (set! (-> arg0 intersection quad) (-> s5-0 root trans quad)) - (set! (-> arg0 intersection quad) (-> (target-pos 0) quad)) + (vector-copy! (-> arg0 intersection) (-> s5-0 root trans)) + (vector-copy! (-> arg0 intersection) (target-pos 0)) ) ) (.lvf vf1 (&-> (-> arg0 trans) quad)) @@ -1932,7 +1932,7 @@ (.mov v1-14 vf1) (cond ((!= v1-14 0.0) - (set! (-> arg0 vector quad) (-> arg0 trans quad)) + (vector-copy! (-> arg0 vector) (-> arg0 trans)) (set! (-> arg0 vector y) 0.0) (vector-xz-normalize! (-> arg0 vector) 1.0) ) @@ -2027,10 +2027,10 @@ (set! (-> this rotate-to) (-> arg0 rotate-to)) ) (if (logtest? s4-0 (attack-mask intersection)) - (set! (-> this intersection quad) (-> arg0 intersection quad)) + (vector-copy! (-> this intersection) (-> arg0 intersection)) ) (if (logtest? (attack-mask attacker-velocity) s4-0) - (set! (-> this attacker-velocity quad) (-> arg0 attacker-velocity quad)) + (vector-copy! (-> this attacker-velocity) (-> arg0 attacker-velocity)) ) (cond ((not (logtest? s4-0 (attack-mask vector))) @@ -2041,7 +2041,7 @@ ) ) (when (and v1-65 (nonzero? (-> v1-65 root))) - (set! (-> this trans quad) (-> v1-65 root trans quad)) + (vector-copy! (-> this trans) (-> v1-65 root trans)) (vector-! (-> this vector) (-> arg1 root trans) (-> v1-65 root trans)) (logior! (-> this mask) (attack-mask vector)) ) @@ -2055,10 +2055,10 @@ ) ) (if (and v1-72 (nonzero? (-> v1-72 root))) - (set! (-> this trans quad) (-> v1-72 root trans quad)) + (vector-copy! (-> this trans) (-> v1-72 root trans)) ) ) - (set! (-> this vector quad) (-> arg0 vector quad)) + (vector-copy! (-> this vector) (-> arg0 vector)) (when (not (logtest? s4-0 (attack-mask shove-back))) (let ((v1-79 (-> this vector))) (set! (-> this shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z))))) @@ -2073,7 +2073,7 @@ (set! (-> this dist) (fabs (-> this shove-back))) ) (if (logtest? s4-0 (attack-mask trans)) - (set! (-> this trans quad) (-> arg0 trans quad)) + (vector-copy! (-> this trans) (-> arg0 trans)) ) ) this @@ -2212,7 +2212,7 @@ ) ((logtest? (-> gp-0 target-flags) (target-flags tf14)) (let ((s5-0 (new 'static 'vector))) - (set! (-> s5-0 quad) (-> gp-0 control camera-pos quad)) + (vector-copy! s5-0 (-> gp-0 control camera-pos)) (set! (-> s5-0 y) (fmax (-> s5-0 y) (-> gp-0 alt-cam-pos y))) (add-debug-sphere *display-camera-marks* @@ -2266,7 +2266,7 @@ (not (logtest? (focus-status mech) (-> this focus-status))) ) (set! v0-0 (new 'static 'vector :w 1.0)) - (set! (-> v0-0 quad) (-> this control trans quad)) + (vector-copy! v0-0 (-> this control trans)) (set! (-> v0-0 y) (-> this water height)) v0-0 ) @@ -2286,7 +2286,7 @@ (cond ((logtest? (-> this draw status) (draw-control-status no-draw no-draw-temp)) (set! v0-0 (new 'static 'vector)) - (set! (-> v0-0 quad) (-> v1-0 trans quad)) + (vector-copy! v0-0 (-> v1-0 trans)) (vector+float*! v0-0 v0-0 (-> this control local-normal) 8192.0) ) (else @@ -2394,6 +2394,7 @@ ;; definition for method 25 of type target ;; WARN: Return type mismatch float vs meters. (defmethod get-water-height ((this target)) + "Get the height of the water that we're in." (the-as meters (if (logtest? (-> this water flags) (water-flag active)) (-> this water surface-height) (-> this control trans y) @@ -2557,7 +2558,7 @@ (lambda :behavior target () (target-update-segs self) - (set! (-> self control trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad)) + (vector-copy! (-> self control trans) (-> (the-as process-drawable (-> self parent 0)) root trans)) (quaternion-copy! (-> self control quat) (-> (the-as process-drawable (-> self parent 0)) root quat)) (none) ) diff --git a/test/decompiler/reference/jak3/engine/target/target2_REF.gc b/test/decompiler/reference/jak3/engine/target/target2_REF.gc index 127463c4db8..dbea1f53d7e 100644 --- a/test/decompiler/reference/jak3/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target2_REF.gc @@ -298,7 +298,7 @@ (vector+float*! s5-1 s5-1 (-> gp-0 uvec) -4096.0) (vector+! (-> self gun fire-point) (camera-pos) s5-1) ) - (set! (-> self gun fire-dir-out quad) (-> gp-0 fvec quad)) + (vector-copy! (-> self gun fire-dir-out) (-> gp-0 fvec)) ) (set! (-> self gun track?) (gun-track-flags gutflags-1 gutflags-2)) (target-gun-check) @@ -684,7 +684,7 @@ (set! (-> self control mod-surface) *pole-mods*) (logior! (-> self focus-status) (focus-status pole)) (target-collide-set! 'pole 0.0) - (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control transv)) (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) (set! (-> self control did-move-to-pole-or-max-jump-height) (the-as float #f)) @@ -919,7 +919,7 @@ (set-time! (-> self control edge-grab-start-time)) (logior! (-> self control root-prim prim-core action) (collide-action dont-push-away)) (logior! (-> self focus-status) (focus-status edge-grab)) - (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control transv)) (set! (-> self control transv quad) (the-as uint128 0)) (send-event *camera* 'ease-in) (if (!= (-> self skel top-anim interp) 0.0) @@ -1700,7 +1700,7 @@ (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) (set! sv-32 (current-time)) (let ((v1-2 (new-stack-vector0))) - (set! (-> v1-2 quad) (-> arg0 quad)) + (vector-copy! v1-2 arg0) (set! sv-40 v1-2) ) (set! sv-44 #t) @@ -1809,7 +1809,7 @@ ) :enter (behavior ((arg0 handle)) (set! (-> self control anim-handle) arg0) - (set! (-> self control unknown-vector37 quad) (-> self control trans quad)) + (vector-copy! (-> self control unknown-vector37) (-> self control trans)) (set! (-> self control unknown-word04) (the-as uint #t)) (quaternion-copy! (the-as quaternion (-> self control unknown-vector38)) (-> self control quat)) (logior! (-> self focus-status) (focus-status grabbed)) @@ -1920,7 +1920,7 @@ (cond ((cpad-hold? (-> self control cpad number) r2) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self control trans quad)) + (vector-copy! a1-0 (-> self control trans)) (let ((v1-14 (new-stack-vector0)) (f0-1 (vector-dot (-> self control dynam gravity-normal) a1-0)) ) @@ -1942,7 +1942,7 @@ ) ((cpad-hold? (-> self control cpad number) l2) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self control trans quad)) + (vector-copy! a1-1 (-> self control trans)) (let ((v1-29 (new-stack-vector0)) (f0-5 (vector-dot (-> self control dynam gravity-normal) a1-1)) ) diff --git a/test/decompiler/reference/jak3/engine/target/target_REF.gc b/test/decompiler/reference/jak3/engine/target/target_REF.gc index 78447ce9a78..35e258e424d 100644 --- a/test/decompiler/reference/jak3/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target_REF.gc @@ -304,9 +304,10 @@ (go target-running-attack) ) (when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3))) - (set! (-> self control transv quad) - (-> self control transv-history (-> self control idx-of-fastest-xz-vel) quad) - ) + (vector-copy! + (-> self control transv) + (-> self control transv-history (-> self control idx-of-fastest-xz-vel)) + ) (set! (-> self control transv w) 1.0) (go target-turn-around) ) @@ -727,7 +728,7 @@ ) ) (let ((v0-2 (-> self control unknown-vector37))) - (set! (-> v0-2 quad) (-> self control trans quad)) + (vector-copy! v0-2 (-> self control trans)) v0-2 ) ) @@ -790,7 +791,7 @@ (cond (v1-57 (set! v0-1 (-> self control anim-collide-offset-local)) - (set! (-> v0-1 quad) (-> v1-57 quad)) + (vector-copy! v0-1 v1-57) ) (else (set! v0-1 (-> self control anim-collide-offset-local)) @@ -1200,7 +1201,7 @@ (a1-3 (-> self control unknown-dword08)) (a2-3 (-> self control unknown-vector37)) ) - (set! (-> a2-3 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (vector-copy! a2-3 (the-as vector (-> self control unknown-dword09))) (go target-launch (the-as float a0-7) (the-as symbol a1-3) a2-3 (-> self control unknown-dword10)) ) ) @@ -1474,7 +1475,7 @@ (a1-1 (-> self control unknown-dword08)) (a2-0 (-> self control unknown-vector37)) ) - (set! (-> a2-0 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (vector-copy! a2-0 (the-as vector (-> self control unknown-dword09))) (go target-launch (the-as float a0-21) (the-as symbol a1-1) a2-0 (-> self control unknown-dword10)) ) ) @@ -1595,7 +1596,7 @@ (a1-1 (-> self control unknown-dword08)) (a2-1 (-> self control unknown-vector37)) ) - (set! (-> a2-1 quad) (-> (the-as vector (-> self control unknown-dword09)) quad)) + (vector-copy! a2-1 (the-as vector (-> self control unknown-dword09))) (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-1 (-> self control unknown-dword10)) ) ) @@ -2847,11 +2848,11 @@ (when (= (-> s5-3 best-other-tri pat mode) (pat-mode wall)) (cond ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s5-3 best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s5-3 best-other-tri intersect)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s5-3 best-other-tri intersect quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s5-3 best-other-tri intersect)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) ) ) @@ -3075,7 +3076,7 @@ ) ) (set! (-> self control dynam gravity-length) 122880.0) - (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) + (vector-copy! (-> self control last-trans-any-surf) (-> self control trans)) ) :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) @@ -3595,7 +3596,7 @@ (target-danger-set! 'harmless #f) (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (vector-copy! (-> self control dynam gravity) (-> self control standard-dynamics gravity)) (set! (-> self neck flex-blend) 1.0) ) :trans (behavior () @@ -3699,7 +3700,7 @@ ) ) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (set! (-> self control dynam gravity quad) (-> self control standard-dynamics gravity quad)) + (vector-copy! (-> self control dynam gravity) (-> self control standard-dynamics gravity)) (target-danger-set! 'flop-down #f) (let ((v1-56 (get-channel (-> self skel top-anim) 0))) (if (and v1-56 (= (-> v1-56 frame-group) jakb-gun-flop-down-ja)) diff --git a/test/decompiler/reference/jak3/engine/ui/bigmap_REF.gc b/test/decompiler/reference/jak3/engine/ui/bigmap_REF.gc index adf868f6998..8dcc3fe0cfc 100644 --- a/test/decompiler/reference/jak3/engine/ui/bigmap_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/bigmap_REF.gc @@ -263,7 +263,7 @@ ) ) (if (and v1-4 (nonzero? (-> v1-4 root))) - (set! (-> arg1 last-world-pos quad) (-> v1-4 root trans quad)) + (vector-copy! (-> arg1 last-world-pos) (-> v1-4 root trans)) ) ) ) @@ -281,13 +281,13 @@ ) ) (if a0-13 - (set! (-> arg1 last-world-pos quad) (-> a0-13 root trans quad)) - (set! (-> arg1 last-world-pos quad) (-> (the-as entity-actor (-> arg1 position)) extra trans quad)) + (vector-copy! (-> arg1 last-world-pos) (-> a0-13 root trans)) + (vector-copy! (-> arg1 last-world-pos) (-> (the-as entity-actor (-> arg1 position)) extra trans)) ) ) ) (else - (set! (-> arg1 last-world-pos quad) (-> arg1 position quad)) + (vector-copy! (-> arg1 last-world-pos) (-> arg1 position)) ) ) (let ((f30-0 (-> arg1 class scale)) @@ -808,7 +808,7 @@ ) ) ) - (if (and (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (and (= (level-status? *level* 'ctywide #f) 'active) (not (or (= (-> s5-0 name) 'mhcitya) (= (-> s5-0 name) 'mhcityb))) ) (set! (-> this bigmap-index) (-> ctyport bigmap-id)) @@ -855,7 +855,7 @@ ;; WARN: Return type mismatch bigmap-flag vs none. (defmethod enable-drawing ((this bigmap)) (set-map-indices! this) - (set! (-> this offset quad) (-> *bigmap-info-array* data (-> this load-index) quad)) + (vector-copy! (-> this offset) (-> *bigmap-info-array* data (-> this load-index))) (let ((s4-0 (target-pos 0)) (s5-0 (-> this offset)) ) @@ -896,16 +896,16 @@ (set! (-> this drawing-flag) #t) (set! (-> this loading-flag) #f) (set! (-> this global-flags) (bigmap-flag)) - (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (= (level-status? *level* 'ctywide #f) 'active) (logior! (-> this global-flags) (bigmap-flag ctywide)) ) - (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (if (= (level-status? *level* 'waswide #f) 'active) (logior! (-> this global-flags) (bigmap-flag wasall)) ) - (if (= (status-of-level-and-borrows *level* 'wasall #f) 'active) + (if (= (level-status? *level* 'wasall #f) 'active) (logior! (-> this global-flags) (bigmap-flag waswide)) ) - (if (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (if (= (level-status? *level* 'desert #f) 'active) (logior! (-> this global-flags) (bigmap-flag desert)) ) (none) diff --git a/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc index b21e27dd5bf..0b771722f78 100644 --- a/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/minimap_REF.gc @@ -1837,7 +1837,7 @@ (vector-reset! (-> s5-0 1)) (let ((s1-0 0)) (while (>= (-> arg1 node-count) s1-0) - (set! (-> s5-0 0 quad) (-> s5-0 1 quad)) + (vector-copy! (-> s5-0 0) (-> s5-0 1)) (cond ((< s1-0 (-> arg1 node-count)) (trail-graph-method-20 *trail-graph* (-> arg1 node-id s1-0) (-> s5-0 1)) @@ -2015,7 +2015,7 @@ (when s3-0 (when (not (logtest? (-> s3-0 flags) (minimap-flag active))) (set! (-> s3-0 class) s2-1) - (set! (-> s3-0 last-world-pos quad) (-> s2-1 default-position quad)) + (vector-copy! (-> s3-0 last-world-pos) (-> s2-1 default-position)) (vector-! (-> s3-0 last-relative-pos) (target-pos 0) (-> s3-0 last-world-pos)) (set! (-> s3-0 edge-ry) -131072) ) @@ -2210,7 +2210,7 @@ ) ) (set! (-> this last-name) (-> s4-0 s3-0 tex-name)) - (set! (-> this minimap-corner quad) (-> s4-0 s3-0 corner quad)) + (vector-copy! (-> this minimap-corner) (-> s4-0 s3-0 corner)) (set! (-> this meters-per-texel) (-> s4-0 s3-0 meters-per-texel)) (set! (-> this pos-scale) (-> s4-0 s3-0 pos-scale)) (set! (-> this level) s5-0) @@ -2242,7 +2242,7 @@ (let ((a0-23 (-> *minimap-texture-name-array* data (+ (* 5 s4-1) s5-1)))) (when a0-23 (set! (-> this last-name) a0-23) - (set! (-> this minimap-corner quad) (-> *minimap-corner-array* data (+ (* 5 s4-1) s5-1) quad)) + (vector-copy! (-> this minimap-corner) (-> *minimap-corner-array* data (+ (* 5 s4-1) s5-1))) (dotimes (v1-69 (-> *level* length)) (let ((a0-34 (-> *level* level v1-69))) (when (= (-> a0-34 status) 'active) @@ -2377,7 +2377,7 @@ (set! sv-220 (new 'stack-no-clear 'vector)) (set! sv-224 (new 'stack-no-clear 'matrix)) (set! sv-228 (new 'stack-no-clear 'matrix)) - (set! (-> sv-216 quad) (-> (matrix-world->local #f #f) fvec quad)) + (vector-copy! sv-216 (-> (matrix-world->local #f #f) fvec)) (set! (-> sv-216 y) 0.0) (vector-normalize! sv-216 1.0) (vector-z-quaternion! sv-220 (-> (the-as process-drawable sv-16) root quat)) @@ -2667,7 +2667,7 @@ (set! sv-228 (new 'stack-no-clear 'matrix)) (set! sv-232 (new 'stack-no-clear 'matrix)) (when sv-212 - (set! (-> sv-220 quad) (-> (matrix-world->local #f #f) fvec quad)) + (vector-copy! sv-220 (-> (matrix-world->local #f #f) fvec)) (set! (-> sv-220 y) 0.0) (vector-normalize! sv-220 1.0) (vector-z-quaternion! sv-224 (-> (the-as process-drawable sv-16) root quat)) @@ -2839,7 +2839,7 @@ (set! sv-228 (new 'stack-no-clear 'matrix)) (set! sv-232 (new 'stack-no-clear 'matrix)) (when sv-212 - (set! (-> sv-220 quad) (-> (matrix-world->local #f #f) fvec quad)) + (vector-copy! sv-220 (-> (matrix-world->local #f #f) fvec)) (set! (-> sv-220 y) 0.0) (vector-normalize! sv-220 1.0) (vector-z-quaternion! sv-224 (-> (the-as process-drawable sv-16) root quat)) @@ -3000,7 +3000,7 @@ (set! (-> (the-as (pointer uint128) s3-1) 1) (-> this draw2-tmpl quad 1)) (let ((s2-0 (new-stack-vector0))) (let ((s1-0 (new-stack-vector0))) - (set! (-> s1-0 quad) (-> (matrix-local->world #f #f) fvec quad)) + (vector-copy! s1-0 (-> (matrix-local->world #f #f) fvec)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) (let ((v1-16 (-> arg0 mat))) @@ -3299,7 +3299,7 @@ (set! sv-48 (new-stack-vector0)) (set! sv-52 (new-stack-vector0)) (set! sv-56 (target-pos 0)) - (set! (-> sv-52 quad) (-> (matrix-world->local #f #f) fvec quad)) + (vector-copy! sv-52 (-> (matrix-world->local #f #f) fvec)) (set! (-> sv-52 y) 0.0) (vector-normalize! sv-52 1.0) (cond @@ -3353,7 +3353,7 @@ ) ) (when (and v1-4 (nonzero? (-> (the-as process-drawable v1-4) root))) - (set! (-> arg1 last-world-pos quad) (-> (the-as process-drawable v1-4) root trans quad)) + (vector-copy! (-> arg1 last-world-pos) (-> (the-as process-drawable v1-4) root trans)) (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) ) ) @@ -3373,18 +3373,18 @@ ) (cond (a0-16 - (set! (-> arg1 last-world-pos quad) (-> (the-as process-drawable a0-16) root trans quad)) + (vector-copy! (-> arg1 last-world-pos) (-> (the-as process-drawable a0-16) root trans)) (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) ) (else - (set! (-> arg1 last-world-pos quad) (-> (the-as entity-actor (-> arg1 position)) extra trans quad)) + (vector-copy! (-> arg1 last-world-pos) (-> (the-as entity-actor (-> arg1 position)) extra trans)) (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) ) ) ) ) (else - (set! (-> arg1 last-world-pos quad) (-> arg1 position quad)) + (vector-copy! (-> arg1 last-world-pos) (-> arg1 position)) (vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos)) ) ) @@ -3394,7 +3394,7 @@ 1.0 0.0 (let ((f30-0 (/ 1.0 (* (-> this icon-inv-scale) (-> this meters-per-texel))))) - (set! (-> s3-2 quad) (-> arg1 last-relative-pos quad)) + (vector-copy! s3-2 (-> arg1 last-relative-pos)) (set! (-> s3-2 x) (* (-> s3-2 x) f30-0)) (set! (-> s3-2 z) (* (-> s3-2 z) f30-0)) (set! (-> s3-2 y) 0.0) @@ -3439,7 +3439,7 @@ ) ((< 50.0 f28-0) (let ((s0-0 (new 'stack-no-clear 'vector))) - (set! (-> s0-0 quad) (-> s3-2 quad)) + (vector-copy! s0-0 s3-2) (let ((s1-1 (get-icon-draw-pos *minimap* arg1 a2-2 s1-0 f30-0 s3-2))) (if (not s1-1) (vector-normalize-copy! s3-2 s0-0 50.0) @@ -3489,7 +3489,7 @@ (cond ((< 50.0 f28-0) (let ((a1-22 (new 'stack-no-clear 'vector))) - (set! (-> a1-22 quad) (-> s3-2 quad)) + (vector-copy! a1-22 s3-2) (vector-normalize-copy! s3-2 a1-22 54.0) ) (let ((f30-2 (atan (-> s3-2 x) (-> s3-2 z)))) @@ -3618,16 +3618,16 @@ (set! (-> gp-0 draw-pos quad) (-> arg1 quad)) (set! (-> gp-0 justify-right) arg2) (set! (-> gp-0 global-flags) (the-as uint 0)) - (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (= (level-status? *level* 'ctywide #f) 'active) (logior! (-> gp-0 global-flags) #x40000) ) - (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (if (= (level-status? *level* 'waswide #f) 'active) (logior! (-> gp-0 global-flags) #x100000) ) - (if (= (status-of-level-and-borrows *level* 'wasall #f) 'active) + (if (= (level-status? *level* 'wasall #f) 'active) (logior! (-> gp-0 global-flags) #x80000) ) - (if (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (if (= (level-status? *level* 'desert #f) 'active) (logior! (-> gp-0 global-flags) #x200000) ) (sub-draw-1-1 this gp-0) @@ -3960,24 +3960,16 @@ (let ((gp-0 (-> this flags))) (when (and (logtest? (minimap-flag local-only) gp-0) (not (logtest? (minimap-flag transport) gp-0))) (cond - ((and (logtest? (minimap-flag ctywide) gp-0) - (!= (status-of-level-and-borrows *level* 'ctywide 'ignore-borrow) 'active) - ) + ((and (logtest? (minimap-flag ctywide) gp-0) (!= (level-status? *level* 'ctywide 'ignore-borrow) 'active)) (return #f) ) - ((and (logtest? (minimap-flag wasall) gp-0) - (!= (status-of-level-and-borrows *level* 'wasall 'ignore-borrow) 'active) - ) + ((and (logtest? (minimap-flag wasall) gp-0) (!= (level-status? *level* 'wasall 'ignore-borrow) 'active)) (return #f) ) - ((and (logtest? (minimap-flag waswide) gp-0) - (!= (status-of-level-and-borrows *level* 'waswide 'ignore-borrow) 'active) - ) + ((and (logtest? (minimap-flag waswide) gp-0) (!= (level-status? *level* 'waswide 'ignore-borrow) 'active)) (return #f) ) - ((and (logtest? (minimap-flag desert) gp-0) - (!= (status-of-level-and-borrows *level* 'desert 'ignore-borrow) 'active) - ) + ((and (logtest? (minimap-flag desert) gp-0) (!= (level-status? *level* 'desert 'ignore-borrow) 'active)) (return #f) ) ) diff --git a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc index 31b30899fa5..b696d5a192a 100644 --- a/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak3/engine/ui/progress/progress_REF.gc @@ -345,10 +345,10 @@ (set! (-> self joint-idx) arg0) (set! (-> self init-angle) arg1) (set! (-> self graphic-index) arg2) - (set! (-> self root trans quad) (-> self parent 0 root trans quad)) + (vector-copy! (-> self root trans) (-> self parent 0 root trans)) (quaternion-copy! (-> self root quat) (-> self parent 0 root quat)) (quaternion-normalize! (-> self root quat)) - (set! (-> self root scale quad) (-> self parent 0 root scale quad)) + (vector-copy! (-> self root scale) (-> self parent 0 root scale)) (let ((gp-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* (-> self init-angle)))) (quaternion-normalize! gp-1) (quaternion*! (-> self root quat) (-> self root quat) gp-1) @@ -1371,7 +1371,7 @@ ) ) ) - (set! (-> s5-0 quad) (-> (the-as vector gp-1) quad)) + (vector-copy! s5-0 (the-as vector gp-1)) (with-dma-buffer-add-bucket ((v1-12 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id hud-draw-hud-alpha) ) @@ -1492,25 +1492,21 @@ (let ((s3-0 (-> self current-options y-center)) (s5-0 (-> self current-options y-space)) ) - (let ((s2-0 (new 'stack-no-clear 'matrix))) - (set! (-> s2-0 rvec quad) (the-as uint128 0)) - (set! (-> s2-0 uvec quad) (the-as uint128 0)) - (set! (-> s2-0 fvec quad) (the-as uint128 0)) - (set! (-> s2-0 trans quad) (the-as uint128 0)) - (let ((s4-0 *progress-work*)) - (mem-copy! (the-as pointer s2-0) (the-as pointer *font-default-matrix*) 64) - (set! sv-208 (new 'stack 'font-context s2-0 0 0 0.0 (font-color default) (font-flags shadow kerning))) - (set! sv-212 (- s3-0 (/ (* s5-0 (length gp-0)) 2))) - (set! sv-216 (new 'stack-no-clear 'hud-box)) - (set! sv-220 (and (!= (-> self current) 'main) (or (= (-> self next) 'none) (> (-> self state-pos) 0)))) - (progress-method-33 self (-> s4-0 small-screen)) - (when sv-220 - (begin-scan sv-216 self) - (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> self menu-transition)))))) - (when (not (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) - (progress-method-43 self (-> s4-0 small-screen) (* 144.0 f30-0)) - (progress-method-41 self (-> s4-0 small-screen) (* 128.0 f30-0)) - ) + (let ((s2-0 (new-stack-matrix0)) + (s4-0 *progress-work*) + ) + (mem-copy! (the-as pointer s2-0) (the-as pointer *font-default-matrix*) 64) + (set! sv-208 (new 'stack 'font-context s2-0 0 0 0.0 (font-color default) (font-flags shadow kerning))) + (set! sv-212 (- s3-0 (/ (* s5-0 (length gp-0)) 2))) + (set! sv-216 (new 'stack-no-clear 'hud-box)) + (set! sv-220 (and (!= (-> self current) 'main) (or (= (-> self next) 'none) (> (-> self state-pos) 0)))) + (progress-method-33 self (-> s4-0 small-screen)) + (when sv-220 + (begin-scan sv-216 self) + (let ((f30-0 (fmax 0.0 (* 2.0 (- 0.5 (-> self menu-transition)))))) + (when (not (or (= (-> self current) 'bigmap) (= (-> self next) 'bigmap))) + (progress-method-43 self (-> s4-0 small-screen) (* 144.0 f30-0)) + (progress-method-41 self (-> s4-0 small-screen) (* 128.0 f30-0)) ) ) ) @@ -2895,7 +2891,7 @@ (cond ((and (or (demo?) (kiosk?)) (or (= (-> arg0 current) 'select-kiosk-start) (= (-> arg0 current) 'select-kiosk-start-special)) - (= (status-of-level-and-borrows *level* 'title #f) 'active) + (= (level-status? *level* 'title #f) 'active) ) (send-event (handle->process (-> *game-info* controller 0)) 'control-spec (get-play-list-idx s5-1)) (set-master-mode 'game) @@ -4146,7 +4142,7 @@ (suspend-for (seconds 2.5) ) (while (or (not (handle-command-list *gui-control* (gui-channel alert) (the-as gui-connection #f))) - (= (status-of-level-and-borrows *level* 'title #f) 'active) + (= (level-status? *level* 'title #f) 'active) ) (suspend) ) diff --git a/test/decompiler/reference/jak3/engine/util/sync-info_REF.gc b/test/decompiler/reference/jak3/engine/util/sync-info_REF.gc index 860494ae18a..9eb672d17e1 100644 --- a/test/decompiler/reference/jak3/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/util/sync-info_REF.gc @@ -572,8 +572,8 @@ (defmethod set-params! ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> this value quad) (-> arg0 quad)) - (set! (-> this target quad) (-> arg0 quad)) + (vector-copy! (-> this value) arg0) + (vector-copy! (-> this target) arg0) ) (else (vector-reset! (-> this value)) diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc index 11086a74c67..9f6abf6fc75 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs2_REF.gc @@ -68,6 +68,7 @@ ;; definition for method 11 of type bt-roboguard (defmethod init-from-entity! ((this bt-roboguard) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (with-pp (set! (-> pp level) (level-get *level* 'lblowtmh)) (bt-roboguard-method-44 this) @@ -82,7 +83,7 @@ (defbehavior bt-roboguard-init-by-other bt-roboguard ((arg0 vector)) (set! (-> self level) (level-get *level* 'lblowtmh)) (bt-roboguard-method-44 self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (init self) (go-virtual idle) @@ -126,11 +127,11 @@ (defmethod on-death ((this bt-roboguard)) (cond ((logtest? (-> *part-group-id-table* 1460 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) @@ -341,7 +342,7 @@ (when (time-elapsed? (-> self state-time) (seconds 0.3)) (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) - (set! (-> gp-0 start-pos quad) (-> self focus-pos quad)) + (vector-copy! (-> gp-0 start-pos) (-> self focus-pos)) (vector-! (-> gp-0 move-dist) (get-trans self 3) (-> self focus-pos)) (let ((v1-13 gp-0)) (set! (-> v1-13 radius) 409.6) @@ -473,7 +474,7 @@ (let ((v1-3 (joint-node bt-roboguard-lod0-jg chest)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (vector-copy! gp-0 (-> v1-3 bone transform fvec)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) (set! (-> gp-0 y) 0.0) (set! (-> s5-1 y) 0.0) @@ -636,8 +637,8 @@ (set! (-> gp-0 vehicle-impulse-factor) 4.0) (logior! (-> gp-0 options) (projectile-options po16)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -650,7 +651,7 @@ (defbehavior bt-roboguard-fire-backcheck bt-roboguard ((arg0 bt-roboguard) (arg1 vector) (arg2 vector)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 1.0))) - (set! (-> gp-0 start-pos quad) (-> (get-trans arg0 3) quad)) + (vector-copy! (-> gp-0 start-pos) (get-trans arg0 3)) (vector-! (-> gp-0 move-dist) arg1 (-> gp-0 start-pos)) (vector+float*! (-> gp-0 move-dist) (-> gp-0 move-dist) s5-0 8192.0) ) @@ -679,7 +680,7 @@ (v1-3 (-> this node-list data 4)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> v1-3 bone transform fvec quad)) + (vector-copy! s4-0 (-> v1-3 bone transform fvec)) (set! (-> s4-0 y) 0.0) (let ((f0-1 (vector-vector-xz-distance s5-0 (-> this focus-pos)))) (vector-normalize! s4-0 f0-1) @@ -831,7 +832,7 @@ ;; INFO: Used lq/sq (defmethod bt-mh-flyer-method-51 ((this bt-mh-flyer)) (let ((f30-0 0.3)) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> this bob-vec quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> this bob-vec)) (set! (-> this xz-dir x) (-> this bobbers 0 current-speed)) (set! (-> this xz-dir z) (/ (-> this bobbers 2 current-speed) 4)) (let ((f26-0 (lerp-scale 0.0 10922.667 (-> this xz-dir z) f30-0 1.0)) @@ -1147,7 +1148,7 @@ (defbehavior bt-grunt-init-by-other bt-grunt ((arg0 tower-enemy-init-params)) (set! (-> self level) (level-get *level* 'lblowtmh)) (bt-grunt-method-46 self) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (set! (-> self target) (-> arg0 target)) (quaternion-identity! (-> self root quat)) (set! (-> self jump-time-offset) (-> arg0 time-offset)) @@ -1161,6 +1162,7 @@ ;; definition for method 11 of type bt-grunt (defmethod init-from-entity! ((this bt-grunt) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (with-pp (set! (-> pp level) (level-get *level* 'lblowtmh)) (bt-grunt-method-46 this) @@ -1244,7 +1246,7 @@ (set! (-> this breathe-sound) (new-sound-id)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1459) this)) (let ((v0-8 (-> this start-pos))) - (set! (-> v0-8 quad) (-> this root trans quad)) + (vector-copy! v0-8 (-> this root trans)) v0-8 ) ) @@ -1254,7 +1256,7 @@ ;; WARN: Return type mismatch matrix vs none. (defmethod blow-tower-enemy-method-36 ((this bt-grunt)) (process-entity-status! this (entity-perm-status no-kill) #t) - (set! (-> this root trans quad) (-> this start-pos quad)) + (vector-copy! (-> this root trans) (-> this start-pos)) (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) (set! (-> this hit-points) 5.0) (set! (-> this rider-index) -1) @@ -1359,10 +1361,10 @@ (the-as int (- (-> self jump-cursor current-time) (the-as time-frame s3-0))) ) ) - (set! (-> self jump-cursor pos quad) (-> s4-1 pos quad)) + (vector-copy! (-> self jump-cursor pos) (-> s4-1 pos)) ) (let ((s4-2 (new 'stack-no-clear 'vector))) - (set! (-> s4-2 quad) (-> self jump-cursor pos quad)) + (vector-copy! s4-2 (-> self jump-cursor pos)) (let ((f28-0 (-> s4-2 y))) (set! (-> s4-2 y) (+ f28-0 (the-as float (send-event (handle->process (-> self target)) 'predict-height)))) ) @@ -1598,7 +1600,7 @@ ;; definition for method 49 of type bt-grunt ;; INFO: Used lq/sq (defmethod calculate-jump-trajectory ((this bt-grunt)) - (set! (-> this jump-start-pos quad) (-> this root trans quad)) + (vector-copy! (-> this jump-start-pos) (-> this root trans)) (quaternion-copy! (-> this jump-start-quat) (-> this root quat)) (let ((f30-0 (-> this jump-cursor pos y))) (set! (-> this jump-cursor pos y) @@ -1606,7 +1608,7 @@ ) ) (quaternion-look-at! (-> this jump-end-quat) (-> this jump-cursor norm) *up-vector*) - (set! (-> this jump-end-pos quad) (-> this jump-cursor pos quad)) + (vector-copy! (-> this jump-end-pos) (-> this jump-cursor pos)) (send-event (handle->process (-> this target)) 'rider-predict-transform @@ -1990,7 +1992,7 @@ ;; INFO: Used lq/sq (defmethod bt-grunt-method-54 ((this bt-grunt) (arg0 vector)) (let ((v1-2 (-> this node-list data 0 bone transform))) - (set! (-> arg0 quad) (-> this root trans quad)) + (vector-copy! arg0 (-> this root trans)) (vector+float*! arg0 arg0 (-> v1-2 uvec) 5324.8) (vector+float*! arg0 arg0 (-> v1-2 fvec) 4915.2) ) @@ -2180,7 +2182,7 @@ (cond ((send-event (handle->process (-> this target)) 'get-rider-transform (-> this rider-index) s4-0 s5-0) (set-vector! (-> this root scale) 1.1 1.1 1.1 1.0) - (set! (-> this root trans quad) (-> s4-0 quad)) + (vector-copy! (-> this root trans) s4-0) (quaternion-copy! (-> this root quat) s5-0) ) (else @@ -2252,7 +2254,7 @@ ) ) (let ((a0-39 (-> this last-attack-dir))) - (set! (-> a0-39 quad) (-> this last-attack-dir quad)) + (vector-copy! a0-39 (-> this last-attack-dir)) (set! (-> a0-39 y) 0.0) (vector-normalize! a0-39 1.0) ) @@ -2279,7 +2281,7 @@ :virtual #t :enter (behavior () (call-parent-state-handler enter) - (set! (-> self root trans quad) (-> self start-pos quad)) + (vector-copy! (-> self root trans) (-> self start-pos)) (set! (-> self entity extra vis-dist) 819200.0) ) :exit (behavior () @@ -2420,7 +2422,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (set! (-> self target) (-> arg0 target)) (set! (-> self chase-start-time) (-> arg0 activate-time)) (set! (-> self dumb-fire?) (-> arg0 bool-userdata?)) @@ -2440,14 +2442,14 @@ (let ((gp-1 (new 'stack 'blow-tower-path-cursor))) (when (send-event (handle->process (-> self target)) 'predict-position gp-1 (-> self root trans)) (blow-tower-path-cursor-method-9 gp-1 (the-as int (-> self chase-end-time))) - (set! (-> self dumb-dest quad) (-> gp-1 pos quad)) + (vector-copy! (-> self dumb-dest) (-> gp-1 pos)) (+! (-> self dumb-dest y) 8192.0) (let ((f30-1 (-> self dumb-dest y))) (set! (-> self dumb-dest y) (+ f30-1 (the-as float (send-event (handle->process (-> self target)) 'predict-height))) ) ) - (set! (-> self dumb-start quad) (-> self root trans quad)) + (vector-copy! (-> self dumb-start) (-> self root trans)) ) ) ) @@ -2632,7 +2634,7 @@ (set! (-> s5-3 root trans y) (-> this base-y)) ) (process-xform-list s5-3 s5-3 (the-as (inline-array xform) (-> this bob-xform)) 1) - (set! (-> this root trans quad) (-> s5-3 root trans quad)) + (vector-copy! (-> this root trans) (-> s5-3 root trans)) (let ((s3-3 (new 'stack-no-clear 'vector))) (set! (-> s3-3 x) (-> this bobbers 0 current-speed)) (set! (-> s3-3 y) (-> this bobbers 1 current-speed)) @@ -2685,11 +2687,11 @@ (let ((v1-3 (get-trans self 3))) (cond ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-3 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-3) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 218)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-3 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-3) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 218)) ) ) @@ -2770,7 +2772,7 @@ (vector-float*! s4-0 (-> this root transv) (seconds-per-frame)) (ragdoll-proc-method-15 (the-as ragdoll-proc s5-1) #f (the-as vector #f) #t) (ragdoll-method-23 (-> (the-as ragdoll-proc s5-1) ragdoll) (-> this root trans) s4-0 1.0 #t) - (set! (-> (the-as ragdoll-proc s5-1) ragdoll ragdoll-joints 0 velocity quad) (-> s4-0 quad)) + (vector-copy! (-> (the-as ragdoll-proc s5-1) ragdoll ragdoll-joints 0 velocity) s4-0) ) ) ) @@ -2878,7 +2880,7 @@ ) ) (set! (-> this main-joint-movement 0 quad) (-> a0-2 quad)) - (set! (-> this main-joint-movement 1 quad) (-> v1-1 quad)) + (vector-copy! (-> this main-joint-movement 1) v1-1) ) (let ((s4-0 (-> this main-joint-movement 1)) (s5-0 (-> this main-joint-movement 2)) @@ -2899,7 +2901,7 @@ 0.75 (quaternion-rotate-local-z! sv-208 a1-3 sv-192) (quaternion->matrix s5-0 sv-208) - (set! (-> s2-1 quad) (-> arg0 root scale quad)) + (vector-copy! s2-1 (-> arg0 root scale)) (scale-matrix! s5-0 s2-1 s5-0) (let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat))) (t9-6 vector-inv-orient-by-quat!) @@ -2943,7 +2945,7 @@ ) ) ) - (set! (-> s5-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 trans) s4-0) (spawn-from-mat (-> arg0 engine-part) s5-0) (lerp-scale 0.75 1.0 f28-0 1638.4 f30-0) ) @@ -2977,11 +2979,11 @@ (logior! (-> this focus-status) (focus-status dead)) (cond ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 218)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 218)) ) ) @@ -3045,6 +3047,7 @@ ;; definition for method 59 of type kg-bombbot (defmethod enemy-common-post ((this kg-bombbot)) + "Common implementation of post. Runs ja-post." (if (< (seconds 20) (- (-> *blow-tower-targets* mission-time) (-> this start-time))) (go empty-state) ) @@ -3054,6 +3057,7 @@ ;; definition for method 121 of type kg-bombbot (defmethod init-enemy! ((this kg-bombbot)) + "Typical place for shared init code. Runs from entity or process style init." (with-pp (set! (-> pp level) (level-get *level* 'lblowtkg)) (set! (-> this start-time) (-> *blow-tower-targets* mission-time)) @@ -3129,8 +3133,8 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-orient-by-quat! s3-0 (-> s4-0 pos-offset) (-> this root quat)) (vector+! s3-0 s3-0 (-> this root trans)) - (set! (-> s4-0 next-position quad) (-> s3-0 quad)) - (set! (-> s4-0 position quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 next-position) s3-0) + (vector-copy! (-> s4-0 position) s3-0) ) (set! (-> s4-0 delta-y) 0.0) ) @@ -3165,7 +3169,7 @@ ) (cond (s5-0 - (set! (-> this target-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-copy! (-> this target-pos) (get-trans s5-0 3)) (let ((v1-9 (-> this target-pos))) (let ((a0-9 (-> s5-0 root trans))) (let ((a1-5 (-> s5-0 root transv))) @@ -3181,9 +3185,9 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-9 quad) vf6) ) - (set! (-> this start-target-pos quad) (-> this target-pos quad)) - (set! (-> this start-target-vel quad) (-> s5-0 root transv quad)) - (try-update-focus (-> this focus) s5-0 this) + (vector-copy! (-> this start-target-pos) (-> this target-pos)) + (vector-copy! (-> this start-target-vel) (-> s5-0 root transv)) + (focus-on! (-> this focus) s5-0 this) ) (else (clear-focused (-> this focus)) diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc index 737e8e9d762..b4b1048bf17 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/blow-tower-obs_REF.gc @@ -126,7 +126,7 @@ ;; definition for method 33 of type blow-tower-enemy (defmethod init ((this blow-tower-enemy)) (set! (-> this hit-points) 5.0) - (if (!= (status-of-level-and-borrows *level* 'lctyblow #f) 'active) + (if (!= (level-status? *level* 'lctyblow #f) 'active) (go empty-state) ) ) @@ -185,11 +185,11 @@ (logior! (-> this focus-status) (focus-status dead)) (cond ((logtest? (-> *part-group-id-table* 1457 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (get-trans this 3) quad)) + (vector-copy! (-> *launch-matrix* trans) (get-trans this 3)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) ) @@ -215,8 +215,8 @@ (let ((f30-0 (get-damage-from-attack this s4-0 (the-as process-focusable arg0)))) (let ((s3-0 (new 'stack-no-clear 'attack-info))) (attack-info-method-9 s4-0 s3-0 (the-as process-drawable arg0) this) - (set! (-> this last-attack-dir quad) (-> s3-0 trans quad)) - (set! (-> this last-attack-pos quad) (-> s3-0 intersection quad)) + (vector-copy! (-> this last-attack-dir) (-> s3-0 trans)) + (vector-copy! (-> this last-attack-pos) (-> s3-0 intersection)) ) (set! (-> this hit-points) (- (-> this hit-points) f30-0)) (if (>= 0.0 (-> this hit-points)) @@ -429,8 +429,8 @@ (defmethod tower-flyer-method-46 ((this tower-flyer)) (cond ((-> this entity-pos) - (set! (-> this basetrans quad) (-> this entity-pos quad)) - (set! (-> this root trans quad) (-> this entity-pos quad)) + (vector-copy! (-> this basetrans) (-> this entity-pos)) + (vector-copy! (-> this root trans) (-> this entity-pos)) (let* ((s4-0 (handle->process (-> this focus))) (s5-0 (if (type? s4-0 process-focusable) (the-as process-focusable s4-0) @@ -439,9 +439,7 @@ ) (when s5-0 (let ((a0-9 (new 'stack-no-clear 'vector))) - (set! (-> a0-9 quad) - (-> (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root trans) (-> this root trans)) quad) - ) + (vector-copy! a0-9 (vector-! (new 'stack-no-clear 'vector) (-> s5-0 root trans) (-> this root trans))) (set! (-> a0-9 y) 0.0) (let ((a1-5 (vector-normalize! a0-9 1.0))) (vector-! (-> this local-offset) (-> this basetrans) (-> s5-0 root trans)) @@ -457,19 +455,19 @@ (let ((s3-0 (new 'stack-no-clear 'quaternion))) (set! (-> s5-1 path) (the-as blow-tower-path (send-event (handle->process (-> this focus)) 'get-path))) (blow-tower-path-cursor-method-9 s5-1 (the-as int (-> this spawn-path-time))) - (set! (-> s4-1 quad) (-> s5-1 pos quad)) + (vector-copy! s4-1 (-> s5-1 pos)) (let ((s2-0 quaternion-look-at!) (s1-0 s3-0) (a0-22 (-> s5-1 norm)) ) - (set! (-> a0-22 quad) (-> s5-1 norm quad)) + (vector-copy! a0-22 (-> s5-1 norm)) (set! (-> a0-22 y) 0.0) (s2-0 s1-0 (vector-normalize! a0-22 1.0) *up-vector*) ) (send-event (handle->process (-> this focus)) 'retrieve-spot (-> this surround-spot) s4-1 s3-0) (let ((s2-1 (new 'stack-no-clear 'collide-query))) (let ((v1-33 (vector-z-quaternion! (new 'stack-no-clear 'vector) s3-0))) - (set! (-> s2-1 start-pos quad) (-> s4-1 quad)) + (vector-copy! (-> s2-1 start-pos) s4-1) (vector-float*! (-> s2-1 move-dist) v1-33 61440.0) ) (let ((v1-34 s2-1)) @@ -490,9 +488,9 @@ (vector+! s4-1 s4-1 (-> s2-1 move-dist)) ) ) - (set! (-> this basetrans quad) (-> s4-1 quad)) + (vector-copy! (-> this basetrans) s4-1) ) - (set! (-> this root trans quad) (-> this basetrans quad)) + (vector-copy! (-> this root trans) (-> this basetrans)) (let* ((s4-2 (handle->process (-> this focus))) (a1-20 (if (type? s4-2 process-focusable) (the-as process-focusable s4-2) @@ -723,7 +721,7 @@ ;; INFO: Used lq/sq (defun tower-fly-quick-raycast ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (let ((s4-0 (new 'stack 'collide-query))) - (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 start-pos) arg0) (vector-! (-> s4-0 move-dist) arg1 arg0) (let ((v1-3 s4-0)) (set! (-> v1-3 radius) arg3) @@ -738,11 +736,11 @@ (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) (cond ((!= f0-1 -100000000.0) - (set! (-> arg2 quad) (-> s4-0 best-other-tri intersect quad)) + (vector-copy! arg2 (-> s4-0 best-other-tri intersect)) (vector+float*! arg2 arg0 (-> s4-0 move-dist) f0-1) ) (else - (set! (-> arg2 quad) (-> arg1 quad)) + (vector-copy! arg2 arg1) ) ) f0-1 @@ -779,11 +777,11 @@ (s3-0 (new 'stack-no-clear 'vector)) (f30-0 (-> pp clock frames-per-second)) ) - (set! (-> s1-0 quad) (-> arg2 quad)) + (vector-copy! s1-0 arg2) (compute-tower-flyer-lerp-point this s3-0 arg0 s1-0 (* f30-0 (seconds-per-frame))) (set! *current-color* *color-red*) (when (= (tower-fly-quick-raycast (-> this basetrans) s3-0 (new 'stack-no-clear 'vector) 8192.0) -100000000.0) - (set! (-> arg2 quad) (-> s1-0 quad)) + (vector-copy! arg2 s1-0) (return #t) ) (let ((s2-0 (new 'stack-no-clear 'vector)) @@ -794,7 +792,7 @@ (compute-tower-flyer-lerp-point this s3-1 arg0 s2-0 (* f30-0 (seconds-per-frame))) (set! *current-color* *color-blue*) (when (= (tower-fly-quick-raycast s3-1 (-> this basetrans) (new 'stack-no-clear 'vector) 0.0) -100000000.0) - (set! (-> arg2 quad) (-> s2-0 quad)) + (vector-copy! arg2 s2-0) (return #t) ) (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) arg0 s2-0))) @@ -832,7 +830,7 @@ ) (set! *current-color* *color-white*) (when (= (tower-fly-quick-raycast (-> this basetrans) s3-1 (new 'stack-no-clear 'vector) 2048.0) -100000000.0) - (set! (-> arg2 quad) (-> s2-1 quad)) + (vector-copy! arg2 s2-1) (return #t) ) ) @@ -884,7 +882,7 @@ (set! sv-608 (new 'stack-no-clear 'collide-query)) (set! sv-612 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg1)) (set! sv-616 #t) - (set! (-> sv-608 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-608 start-pos) arg0) (vector-float*! (-> sv-608 move-dist) sv-612 (+ 16384.0 (-> this desired-z-dist))) (let ((v1-7 sv-608)) (set! (-> v1-7 radius) 4096.0) @@ -908,7 +906,7 @@ (f28-0 (vector-dot v1-15 sv-612)) ) (vector+float*! s4-0 arg0 sv-612 f28-0) - (set! (-> a1-5 start-pos quad) (-> this basetrans quad)) + (vector-copy! (-> a1-5 start-pos) (-> this basetrans)) (vector-! (-> a1-5 move-dist) s4-0 (-> a1-5 start-pos)) (let ((v1-21 a1-5)) (set! (-> v1-21 radius) 40.96) @@ -990,7 +988,7 @@ ) ) ) - (set! (-> this basetrans quad) (-> s4-0 quad)) + (vector-copy! (-> this basetrans) s4-0) ) (tower-flyer-method-48 this arg0) ) @@ -1124,7 +1122,7 @@ ;; INFO: Used lq/sq (defbehavior flyer-projectile-init-by-other flyer-projectile ((arg0 flyer-projectile-params) (arg1 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (mem-copy! (the-as pointer (-> self params)) (the-as pointer arg0) 20) (let ((gp-1 (new 'stack-no-clear 'vector))) (send-event (handle->process (-> self params target)) 'get-attack-pos gp-1) @@ -1351,7 +1349,7 @@ ) ) (if a0-4 - (set! (-> self track-pos quad) (-> (get-trans a0-4 2) quad)) + (vector-copy! (-> self track-pos) (get-trans a0-4 2)) ) ) (target-set! (-> self neck) (-> self track-pos)) @@ -1412,7 +1410,7 @@ ;; INFO: Used lq/sq (defbehavior bt-barrel-init-by-other bt-barrel ((arg0 vector)) (init self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (go-virtual idle) ) @@ -1469,9 +1467,10 @@ (when a0-8 (when (and (= (-> a0-8 type) bt-barrel) (< (-> this num-nearby-barrels) 16) (!= a0-8 this)) (set! (-> this nearby-barrels (-> this num-nearby-barrels)) (process->handle a0-8)) - (set! (-> this nearby-barrel-pos (-> this num-nearby-barrels) quad) - (-> (get-trans (the-as process-focusable a0-8) 3) quad) - ) + (vector-copy! + (-> this nearby-barrel-pos (-> this num-nearby-barrels)) + (get-trans (the-as process-focusable a0-8) 3) + ) (set! (-> this nearby-barrel-dist (-> this num-nearby-barrels)) (vector-vector-distance (-> this nearby-barrel-pos (-> this num-nearby-barrels)) (get-trans this 3)) ) @@ -1494,7 +1493,7 @@ (when (and s4-1 (< (vector-vector-distance (get-trans s4-1 0) s5-0) (-> s5-0 r))) (when (and (= (-> s4-1 type) bt-barrel) (< (-> this num-nearby-barrels) 16) (!= s4-1 this)) (set! (-> this nearby-barrels (-> this num-nearby-barrels)) (process->handle s4-1)) - (set! (-> this nearby-barrel-pos (-> this num-nearby-barrels) quad) (-> (get-trans s4-1 3) quad)) + (vector-copy! (-> this nearby-barrel-pos (-> this num-nearby-barrels)) (get-trans s4-1 3)) (set! (-> this nearby-barrel-dist (-> this num-nearby-barrels)) (vector-vector-distance (-> this nearby-barrel-pos (-> this num-nearby-barrels)) (get-trans this 3)) ) @@ -1725,11 +1724,11 @@ (count-nearby-barrels self) (cond ((logtest? (-> *part-group-id-table* 1460 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) @@ -1757,7 +1756,7 @@ (set-vector! (-> self draw color-mult) 0.2 0.2 0.2 0.0) (set-vector! (-> self draw color-emissive) 0.0 0.0 0.0 0.0) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (math-camera-matrix) rvec quad)) + (vector-copy! gp-0 (-> (math-camera-matrix) rvec)) (let* ((s5-0 vector-rotate-around-y!) (s4-0 gp-0) (s3-0 gp-0) @@ -1833,12 +1832,12 @@ ) :trans (behavior () (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) - (set! (-> a1-1 trans quad) (-> self root trans quad)) + (vector-copy! (-> a1-1 trans) (-> self root trans)) (spawn-from-mat (-> self part) a1-1) ) (set! (-> self root transv y) (- (-> self root transv y) (* 368640.0 (seconds-per-frame)))) (let ((gp-0 (new 'stack-no-clear 'collide-query))) - (set! (-> gp-0 start-pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> self root trans)) (vector-float*! (-> gp-0 move-dist) (-> self root transv) (seconds-per-frame)) (when (< (-> self root transv y) 40960.0) (let ((v1-14 gp-0)) @@ -1856,11 +1855,11 @@ (vector+float*! (-> self root trans) (-> self root trans) (-> gp-0 move-dist) f0-5) (cond ((logtest? (-> *part-group-id-table* 1457 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) ) @@ -1875,11 +1874,11 @@ (set! (-> self root trans y) 0.0) (cond ((logtest? (-> *part-group-id-table* 1457 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1457)) ) ) @@ -1967,7 +1966,7 @@ (the-as pair 0) ) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (go-virtual idle) ) @@ -2005,17 +2004,17 @@ (local-vars (sv-48 vector) (sv-52 vector) (sv-80 vector) (sv-84 float) (sv-112 process) (sv-128 vector)) (set! sv-48 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> self root trans quad)) + (vector-copy! v1-1 (-> self root trans)) (set! sv-52 v1-1) ) (let ((a0-5 sv-48)) - (set! (-> a0-5 quad) (-> sv-48 quad)) + (vector-copy! a0-5 sv-48) (set! (-> a0-5 y) 0.0) (vector-normalize! a0-5 1.0) ) (dotimes (s2-0 arg0) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> sv-52 quad)) + (vector-copy! v1-4 sv-52) (set! sv-80 v1-4) ) (let* ((f30-0 (- (/ arg2 2))) @@ -2066,6 +2065,7 @@ ;; definition for method 11 of type bt-barrel-stack (defmethod init-from-entity! ((this bt-barrel-stack) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (initialize-skeleton this @@ -2193,11 +2193,11 @@ (('die) (cond ((logtest? (-> *part-group-id-table* 1460 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1460)) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc b/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc index 20f8b425894..039757c0bfe 100644 --- a/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/blow-tower/cty-blow-tower_REF.gc @@ -622,7 +622,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-params ((this bt-vehicle)) - (set! (-> this path-pos quad) (-> this root trans quad)) + (vector-copy! (-> this path-pos) (-> this root trans)) (quaternion-identity! (-> this barrel-roll-quat)) (set! (-> this root penetrated-by) (penetrate)) (set! (-> this mission-fail?) #f) @@ -681,7 +681,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod bt-vehicle-method-35 ((this bt-vehicle) (arg0 int) (arg1 vector) (arg2 quaternion)) - (set! (-> arg1 quad) (-> this root trans quad)) + (vector-copy! arg1 (-> this root trans)) (quaternion-copy! arg2 (-> this root quat)) (bt-vehicle-method-36 this arg0 arg1 arg2) 0 @@ -728,11 +728,11 @@ (sound-play "snd-ship-explod") (cond ((logtest? (-> *part-group-id-table* 296 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 296)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 296)) ) ) @@ -777,7 +777,7 @@ (set! sv-100 (the-as float 0.0)) (let ((s2-0 (new 'stack-no-clear 'attack-info))) (attack-info-method-9 arg1 s2-0 arg2 this) - (set! (-> sv-64 quad) (-> s2-0 intersection quad)) + (vector-copy! sv-64 (-> s2-0 intersection)) ) (let ((a0-6 (if (type? arg2 process-focusable) arg2 @@ -785,13 +785,13 @@ ) ) (if a0-6 - (set! (-> sv-64 quad) (-> (get-trans a0-6 3) quad)) + (vector-copy! sv-64 (get-trans a0-6 3)) ) ) (vector-! sv-72 sv-64 sv-68) (set! (-> sv-72 y) 0.0) (let ((a0-8 sv-96)) - (set! (-> a0-8 quad) (-> sv-96 quad)) + (vector-copy! a0-8 sv-96) (set! (-> a0-8 y) 0.0) (vector-normalize! a0-8 1.0) ) @@ -1073,7 +1073,7 @@ ;; INFO: Used lq/sq (defmethod update-barrel-pos ((this bt-pickup) (arg0 vector) (arg1 vector) (arg2 quaternion)) (let ((v1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))) - (set! (-> arg0 quad) (-> this root trans quad)) + (vector-copy! arg0 (-> this root trans)) (vector+float*! arg0 arg0 (-> v1-1 uvec) 819.2) (vector+float*! arg0 arg0 (-> v1-1 rvec) 4096.0) (cond @@ -1410,11 +1410,11 @@ (sound-play "snd-hellcat-hit") (cond ((logtest? (-> *part-group-id-table* 1458 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> arg1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> arg1 intersection)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> arg1 intersection)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) ) @@ -1446,14 +1446,14 @@ ) (vector-z-quaternion! sv-48 sv-68) (let ((a0-8 sv-48)) - (set! (-> a0-8 quad) (-> sv-48 quad)) + (vector-copy! a0-8 sv-48) (set! (-> a0-8 y) 0.0) (vector-normalize! a0-8 1.0) ) (dotimes (s2-0 12) (when (= (-> this spots s2-0 rider-index) arg0) (let ((a0-9 (new 'stack-no-clear 'vector))) - (set! (-> a0-9 quad) (-> this spots s2-0 offset-dir quad)) + (vector-copy! a0-9 (-> this spots s2-0 offset-dir)) (set! (-> a0-9 y) 0.0) (let ((v1-18 (vector-normalize! a0-9 1.0))) 0.0 @@ -1462,7 +1462,7 @@ (set! sv-64 f0-5) (set! sv-56 s2-0) (if arg3 - (set! (-> arg3 quad) (-> v1-18 quad)) + (vector-copy! arg3 v1-18) ) ) ) @@ -1471,7 +1471,7 @@ ) ) (if arg2 - (set! (-> arg2 quad) (-> sv-48 quad)) + (vector-copy! arg2 sv-48) ) sv-56 ) @@ -1580,7 +1580,7 @@ ) (vector-z-quaternion! sv-240 sv-224) (let ((a0-14 sv-240)) - (set! (-> a0-14 quad) (-> sv-240 quad)) + (vector-copy! a0-14 sv-240) (set! (-> a0-14 y) 0.0) (vector-normalize! a0-14 1.0) ) @@ -1660,7 +1660,7 @@ (stack-size-set! (-> self main-thread) 256) (set! (-> self parent-vehicle) (the-as handle arg0)) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self root trans) (target-pos 0)) (quaternion-identity! (-> self root quat)) (matrix-identity! (-> self last-parent-xform)) (set! (-> self params) *bt-turret-params*) @@ -1719,7 +1719,7 @@ ) (('trans 'player-pos) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> this root trans quad)) + (vector-copy! v1-1 (-> this root trans)) (set! v0-0 (-> arg3 param 0)) (set! (-> (the-as vector v0-0) quad) (-> v1-1 quad)) ) @@ -1865,7 +1865,7 @@ :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 @@ -2473,7 +2473,7 @@ (vector-float*! (new 'stack-no-clear 'vector) (-> (camera-matrix) fvec) 1.0) sv-80 ) - (set! (-> this aim-pos quad) (-> sv-92 quad)) + (vector-copy! (-> this aim-pos) sv-92) (vector-! (-> this aim-dir) sv-92 (-> this root trans)) (vector-normalize! (-> this aim-dir) 1.0) (quaternion-look-at! (-> this root quat) (-> this aim-dir) *up-vector*) @@ -2499,7 +2499,7 @@ (not (logtest? (-> (the-as process-focusable a0-37) focus-status) (focus-status disable dead ignore inactive)) ) ) - (set! (-> this look-cursor pos quad) (-> (get-trans (the-as process-focusable a0-37) 3) quad)) + (vector-copy! (-> this look-cursor pos) (get-trans (the-as process-focusable a0-37) 3)) ) (else (set! (-> this look-mode) (the-as uint 0)) @@ -2509,7 +2509,7 @@ ) ) (else - (set! (-> this look-cursor pos quad) (-> v1-64 extra trans quad)) + (vector-copy! (-> this look-cursor pos) (-> v1-64 extra trans)) ) ) ) @@ -2526,7 +2526,7 @@ (not (logtest? (-> (the-as process-focusable a0-43) focus-status) (focus-status disable dead ignore inactive)) ) ) - (set! (-> this look-cursor pos quad) (-> (get-trans (the-as process-focusable a0-43) 3) quad)) + (vector-copy! (-> this look-cursor pos) (get-trans (the-as process-focusable a0-43) 3)) ) ) ) @@ -2539,12 +2539,12 @@ (cond ((zero? (-> this look-mode)) (let ((a0-47 s2-2)) - (set! (-> a0-47 quad) (-> s2-2 quad)) + (vector-copy! a0-47 s2-2) (set! (-> a0-47 y) 0.0) (vector-normalize! a0-47 1.0) ) (let ((a0-48 s4-12)) - (set! (-> a0-48 quad) (-> s4-12 quad)) + (vector-copy! a0-48 s4-12) (set! (-> a0-48 y) 0.0) (vector-normalize! a0-48 1.0) ) @@ -2565,14 +2565,14 @@ (when (handle->process (-> s1-0 grunt-rider-boarded?)) (let ((s2-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s1-0 root quat)))) (let ((a0-59 s2-3)) - (set! (-> a0-59 quad) (-> s2-3 quad)) + (vector-copy! a0-59 s2-3) (set! (-> a0-59 y) 0.0) (vector-normalize! a0-59 1.0) ) (vector-rotate-around-y! s2-3 s2-3 (-> s1-0 land-grunt-offset)) (let ((f0-33 (vector-dot s4-12 s2-3))) (when (< 0.2 f0-33) - (set! (-> s4-12 quad) (-> s2-3 quad)) + (vector-copy! s4-12 s2-3) (set! f30-0 6.0) ) ) @@ -2610,7 +2610,7 @@ ;; INFO: Used lq/sq (defbehavior bt-hellcat-init-by-other bt-hellcat ((arg0 bt-obj-init-params)) (init-collision! self) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (initialize-skeleton self @@ -2627,7 +2627,7 @@ ;; definition for method 46 of type bt-hellcat ;; INFO: Used lq/sq (defmethod bt-hellcat-method-46 ((this bt-hellcat) (arg0 vector) (arg1 quaternion)) - (set! (-> arg0 quad) (-> this root trans quad)) + (vector-copy! arg0 (-> this root trans)) (quaternion-copy! arg1 (-> this root quat)) (vector<-cspace! arg0 (-> this node-list data 5)) (vector+float*! arg0 arg0 (-> this node-list data 5 bone transform uvec) 8192.0) @@ -2990,7 +2990,7 @@ ) ) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> (get-trans (the-as process-focusable sv-32) 3) quad)) + (vector-copy! s3-1 (get-trans (the-as process-focusable sv-32) 3)) (set! sv-80 s3-1) ) (set! sv-84 (new 'stack-no-clear 'vector)) @@ -3023,7 +3023,7 @@ (set! sv-136 (vector-vector-distance sv-132 sv-128)) (set! sv-136 (- sv-136 sv-224)) (let ((a1-11 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-11 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> a1-11 start-pos) (-> this root trans)) (vector-! (-> a1-11 move-dist) sv-80 (-> a1-11 start-pos)) (let ((v1-57 a1-11)) (set! (-> v1-57 radius) 40.96) @@ -3039,7 +3039,7 @@ (when (< sv-136 sv-16) (set! sv-20 sv-32) (set! sv-16 sv-136) - (set! (-> this hit-pos quad) (-> sv-80 quad)) + (vector-copy! (-> this hit-pos) sv-80) (set! sv-24 (-> this num-onscreen-targets)) ) (transform-point-qword! (-> sv-228 transformed-pos) sv-80) @@ -3083,7 +3083,7 @@ ) ) (let ((s3-10 (new 'stack-no-clear 'vector))) - (set! (-> s3-10 quad) (-> (get-trans (the-as process-focusable sv-784) 3) quad)) + (vector-copy! s3-10 (get-trans (the-as process-focusable sv-784) 3)) (set! sv-832 s3-10) ) (set! sv-836 (new 'stack-no-clear 'vector)) @@ -3116,7 +3116,7 @@ (set! sv-888 (vector-vector-distance sv-884 sv-880)) (set! sv-888 (- sv-888 sv-976)) (let ((a1-25 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-25 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> a1-25 start-pos) (-> this root trans)) (vector-! (-> a1-25 move-dist) sv-832 (-> a1-25 start-pos)) (let ((v1-133 a1-25)) (set! (-> v1-133 radius) 40.96) @@ -3132,7 +3132,7 @@ (when (< sv-888 sv-16) (set! sv-20 sv-784) (set! sv-16 sv-888) - (set! (-> this hit-pos quad) (-> sv-832 quad)) + (vector-copy! (-> this hit-pos) sv-832) (set! sv-24 (-> this num-onscreen-targets)) ) (transform-point-qword! (-> sv-980 transformed-pos) sv-832) @@ -3175,7 +3175,7 @@ ) ) (let ((s3-19 (new 'stack-no-clear 'vector))) - (set! (-> s3-19 quad) (-> (get-trans (the-as process-focusable sv-1536) 3) quad)) + (vector-copy! s3-19 (get-trans (the-as process-focusable sv-1536) 3)) (set! sv-1584 s3-19) ) (set! sv-1588 (new 'stack-no-clear 'vector)) @@ -3208,7 +3208,7 @@ (set! sv-1640 (vector-vector-distance sv-1636 sv-1632)) (set! sv-1640 (- sv-1640 sv-1728)) (let ((a1-39 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-39 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> a1-39 start-pos) (-> this root trans)) (vector-! (-> a1-39 move-dist) sv-1584 (-> a1-39 start-pos)) (let ((v1-208 a1-39)) (set! (-> v1-208 radius) 40.96) @@ -3224,7 +3224,7 @@ (when (< sv-1640 sv-16) (set! sv-20 sv-1536) (set! sv-16 sv-1640) - (set! (-> this hit-pos quad) (-> sv-1584 quad)) + (vector-copy! (-> this hit-pos) sv-1584) (set! sv-24 (-> this num-onscreen-targets)) ) (transform-point-qword! (-> sv-1732 transformed-pos) sv-1584) @@ -3285,7 +3285,7 @@ (set-time! (-> this last-fire-time)) (new 'stack 'projectile-init-by-other-params) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (new 'stack-no-clear 'vector) 491520.0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)) @@ -3302,7 +3302,7 @@ ) (sound-play "hc-gun-fire" :position (-> this root trans)) (let ((s4-2 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-2 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-2 start-pos) (-> this root trans)) (vector-! (-> s4-2 move-dist) (-> this hit-pos) (-> s4-2 start-pos)) (let ((v1-35 s4-2)) (set! (-> v1-35 radius) 1228.8) @@ -3321,27 +3321,25 @@ (sound-play "hellcat-riccos" :position s3-2) (cond ((logtest? (-> *part-group-id-table* 1461 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector+! - (new 'stack-no-clear 'vector) - s3-2 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-2 move-dist) -4096.0) - ) - quad - ) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector+! + (new 'stack-no-clear 'vector) + s3-2 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-2 move-dist) -4096.0) + ) + ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1461)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector+! - (new 'stack-no-clear 'vector) - s3-2 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-2 move-dist) -4096.0) - ) - quad - ) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector+! + (new 'stack-no-clear 'vector) + s3-2 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-2 move-dist) -4096.0) + ) + ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1461)) ) ) @@ -3411,7 +3409,7 @@ (cubic-curve-method-10 arg0 (-> s4-0 uvec) 0.0) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s4-0 uvec) (the-as rgba arg1)) (dotimes (s2-0 s3-0) - (set! (-> s4-0 rvec quad) (-> s4-0 uvec quad)) + (vector-copy! (-> s4-0 rvec) (-> s4-0 uvec)) (let ((f0-2 (/ (+ 1.0 (the float s2-0)) (the float s3-0)))) (cubic-curve-method-10 arg0 (-> s4-0 uvec) f0-2) ) @@ -3453,13 +3451,13 @@ (vector-lerp! (-> this path-pos) (-> this path-pos) (-> this path-cursor pos) f0-9) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> this pre-bounce-pos quad)) + (vector-copy! s2-0 (-> this pre-bounce-pos)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (set! (-> this pre-bounce-pos quad) (-> this path-pos quad)) + (vector-copy! (-> this pre-bounce-pos) (-> this path-pos)) (bt-vehicle-method-40 this (the-as int (-> s5-0 elapsed-clock-time))) (+! (-> this pre-bounce-pos y) (-> this path-height-offset)) (vector-! s4-0 s2-0 (-> this pre-bounce-pos)) @@ -3486,7 +3484,7 @@ (-> this root trans) ) ) - (set! (-> this last-vel quad) (-> s4-0 quad)) + (vector-copy! (-> this last-vel) s4-0) (set! (-> this last-speed) f30-0) ) ) @@ -3498,7 +3496,7 @@ (vector+! (-> this root trans) (-> this pre-bounce-pos) s4-1) ) (let ((v1-58 (new 'stack-no-clear 'vector))) - (set! (-> v1-58 quad) (-> this path-cursor norm quad)) + (vector-copy! v1-58 (-> this path-cursor norm)) (set! sv-256 v1-58) ) (set! sv-260 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) @@ -3609,7 +3607,7 @@ ) (vector-x-quaternion! s3-4 s5-3) (let ((a0-101 s3-4)) - (set! (-> a0-101 quad) (-> s3-4 quad)) + (vector-copy! a0-101 s3-4) (set! (-> a0-101 y) 0.0) (vector-normalize! a0-101 1.0) ) @@ -3648,7 +3646,7 @@ (defbehavior bt-pickup-init-by-other bt-pickup ((arg0 bt-obj-init-params)) (init-collision! self) (set-vector! (-> self root scale) 2.2 2.0 1.75 1.0) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (initialize-skeleton self @@ -3835,7 +3833,7 @@ (set! (-> s5-0 debug?) #f) (send-event (handle->process (-> this task-man)) 'get-clock s5-0) (blow-tower-path-cursor-method-9 (-> this path-cursor) (the-as int (-> s5-0 elapsed-clock-time))) - (set! (-> this root trans quad) (-> this path-cursor pos quad)) + (vector-copy! (-> this root trans) (-> this path-cursor pos)) (let ((f0-5 (* 4.0 (seconds-per-frame)))) (if (-> s5-0 debug?) (set! f0-5 1.0) @@ -3846,7 +3844,7 @@ ) (vector-lerp! (-> this path-pos) (-> this path-pos) (-> this path-cursor pos) f0-5) ) - (set! (-> this pre-bounce-pos quad) (-> this path-pos quad)) + (vector-copy! (-> this pre-bounce-pos) (-> this path-pos)) (bt-vehicle-method-40 this (the-as int (-> s5-0 elapsed-clock-time))) (+! (-> this pre-bounce-pos y) (-> this path-height-offset)) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -3856,7 +3854,7 @@ (vector+! (-> this root trans) (-> this pre-bounce-pos) s4-0) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this path-cursor norm quad)) + (vector-copy! s3-0 (-> this path-cursor norm)) (let ((s2-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (set! (-> s2-0 y) 0.0) (vector-normalize! s2-0 1.0) @@ -4261,7 +4259,7 @@ (set! (-> self event-cursor path) (-> *blow-tower-paths* 0)) (init-fields (-> self event-cursor)) (let ((s5-0 (new 'stack 'bt-obj-init-params))) - (set! (-> s5-0 pos quad) (-> *blow-tower-paths* 0 pts 0 quad)) + (vector-copy! (-> s5-0 pos) (-> *blow-tower-paths* 0 pts 0)) (quaternion-copy! (-> s5-0 quat) (quaternion-look-at! (new 'stack-no-clear 'quaternion) gp-1 *up-vector*)) (set! (-> s5-0 path) (-> *blow-tower-paths* 0)) (set! (-> s5-0 task-man) (process->handle self)) @@ -4275,7 +4273,7 @@ (vector-normalize! gp-4 1.0) (set! (-> *blow-tower-paths* 1 total-time) (the-as time-frame (the int (* 300.0 f30-0)))) (let ((s5-1 (new 'stack 'bt-obj-init-params))) - (set! (-> s5-1 pos quad) (-> *blow-tower-paths* 1 pts 0 quad)) + (vector-copy! (-> s5-1 pos) (-> *blow-tower-paths* 1 pts 0)) (quaternion-copy! (-> s5-1 quat) (quaternion-look-at! (new 'stack-no-clear 'quaternion) gp-4 *up-vector*)) (set! (-> s5-1 path) (-> *blow-tower-paths* 1)) (set! (-> s5-1 task-man) (process->handle self)) @@ -4331,7 +4329,7 @@ (((blow-tower-cmd-spawn-type kg-flyer) (blow-tower-cmd-spawn-type kg-flyer-ent)) (let ((s4-0 (new 'stack 'tower-enemy-init-params))) (set! (-> s4-0 target) (-> this target-handles (-> arg0 target))) - (set! (-> s4-0 pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s4-0 pos) (target-pos 0)) (set! (-> s4-0 entity-name) (-> arg0 entity-name)) (set! (-> s4-0 time-offset) (-> arg0 time-offset)) (if (= (-> s4-0 time-offset) 0.0) @@ -4349,7 +4347,7 @@ (((blow-tower-cmd-spawn-type mh-flyer) (blow-tower-cmd-spawn-type mh-flyer-ent)) (let ((s4-1 (new 'stack 'tower-enemy-init-params))) (set! (-> s4-1 target) (-> this target-handles (-> arg0 target))) - (set! (-> s4-1 pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s4-1 pos) (target-pos 0)) (set! (-> s4-1 entity-name) (-> arg0 entity-name)) (set! (-> s4-1 time-offset) (-> arg0 time-offset)) (if (= (-> s4-1 time-offset) 0.0) @@ -4367,7 +4365,7 @@ (((blow-tower-cmd-spawn-type missiles)) (let ((s4-2 (new 'stack 'tower-enemy-init-params))) (set! (-> s4-2 target) (-> this target-handles (-> arg0 target))) - (set! (-> s4-2 pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s4-2 pos) (target-pos 0)) (set! (-> s4-2 entity-name) "") (set! (-> s4-2 activate-time) (the-as @@ -4390,7 +4388,7 @@ (set! (-> s4-3 target) (-> this target-handles (-> arg0 target))) (let ((a0-30 (entity-by-name (-> arg0 entity-name)))) (if a0-30 - (set! (-> s4-3 pos quad) (-> a0-30 extra trans quad)) + (vector-copy! (-> s4-3 pos) (-> a0-30 extra trans)) ) ) (set! (-> s4-3 entity-name) "") @@ -4416,7 +4414,7 @@ ) ) (else - (set! (-> this missile-dir-vec quad) (-> s3-6 quad)) + (vector-copy! (-> this missile-dir-vec) s3-6) (set! (-> this last-missile-ent) (-> arg0 entity-name)) ) ) @@ -4436,7 +4434,7 @@ (if (> (-> arg0 event-id) 0) (set! v1-93 (find-event-id-index (-> this event-cursor) (the-as int (-> arg0 event-id)))) ) - (set! (-> s4-4 pos quad) (-> *blow-tower-paths* 0 pts v1-93 quad)) + (vector-copy! (-> s4-4 pos) (-> *blow-tower-paths* 0 pts v1-93)) ) (set! (-> s4-4 entity-name) "") (set! (-> s4-4 time-offset) (-> arg0 time-offset)) @@ -4454,14 +4452,14 @@ (set! (-> s1-0 path) (-> *blow-tower-paths* (-> arg0 target))) (cond (s0-0 - (set! (-> s2-2 quad) (-> s0-0 extra trans quad)) + (vector-copy! s2-2 (-> s0-0 extra trans)) ) (else (blow-tower-path-cursor-method-9 s1-0 (the-as int (+ (-> this mission-elapsed-clock) (the int (* 300.0 (-> arg0 time-offset))))) ) - (set! (-> s2-2 quad) (-> s1-0 pos quad)) + (vector-copy! s2-2 (-> s1-0 pos)) ) ) ) @@ -4469,15 +4467,15 @@ (((blow-tower-cmd-spawn-type kg-bombbot)) (let ((a0-79 (find-path-event-id-index (-> *blow-tower-paths* 0) (the-as int (-> arg0 event-id))))) (if (>= a0-79 0) - (set! (-> s3-7 quad) (-> *blow-tower-paths* (-> arg0 target) pts a0-79 quad)) - (set! (-> s3-7 quad) (-> s2-2 quad)) + (vector-copy! s3-7 (-> *blow-tower-paths* (-> arg0 target) pts a0-79)) + (vector-copy! s3-7 s2-2) ) ) ) (((blow-tower-cmd-spawn-type kg-bombbot-ent)) (let ((a0-87 (entity-by-name (-> arg0 entity-name2)))) (if a0-87 - (set! (-> s3-7 quad) (-> a0-87 extra trans quad)) + (vector-copy! s3-7 (-> a0-87 extra trans)) ) ) ) @@ -4928,16 +4926,16 @@ ) ) (if a0-11 - (set! (-> s2-1 intersection quad) (-> (get-trans a0-11 3) quad)) + (vector-copy! (-> s2-1 intersection) (get-trans a0-11 3)) ) ) (cond ((logtest? (-> *part-group-id-table* 1458 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s2-1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s2-1 intersection)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s2-1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s2-1 intersection)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) ) @@ -4948,11 +4946,11 @@ ) ) ((logtest? (-> *part-group-id-table* 1458 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> arg1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> arg1 intersection)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg1 intersection quad)) + (vector-copy! (-> *launch-matrix* trans) (-> arg1 intersection)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1458)) ) ) @@ -5007,7 +5005,7 @@ ;; definition for method 50 of type bt-pickup ;; INFO: Used lq/sq (defmethod bt-pickup-method-50 ((this bt-pickup) (arg0 int) (arg1 vector)) - (set! (-> arg1 quad) (-> this root trans quad)) + (vector-copy! arg1 (-> this root trans)) (let ((v1-2 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))) (vector+float*! arg1 arg1 (-> v1-2 fvec) -21708.8) (vector+float*! arg1 arg1 (-> v1-2 uvec) -2457.6) diff --git a/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc index 08cd6ac8255..9111851b6f9 100644 --- a/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/bombbot/bombbot_REF.gc @@ -402,7 +402,7 @@ (let ((s5-0 (-> this root))) (let ((a1-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 (-> s5-0 root-prim))) - (set! (-> a1-0 start-pos quad) (-> s5-0 trans quad)) + (vector-copy! (-> a1-0 start-pos) (-> s5-0 trans)) (let ((a0-2 (-> a1-0 move-dist))) (.lvf vf1 (&-> (-> s5-0 transv) quad)) (let ((f0-0 (seconds-per-frame))) @@ -429,7 +429,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) (vector-cross! s5-1 (-> this root transv) *y-vector*) (vector-normalize! s5-1 1.0) - (set! (-> this rot-axis quad) (-> s5-1 quad)) + (vector-copy! (-> this rot-axis) s5-1) ) (let ((s5-2 (new 'stack-no-clear 'quaternion))) (new 'stack-no-clear 'vector) @@ -557,19 +557,19 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s1-1 quad) vf6) ) - (set! (-> s5-0 src quad) (-> self root trans quad)) + (vector-copy! (-> s5-0 src) (-> self root trans)) (set! (-> s5-0 initial-tilt) (* 182.04445 (rand-vu-float-range 30.0 50.0))) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) (vector-! gp-1 (-> self root trans) (target-pos 0)) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) - (set! (-> s4-0 quad) (-> s5-0 initial-velocity quad)) + (vector-copy! s4-0 (-> s5-0 initial-velocity)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (cond ((< 0.7 (vector-dot gp-1 s4-0)) - (set! (-> self root transv quad) (-> s5-0 initial-velocity quad)) + (vector-copy! (-> self root transv) (-> s5-0 initial-velocity)) ) (else (let ((t9-10 vector-normalize!) @@ -579,7 +579,7 @@ (t9-10 a0-22 (sqrtf (+ (* (-> v1-20 x) (-> v1-20 x)) (* (-> v1-20 z) (-> v1-20 z))))) ) (set! (-> gp-1 y) (-> s5-0 initial-velocity y)) - (set! (-> self root transv quad) (-> gp-1 quad)) + (vector-copy! (-> self root transv) gp-1) ) ) (go-virtual back) @@ -616,7 +616,7 @@ (a0-5 (-> a0-3 root-prim prim-core)) ) 0.0 - (set! (-> a1-2 start-pos quad) (-> v1-4 world-sphere quad)) + (vector-copy! (-> a1-2 start-pos) (-> v1-4 world-sphere)) (vector-! (-> a1-2 move-dist) (the-as vector a0-5) (the-as vector v1-4)) ) (let ((v1-5 a1-2)) @@ -719,7 +719,7 @@ 0 (sound-play "grenade-explode") (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 12288.0) (set! (-> gp-1 scale) 1.0) @@ -740,7 +740,7 @@ (cond ((not (time-elapsed? (-> self state-time) (seconds 2))) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (+! (-> a1-0 y) 2048.0) (spawn (-> self explode-part) a1-0) ) @@ -896,7 +896,7 @@ (set! (-> s4-0 event-self) 'touched) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot-bomb" (the-as (pointer level) #f))) @@ -904,7 +904,7 @@ ) (set-vector! (-> self root scale) 0.5 0.5 0.5 1.0) (quaternion-set! (-> self root quat) 0.0 0.0 0.0 1.0) - (set! (-> self root transv quad) (-> arg1 quad)) + (vector-copy! (-> self root transv) arg1) (set! (-> self draw light-index) (the-as uint 10)) (set! (-> self root dynam gravity y) 184320.0) (set! (-> self root dynam gravity-length) 184320.0) @@ -912,7 +912,7 @@ (let ((s5-2 (new 'stack-no-clear 'vector))) (vector-cross! s5-2 arg1 *z-vector*) (vector-normalize! s5-2 1.0) - (set! (-> self rot-axis quad) (-> s5-2 quad)) + (vector-copy! (-> self rot-axis) s5-2) ) (set! (-> self rot-angle) 65536.0) (set! (-> self explode-part) (create-launch-control (-> *part-group-id-table* 219) self)) @@ -1162,34 +1162,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -1352,18 +1352,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s1-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> this node-list data 6 bone transform)) - (v1-2 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s1-0 rvec quad) v1-2) - (set! (-> s1-0 uvec quad) a0-1) - (set! (-> s1-0 fvec quad) a1-0) - (set! (-> s1-0 trans quad) a2-1) - ) + (let ((s1-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 6 bone transform)))) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) @@ -1392,8 +1381,8 @@ (.svf (&-> a1-3 quad) vf6) ) (vector-normalize-copy! s5-0 (-> s1-0 fvec) 819200.0) - (set! (-> s3-0 start-pos quad) (-> gp-0 quad)) - (set! (-> s3-0 move-dist quad) (-> s5-0 quad)) + (vector-copy! (-> s3-0 start-pos) gp-0) + (vector-copy! (-> s3-0 move-dist) s5-0) (let ((v1-13 s3-0)) (set! (-> v1-13 radius) 40.96) (set! (-> v1-13 collide-with) (collide-spec backgnd enemy hit-by-others-list)) @@ -1416,7 +1405,7 @@ (v1-22 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s3-0 start-pos) s4-0) 1638.4)) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> s4-0 quad)) + (vector-copy! s3-1 s4-0) (vector+! s3-1 s3-1 v1-22) (cond (s2-1 @@ -1521,7 +1510,7 @@ (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> a1-0 velocity) (-> this root transv)) (vector-reset! (-> a1-0 velocity)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) @@ -1612,7 +1601,7 @@ (-> this joint-ik s4-0 elbow-matrix-no-ik) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> this node-list data 3 bone transform uvec quad)) + (vector-copy! s2-0 (-> this node-list data 3 bone transform uvec)) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((f30-0 0.4)) @@ -1729,11 +1718,11 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-51 quad) vf6) (- (-> s3-0 y) (-> v1-51 y)) - (set! (-> s3-0 quad) (-> v1-51 quad)) + (vector-copy! s3-0 v1-51) ) ) ) - (set! (-> s1-0 next-position quad) (-> s3-0 quad)) + (vector-copy! (-> s1-0 next-position) s3-0) (set! (-> s1-0 moving) #t) (let ((a1-16 s3-0)) (let ((v1-55 (-> s1-0 position))) @@ -1785,7 +1774,7 @@ (else (toggle-cspec-deadly this #f (+ s4-0 1)) (when (-> s1-0 moving) - (set! (-> s1-0 position quad) (-> s1-0 next-position quad)) + (vector-copy! (-> s1-0 position) (-> s1-0 next-position)) (set! (-> s1-0 moving) #f) (let ((s0-1 lerp-scale)) (set! sv-896 (the-as float 819.2)) @@ -1804,11 +1793,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 23 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s1-0 position quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s1-0 position)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 23)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s1-0 position quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s1-0 position)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 23)) ) ) @@ -1852,7 +1841,7 @@ ) ) (set! (-> s1-0 delta-y) 0.0) - (set! (-> s3-0 quad) (-> s1-0 position quad)) + (vector-copy! s3-0 (-> s1-0 position)) ) ) ) @@ -1906,7 +1895,7 @@ ) ) ) - (set! (-> s1-0 real-position quad) (-> s3-0 quad)) + (vector-copy! (-> s1-0 real-position) s3-0) ) ) (set-ik-target! (-> this joint-ik s4-0) s3-0) @@ -1924,6 +1913,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this bombbot)) + "Common implementation of post. Runs ja-post." (local-vars (sv-48 sparticle-launcher) (sv-52 sparticle-launcher)) (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) @@ -1950,7 +1940,7 @@ ) ) (vector-! (-> this linear-speed) (-> this root trans) (-> this last-trans)) - (set! (-> this last-trans quad) (-> this root trans quad)) + (vector-copy! (-> this last-trans) (-> this root trans)) (set! (-> this y-angular-velocity) (deg- (quaternion-y-angle (-> this root quat)) (quaternion-y-angle (-> this last-quat))) ) @@ -1998,7 +1988,7 @@ (a1-10 sv-48) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> s5-3 quad)) + (vector-copy! (-> a2-2 trans) s5-3) (t9-15 a0-23 a1-10 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -2007,7 +1997,7 @@ (a1-11 sv-48) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> s5-3 quad)) + (vector-copy! (-> a2-3 trans) s5-3) (t9-16 a0-24 a1-11 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -2061,13 +2051,15 @@ ) ;; definition for method 65 of type bombbot -(defmethod penetrate->next-state ((this bombbot) (arg0 process) (arg1 event-message-block) (arg2 float)) - ((method-of-type nav-enemy penetrate->next-state) this arg0 arg1 arg2) +(defmethod msg-for-incoming-attack ((this bombbot) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." + ((method-of-type nav-enemy msg-for-incoming-attack) this arg0 arg1 arg2) 'hit-flinch ) ;; definition for method 62 of type bombbot (defmethod get-damage-from-attack ((this bombbot) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (-> arg1 param 1) (let* ((t9-0 (method-of-type nav-enemy get-damage-from-attack)) (f30-0 (t9-0 this arg0 arg1)) @@ -2095,6 +2087,7 @@ ;; definition for method 82 of type bombbot ;; INFO: Used lq/sq (defmethod event-handler ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('nav-mesh-kill) (change-to *default-nav-mesh* this) @@ -2114,7 +2107,7 @@ (when v1-8 (let ((s5-1 (new 'stack-no-clear 'vector))) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> v1-8 root trans quad)) + (vector-copy! s4-1 (-> v1-8 root trans)) (let ((s3-1 (matrix->trans (-> this node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) (+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) (+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0))) @@ -2176,7 +2169,7 @@ (t9-0) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -2238,7 +2231,7 @@ ) (cond (gp-0 - (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (vector-copy! (-> this target-pos) (get-trans (the-as process-focusable gp-0) 3)) (let ((v1-34 (-> this target-pos))) (let ((a0-16 (-> gp-0 root trans))) (let ((a1-8 (-> gp-0 root transv))) @@ -2254,9 +2247,9 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-34 quad) vf6) ) - (set! (-> this start-target-pos quad) (-> gp-0 root trans quad)) - (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) - (try-update-focus (-> this focus) (the-as process-focusable gp-0) this) + (vector-copy! (-> this start-target-pos) (-> gp-0 root trans)) + (vector-copy! (-> this start-target-vel) (-> gp-0 root transv)) + (focus-on! (-> this focus) (the-as process-focusable gp-0) this) ) (else (clear-focused (-> this focus)) @@ -2271,7 +2264,7 @@ ;; definition for method 208 of type bombbot ;; INFO: Used lq/sq (defmethod bombbot-method-208 ((this bombbot) (arg0 vector) (arg1 vector)) - (set! (-> arg1 quad) (-> this target-pos quad)) + (vector-copy! arg1 (-> this target-pos)) arg1 ) @@ -2287,18 +2280,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> this node-list data 6 bone transform)) - (v1-2 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s4-0 rvec quad) v1-2) - (set! (-> s4-0 uvec quad) a0-1) - (set! (-> s4-0 fvec quad) a1-0) - (set! (-> s4-0 trans quad) a2-1) - ) + (let ((s4-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 6 bone transform)))) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -2322,8 +2304,8 @@ (.svf (&-> a1-2 quad) vf6) ) (vector-normalize-copy! s2-0 (-> s4-0 fvec) 819200.0) - (set! (-> s5-0 dest quad) (-> (bombbot-method-208 this s3-0 (new 'stack-no-clear 'vector)) quad)) - (set! (-> s5-0 src quad) (-> s3-0 quad)) + (vector-copy! (-> s5-0 dest) (bombbot-method-208 this s3-0 (new 'stack-no-clear 'vector))) + (vector-copy! (-> s5-0 src) s3-0) (set! (-> s5-0 initial-tilt) (+ 3640.889 (-> this angle-gun))) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) @@ -2331,7 +2313,7 @@ (sound-play "bb-fire-grenade") (process-spawn bombbot-bomb (-> s5-0 src) (-> s5-0 initial-velocity) :name "bombbot-bomb" :to this) (let ((s4-4 (new 'stack-no-clear 'vector))) - (set! (-> s4-4 quad) (-> s5-0 initial-velocity quad)) + (vector-copy! s4-4 (-> s5-0 initial-velocity)) (vector-normalize! s4-4 -2048000.0) (vector-inv-orient-by-quat! s4-4 s4-4 (-> this root quat)) (apply-impact! @@ -2486,7 +2468,7 @@ ;; INFO: Used lq/sq (defmethod init-proj-settings! ((this bombbot-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'guard-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) guard-shot-move) @@ -2522,8 +2504,8 @@ (set! (-> gp-0 damage) arg5) (logior! (-> gp-0 options) (projectile-options po14)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 1.0) ) @@ -2561,18 +2543,7 @@ (when (>= (+ (current-time) (seconds -0.2)) (-> this next-shoot)) (set-time! (-> this next-shoot)) (handle->process (-> this focus handle)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> this node-list data 6 bone transform)) - (v1-27 (-> a2-0 rvec quad)) - (a0-12 (-> a2-0 uvec quad)) - (a1-2 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-27) - (set! (-> s5-0 uvec quad) a0-12) - (set! (-> s5-0 fvec quad) a1-2) - (set! (-> s5-0 trans quad) a2-1) - ) + (let ((s5-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 6 bone transform)))) (new 'stack-no-clear 'matrix) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -2599,7 +2570,7 @@ (fire-shot this s3-0 (vector+! (new 'stack-no-clear 'vector) s3-0 s4-0)) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> s4-0 quad)) + (vector-copy! s5-1 s4-0) (vector-normalize! s5-1 -2048000.0) (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) (apply-impact! @@ -2625,7 +2596,7 @@ (let ((a0-1 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (let ((a2-0 (-> this nav state))) - (set! (-> a0-1 quad) (-> a2-0 heading quad)) + (vector-copy! a0-1 (-> a2-0 heading)) ) (let ((f0-1 (deg-diff (-> this y-angle) (vector-y-angle a0-1)))) (let ((f1-0 7281.778)) @@ -2687,8 +2658,8 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-orient-by-quat! s3-0 (-> s4-0 pos-offset) (-> this root quat)) (vector+! s3-0 s3-0 (-> this root trans)) - (set! (-> s4-0 next-position quad) (-> s3-0 quad)) - (set! (-> s4-0 position quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 next-position) s3-0) + (vector-copy! (-> s4-0 position) s3-0) ) (set! (-> s4-0 delta-y) 0.0) ) @@ -2734,7 +2705,7 @@ ) (when (< (-> self next-target) (current-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 w) 204800.0) (bombbot-method-196 self a1-0) ) @@ -2746,8 +2717,8 @@ (when v1-19 (when (< (current-time) (+ (-> self next-target) (seconds -3.5))) (set-time! (-> self start-target)) - (set! (-> self start-target-pos quad) (-> v1-19 root trans quad)) - (set! (-> self start-target-vel quad) (-> v1-19 root transv quad)) + (vector-copy! (-> self start-target-pos) (-> v1-19 root trans)) + (vector-copy! (-> self start-target-vel) (-> v1-19 root transv)) (vector-! (-> self target-delta) (-> v1-19 root trans) (-> self root trans)) ) (let ((a2-2 (-> self target-pos))) @@ -2766,7 +2737,7 @@ (.svf (&-> a2-2 quad) vf6) ) (if (= (-> v1-19 type) target) - (set! (-> self target-pos quad) (-> self start-target-pos quad)) + (vector-copy! (-> self target-pos) (-> self start-target-pos)) ) (if (< (+ (-> self next-target) (seconds -1)) (current-time)) (bombbot-method-197 self) @@ -2828,7 +2799,7 @@ ) (logclear! (-> v1-25 flags) (nav-state-flag directional-mode)) (logior! (-> v1-25 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-25 target-pos quad) (-> a0-10 position quad)) + (vector-copy! (-> v1-25 target-pos) (-> a0-10 position)) ) 0 (nav-enemy-method-187 self) @@ -2877,7 +2848,7 @@ ) (init-vf0-vector) (when (and (nonzero? (-> self drop-num)) (< (-> self next-target) (current-time))) - (let ((v1-5 (enemy-method-131 self 5 (the-as int (-> self drop-mask))))) + (let ((v1-5 (rnd-int-excluding-masked self 5 (the-as int (-> self drop-mask))))) (logior! (-> self drop-mask) (ash 1 v1-5)) (set! (-> self next-shoot) (+ (current-time) (seconds 0.8))) (set! (-> self next-target) (+ (current-time) (seconds 1))) @@ -3000,7 +2971,7 @@ ) (logclear! (-> v1-2 flags) (nav-state-flag directional-mode)) (logior! (-> v1-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-2 target-pos quad) (-> a0-0 quad)) + (vector-copy! (-> v1-2 target-pos) a0-0) ) 0 (when (logtest? (-> self nav state flags) (nav-state-flag at-target)) @@ -3117,21 +3088,21 @@ (set! (-> a1-1 gravity) -163840.0) (set! (-> a1-1 scale-rand-lo) 1.0) (set! (-> a1-1 scale-rand-hi) 3.0) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> self root trans)) (debris-spawn self a1-1 *bombbot-debris-params* (the-as process-drawable #f)) ) (let ((v1-15 (new 'stack-no-clear 'vector))) - (set! (-> v1-15 quad) (-> self root trans quad)) + (vector-copy! v1-15 (-> self root trans)) (+! (-> v1-15 y) 2048.0) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! s5-0 (-> self node-list data 3 bone transform trans)) (new 'stack-no-clear 'vector) 4.0 (+! (-> s5-0 y) 8192.0) (activate! *camera-smush-control* 1024.0 37 210 1.0 0.995 (-> self clock)) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> s5-0 quad)) + (vector-copy! (-> gp-0 spawn-point) s5-0) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 61440.0) (set! (-> gp-0 scale) 1.0) @@ -3155,13 +3126,13 @@ (set-vector! s4-0 (cos f30-0) 0.0 (sin f30-0) 1.0) ) (vector-float*! s4-0 s4-0 (* 4096.0 (+ 2.0 (* 2.0 (rand-vu))))) - (set! (-> s5-1 quad) (-> self root trans quad)) + (vector-copy! s5-1 (-> self root trans)) (vector+! (-> self root trans) (-> self root trans) s4-0) (set! (-> self fact pickup-type) (pickup-type ammo-random)) (set! (-> self fact pickup-amount) 10.0) (set! (-> self fact pickup-spawn-amount) 2.0) (drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0 #f) - (set! (-> self root trans quad) (-> s5-1 quad)) + (vector-copy! (-> self root trans) s5-1) ) ) (set! (-> self explosing) #t) @@ -3198,6 +3169,7 @@ ;; definition for method 120 of type bombbot ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this bombbot)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -3467,6 +3439,7 @@ ;; definition for method 67 of type bombbot (defmethod coin-flip? ((this bombbot)) + "Return #t half the time, #f the other." #f ) @@ -3519,7 +3492,7 @@ (set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y))) (set! (-> v1-3 main-y) (-> v1-3 delta-y)) (+! f30-0 (/ (-> v1-3 main-y) 4)) - (set! (-> s1-0 quad) (-> v1-3 pos-offset quad)) + (vector-copy! s1-0 (-> v1-3 pos-offset)) (set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y))) (new 'stack-no-clear 'vector) (set! sv-224 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> v1-3 pos-offset) 1.0)) @@ -3576,12 +3549,13 @@ (quaternion-slerp! (-> s4-0 main-quat) (-> s4-0 main-quat) s3-0 0.8) ) (quaternion-copy! (-> arg1 quat) (-> s4-0 main-quat)) - (set! (-> arg1 trans quad) (-> s4-0 main-pos quad)) + (vector-copy! (-> arg1 trans) (-> s4-0 main-pos)) (set! (-> arg1 trans y) (+ 16384.0 (-> s4-0 main-pos-y))) (quaternion-copy! (-> arg1 quat) (the-as quaternion (-> s4-0 rigidbody rot))) - (set! (-> arg1 trans quad) - (-> (rigid-body-control-method-25 (-> s4-0 rigidbody) (new 'stack-no-clear 'vector)) quad) - ) + (vector-copy! + (-> arg1 trans) + (rigid-body-control-method-25 (-> s4-0 rigidbody) (new 'stack-no-clear 'vector)) + ) ) (cspace<-parented-transformq-joint! arg0 arg1) 0 @@ -3598,12 +3572,12 @@ (s3-0 (new 'stack-no-clear 'quaternion)) ) (let ((a1-1 (-> s4-0 nav state))) - (set! (-> s2-0 quad) (-> a1-1 target-pos quad)) + (vector-copy! s2-0 (-> a1-1 target-pos)) ) (vector-! s2-0 s2-0 (-> s4-0 root trans)) (set! (-> s2-0 y) 0.0) (let ((a1-6 (-> s4-0 nav state))) - (set! (-> s2-0 quad) (-> a1-6 heading quad)) + (vector-copy! s2-0 (-> a1-6 heading)) ) (vector-normalize! s2-0 1.0) (quaternion-from-two-vectors! @@ -3658,7 +3632,7 @@ (set! (-> s3-0 angle-turret) (deg-seek (-> s3-0 angle-turret) (-> s2-0 y) (* 36408.89 (seconds-per-frame)))) (quaternion-vector-angle! s4-0 *up-vector* (-> s3-0 angle-turret)) (quaternion->matrix (-> arg0 bone transform) s4-0) - (set! (-> arg0 bone transform trans quad) (-> s5-0 quad)) + (vector-copy! (-> arg0 bone transform trans) s5-0) ) ) 0 @@ -3854,12 +3828,13 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this bombbot)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *bombbot-nav-enemy-info*) + (setup-enemy! this *bombbot-nav-enemy-info*) (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) @@ -3961,8 +3936,8 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> this root quat)) (vector+! s3-0 s3-0 (-> this root trans)) - (set! (-> s4-1 next-position quad) (-> s3-0 quad)) - (set! (-> s4-1 position quad) (-> s3-0 quad)) + (vector-copy! (-> s4-1 next-position) s3-0) + (vector-copy! (-> s4-1 position) s3-0) ) (set! (-> s4-1 delta-y) 0.0) ) @@ -3974,7 +3949,7 @@ (let ((s5-3 (new 'stack-no-clear 'vector))) (vector-z-quaternion! s5-3 (-> this root quat)) (set! (-> this y-angle) (vector-y-angle s5-3)) - (set! (-> this nav state heading quad) (-> s5-3 quad)) + (vector-copy! (-> this nav state heading) s5-3) ) 0 (set! (-> this max-hit-points) (-> this hit-points)) @@ -4017,14 +3992,14 @@ (set! (-> self city-path) (-> arg0 path)) (set! (-> self current-node) (-> arg0 first-node)) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> self city-path node (-> self current-node) position quad)) + (vector-copy! (-> self root trans) (-> self city-path node (-> self current-node) position)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (vector-identity! (-> self root scale)) (-> arg0 nav-mesh) (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) (init-enemy! self) (set! (-> self shot-count) (the-as uint 5)) - (set! (-> self last-trans quad) (-> self root trans quad)) + (vector-copy! (-> self last-trans) (-> self root trans)) (logior! (-> self mask) (process-mask kg-robot)) (set! (-> self minimap) #f) (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) @@ -4036,7 +4011,8 @@ ) ;; definition for method 84 of type bombbot -(defmethod send-attack-on-jump-or-knocked ((this bombbot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this bombbot) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (when (!= (-> arg0 type) target) (let* ((s3-0 (-> arg1 param 0)) (s2-0 arg0) @@ -4069,7 +4045,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -4157,7 +4133,7 @@ ) (cond (gp-0 - (set! (-> this target-pos quad) (-> (get-trans gp-0 3) quad)) + (vector-copy! (-> this target-pos) (get-trans gp-0 3)) (let ((v1-25 (-> this target-pos))) (let ((a0-12 (-> gp-0 root trans))) (let ((a1-7 (-> gp-0 root transv))) @@ -4173,9 +4149,9 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-25 quad) vf6) ) - (set! (-> this start-target-pos quad) (-> this target-pos quad)) - (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) - (try-update-focus (-> this focus) gp-0 this) + (vector-copy! (-> this start-target-pos) (-> this target-pos)) + (vector-copy! (-> this start-target-vel) (-> gp-0 root transv)) + (focus-on! (-> this focus) gp-0 this) ) (else (clear-focused (-> this focus)) @@ -4188,7 +4164,8 @@ ) ;; definition for method 122 of type bomb-bot -(defmethod go-idle2 ((this bomb-bot)) +(defmethod go-fallback-init ((this bomb-bot)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this hostile)) ) @@ -4206,7 +4183,7 @@ (init-vf0-vector) (when (< (-> self next-target) (current-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 w) 409600.0) (bombbot-method-196 self a1-0) ) @@ -4218,8 +4195,8 @@ (when gp-0 (when (< (current-time) (+ (-> self next-target) (seconds -2))) (set-time! (-> self start-target)) - (set! (-> self start-target-pos quad) (-> (get-trans gp-0 3) quad)) - (set! (-> self start-target-vel quad) (-> gp-0 root transv quad)) + (vector-copy! (-> self start-target-pos) (get-trans gp-0 3)) + (vector-copy! (-> self start-target-vel) (-> gp-0 root transv)) (vector-! (-> self target-delta) (-> gp-0 root trans) (-> self root trans)) ) (let ((a1-5 (-> self target-pos))) @@ -4237,7 +4214,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-5 quad) vf6) ) - (set! (-> self target-pos quad) (-> self start-target-pos quad)) + (vector-copy! (-> self target-pos) (-> self start-target-pos)) (if (< (+ (-> self next-target) (seconds -1)) (current-time)) (bombbot-method-197 self) (bombbot-method-204 self) @@ -4275,7 +4252,7 @@ (if (logtest? (-> self nav state flags) (nav-state-flag at-target)) (nav-enemy-method-164 self) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self nav state target-pos quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self nav state target-pos)) (nav-enemy-method-187 self) ) ) @@ -4285,13 +4262,14 @@ ;; definition for method 11 of type bomb-bot ;; INFO: Used lq/sq (defmethod init-from-entity! ((this bomb-bot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (init-enemy-collision! this) (process-drawable-from-entity! this arg0) (set! (-> *bombbot-nav-enemy-info* nav-mesh) *default-nav-mesh*) (init-enemy! this) (set! (-> this shot-count) (the-as uint 5)) - (set! (-> this last-trans quad) (-> this root trans quad)) + (vector-copy! (-> this last-trans) (-> this root trans)) (logior! (-> this mask) (process-mask kg-robot)) (set! (-> this minimap) #f) (logior! (-> this mask) (process-mask enemy)) @@ -4304,7 +4282,7 @@ ) (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-19 target-pos quad) (-> a0-13 quad)) + (vector-copy! (-> v1-19 target-pos) a0-13) ) 0 (set! (-> this max-hit-points) (-> this hit-points)) @@ -4343,6 +4321,7 @@ ;; definition for method 139 of type bombbot-player ;; INFO: Used lq/sq (defmethod move-above-ground! ((this bombbot-player) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." (let ((a1-1 (new 'stack-no-clear 'collide-query))) (find-ground (-> this root) @@ -4355,7 +4334,7 @@ ) ) (-> *math-camera* inv-camera-rot) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> *math-camera* inv-camera-rot fvec)) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) @@ -4421,6 +4400,7 @@ ;; definition for method 59 of type bombbot-player ;; WARN: Return type mismatch float vs none. (defmethod enemy-common-post ((this bombbot-player)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type bombbot enemy-common-post))) (t9-0 this) ) @@ -4524,7 +4504,7 @@ (set! sv-880 (new 'stack-no-clear 'collide-query)) (set! sv-884 (new 'stack-no-clear 'array 'collide-shape 64)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (camera-matrix) fvec quad)) + (vector-copy! s5-0 (-> (camera-matrix) fvec)) (set! sv-888 s5-0) ) (set! sv-896 0) @@ -4545,12 +4525,12 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s5-1 quad) vf6) ) - (set! (-> sv-876 quad) (-> (get-trans this 4) quad)) + (vector-copy! sv-876 (get-trans this 4)) (matrix->trans (-> this node-list data 6 bone transform) sv-872) (set! (-> sv-876 y) (-> sv-872 y)) (vector-normalize-copy! sv-872 sv-888 204800.0) - (set! (-> sv-880 start-pos quad) (-> sv-876 quad)) - (set! (-> sv-880 move-dist quad) (-> sv-872 quad)) + (vector-copy! (-> sv-880 start-pos) sv-876) + (vector-copy! (-> sv-880 move-dist) sv-872) (let ((v1-20 sv-880)) (set! (-> v1-20 radius) 40.96) (set! (-> v1-20 collide-with) (collide-spec backgnd)) @@ -4607,10 +4587,10 @@ ) (cond (sv-864 - (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable sv-864) 3) quad)) - (set! (-> this start-target-pos quad) (-> sv-864 root trans quad)) - (set! (-> this start-target-vel quad) (-> sv-864 root transv quad)) - (try-update-focus (-> this focus) (the-as process-focusable sv-864) this) + (vector-copy! (-> this target-pos) (get-trans (the-as process-focusable sv-864) 3)) + (vector-copy! (-> this start-target-pos) (-> sv-864 root trans)) + (vector-copy! (-> this start-target-vel) (-> sv-864 root transv)) + (focus-on! (-> this focus) (the-as process-focusable sv-864) this) ) (else (vector+! (-> this target-pos) sv-876 sv-872) @@ -4636,18 +4616,7 @@ ) (init-vf0-vector) (handle->process (-> this focus handle)) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> this node-list data 6 bone transform)) - (v1-7 (-> a2-0 rvec quad)) - (a0-5 (-> a2-0 uvec quad)) - (a1-1 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-7) - (set! (-> s5-0 uvec quad) a0-5) - (set! (-> s5-0 fvec quad) a1-1) - (set! (-> s5-0 trans quad) a2-1) - ) + (let ((s5-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 6 bone transform)))) (new 'stack-no-clear 'matrix) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -4682,7 +4651,7 @@ (launch-particles (-> *part-id-table* 2055) s3-0) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> s4-0 quad)) + (vector-copy! s5-1 s4-0) (vector-normalize! s5-1 -2048000.0) (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) (apply-impact! @@ -4780,7 +4749,7 @@ (.svf (&-> s5-5 quad) vf6) ) (let ((a1-7 (new 'stack-no-clear 'vector))) - (set! (-> a1-7 quad) (-> self root trans quad)) + (vector-copy! a1-7 (-> self root trans)) (set! (-> a1-7 w) 204800.0) (bombbot-method-196 self a1-7) ) @@ -4852,7 +4821,7 @@ (else (-> *math-camera* inv-camera-rot) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! gp-0 (-> *math-camera* inv-camera-rot fvec)) (let ((s5-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -4882,7 +4851,7 @@ (let ((v1-24 (-> self nav state))) (logclear! (-> v1-24 flags) (nav-state-flag directional-mode)) (logior! (-> v1-24 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-24 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-24 target-pos) s5-0) ) 0 (when *target* @@ -4931,6 +4900,7 @@ ;; definition for method 146 of type bombbot-player ;; WARN: Return type mismatch none vs sound-id. (defmethod play-damage-sound ((this bombbot-player) (arg0 int)) + "Pick and play the damage/death sound." ((method-of-type bombbot play-damage-sound) this arg0) (the-as sound-id (if (zero? arg0) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) @@ -4953,7 +4923,7 @@ (set! (-> self city-path) (-> arg0 path)) (set! (-> self current-node) (the-as uint 0)) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (vector-identity! (-> self root scale)) (-> arg0 nav-mesh) @@ -4961,7 +4931,7 @@ (init-enemy! self) (set! (-> self gun-rotation-speed) 7281.778) (set! (-> self shot-count) (the-as uint 5)) - (set! (-> self last-trans quad) (-> self root trans quad)) + (vector-copy! (-> self last-trans) (-> self root trans)) (set! (-> self minimap) #f) (logior! (-> self mask) (process-mask enemy guard)) (send-event *camera* 'change-target self) @@ -5086,7 +5056,7 @@ (gp-1 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (target-pos 0) quad)) + (vector-copy! s5-1 (target-pos 0)) (if (and (< 4096000.0 (vector-vector-distance s5-1 s3-0)) (< 819200.0 (vector-vector-distance s5-1 (-> self start-point))) ) @@ -5200,8 +5170,8 @@ (when (or (zero? (-> this bombbot-h)) (not (handle->process (-> this bombbot-h)))) (let ((s5-1 (new 'stack 'bombbot-spawn-params))) (set! (-> s5-1 nav-mesh) (get-nav-mesh (the-as actor-id #x48e9))) - (set! (-> s5-1 position quad) (-> this start-point quad)) - (set! (-> s5-1 position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s5-1 position) (-> this start-point)) + (vector-copy! (-> s5-1 position) (target-pos 0)) (quaternion-copy! (-> s5-1 quat) (new 'static 'quaternion :y 0.841 :w 0.5409)) (set! (-> this bombbot-h) (ppointer->handle (process-spawn bombbot-player s5-1 :name "bombbot-player" :to this)) @@ -5418,7 +5388,7 @@ :code (behavior () (when (and *target* (not (logtest? (-> *target* focus-status) (focus-status dead)))) (cond - ((= (status-of-level-and-borrows *level* 'ctyport #f) 'active) + ((= (level-status? *level* 'ctyport #f) 'active) (set-setting! 'entity-name "camera-321" 0.0 0) (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set-time! (-> self state-time)) diff --git a/test/decompiler/reference/jak3/levels/city/common/cty-guard-projectile_REF.gc b/test/decompiler/reference/jak3/levels/city/common/cty-guard-projectile_REF.gc index 84b45b83507..7e2e4f015fc 100644 --- a/test/decompiler/reference/jak3/levels/city/common/cty-guard-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/cty-guard-projectile_REF.gc @@ -124,7 +124,7 @@ (set! (-> v1-11 y) 2.0) (set! (-> v1-11 z) 2.0) (set! (-> v1-11 w) 1.0) - (set! (-> this root scale quad) (-> v1-11 quad)) + (vector-copy! (-> this root scale) v1-11) ) 0 (none) @@ -191,7 +191,7 @@ ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) (-> self blast-radius)) (set! (-> gp-0 scale) 1.0) @@ -227,7 +227,7 @@ (let ((v1-1 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-1 sphere quad) (-> this root trans quad)) (set! (-> v1-1 sphere r) (-> this blast-radius)) - (set! (-> v1-1 velocity quad) (-> this root transv quad)) + (vector-copy! (-> v1-1 velocity) (-> this root transv)) (set! (-> v1-1 notify-radius) 122880.0) (set! (-> v1-1 danger-level) 2.0) (set! (-> v1-1 decay-rate) 0.0) @@ -260,7 +260,7 @@ (let ((v1-10 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-10 sphere quad) (-> self root trans quad)) (set! (-> v1-10 sphere r) (the-as float (* (the int (-> self blast-radius)) 2))) - (set! (-> v1-10 velocity quad) (-> self root transv quad)) + (vector-copy! (-> v1-10 velocity) (-> self root transv)) (set! (-> v1-10 notify-radius) 122880.0) (set! (-> v1-10 danger-level) 2.0) (set! (-> v1-10 decay-rate) 0.0) @@ -406,11 +406,11 @@ (if (-> this has-hit-ground) (set! f26-0 0.7) ) - (set! (-> s3-1 quad) (-> (the-as target v1-22) control to-target-pt-xz quad)) + (vector-copy! s3-1 (-> (the-as target v1-22) control to-target-pt-xz)) (vector-normalize! s3-1 1.0) (set! (-> s3-1 y) 0.0) (if (< (vector-dot s3-1 s4-2) f26-0) - (set! (-> s4-2 quad) (-> s3-1 quad)) + (vector-copy! s4-2 s3-1) ) ) ) @@ -667,7 +667,3 @@ ) (call-parent-method this arg0 arg1) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/common/ff-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/city/common/ff-squad-control_REF.gc index 8921f8fa21d..8a61beb9fff 100644 --- a/test/decompiler/reference/jak3/levels/city/common/ff-squad-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/ff-squad-control_REF.gc @@ -531,7 +531,7 @@ (if (not (logtest? (-> this alert-state flags) (squad-alert-flag alarm-on))) (logior! (-> this alert-state flags) (squad-alert-flag alarm-on)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> (target-pos 0) quad)) + (vector-copy! (new 'stack-no-clear 'vector) (target-pos 0)) (if #t (ff-squad-control-method-47 this) ) @@ -680,7 +680,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc index e02a6047a72..f4b580ecb62 100644 --- a/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/guard-grenade_REF.gc @@ -24,9 +24,10 @@ (cond ((!= (-> (handle->process (-> this focus handle)) type) target) (set! (-> s3-1 quad) (the-as uint128 0)) - (set! (-> s5-0 dest quad) - (-> (get-trans (the-as process-focusable (handle->process (-> this focus handle))) 3) quad) - ) + (vector-copy! + (-> s5-0 dest) + (get-trans (the-as process-focusable (handle->process (-> this focus handle))) 3) + ) 0.0 ) (else @@ -34,14 +35,12 @@ (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 2.0))) (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 3.0))) ) - (set! (-> s5-0 dest quad) - (-> (vector+! (new 'stack-no-clear 'vector) s3-1 (-> this target-pos-predict-miss)) quad) - ) + (vector-copy! (-> s5-0 dest) (vector+! (new 'stack-no-clear 'vector) s3-1 (-> this target-pos-predict-miss))) f30-0 ) ) ) - (set! (-> s5-0 src quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 src) s4-0) (set! (-> s5-0 initial-tilt) 8192.0) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) @@ -50,8 +49,8 @@ (set! (-> a1-14 charge) f30-0) (set! (-> a1-14 options) (projectile-options)) (logclear! (-> a1-14 options) (projectile-options po14 po15 po16)) - (set! (-> a1-14 pos quad) (-> s5-0 src quad)) - (set! (-> a1-14 vel quad) (-> s5-0 initial-velocity quad)) + (vector-copy! (-> a1-14 pos) (-> s5-0 src)) + (vector-copy! (-> a1-14 vel) (-> s5-0 initial-velocity)) (set! (-> a1-14 notify-handle) (the-as handle #f)) (set! (-> a1-14 owner-handle) (process->handle this)) (set! (-> a1-14 target-handle) (the-as handle #f)) @@ -133,7 +132,7 @@ (loop (let ((a2-0 (new 'stack-no-clear 'vector))) (let ((a1-0 (-> self nav state))) - (set! (-> a2-0 quad) (-> a1-0 target-pos quad)) + (vector-copy! a2-0 (-> a1-0 target-pos)) ) (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 2) *color-red*) ) @@ -445,7 +444,7 @@ (let ((a0-8 (-> self nav state)) (v1-15 *null-vector*) ) - (set! (-> a0-8 velocity quad) (-> v1-15 quad)) + (vector-copy! (-> a0-8 velocity) v1-15) ) 0 (set-time! (-> self state-time)) diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-rifle_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-rifle_REF.gc index 220a270f3a0..964d062de87 100644 --- a/test/decompiler/reference/jak3/levels/city/common/guard-rifle_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/guard-rifle_REF.gc @@ -21,7 +21,7 @@ ;; INFO: Used lq/sq (defmethod crimson-guard-method-257 ((this crimson-guard)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) + (vector-copy! s5-0 (-> this target-pos-predict-miss)) (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a0-3)) @@ -65,7 +65,7 @@ (let ((a0-9 (-> self nav state)) (v1-20 *null-vector*) ) - (set! (-> a0-9 velocity quad) (-> v1-20 quad)) + (vector-copy! (-> a0-9 velocity) v1-20) ) 0 (set-time! (-> self state-time)) diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc index 42e43bbe5dc..fbbc78b2b31 100644 --- a/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/guard-states_REF.gc @@ -13,7 +13,7 @@ (v1-3 *null-vector*) ) (logior! (-> a0-3 flags) (nav-state-flag directional-mode)) - (set! (-> a0-3 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-3 travel) v1-3) ) 0 (if *citizen-debug* @@ -46,9 +46,9 @@ (suspend) (ja :num! (seek! max (-> self speed-scale))) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) - (go-best-state self) + (go-state-for-focused self) ) ) ) @@ -77,7 +77,7 @@ (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) (set! (-> self hit-face) (the-as uint -1)) - (enemy-method-50 self 0) + (update-collision-action self 0) ) :trans (behavior () '() @@ -93,15 +93,15 @@ (ja :num! (seek! max (-> self speed-scale))) ) (set! (-> self hit-face) (the-as uint -1)) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (let ((a0-1 (-> self nav state)) (v1-3 *null-vector*) ) (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) - (set! (-> a0-1 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-1 travel) v1-3) ) 0 (enemy-common-post self) @@ -132,7 +132,7 @@ (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) ) (set! (-> self hit-face) (the-as uint -1)) - (enemy-method-50 self 0) + (update-collision-action self 0) ) :trans (behavior () '() @@ -148,15 +148,15 @@ (ja :num! (seek! max (-> self speed-scale))) ) (set! (-> self hit-face) (the-as uint -1)) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (let ((a0-1 (-> self nav state)) (v1-3 *null-vector*) ) (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) - (set! (-> a0-1 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-1 travel) v1-3) ) 0 (enemy-common-post self) @@ -204,7 +204,7 @@ (t9-0) ) ) - (reset-penetrate! self) + (reset-penetrate-later! self) ) ) @@ -400,7 +400,7 @@ ) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-9 quad)) + (vector-copy! (-> a0-2 target-pos) v1-9) ) 0 (nav-enemy-method-187 self) @@ -523,7 +523,7 @@ (init-vf0-vector) (handle->process (-> this focus handle)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this move-position quad)) + (vector-copy! s5-0 (-> this move-position)) (when (< 8192000.0 (-> this target-self-xz-dist)) (let ((s3-0 (-> this root trans)) (s2-0 (new 'stack-no-clear 'vector)) @@ -532,7 +532,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (set! sv-112 (new 'stack-no-clear 'vector)) - (set! (-> s1-0 quad) (-> s5-0 quad)) + (vector-copy! s1-0 s5-0) (vector-z-quaternion! s2-0 (-> this root quat)) (let ((f30-0 (* 182.04445 (* 60.0 (the float (- (-> this traffic-id) *guard-min-id-hack*)))))) (set! sv-128 s0-0) @@ -568,13 +568,13 @@ (set! sv-144 (+ sv-144 1)) ) (do-spline s4-0 s3-0 s2-0 s1-0 s0-0 0.9) - (set! (-> s4-0 quad) (-> s5-0 quad)) + (vector-copy! s4-0 s5-0) ) ) (let ((v1-39 (-> this nav state))) (logclear! (-> v1-39 flags) (nav-state-flag directional-mode)) (logior! (-> v1-39 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-39 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-39 target-pos) s5-0) ) ) 0 @@ -925,7 +925,7 @@ (let ((a0-9 (-> self nav state)) (v1-12 *null-vector*) ) - (set! (-> a0-9 velocity quad) (-> v1-12 quad)) + (vector-copy! (-> a0-9 velocity) v1-12) ) 0 (set-time! (-> self state-time)) @@ -1004,7 +1004,7 @@ (let ((a0-9 (-> self nav state)) (v1-12 *null-vector*) ) - (set! (-> a0-9 velocity quad) (-> v1-12 quad)) + (vector-copy! (-> a0-9 velocity) v1-12) ) 0 (set-time! (-> self state-time)) @@ -1085,7 +1085,7 @@ (when (not (-> self already-shot)) (crimson-guard-method-265 self 1.0) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (s5-0 (new 'stack 'collide-query)) ) @@ -1112,7 +1112,7 @@ (a1-7 (-> self event-param-point)) (f0-3 (-> v1-16 extra-nav-sphere w)) ) - (set! (-> v1-16 extra-nav-sphere quad) (-> a1-7 quad)) + (vector-copy! (-> v1-16 extra-nav-sphere) a1-7) (set! (-> v1-16 extra-nav-sphere w) f0-3) ) 0 @@ -1161,6 +1161,7 @@ ;; definition for method 78 of type crimson-guard ;; WARN: Return type mismatch int vs object. (defmethod go-hostile ((this crimson-guard)) + "Go to the hostile state, actively trying to attack the target." (let ((v1-2 (handle->process (-> this focus handle)))) (cond (v1-2 diff --git a/test/decompiler/reference/jak3/levels/city/common/guard-tazer_REF.gc b/test/decompiler/reference/jak3/levels/city/common/guard-tazer_REF.gc index fb32c69dc57..71e2d07f2c2 100644 --- a/test/decompiler/reference/jak3/levels/city/common/guard-tazer_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/guard-tazer_REF.gc @@ -14,15 +14,15 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> arg2 quad)) + (vector-copy! s4-0 arg2) (let ((s3-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'quaternion)) ) (vector-length arg2) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> arg3 quad)) + (vector-copy! s1-0 arg3) (let ((s0-0 (new 'stack-no-clear 'collide-query))) (set! sv-640 0) (while (< sv-640 6) @@ -38,8 +38,8 @@ ) (set! (-> v1-6 action-mask) (collide-action solid)) ) - (set! (-> s0-0 start-pos quad) (-> s5-0 quad)) - (set! (-> s0-0 move-dist quad) (-> s4-0 quad)) + (vector-copy! (-> s0-0 start-pos) s5-0) + (vector-copy! (-> s0-0 move-dist) s4-0) (set-from-point-offset-pad! (-> s0-0 bbox) (-> s0-0 start-pos) (-> s0-0 move-dist) (-> s0-0 radius)) (fill-using-bounding-box *collide-cache* s0-0) (set! (-> s0-0 radius) 409.6) @@ -61,7 +61,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-4 quad) vf6) ) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) ) (else (vector+! (-> s0-0 start-pos) s5-0 s4-0) @@ -113,7 +113,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-11 quad) vf6) ) - (set! (-> s5-0 quad) (-> s3-0 quad)) + (vector-copy! s5-0 s3-0) ) ) ) @@ -127,7 +127,7 @@ (set! sv-656 (-> s0-0 best-other-tri normal)) (quaternion-from-two-vectors! s2-0 s1-0 sv-656) (vector-orient-by-quat! s4-0 s4-0 s2-0) - (set! (-> s1-0 quad) (-> sv-656 quad)) + (vector-copy! s1-0 sv-656) (vector-flatten! s4-0 s4-0 sv-656) ) (else @@ -205,8 +205,8 @@ ) (set! (-> v1-10 action-mask) (collide-action solid)) ) - (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) - (set! (-> s3-0 move-dist quad) (-> s1-0 quad)) + (vector-copy! (-> s3-0 start-pos) s4-0) + (vector-copy! (-> s3-0 move-dist) s1-0) (set! (-> this l-control state points-to-draw) 0) (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) (s2-1 (new 'stack-no-clear 'vector)) @@ -229,21 +229,21 @@ ) (cond ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) ) ) (cond ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) ) ) @@ -272,7 +272,7 @@ (set! (-> s0-1 ignore-handle) (process->handle this)) (set! (-> s0-1 attack-id) (-> this attack-id)) (set! (-> s0-1 timeout) (seconds 4)) - (set! (-> s0-1 pos quad) (-> s4-0 quad)) + (vector-copy! (-> s0-1 pos) s4-0) (vector-! (-> s0-1 vel) s5-0 s4-0) (vector-normalize! (-> s0-1 vel) 131072.0) (spawn-projectile guard-lazer-shot s0-1 this *default-dead-pool*) @@ -284,21 +284,21 @@ (else (cond ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) ) ) (cond ((logtest? (-> *part-group-id-table* 254 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 254)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 254)) ) ) @@ -310,7 +310,7 @@ (let ((a0-97 (-> this l-control)) (v1-178 s5-0) ) - (set! (-> a0-97 state meet data (+ (-> a0-97 state points-to-draw) -1) quad) (-> v1-178 quad)) + (vector-copy! (-> a0-97 state meet data (+ (-> a0-97 state points-to-draw) -1)) v1-178) ) ) ) @@ -643,7 +643,3 @@ (crimson-guard-method-254 self) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/common/height-map_REF.gc b/test/decompiler/reference/jak3/levels/city/common/height-map_REF.gc index ce53cd935e7..9d08aba0590 100644 --- a/test/decompiler/reference/jak3/levels/city/common/height-map_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/height-map_REF.gc @@ -145,7 +145,7 @@ (set! sv-80 (+ s4-0 -1)) (while (nonzero? sv-80) (set! sv-80 (+ sv-80 -1)) - (set! (-> s5-0 0 max quad) (-> s5-0 0 min quad)) + (vector-copy! (-> s5-0 0 max) (-> s5-0 0 min)) (+! (-> s5-0 0 min x) f28-0) (set! s0-0 (&-> s0-0 1)) (set! (-> s5-0 0 min y) (+ (-> this y-offset) (* (the float (-> s0-0 0)) (-> this y-scale)))) @@ -177,7 +177,7 @@ (set! sv-96 (+ s3-0 -1)) (while (nonzero? sv-96) (set! sv-96 (+ sv-96 -1)) - (set! (-> s5-0 0 max quad) (-> s5-0 0 min quad)) + (vector-copy! (-> s5-0 0 max) (-> s5-0 0 min)) (+! (-> s5-0 0 min z) f30-0) (&+! s0-1 s4-0) (set! (-> s5-0 0 min y) @@ -246,7 +246,3 @@ (none) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/common/kg-squad-member_REF.gc b/test/decompiler/reference/jak3/levels/city/common/kg-squad-member_REF.gc index d7075c822c8..ae947b9c858 100644 --- a/test/decompiler/reference/jak3/levels/city/common/kg-squad-member_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/kg-squad-member_REF.gc @@ -138,6 +138,7 @@ ;; definition for method 59 of type kg-squad-member (defmethod enemy-common-post ((this kg-squad-member)) + "Common implementation of post. Runs ja-post." (local-vars (s5-0 int)) (when (focus-test? this dangerous) (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) @@ -179,10 +180,11 @@ ) ;; definition for method 84 of type kg-squad-member -(defmethod send-attack-on-jump-or-knocked ((this kg-squad-member) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this kg-squad-member) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond (#f - ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type citizen enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -218,7 +220,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else diff --git a/test/decompiler/reference/jak3/levels/city/common/krimson-wall_REF.gc b/test/decompiler/reference/jak3/levels/city/common/krimson-wall_REF.gc index 0ac61672877..571b0a39d09 100644 --- a/test/decompiler/reference/jak3/levels/city/common/krimson-wall_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/krimson-wall_REF.gc @@ -138,18 +138,7 @@ '() ) :trans (behavior () - (let* ((v1-0 (new 'stack-no-clear 'matrix)) - (a3-0 (-> self node-list data 2 bone transform)) - (a0-2 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-2) - (set! (-> v1-0 uvec quad) a1-0) - (set! (-> v1-0 fvec quad) a2-0) - (set! (-> v1-0 trans quad) a3-1) - ) + (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 2 bone transform)) ) :code sleep-code :post ja-post @@ -164,7 +153,7 @@ :trans (behavior () (when (not (time-elapsed? (-> self state-time) (seconds 0.5))) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (+! (-> gp-0 z) (* 4096.0 (rand-vu-float-range -60.0 60.0))) (+! (-> gp-0 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) (+! (-> gp-0 y) (* 4096.0 (rand-vu-float-range 0.0 25.0))) @@ -173,11 +162,11 @@ ((zero? v1-9) (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) ) ) @@ -185,11 +174,11 @@ ((= v1-9 1) (cond ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 218)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 218)) ) ) @@ -218,6 +207,7 @@ ;; definition for method 11 of type krimson-wall-break ;; INFO: Used lq/sq (defmethod init-from-entity! ((this krimson-wall-break) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-96 entity)) (set! (-> this level) (level-get *level* (-> this level-name))) (stack-size-set! (-> this main-thread) 512) @@ -417,10 +407,10 @@ ) ) (if (nonzero? (-> this alt-actor 0)) - (set! (-> gp-0 0 quad) (-> this alt-actor 0 extra trans quad)) + (vector-copy! (-> gp-0 0) (-> this alt-actor 0 extra trans)) ) (if (nonzero? (-> this alt-actor 1)) - (set! (-> gp-0 1 quad) (-> this alt-actor 1 extra trans quad)) + (vector-copy! (-> gp-0 1) (-> this alt-actor 1 extra trans)) ) (spawn-security-wall this (-> gp-0 0) (-> gp-0 1) 77824.0 #f) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 1) (-> gp-0 0)))) @@ -448,6 +438,7 @@ ;; definition for method 11 of type krimson-wall (defmethod init-from-entity! ((this krimson-wall) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) diff --git a/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc b/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc index 1643ce380a0..32d1207975b 100644 --- a/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/mh-squad-member_REF.gc @@ -96,6 +96,7 @@ ;; definition for method 59 of type mh-squad-member (defmethod enemy-common-post ((this mh-squad-member)) + "Common implementation of post. Runs ja-post." (local-vars (s5-0 int)) (when (focus-test? this dangerous) (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) @@ -138,10 +139,11 @@ ) ;; definition for method 84 of type mh-squad-member -(defmethod send-attack-on-jump-or-knocked ((this mh-squad-member) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this mh-squad-member) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond (#f - ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type citizen enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -177,7 +179,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -228,7 +230,7 @@ (not (logtest? (-> (the-as process-focusable a0-18) focus-status) (focus-status disable dead inactive))) ) (let* ((s5-1 this) - (s4-0 (method-of-object s5-1 enemy-method-70)) + (s4-0 (method-of-object s5-1 set-focus!)) (s3-0 (handle->process (-> this current-enemy))) ) (s4-0 diff --git a/test/decompiler/reference/jak3/levels/city/common/nav-graph-h_REF.gc b/test/decompiler/reference/jak3/levels/city/common/nav-graph-h_REF.gc index 5919012a00d..26804fca991 100644 --- a/test/decompiler/reference/jak3/levels/city/common/nav-graph-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/nav-graph-h_REF.gc @@ -183,7 +183,7 @@ ;; definition for method 18 of type nav-node ;; INFO: Used lq/sq (defmethod get-position ((this nav-node) (arg0 vector)) - (set! (-> arg0 quad) (-> this position quad)) + (vector-copy! arg0 (-> this position)) (set! (-> arg0 w) 1.0) arg0 ) diff --git a/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc b/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc index 152100753ed..ff41402a0fe 100644 --- a/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/nav-graph_REF.gc @@ -67,7 +67,7 @@ (let ((a1-0 this) (v1-0 gp-0) ) - (set! (-> v1-0 quad) (-> a1-0 position quad)) + (vector-copy! v1-0 (-> a1-0 position)) (set! (-> v1-0 w) 1.0) ) (set! (-> s4-0 quad) (-> gp-0 quad)) @@ -274,7 +274,7 @@ (let ((a2-6 this) (a0-19 v1-24) ) - (set! (-> a0-19 quad) (-> a2-6 position quad)) + (vector-copy! a0-19 (-> a2-6 position)) (set! (-> a0-19 w) 1.0) ) (format arg0 "~S~T :position (~4,,2M ~4,,2M ~4,,2M)~%" arg1 (-> v1-24 x) (-> v1-24 y) (-> v1-24 z)) @@ -304,7 +304,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-pos-xyz ((this nav-node) (arg0 vector)) (let ((f0-0 (-> this position w))) - (set! (-> this position quad) (-> arg0 quad)) + (vector-copy! (-> this position) arg0) (set! (-> this position w) f0-0) ) 0 @@ -903,7 +903,7 @@ (let ((a2-0 a0-2) (v1-4 s4-0) ) - (set! (-> v1-4 quad) (-> a2-0 position quad)) + (vector-copy! v1-4 (-> a2-0 position)) (set! (-> v1-4 w) 1.0) ) (vector+! s4-0 s4-0 arg0) @@ -954,7 +954,7 @@ (let ((a1-0 s3-0) (v1-6 (-> s5-0 rvec)) ) - (set! (-> v1-6 quad) (-> a1-0 position quad)) + (vector-copy! v1-6 (-> a1-0 position)) (set! (-> v1-6 w) 1.0) ) (dotimes (s2-0 (-> s3-0 branch-count)) @@ -963,7 +963,7 @@ (let ((a2-0 v1-9) (a0-7 (-> s5-0 uvec)) ) - (set! (-> a0-7 quad) (-> a2-0 position quad)) + (vector-copy! a0-7 (-> a2-0 position)) (set! (-> a0-7 w) 1.0) ) (vector-! (-> s5-0 fvec) (-> s5-0 uvec) (-> s5-0 rvec)) @@ -1020,7 +1020,7 @@ (let ((a2-1 s1-0) (v1-8 a1-1) ) - (set! (-> v1-8 quad) (-> a2-1 position quad)) + (vector-copy! v1-8 (-> a2-1 position)) (set! (-> v1-8 w) 1.0) ) (let ((f0-3 (vector-vector-distance-squared arg0 a1-1))) @@ -1052,7 +1052,7 @@ (let ((a1-0 s4-0) (v1-8 s3-0) ) - (set! (-> v1-8 quad) (-> a1-0 position quad)) + (vector-copy! v1-8 (-> a1-0 position)) (set! (-> v1-8 w) 1.0) ) (let ((a1-3 s3-0)) @@ -1078,7 +1078,7 @@ (let ((a1-0 s4-0) (v1-1 s3-0) ) - (set! (-> v1-1 quad) (-> a1-0 position quad)) + (vector-copy! v1-1 (-> a1-0 position)) (set! (-> v1-1 w) 1.0) ) (when (logtest? (-> s4-0 flags) (nav-node-flag-byte pedestrian)) @@ -1234,7 +1234,7 @@ (let ((t0-0 a0-12) (a2-8 (-> a1-7 position)) ) - (set! (-> a2-8 quad) (-> t0-0 position quad)) + (vector-copy! a2-8 (-> t0-0 position)) (set! (-> a2-8 w) 1.0) ) (set! (-> a1-7 level_name) (-> a0-12 level)) diff --git a/test/decompiler/reference/jak3/levels/city/common/searchlight_REF.gc b/test/decompiler/reference/jak3/levels/city/common/searchlight_REF.gc index 528bcd9364d..67b2b6a3ad5 100644 --- a/test/decompiler/reference/jak3/levels/city/common/searchlight_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/searchlight_REF.gc @@ -78,6 +78,7 @@ ;; definition for method 11 of type searchlight (defmethod init-from-entity! ((this searchlight) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -108,7 +109,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/common/trail_REF.gc b/test/decompiler/reference/jak3/levels/city/common/trail_REF.gc index 8741a910f1f..4bd0f407f37 100644 --- a/test/decompiler/reference/jak3/levels/city/common/trail_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/common/trail_REF.gc @@ -102,11 +102,11 @@ (+ (* (-> s5-0 cell-width) (the float (/ arg0 16))) (-> s5-0 origin z)) 1.0 ) - (set! (-> s3-0 1 quad) (-> s3-0 0 quad)) + (vector-copy! (-> s3-0 1) (-> s3-0 0)) (+! (-> s3-0 1 x) (-> s5-0 cell-width)) - (set! (-> s3-0 2 quad) (-> s3-0 1 quad)) + (vector-copy! (-> s3-0 2) (-> s3-0 1)) (+! (-> s3-0 2 z) (-> s5-0 cell-width)) - (set! (-> s3-0 3 quad) (-> s3-0 2 quad)) + (vector-copy! (-> s3-0 3) (-> s3-0 2)) (set! (-> s3-0 3 x) (- (-> s3-0 3 x) (-> s5-0 cell-width))) (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s3-0 0) (-> s3-0 1) *color-white* #f (the-as rgba -1)) (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s3-0 1) (-> s3-0 2) *color-white* #f (the-as rgba -1)) @@ -164,7 +164,7 @@ (set-vector! (-> s0-0 1) (+ (-> arg2 x) arg5) (+ (-> arg2 y) arg5) (+ (-> arg2 z) arg5) 1.0) (set! sv-48 0) (until #f - (set! (-> s0-0 0 quad) (-> s0-0 1 quad)) + (vector-copy! (-> s0-0 0) (-> s0-0 1)) (cond ((< sv-48 arg0) (let ((a0-6 (-> this node (-> arg1 sv-48)))) @@ -197,10 +197,10 @@ (defmethod debug-draw ((this trail-graph)) (when (= (-> this mode) 3) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-0 1 quad) (-> this orig-goal-pos quad)) + (vector-copy! (-> s5-0 1) (-> this orig-goal-pos)) (let ((v1-3 (-> this goal-node-id))) (until #f - (set! (-> s5-0 0 quad) (-> s5-0 1 quad)) + (vector-copy! (-> s5-0 0) (-> s5-0 1)) (cond ((>= v1-3 0) (let ((s4-0 (-> this node v1-3))) @@ -216,7 +216,7 @@ ) ) (else - (set! (-> s5-0 1 quad) (-> this orig-start-pos quad)) + (vector-copy! (-> s5-0 1) (-> this orig-start-pos)) (add-debug-line #t (bucket-id debug) (-> s5-0 0) (-> s5-0 1) *color-green* #f (the-as rgba -1)) (goto cfg-7) ) @@ -237,7 +237,7 @@ (meters 1) (new 'static 'rgba :r #xff :a #x80) ) - (set! (-> s5-1 quad) (-> this conn-start-pos quad)) + (vector-copy! s5-1 (-> this conn-start-pos)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-1 (meters 0.25) (new 'static 'rgba :r #xff :a #x80)) (add-debug-sphere #t @@ -246,7 +246,7 @@ (meters 1) (new 'static 'rgba :g #xff :a #x80) ) - (set! (-> s5-1 quad) (-> this conn-goal-pos quad)) + (vector-copy! s5-1 (-> this conn-goal-pos)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-1 (meters 0.25) (new 'static 'rgba :g #xff :a #x80)) ) ) @@ -516,7 +516,7 @@ ) (set! (-> arg0 best-dist) f0-14) (set! (-> arg0 best-conn-id) (the-as int s2-0)) - (set! (-> arg0 conn-pos quad) (-> s1-0 quad)) + (vector-copy! (-> arg0 conn-pos) s1-0) ) ) ) @@ -692,7 +692,7 @@ (cond ((< (seconds 1) a0-2) (set! (-> gp-0 last-updated) v1-1) - (set! (-> gp-0 start-pos quad) (-> this orig-start-pos quad)) + (vector-copy! (-> gp-0 start-pos) (-> this orig-start-pos)) (let* ((v1-7 (-> this cell-pov-bit-arrays (trail-graph-method-18 this (-> gp-0 start-pos)))) (s3-0 (-> this node 0)) (s2-0 1) @@ -712,7 +712,7 @@ ) ((> a0-2 0) (set! (-> gp-0 last-updated) v1-1) - (set! (-> gp-0 start-pos quad) (-> this orig-start-pos quad)) + (vector-copy! (-> gp-0 start-pos) (-> this orig-start-pos)) (let ((s3-1 (-> this cell-pov-bit-arrays (trail-graph-method-18 this (-> gp-0 start-pos))))) (set! s4-2 (logand (-> gp-0 pov-can-see-start) s3-1)) (let ((s2-1 (-> gp-0 next-node-id))) @@ -752,10 +752,10 @@ ;; INFO: Used lq/sq (defmethod trail-graph-method-13 ((this trail-graph) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) - (set! (-> gp-0 1 quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 1) arg0) (set! (-> gp-0 1 y) 0.0) (set! (-> gp-0 1 w) 1.0) - (set! (-> gp-0 2 quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 2) arg1) (set! (-> gp-0 2 y) 0.0) (set! (-> gp-0 2 w) 1.0) (let ((s5-0 (-> this blocker 0))) @@ -1053,7 +1053,7 @@ (* 4096.0 (the float (-> v1-2 z))) 1.0 ) - (set! (-> s5-0 p1 quad) (-> s5-0 p0 quad)) + (vector-copy! (-> s5-0 p1) (-> s5-0 p0)) (set! (-> s5-0 best-count) (the-as uint 0)) (set! (-> s5-0 best-dist) -1.0) (let ((s2-0 (&-> (-> this conn-ids) (-> v1-2 first-conn)))) @@ -1114,7 +1114,7 @@ (local-vars (v0-6 int)) (trail-graph-method-26 this) (+! (-> this search-id) 1) - (set! (-> this orig-start-pos quad) (-> arg0 quad)) + (vector-copy! (-> this orig-start-pos) arg0) (let ((s5-1 0)) (let ((a1-1 -1)) (when arg2 @@ -1125,17 +1125,17 @@ (= (-> arg2 orig-goal-pos z) (-> arg1 z)) ) (set! a1-1 v1-6) - (set! (-> this conn-goal-pos quad) (-> arg2 conn-goal-pos quad)) + (vector-copy! (-> this conn-goal-pos) (-> arg2 conn-goal-pos)) ) ) ) - (set! (-> this orig-goal-pos quad) (-> arg1 quad)) + (vector-copy! (-> this orig-goal-pos) arg1) (when (< a1-1 0) (set! a1-1 (trail-graph-method-17 this (-> this orig-goal-pos) (-> this conn-goal-pos))) (when arg2 (set! (-> arg2 goal-conn-id) a1-1) - (set! (-> arg2 orig-goal-pos quad) (-> this orig-goal-pos quad)) - (set! (-> arg2 conn-goal-pos quad) (-> this conn-goal-pos quad)) + (vector-copy! (-> arg2 orig-goal-pos) (-> this orig-goal-pos)) + (vector-copy! (-> arg2 conn-goal-pos) (-> this conn-goal-pos)) ) ) (set! (-> this goal-conn-id) a1-1) diff --git a/test/decompiler/reference/jak3/levels/city/ctyport-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/ctyport-obs_REF.gc index f916841f232..2e2a8681b7d 100644 --- a/test/decompiler/reference/jak3/levels/city/ctyport-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/ctyport-obs_REF.gc @@ -384,12 +384,12 @@ (when (not (logtest? (-> this rbody flags) (rigid-body-flag enable-physics))) (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 6))) (let ((a1-1 (-> this nav state))) - (set! (-> s5-1 0 quad) (-> a1-1 velocity quad)) + (vector-copy! (-> s5-1 0) (-> a1-1 velocity)) ) (let ((s4-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info))) (let ((s3-0 (-> this nav state current-poly))) (vector-xz-normalize-copy! (-> s5-1 3) (-> s5-1 0) 163840.0) - (set! (-> s5-1 4 quad) (-> s5-1 3 quad)) + (vector-copy! (-> s5-1 4) (-> s5-1 3)) (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s3-0 (-> s5-1 4) s4-0) ) (when (-> s4-0 found-boundary) @@ -415,7 +415,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-42 vf1) (when (< f0-5 v1-42) - (set! (-> s5-1 5 quad) (-> s5-1 0 quad)) + (vector-copy! (-> s5-1 5) (-> s5-1 0)) (vector-normalize! (-> s5-1 5) 1.0) (let ((s4-1 (-> this root quat))) (quaternion-set! (the-as quaternion (-> s5-1 2)) 0.0 (-> s5-1 5 x) 0.0 (+ 1.0 (-> s5-1 5 z))) @@ -441,7 +441,7 @@ ) (when s4-2 (let ((a1-22 (-> this nav state))) - (set! (-> s5-2 quad) (-> a1-22 target-pos quad)) + (vector-copy! s5-2 (-> a1-22 target-pos)) ) (if (or (= (-> this path-num) 2) (-> *setting-control* user-current stop-boats?)) (get-point-at-percent-along-path! @@ -468,7 +468,7 @@ (let ((v1-102 (-> this nav state))) (logclear! (-> v1-102 flags) (nav-state-flag directional-mode)) (logior! (-> v1-102 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-102 target-pos quad) (-> s5-2 quad)) + (vector-copy! (-> v1-102 target-pos) s5-2) ) 0 ) @@ -491,7 +491,7 @@ (s4-0 (new 'stack-no-clear 'matrix)) ) (let ((a1-1 (-> this nav state))) - (set! (-> s4-0 uvec quad) (-> a1-1 velocity quad)) + (vector-copy! (-> s4-0 uvec) (-> a1-1 velocity)) ) (vector-! (-> s4-0 rvec) (-> s4-0 uvec) (-> s3-0 lin-velocity)) (vector-float*! (-> s4-0 rvec) (-> s4-0 rvec) (* 4.0 (-> s2-0 info mass))) @@ -918,8 +918,8 @@ (set! (-> s2-0 flags) (traffic-spawn-flags tsf0)) (set! (-> s2-0 guard-type) (the-as uint 11)) (set! (-> s2-0 entity) #f) - (set! (-> s2-0 velocity quad) (-> s3-0 uvec quad)) - (set! (-> s2-0 position quad) (-> s3-0 rvec quad)) + (vector-copy! (-> s2-0 velocity) (-> s3-0 uvec)) + (vector-copy! (-> s2-0 position) (-> s3-0 rvec)) (quaternion-copy! (-> s2-0 rotation) (the-as quaternion (-> s3-0 trans))) (set! (-> s2-0 position w) f30-0) (when (vehicle-spawn-hack barge s2-0 this) @@ -943,6 +943,7 @@ ;; definition for method 11 of type boat-manager (defmethod init-from-entity! ((this boat-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) (set! (-> this entity) arg0) (set! (-> this boats-stop?) (-> *setting-control* user-current stop-boats?)) @@ -954,7 +955,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc index 3bd2be38cbf..7500b56798b 100644 --- a/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/ctywide-obs_REF.gc @@ -217,7 +217,7 @@ ) (when (< f0-0 (* f1-1 f1-1)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) - (set! (-> s5-0 0 quad) (-> s4-0 control trans quad)) + (vector-copy! (-> s5-0 0) (-> s4-0 control trans)) (when (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) (* f30-0 f30-0)) (let ((f0-3 (vector4-dot (-> this target-pos) (the-as vector (-> this plane)))) (f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> this plane)))) @@ -230,7 +230,7 @@ ) ) ) - (set! (-> this target-pos quad) (-> s5-0 0 quad)) + (vector-copy! (-> this target-pos) (-> s5-0 0)) ) (when (-> this breach) (if (send-event @@ -532,7 +532,7 @@ (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) (set! (-> s1-0 scale y) (/ arg2 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) - (set! (-> s2-1 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-copy! (-> s2-1 uvec) (new 'static 'vector :y 1.0 :w 1.0)) (vector-cross! (-> s2-1 fvec) (-> s2-1 rvec) (-> s2-1 uvec)) (vector-normalize! (-> s2-1 fvec) 1.0) (matrix->quaternion (-> s1-0 quat) s2-1) @@ -556,6 +556,7 @@ ;; definition for method 11 of type security-wall (defmethod init-from-entity! ((this security-wall) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (set! (-> this breach) #f) (set! (-> this pass) (res-lump-value arg0 'pickup-type pickup-type :time -1000000000.0)) @@ -783,8 +784,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod parking-spot-method-24 ((this parking-spot)) (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> gp-0 vec0 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> gp-0 vec0) (-> this root trans)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec0)) (vector-reset! (-> gp-0 vec1)) (set! (-> gp-0 vec1 y) 1.0) (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) @@ -801,15 +802,15 @@ (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) (when (>= f30-0 0.0) (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) - (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) - (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> gp-0 vec1) (-> gp-0 cquery best-other-tri normal)) + (vector-copy! (-> this root trans) (-> gp-0 vec0)) (format #t "parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) ) (if (< f30-0 0.0) (format #t "parking-spot::find-ground: could not find ground~%") ) ) - (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec0)) (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) ) 0 @@ -916,7 +917,7 @@ (a1-2 (the-as uint #xa01013fd)) (a2-1 (logand -2 a1-2)) ) - (set! (-> a0-1 0 quad) (-> this test-sphere quad)) + (vector-copy! (-> a0-1 0) (-> this test-sphere)) (let ((a1-4 (-> v1-0 cquery))) (set! (-> a1-4 best-dist) (the-as float a0-1)) (set! (-> a1-4 best-other-prim) (the-as collide-shape-prim 1)) @@ -933,7 +934,7 @@ 0 (when (not (fill-and-probe-using-spheres *collide-cache* (-> v1-0 cquery))) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 position quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 position) (-> this root trans)) (mem-copy! (the-as pointer (-> s4-0 rotation)) (the-as pointer (-> this root quat)) 16) (+! (-> s4-0 position y) 14336.0) (set! (-> s4-0 behavior) (the-as uint 0)) @@ -961,6 +962,7 @@ ;; definition for method 11 of type parking-spot ;; INFO: Used lq/sq (defmethod init-from-entity! ((this parking-spot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (set! (-> this minimap) #f) (set! (-> this vehicle) (the-as handle #f)) @@ -1242,7 +1244,7 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a0-12 quad) vf6) - (set! (-> v1-25 quad) (-> a0-12 quad)) + (vector-copy! v1-25 a0-12) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 224)) ) @@ -1263,7 +1265,7 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a0-17 quad) vf6) - (set! (-> v1-40 quad) (-> a0-17 quad)) + (vector-copy! v1-40 a0-17) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 224)) ) @@ -1327,7 +1329,7 @@ ) ) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> self root trans quad)) + (vector-copy! a1-4 (-> self root trans)) (set! (-> a1-4 w) 40960.0) (propa-method-32 self a1-4) ) @@ -1501,6 +1503,7 @@ ;; definition for method 11 of type propa (defmethod init-from-entity! ((this propa) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (propa-method-30 this) (process-drawable-from-entity! this arg0) (ctywide-entity-hack) @@ -1602,18 +1605,7 @@ ) :trans (behavior () (let ((gp-0 (get-current-task-event (-> self task)))) - (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> self node-list data 3 bone transform)) - (v1-4 (-> a2-0 rvec quad)) - (a0-1 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s5-0 rvec quad) v1-4) - (set! (-> s5-0 uvec quad) a0-1) - (set! (-> s5-0 fvec quad) a1-0) - (set! (-> s5-0 trans quad) a2-1) - ) + (let ((s5-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform)))) (when (< (vector-dot (-> s5-0 fvec) (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans s5-0 (new 'stack-no-clear 'vector))) @@ -1810,7 +1802,7 @@ (vector+! s5-0 s4-0 (s3-0 s2-0 s1-0 (s0-0 (the-as quaternion sv-272) sv-288 a2-1))) ) ) - (set! (-> *camera* slave 0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> *camera* slave 0 trans) gp-0) (let ((t9-4 forward-down->inv-matrix) (a0-6 (-> *camera* slave 0 tracking)) (a1-3 (new 'stack-no-clear 'vector)) @@ -1833,18 +1825,7 @@ ) ) ) - (let ((gp-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-6 (-> self node-list data 3 bone transform)) - (v1-23 (-> a2-6 rvec quad)) - (a0-7 (-> a2-6 uvec quad)) - (a1-5 (-> a2-6 fvec quad)) - (a2-7 (-> a2-6 trans quad)) - ) - (set! (-> gp-1 rvec quad) v1-23) - (set! (-> gp-1 uvec quad) a0-7) - (set! (-> gp-1 fvec quad) a1-5) - (set! (-> gp-1 trans quad) a2-7) - ) + (let ((gp-1 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform)))) (if (< (vector-dot (-> gp-1 fvec) (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-1 (new 'stack-no-clear 'vector))) @@ -2060,7 +2041,7 @@ (-> self root quat) ) ) - (set! (-> *camera* slave 0 trans quad) (-> gp-1 quad)) + (vector-copy! (-> *camera* slave 0 trans) gp-1) (let ((t9-6 forward-down->inv-matrix) (a0-27 (-> *camera* slave 0 tracking)) (a1-13 (new 'stack-no-clear 'vector)) @@ -2083,18 +2064,7 @@ ) ) ) - (let ((gp-2 (new 'stack-no-clear 'matrix))) - (let* ((a2-11 (-> self node-list data 3 bone transform)) - (v1-40 (-> a2-11 rvec quad)) - (a0-28 (-> a2-11 uvec quad)) - (a1-15 (-> a2-11 fvec quad)) - (a2-12 (-> a2-11 trans quad)) - ) - (set! (-> gp-2 rvec quad) v1-40) - (set! (-> gp-2 uvec quad) a0-28) - (set! (-> gp-2 fvec quad) a1-15) - (set! (-> gp-2 trans quad) a2-12) - ) + (let ((gp-2 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform)))) (if (< (vector-dot (-> gp-2 fvec) (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans gp-2 (new 'stack-no-clear 'vector))) @@ -2292,6 +2262,7 @@ ;; definition for method 11 of type burning-bush (defmethod init-from-entity! ((this burning-bush) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (burning-bush-method-32 this) (process-drawable-from-entity! this arg0) (ctywide-entity-hack) @@ -2583,7 +2554,7 @@ (set! (-> t1-1 fade-time) (the-as time-frame (the int (-> *city-burning-bush-get-on-info* (-> self info index) time))) ) - (set! (-> a0-3 quad) (-> *city-burning-bush-get-on-info* (-> self info index) trans quad)) + (vector-copy! a0-3 (-> *city-burning-bush-get-on-info* (-> self info index) trans)) (+! (-> a0-3 y) 4096.0) (set! (-> self skill) (ppointer->handle @@ -2603,24 +2574,13 @@ (suspend) (let ((f30-0 (-> *camera* settings fov))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *camera-combiner* trans quad)) - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-7 (-> *camera-combiner* inv-camera-rot)) - (v1-46 (-> a2-7 rvec quad)) - (a0-15 (-> a2-7 uvec quad)) - (a1-15 (-> a2-7 fvec quad)) - (a2-8 (-> a2-7 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-46) - (set! (-> gp-0 uvec quad) a0-15) - (set! (-> gp-0 fvec quad) a1-15) - (set! (-> gp-0 trans quad) a2-8) - ) + (vector-copy! s5-0 (-> *camera-combiner* trans)) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> *camera-combiner* inv-camera-rot)))) (let ((s4-0 (new 'stack 'transformq))) (let ((v1-52 (-> *city-burning-bush-get-on-info* (-> self info index))) (a1-17 (new 'stack-no-clear 'matrix)) ) - (set! (-> s4-0 trans quad) (-> v1-52 camera-trans quad)) + (vector-copy! (-> s4-0 trans) (-> v1-52 camera-trans)) (set-vector! (-> s4-0 scale) 1.0 1.0 1.0 1.0) (set! (-> a1-17 rvec x) (-> v1-52 camera-rot 0)) (set! (-> a1-17 rvec y) (-> v1-52 camera-rot 1)) @@ -2645,18 +2605,8 @@ (suspend-for (seconds 3) (set! (-> *camera* slave 0 fov) (-> *city-burning-bush-get-on-info* (-> self info index) fov)) ) - (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) - (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) - (v1-74 (-> gp-0 rvec quad)) - (a0-24 (-> gp-0 uvec quad)) - (a1-19 (-> gp-0 fvec quad)) - (a3-5 (-> gp-0 trans quad)) - ) - (set! (-> a2-15 rvec quad) v1-74) - (set! (-> a2-15 uvec quad) a0-24) - (set! (-> a2-15 fvec quad) a1-19) - (set! (-> a2-15 trans quad) a3-5) - ) + (vector-copy! (-> *camera-combiner* trans) s5-0) + (matrix-copy! (-> *camera-combiner* inv-camera-rot) gp-0) ) ) (set! (-> *camera* settings fov) f30-0) @@ -2715,12 +2665,12 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init ((this city-ambush-info) (arg0 traffic-object-spawn-params)) - (set! (-> arg0 position quad) (-> this array 0 pos quad)) + (vector-copy! (-> arg0 position) (-> this array 0 pos)) (set! (-> arg0 nav-mesh) (find-nearest-nav-mesh (-> arg0 position) (the-as float #x7f800000))) (vector-reset! (-> arg0 velocity)) (dotimes (s4-0 (-> this count)) (let ((v1-3 (-> this array s4-0))) - (set! (-> arg0 position quad) (-> v1-3 pos quad)) + (vector-copy! (-> arg0 position) (-> v1-3 pos)) (set! (-> arg0 object-type) (-> v1-3 obj-type)) ) (send-event *traffic-manager* 'activate-object arg0) @@ -2785,7 +2735,7 @@ (let ((s5-0 proc) (gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) ) - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (the-as joint-exploder s5-0) root trans quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) (-> (the-as joint-exploder s5-0) root trans)) (set! (-> gp-0 fountain-rand-transv-hi x) 16384.0) (set! (-> gp-0 fountain-rand-transv-hi y) 40960.0) (process-spawn @@ -2885,6 +2835,7 @@ ;; definition for method 11 of type ctyn-lamp (defmethod init-from-entity! ((this ctyn-lamp) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctyn-lamp-method-30 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2957,6 +2908,7 @@ ;; definition for method 11 of type fac-lorez (defmethod init-from-entity! ((this fac-lorez) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -3065,6 +3017,7 @@ ;; definition for method 11 of type flitter-spawner ;; INFO: Used lq/sq (defmethod init-from-entity! ((this flitter-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -3118,7 +3071,7 @@ (defmethod spawn-flitter ((this flitter-spawner) (arg0 entity-actor)) (let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params))) (set! (-> gp-0 velocity quad) (the-as uint128 0)) - (set! (-> gp-0 position quad) (-> arg0 extra trans quad)) + (vector-copy! (-> gp-0 position) (-> arg0 extra trans)) (quaternion-copy! (-> gp-0 rotation) (-> arg0 quat)) (set! (-> gp-0 behavior) (the-as uint 2)) (set! (-> gp-0 object-type) (traffic-type metalhead-flitter)) @@ -3142,7 +3095,7 @@ (set! (-> v1-8 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) - (set! (-> s4-0 quad) (-> s3-0 best-other-tri intersect quad)) + (vector-copy! s4-0 (-> s3-0 best-other-tri intersect)) ) ) (set! (-> gp-0 nav-mesh) (find-nearest-nav-mesh s4-0 (the-as float #x7f800000))) @@ -3938,6 +3891,7 @@ ;; definition for method 11 of type mh-tower-smoke-cty (defmethod init-from-entity! ((this mh-tower-smoke-cty) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc index 96bcb8690aa..7d5c1a854f5 100644 --- a/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/ctywide-tasks_REF.gc @@ -291,9 +291,9 @@ ) (until v1-22 (suspend) - (set! v1-22 (and (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) - (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) - (= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) + (set! v1-22 (and (= (level-status? *level* 'ctypesb #f) 'active) + (= (level-status? *level* 'ctypesc #f) 'active) + (= (level-status? *level* 'ctypesa #f) 'active) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/ctywide-texture_REF.gc b/test/decompiler/reference/jak3/levels/city/ctywide-texture_REF.gc index 9776e42fdbe..d66f1695275 100644 --- a/test/decompiler/reference/jak3/levels/city/ctywide-texture_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/ctywide-texture_REF.gc @@ -146,17 +146,17 @@ ;; INFO: Used lq/sq (defun set-security-color! ((arg0 vector)) (let ((v1-1 (-> *security-texture-anim-array* array-data 0))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-1 data 0 start-color) arg0) + (vector-copy! (-> v1-1 data 0 end-color) arg0) + (vector-copy! (-> v1-1 data 1 start-color) arg0) + (vector-copy! (-> v1-1 data 1 end-color) arg0) ) (let ((v1-5 (-> *security-texture-anim-array* array-data 1))) - (set! (-> v1-5 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 1 end-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 2 start-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-5 data 1 start-color) arg0) + (vector-copy! (-> v1-5 data 1 end-color) arg0) + (vector-copy! (-> v1-5 data 2 start-color) arg0) (let ((v0-0 (-> v1-5 data 2 end-color))) - (set! (-> v0-0 quad) (-> arg0 quad)) + (vector-copy! v0-0 arg0) v0-0 ) ) @@ -166,9 +166,9 @@ ;; INFO: Used lq/sq (defun set-security-flash! ((arg0 vector)) (let ((v1-1 (-> *security-texture-anim-array* array-data 1))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-1 data 0 start-color) arg0) (let ((v0-0 (-> v1-1 data 0 end-color))) - (set! (-> v0-0 quad) (-> arg0 quad)) + (vector-copy! v0-0 arg0) v0-0 ) ) @@ -197,7 +197,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc b/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc index 26f857d02df..704c98fb0ed 100644 --- a/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/destroy-grid/cty-destroy-grid_REF.gc @@ -200,34 +200,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 45056.0 - :knocked-soft-vxz-hi 54067.2 - :knocked-soft-vy-lo 38092.8 - :knocked-soft-vy-hi 45056.0 - :knocked-medium-vxz-lo 65536.0 - :knocked-medium-vxz-hi 74547.2 - :knocked-medium-vy-lo 65536.0 - :knocked-medium-vy-hi 73728.0 - :knocked-hard-vxz-lo 66355.2 - :knocked-hard-vxz-hi 85196.8 - :knocked-hard-vy-lo 60620.8 - :knocked-hard-vy-hi 101580.8 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 73728.0 - :knocked-red-vy-lo 65536.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 40960.0 + :knocked-soft-vxz-lo (meters 11) + :knocked-soft-vxz-hi (meters 13.2) + :knocked-soft-vy-lo (meters 9.3) + :knocked-soft-vy-hi (meters 11) + :knocked-medium-vxz-lo (meters 16) + :knocked-medium-vxz-hi (meters 18.2) + :knocked-medium-vy-lo (meters 16) + :knocked-medium-vy-hi (meters 18) + :knocked-hard-vxz-lo (meters 16.2) + :knocked-hard-vxz-hi (meters 20.8) + :knocked-hard-vy-lo (meters 14.8) + :knocked-hard-vy-hi (meters 24.8) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 18) + :knocked-red-vy-lo (meters 16) + :knocked-red-vy-hi (meters 20) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 10) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -354,11 +354,13 @@ ;; definition for method 81 of type jinx (defmethod go-die ((this jinx)) + "Go to the die state." ((method-of-type nav-enemy go-die) this) ) ;; definition for method 139 of type jinx (defmethod move-above-ground! ((this jinx) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." ((method-of-type nav-enemy move-above-ground!) this arg0 arg1) (none) ) @@ -377,6 +379,7 @@ ;; definition for method 59 of type jinx (defmethod enemy-common-post ((this jinx)) + "Common implementation of post. Runs ja-post." (logior! (-> this flags) (citizen-flag persistent)) (update-nav-mesh this) (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) @@ -524,8 +527,8 @@ ) (let ((s3-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (set! (-> s2-0 quad) (-> self root trans quad)) - (set! (-> s1-0 quad) (-> gp-0 quad)) + (vector-copy! s2-0 (-> self root trans)) + (vector-copy! s1-0 gp-0) (vector-! s5-0 gp-0 (-> s0-0 root trans)) (vector-z-quaternion! s4-0 (-> self root quat)) (let ((f30-1 (* 0.5 (vector-vector-xz-distance s2-0 s1-0)))) @@ -537,7 +540,7 @@ (let ((v1-20 (-> self nav state))) (logclear! (-> v1-20 flags) (nav-state-flag directional-mode)) (logior! (-> v1-20 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-20 target-pos quad) (-> s3-0 quad)) + (vector-copy! (-> v1-20 target-pos) s3-0) ) ) 0 @@ -697,7 +700,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! jinx-get-in-car-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -735,7 +738,7 @@ :virtual #t :code (behavior () (cond - ((enemy-method-109 self) + ((out-of-bounds? self) (go-die self) ) ((>= 0.0 (-> self box-time)) @@ -798,7 +801,7 @@ ) (logclear! (-> a0-5 flags) (nav-state-flag directional-mode)) (logior! (-> a0-5 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-5 target-pos quad) (-> v1-14 quad)) + (vector-copy! (-> a0-5 target-pos) v1-14) ) 0 (citizen-method-195 self) @@ -862,7 +865,7 @@ (ja :num! (seek!)) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> gp-0 quad)) + (vector-copy! s5-1 gp-0) (let ((gp-1 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! jinx-get-out-car-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1017,7 +1020,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1036,7 +1039,7 @@ (nav-enemy-method-177 self) ) :trans (behavior () - (set! (-> self destination quad) (-> self event-param-point quad)) + (vector-copy! (-> self destination) (-> self event-param-point)) (if (< (vector-vector-distance (-> self destination) (-> self root trans)) 10240.0) (go-virtual do-power-box) ) @@ -1054,7 +1057,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1226,6 +1229,7 @@ ;; definition for method 82 of type jinx (defmethod event-handler ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('nav-mesh-kill) (set! (-> this nav-mesh-aid) (the-as actor-id (-> this nav state mesh entity aid))) @@ -1239,13 +1243,14 @@ ) ;; definition for method 84 of type jinx -(defmethod send-attack-on-jump-or-knocked ((this jinx) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this jinx) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'knocked) (= v1-3 'jump)) ) ) - ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type nav-enemy enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -1280,7 +1285,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -1319,6 +1324,7 @@ ;; definition for method 120 of type jinx ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this jinx)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1391,21 +1397,21 @@ ) ;; definition for method 119 of type jinx -;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-defaults! ((this jinx) (arg0 nav-enemy-info)) +;; WARN: Return type mismatch int vs object. +(defmethod setup-enemy! ((this jinx) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) 0 - (none) ) ;; definition for method 121 of type jinx ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this jinx)) + "Typical place for shared init code. Runs from entity or process style init." (set-vector! (-> this follow-dir) 0.0 0.0 1.0 1.0) (logclear! (-> this mask) (process-mask enemy)) (logior! (-> this mask) (process-mask bot)) @@ -1419,7 +1425,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-jinx" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *jinx-nav-enemy-info*) + (setup-enemy! this *jinx-nav-enemy-info*) (set! (-> this draw light-index) (the-as uint 10)) (set! (-> this shield-handle) (the-as handle #f)) (set! (-> this health-handle) @@ -1806,7 +1812,7 @@ (dotimes (s4-0 (length (-> this actor-group 0))) (let ((s3-0 (-> this actor-group 0 data s4-0))) (when (= (-> this next-box) s4-0) - (set! (-> this goal-pos quad) (-> s3-0 actor trans quad)) + (vector-copy! (-> this goal-pos) (-> s3-0 actor trans)) (let ((s2-0 (-> this goal-pos-front))) (let ((s1-0 (-> s3-0 actor trans))) (let ((v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 actor quat)))) @@ -2014,9 +2020,7 @@ :virtual #t :code (behavior () (set-setting! 'borrow-hold-perm '(ctycara) 0.0 0) - (while (or (!= (status-of-level-and-borrows *level* 'ctycara #f) 'active) - (!= (status-of-level-and-borrows *level* 'mhcitya #f) 'active) - ) + (while (or (!= (level-status? *level* 'ctycara #f) 'active) (!= (level-status? *level* 'mhcitya #f) 'active)) (suspend) ) (call-parent-state-handler code) @@ -2051,7 +2055,7 @@ (let ((s5-0 *traffic-manager*) (gp-0 (new 'stack 'traffic-object-spawn-params)) ) - (set! (-> gp-0 position quad) (-> (new 'static 'vector :x -1781217.8 :y 49152.0 :z 3740217.0 :w 1.0) quad)) + (vector-copy! (-> gp-0 position) (new 'static 'vector :x -1781217.8 :y 49152.0 :z 3740217.0 :w 1.0)) (quaternion-copy! (-> gp-0 rotation) (new 'static 'quaternion :x 0.0013 :y 0.744 :z -0.0068 :w 0.6681)) (set! (-> gp-0 object-type) (traffic-type civilian-car-a)) (set! (-> gp-0 behavior) (the-as uint 0)) @@ -2069,7 +2073,7 @@ (let ((gp-1 (entity-by-name "tmanager-1"))) (when gp-1 (let ((s5-1 (new 'stack-no-clear 'enemy-init-by-other-params))) - (set! (-> s5-1 trans quad) (-> (new 'static 'vector :x -1785244.0 :y 35316.53 :z 3693337.5 :w 1.0) quad)) + (vector-copy! (-> s5-1 trans) (new 'static 'vector :x -1785244.0 :y 35316.53 :z 3693337.5 :w 1.0)) (quaternion-copy! (-> s5-1 quat) (new 'static 'quaternion :y 0.5494 :w 0.8355)) (set! (-> s5-1 entity) gp-1) (set! (-> s5-1 directed?) #f) @@ -2104,7 +2108,7 @@ ) (let ((gp-3 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-38 (new 'static 'vector :w 1.0))) - (set! (-> gp-3 pos quad) (-> a0-38 quad)) + (vector-copy! (-> gp-3 pos) a0-38) ) (quaternion-identity! (-> gp-3 quat)) (set! (-> gp-3 flags) (task-arrow-flags taf3 taf8)) @@ -2282,7 +2286,7 @@ ) 0 (let ((gp-4 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-4 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-4 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-4 spawn-quat)) (set! (-> gp-4 radius) 32768.0) (set! (-> gp-4 scale) 1.0) @@ -2311,7 +2315,7 @@ (set! (-> a1-11 hit-y-reaction) 0.6) (set! (-> a1-11 scale-rand-lo) 0.4) (set! (-> a1-11 scale-rand-hi) 0.7) - (set! (-> a1-11 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> a1-11 fountain-rand-transv-lo) (-> self root trans)) (+! (-> a1-11 fountain-rand-transv-lo y) -40960.0) (debris-spawn self a1-11 *combox-debris-params* (the-as process-drawable #f)) ) @@ -2323,6 +2327,7 @@ ;; definition for method 11 of type com-power-box ;; INFO: Used lq/sq (defmethod init-from-entity! ((this com-power-box) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-80 vector) (sv-96 vector)) (rlet ((acc :class vf) (vf0 :class vf) diff --git a/test/decompiler/reference/jak3/levels/city/farm/ctyfarm-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/farm/ctyfarm-obs_REF.gc index c601bfb4ee0..7574366ba2a 100644 --- a/test/decompiler/reference/jak3/levels/city/farm/ctyfarm-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/farm/ctyfarm-obs_REF.gc @@ -947,6 +947,7 @@ ;; definition for method 11 of type farm-marrow (defmethod init-from-entity! ((this farm-marrow) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -997,6 +998,7 @@ ;; definition for method 11 of type farm-beetree (defmethod init-from-entity! ((this farm-beetree) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1047,6 +1049,7 @@ ;; definition for method 11 of type farm-cabbage (defmethod init-from-entity! ((this farm-cabbage) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1097,6 +1100,7 @@ ;; definition for method 11 of type farm-small-cabbage (defmethod init-from-entity! ((this farm-small-cabbage) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1147,6 +1151,7 @@ ;; definition for method 11 of type farm-chilirots (defmethod init-from-entity! ((this farm-chilirots) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1205,6 +1210,7 @@ ;; definition for method 11 of type farm-sprinkler-barrels (defmethod init-from-entity! ((this farm-sprinkler-barrels) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1331,7 +1337,7 @@ ;; WARN: Return type mismatch int vs none. (defun birth-func-ctyfarma-drip ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (vector-copy! (-> s4-0 start-pos) (-> arg2 launchrot)) (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) (let ((v1-2 s4-0)) (set! (-> v1-2 radius) 40.96) @@ -1579,7 +1585,7 @@ ;; WARN: Return type mismatch int vs none. (defun birth-func-ctyfarmb-drip ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (vector-copy! (-> s4-0 start-pos) (-> arg2 launchrot)) (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) (let ((v1-2 s4-0)) (set! (-> v1-2 radius) 40.96) @@ -1765,7 +1771,3 @@ (:rotate-z (degrees 0) (degrees 3600)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/freehq/freehq-scenes_REF.gc b/test/decompiler/reference/jak3/levels/city/freehq/freehq-scenes_REF.gc index cad9d308706..0bac5de4bf0 100644 --- a/test/decompiler/reference/jak3/levels/city/freehq/freehq-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/freehq/freehq-scenes_REF.gc @@ -136,6 +136,7 @@ ;; definition for method 11 of type freehq-sml-door (defmethod init-from-entity! ((this freehq-sml-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -1040,7 +1041,3 @@ (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/hijack/billiards_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/billiards_REF.gc index 34aabb84d35..718b085173c 100644 --- a/test/decompiler/reference/jak3/levels/city/hijack/billiards_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/hijack/billiards_REF.gc @@ -104,8 +104,8 @@ (defmethod init! ((this billiard-table) (arg0 int) (arg1 vector) (arg2 vector)) (set! (-> this billiards) (new 'process 'billiard-ball-array arg0)) (set! (-> this billiards length) arg0) - (set! (-> this min-xyz quad) (-> arg1 quad)) - (set! (-> this max-xyz quad) (-> arg2 quad)) + (vector-copy! (-> this min-xyz) arg1) + (vector-copy! (-> this max-xyz) arg2) (dotimes (v1-4 (-> this billiards length)) (set! (-> this billiards data v1-4 size) 4096.0) ) @@ -179,13 +179,13 @@ (a1-4 (new 'stack-no-clear 'vector)) ) (let ((a3-0 (new 'stack-no-clear 'vector))) - (set! (-> a3-0 quad) (-> this accum-force quad)) + (vector-copy! a3-0 (-> this accum-force)) (vector-float*! a1-4 (-> a2-1 pos) (- 2.0 f1-1)) (vector-! a1-4 a1-4 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) (vector+float*! a1-4 a1-4 a3-0 f0-1) ) - (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) - (set! (-> a2-1 pos quad) (-> a1-4 quad)) + (vector-copy! (-> a2-1 prev-pos) (-> a2-1 pos)) + (vector-copy! (-> a2-1 pos) a1-4) ) ) ) @@ -278,7 +278,7 @@ ) (logior! (-> s3-1 flags) (billiard-ball-flag bb0)) (vector+float*! v1-38 (-> s3-1 prev-pos) a0-24 f30-1) - (set! (-> s1-2 quad) (-> a0-24 quad)) + (vector-copy! s1-2 a0-24) (set! (-> s1-2 data s2-1) (* -1.0 (-> s1-2 data s2-1))) (vector+float*! (-> s3-1 pos) v1-38 s1-2 (- 1.0 f30-1)) (let ((v1-39 (vector-normalize-copy! (new 'stack-no-clear 'vector) s1-2 1.0))) @@ -318,7 +318,3 @@ (add-debug-box #t (bucket-id debug) (-> this min-xyz) (-> this max-xyz) *color-red*) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack-missile_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack-missile_REF.gc index 059609a0fa5..9bb20d9eebc 100644 --- a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack-missile_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack-missile_REF.gc @@ -431,7 +431,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-hijack-missile" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) self (set! (-> self particle-trail) @@ -472,7 +472,7 @@ ) ) (if a0-5 - (set! (-> arg0 quad) (-> (get-trans a0-5 3) quad)) + (vector-copy! arg0 (get-trans a0-5 3)) ) ) arg0 @@ -482,7 +482,7 @@ ;; INFO: Used lq/sq (defmethod probe-ground ((this cty-hijack-missile) (arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 start-pos) arg0) (vector-! (-> v1-0 move-dist) arg1 (-> v1-0 start-pos)) (let ((a0-4 v1-0)) (set! (-> a0-4 radius) 8192.0) @@ -523,9 +523,7 @@ (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -2)) s5-0 ) - (set! (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -1) quad) - (-> s5-0 quad) - ) + (vector-copy! (-> this tracked-player-positions data (+ (-> this tracked-player-positions length) -1)) s5-0) (push-back (-> this tracked-player-positions) s5-0) ) ) @@ -641,11 +639,11 @@ :enter (behavior () (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217)) ) ) @@ -664,11 +662,11 @@ (logior! (-> self draw status) (draw-control-status no-draw)) (cond ((logtest? (-> *part-group-id-table* 296 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 296)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 296)) ) ) @@ -703,7 +701,7 @@ (s5-1 (new 'stack-no-clear 'vector)) ) (let ((s0-0 (new 'stack-no-clear 'vector))) - (set! (-> s0-0 quad) (-> s2-0 root transv quad)) + (vector-copy! s0-0 (-> s2-0 root transv)) (let ((v1-8 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s2-0 root quat))) (s1-0 (new 'stack-no-clear 'vector)) ) @@ -736,7 +734,7 @@ ) ) ) - (set! (-> arg0 quad) (-> s5-1 quad)) + (vector-copy! arg0 s5-1) ) (add-debug-sphere #t (bucket-id debug) arg0 (meters 2) *color-yellow*) arg0 @@ -773,11 +771,11 @@ (logior! (-> self draw status) (draw-control-status no-draw)) (cond ((logtest? (-> *part-group-id-table* 88 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 88)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 88)) ) ) @@ -855,7 +853,7 @@ (defmethod cty-hijack-missile-method-49 ((this cty-hijack-missile)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) - (set! (-> gp-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> gp-0 trans) (-> this root trans)) (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -3686.4) (spawn-from-mat (-> this part) gp-0) (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -4096.0) @@ -900,16 +898,14 @@ (when (-> this is-leader?) (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((s3-0 arg0)) - (set! (-> s4-0 quad) (-> (get-trans - (the-as process-focusable (if (type? s3-0 process-focusable) - (the-as process-focusable s3-0) - ) - ) - 3 - ) - quad - ) - ) + (vector-copy! s4-0 (get-trans + (the-as process-focusable (if (type? s3-0 process-focusable) + (the-as process-focusable s3-0) + ) + ) + 3 + ) + ) ) (let ((s3-1 (get-tracked-obj-pos this (new 'stack-no-clear 'vector)))) 0.0 @@ -1028,9 +1024,9 @@ (if (not s5-0) (return 0) ) - (set! (-> a0-5 quad) (-> s5-0 root transv quad)) + (vector-copy! a0-5 (-> s5-0 root transv)) (let ((f30-0 (vector-normalize-ret-len! a0-5 1.0))) - (set! (-> s4-1 quad) (-> this target-pos quad)) + (vector-copy! s4-1 (-> this target-pos)) (when #t (seek! (-> this offset-dist) (-> this missile-dist) (* 20480.0 (seconds-per-frame))) (seek! (-> this vel-factor) *k1* (* 2.0 (seconds-per-frame))) @@ -1173,8 +1169,8 @@ (set! (-> this lisa rate y-mag) (* 10240.0 (seconds-per-frame))) (set! (-> this lisa rate period-shift) (* 16384.0 (seconds-per-frame))) (set! (-> this lisa dest period-shift) 16384.0) - (lissajous-interp-method-10 (-> this lisa)) - (let ((s5-3 (lissajous-interp-method-9 (-> this lisa) (new 'stack-no-clear 'vector)))) + (update! (-> this lisa)) + (let ((s5-3 (evaluate! (-> this lisa) (new 'stack-no-clear 'vector)))) (vector-float*! s5-3 s5-3 0.5) (vector-lerp! (-> this lisa-pt) (-> this lisa-pt) s5-3 1.0) (let ((a2-9 (matrix-f-u-compose (matrix-identity! (new 'stack-no-clear 'matrix)) sv-76 *up-vector*))) @@ -1202,7 +1198,7 @@ (vector-normalize! s5-5 1.0) (quaternion-look-at! (-> this root quat) s5-5 *up-vector*) ) - (set! (-> this last-trans quad) (-> this root trans quad)) + (vector-copy! (-> this last-trans) (-> this root trans)) (none) ) @@ -1232,7 +1228,7 @@ (set! (-> this lisa dest wx) 1.0) (set! (-> this lisa dest wy) 1.2) (set! (-> this lisa dest period-shift) 16384.0) - (set! (-> this basetrans quad) (-> this root trans quad)) + (vector-copy! (-> this basetrans) (-> this root trans)) (none) ) @@ -1332,8 +1328,8 @@ (set! (-> self lisa rate y-mag) (* 10240.0 (seconds-per-frame))) (set! (-> self lisa rate period-shift) (* 16384.0 (seconds-per-frame))) (set! (-> self lisa dest period-shift) 16384.0) - (lissajous-interp-method-10 (-> self lisa)) - (let ((gp-0 (lissajous-interp-method-9 (-> self lisa) (new 'stack-no-clear 'vector)))) + (update! (-> self lisa)) + (let ((gp-0 (evaluate! (-> self lisa) (new 'stack-no-clear 'vector)))) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self target-pos) (-> self basetrans)))) (vector-normalize! s5-1 1.0) (vector-float*! gp-0 gp-0 0.5) @@ -1349,7 +1345,7 @@ (vector-normalize! gp-2 1.0) (quaternion-look-at! (-> self root quat) gp-2 *up-vector*) ) - (set! (-> self last-trans quad) (-> self root trans quad)) + (vector-copy! (-> self last-trans) (-> self root trans)) (if (and (< (vector-vector-distance (-> self root trans) (get-tracked-obj-pos self (new 'stack-no-clear 'vector))) 20480.0 ) diff --git a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc index a1d754e9525..0b3117cbb71 100644 --- a/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/hijack/cty-hijack_REF.gc @@ -15,7 +15,7 @@ (new 'static 'talker-speech-class :name "dax373" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -80,7 +80,7 @@ (new 'static 'talker-speech-class :name "dax381" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xa :neg #x1 :on-close #f @@ -217,7 +217,7 @@ (new 'static 'talker-speech-class :name "jak103" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1b :neg #x1 :on-close #f @@ -250,7 +250,7 @@ (new 'static 'talker-speech-class :name "jak107" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1f :neg #x1 :on-close #f @@ -275,7 +275,7 @@ (new 'static 'talker-speech-class :name "jak110" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x22 :neg #x1 :on-close #f @@ -292,7 +292,7 @@ (new 'static 'talker-speech-class :name "jak112" :channel (gui-channel jak) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x24 :neg #x1 :on-close #f @@ -301,7 +301,7 @@ (new 'static 'talker-speech-class :name "torn149" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x25 :neg #x1 :on-close #f @@ -334,7 +334,7 @@ (new 'static 'talker-speech-class :name "torn153" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x29 :neg #x1 :on-close #f @@ -895,7 +895,7 @@ ((= arg0 3) (let ((gp-1 (new 'static 'vector))) (if (-> this is-naughty-ottsel?) - (set! (-> gp-1 quad) (-> this root trans quad)) + (vector-copy! gp-1 (-> this root trans)) (vector<-cspace! gp-1 (-> this node-list data 16)) ) gp-1 @@ -1006,7 +1006,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-missile-lure" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 orient)) (set-vector! (-> self root scale) 3.0 3.0 3.0 1.0) (set! (-> self is-naughty-ottsel?) (-> arg0 is-naughty-ottsel?)) @@ -1105,7 +1105,7 @@ ;; INFO: Used lq/sq (defmethod find-and-lure-missiles ((this cty-missile-lure)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> this root trans quad)) + (vector-copy! v1-0 (-> this root trans)) (set! (-> v1-0 w) 327680.0) ) (when #f @@ -1483,7 +1483,7 @@ (set-setting! 'exclusive-load '((ignore lctyhijk)) 0.0 0) (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> gp-0 flags) (traffic-spawn-flags)) - (set! (-> gp-0 position quad) (-> *pickup-start-pos* quad)) + (vector-copy! (-> gp-0 position) *pickup-start-pos*) (quaternion-identity! (-> gp-0 rotation)) (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *pickup-start-angle*) (set! (-> gp-0 velocity quad) (the-as uint128 0)) @@ -1505,7 +1505,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-1 pos quad) (-> *pickup-start-pos* quad)) + (vector-copy! (-> gp-1 pos) *pickup-start-pos*) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags taf8)) (set! (-> gp-1 map-icon) (the-as uint 12)) @@ -1527,7 +1527,7 @@ (when (time-elapsed? (-> self last-check-vehicle-vis-time) (seconds 0.5)) (set-time! (-> self last-check-vehicle-vis-time)) (let ((s5-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-1 start-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s5-1 start-pos) (target-pos 0)) (vector-! (-> s5-1 move-dist) (get-trans gp-0 0) (-> s5-1 start-pos)) (let ((v1-20 s5-1)) (set! (-> v1-20 radius) 40.96) @@ -1883,7 +1883,7 @@ (set! (-> s4-0 is-leader?) #t) (set! (-> s4-0 is-leader?) #f) ) - (set! (-> s4-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 pos) arg0) (quaternion-copy! (-> s4-0 quat) arg1) (set! (-> s4-0 track-obj) (-> this hpickup)) (let* ((s3-0 (get-process *default-dead-pool* cty-hijack-missile #x4000 1)) @@ -1960,7 +1960,7 @@ (let ((gp-0 (new 'stack-no-clear 'cty-missile-lure-init-params))) (dotimes (s5-0 (-> *cty-hijack-lure-positions* length)) (let ((a0-21 (-> *cty-hijack-lure-positions* s5-0))) - (set! (-> gp-0 pos quad) (-> a0-21 pos quad)) + (vector-copy! (-> gp-0 pos) (-> a0-21 pos)) ) (quaternion-identity! (-> gp-0 orient)) (set! (-> gp-0 is-naughty-ottsel?) #f) @@ -1968,7 +1968,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'cty-missile-lure-init-params))) - (set! (-> gp-1 pos quad) (-> *naughty-ottsel-pos* quad)) + (vector-copy! (-> gp-1 pos) *naughty-ottsel-pos*) (quaternion-identity! (-> gp-1 orient)) (set! (-> gp-1 is-naughty-ottsel?) #t) (let ((s5-1 (get-process *default-dead-pool* cty-missile-lure #x4000 1))) @@ -2080,6 +2080,7 @@ ;; definition for method 11 of type cty-missile-launcher (defmethod init-from-entity! ((this cty-missile-launcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) @@ -2300,11 +2301,11 @@ (dotimes (s5-0 (-> *guide-arrow-list* length)) (let ((a0-1 (new 'stack-no-clear 'guide-arrow-init-params))) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> *guide-arrow-list* s5-0 pos quad)) + (vector-copy! v1-0 (-> *guide-arrow-list* s5-0 pos)) (let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> *guide-arrow-list* s5-0 facing quad)) - (set! (-> a0-1 pos quad) (-> v1-0 quad)) - (set! (-> a0-1 facing quad) (-> a1-5 quad)) + (vector-copy! a1-5 (-> *guide-arrow-list* s5-0 facing)) + (vector-copy! (-> a0-1 pos) v1-0) + (vector-copy! (-> a0-1 facing) a1-5) ) ) (set! (-> a0-1 xz?) #t) diff --git a/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc index ec373c050fd..90548d70a05 100644 --- a/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/hijack/guide-arrow_REF.gc @@ -71,7 +71,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-guide-arrow" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (cond ((-> arg0 xz?) (let ((a1-5 (matrix-u-r-compose @@ -132,7 +132,7 @@ ) ) :enter (behavior () - (set! (-> self base-pos quad) (-> self root trans quad)) + (vector-copy! (-> self base-pos) (-> self root trans)) (set-time! (-> self state-time)) ) :trans (behavior () diff --git a/test/decompiler/reference/jak3/levels/city/hijack/kg-vehicles_REF.gc b/test/decompiler/reference/jak3/levels/city/hijack/kg-vehicles_REF.gc index 93e630762d7..7c19fa02900 100644 --- a/test/decompiler/reference/jak3/levels/city/hijack/kg-vehicles_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/hijack/kg-vehicles_REF.gc @@ -476,12 +476,12 @@ ;; WARN: Return type mismatch int vs none. (defmethod reset-accum-force ((this pickup-sled-sim)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this mat uvec quad)) + (vector-copy! s5-0 (-> this mat uvec)) (set! (-> s5-0 y) 0.0) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this mat fvec quad)) + (vector-copy! s4-0 (-> this mat fvec)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this mat rvec quad)) + (vector-copy! s3-0 (-> this mat rvec)) (let ((s2-0 (new 'stack-no-clear 'matrix))) (set! (-> s4-0 y) 0.0) (set! (-> s3-0 y) 0.0) @@ -598,18 +598,7 @@ (set! (-> this sled drag) 0.05) (set! (-> this sled bounce-wall-friction) 0.3) (set! (-> this sled ball-friction) 0.05) - (let* ((v1-45 (-> this sled mat)) - (a3-2 (-> this rbody matrix)) - (a0-13 (-> a3-2 rvec quad)) - (a1-5 (-> a3-2 uvec quad)) - (a2-2 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> v1-45 rvec quad) a0-13) - (set! (-> v1-45 uvec quad) a1-5) - (set! (-> v1-45 fvec quad) a2-2) - (set! (-> v1-45 trans quad) a3-3) - ) + (matrix-copy! (-> this sled mat) (-> this rbody matrix)) (let ((s5-1 (new 'stack-no-clear 'vector))) (get-linear-accel! this s5-1) (let ((f0-10 (vector-normalize-ret-len! s5-1 1.0))) @@ -631,7 +620,7 @@ (-> this sled billiards data s5-2) (let ((s3-3 (new 'stack-no-clear 'vector))) (vector-matrix*! s3-3 (the-as vector (-> this sled billiards data s5-2)) (-> this sled mat)) - (set! (-> s4-2 root trans quad) (-> s3-3 quad)) + (vector-copy! (-> s4-2 root trans) s3-3) ) ) ) @@ -851,7 +840,7 @@ (defun spawn-pickup () (let ((gp-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> gp-0 proc) #f) - (set! (-> gp-0 position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> gp-0 position) (target-pos 0)) (quaternion-identity! (-> gp-0 rotation)) (set! (-> gp-0 velocity quad) (the-as uint128 0)) (set! (-> gp-0 behavior) (the-as uint 0)) @@ -910,7 +899,7 @@ (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (the-as quaternion (-> this rbody rot)))) (s4-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-2 quad) (-> this rbody lin-momentum quad)) + (vector-copy! s4-2 (-> this rbody lin-momentum)) 0.0 (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) @@ -920,7 +909,7 @@ (let ((f0-20 (vector-dot s4-2 s3-0))) (cond (#f - (set! (-> s4-2 quad) (-> s3-0 quad)) + (vector-copy! s4-2 s3-0) ) (else (let ((s2-1 (vector-cross! (new 'stack-no-clear 'vector) s4-2 s3-0)) diff --git a/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-obs_REF.gc index e1191050495..9494e5826cc 100644 --- a/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/industrial/ctyinda-obs_REF.gc @@ -66,6 +66,7 @@ ;; definition for method 11 of type ctyinda-vingate (defmethod init-from-entity! ((this ctyinda-vingate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (when (task-node-closed? (game-task-node sewer-hum-kg-resolution)) (process-entity-status! this (entity-perm-status dead) #t) (deactivate this) @@ -166,6 +167,7 @@ ;; definition for method 11 of type ctyinda-evil-streetlamp (defmethod init-from-entity! ((this ctyinda-evil-streetlamp) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -179,7 +181,3 @@ (set! (-> this root pause-adjust-distance) 327680.0) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc index 139a2d0cc06..d3b0345f676 100644 --- a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack-bbush_REF.gc @@ -391,7 +391,7 @@ ) ) (dotimes (v1-46 (-> *ctyport-package-positions* length)) - (set! (-> *ctyport-attack-bbush-positions* v1-46 pos quad) (-> *ctyport-package-positions* v1-46 pos quad)) + (vector-copy! (-> *ctyport-attack-bbush-positions* v1-46 pos) (-> *ctyport-package-positions* v1-46 pos)) (set! (-> *ctyport-attack-bbush-positions* v1-46 on-water?) (-> *ctyport-package-positions* v1-46 on-water?)) ) (set! (-> *ctyport-attack-bbush-positions* length) (-> *ctyport-package-positions* length)) @@ -400,7 +400,7 @@ (dotimes (a0-35 (-> this actor-group 0 length)) (let ((a1-36 (-> this actor-group 0 data a0-35 actor))) (when a1-36 - (set! (-> *ctyport-attack-bbush-positions* v1-53 pos quad) (-> a1-36 extra trans quad)) + (vector-copy! (-> *ctyport-attack-bbush-positions* v1-53 pos) (-> a1-36 extra trans)) (set! (-> *ctyport-attack-bbush-positions* v1-53 on-water?) #f) (set! (-> *ctyport-attack-bbush-positions* v1-53 probe?) #t) (+! v1-53 1) @@ -449,7 +449,7 @@ (suspend) (while (or (not *target*) (not *spawn-actors*) - (!= (status-of-level-and-borrows *level* 'lpatkcs #f) 'active) + (!= (level-status? *level* 'lpatkcs #f) 'active) (focus-test? *target* board) ) (if *target* @@ -578,11 +578,11 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs object. (defmethod ctyport-attack-manager-method-51 ((this ctyport-attack-manager-bbush) (arg0 traffic-object-spawn-params)) - (set! (-> arg0 position quad) (-> (new 'static 'vector :x 2492384.8 :y 34605.055 :z 6578958.5 :w 1.0) quad)) + (vector-copy! (-> arg0 position) (new 'static 'vector :x 2492384.8 :y 34605.055 :z 6578958.5 :w 1.0)) (quaternion-copy! (-> arg0 rotation) (new 'static 'quaternion :x 0.0002 :y 0.6305 :z 0.0011 :w -0.7761)) (let ((v1-1 (the-as entity-actor (entity-by-name "port-attack-bbush-1")))) (when v1-1 - (set! (-> arg0 position quad) (-> v1-1 extra trans quad)) + (vector-copy! (-> arg0 position) (-> v1-1 extra trans)) (quaternion-copy! (-> arg0 rotation) (-> v1-1 quat)) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc index d7139c00933..11691ad9067 100644 --- a/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/attack/ctyport-attack_REF.gc @@ -7,7 +7,7 @@ (new 'static 'talker-speech-class :name "torn208" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1 :neg #x1 :on-close #f @@ -16,7 +16,7 @@ (new 'static 'talker-speech-class :name "torn209" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -25,7 +25,7 @@ (new 'static 'talker-speech-class :name "torn210" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :neg #x1 :on-close #f @@ -34,7 +34,7 @@ (new 'static 'talker-speech-class :name "torn211" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :neg #x1 :on-close #f @@ -107,7 +107,7 @@ (new 'static 'talker-speech-class :name "torn220" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xd :neg #x1 :on-close #f @@ -116,7 +116,7 @@ (new 'static 'talker-speech-class :name "torn221" :channel (gui-channel voicebox) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xe :neg #x1 :on-close #f @@ -389,7 +389,7 @@ (new 'static 'talker-speech-class :name "port-attack-jump-hint" :channel (gui-channel message) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x30 :text-duration (seconds 3) :neg #x1 @@ -1168,7 +1168,7 @@ ;; WARN: Return type mismatch int vs none. (defun record-pos () (when (cpad-pressed? 0 r1) - (set! (-> *recorded-pos* *recorded-length* quad) (-> (target-pos 0) quad)) + (vector-copy! (-> *recorded-pos* *recorded-length*) (target-pos 0)) (set! *recorded-length* (+ *recorded-length* 1)) ) (none) @@ -1780,7 +1780,7 @@ (case message (('activate) (let ((v1-1 (the-as object (-> block param 0)))) - (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + (vector-copy! (-> self root trans) (the-as vector v1-1)) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual idle) @@ -2027,7 +2027,7 @@ (let ((a0-42 *ctyport-barrier-pos*) (s5-1 (new 'stack-no-clear 'task-arrow-params)) ) - (set! (-> s5-1 pos quad) (-> a0-42 quad)) + (vector-copy! (-> s5-1 pos) a0-42) (quaternion-identity! (-> s5-1 quat)) (set! (-> s5-1 flags) (task-arrow-flags)) (set! (-> s5-1 map-icon) (the-as uint 12)) @@ -2079,7 +2079,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self hum-sound) (new-sound-id)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 530) self)) (go-virtual idle) @@ -2158,7 +2158,7 @@ ;; WARN: Return type mismatch int vs handle. (defmethod ctyport-attack-manager-method-45 ((this ctyport-attack-manager)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this package-positions (-> this current-package-index) pos quad)) + (vector-copy! s5-0 (-> this package-positions (-> this current-package-index) pos)) (let ((s4-0 (process-spawn ctyport-attack-package s5-0 :name "ctyport-attack-package" :to this)) (s3-1 (new 'stack-no-clear 'task-arrow-params)) ) @@ -2168,7 +2168,7 @@ (when (-> this package-positions (-> this current-package-index) probe?) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (let ((v1-21 (new 'stack-no-clear 'vector))) - (set! (-> v1-21 quad) (-> s5-0 quad)) + (vector-copy! v1-21 s5-0) (vector+float*! (-> s2-0 start-pos) v1-21 *up-vector* 24576.0) ) (set! (-> s2-0 move-dist quad) (the-as uint128 0)) @@ -2189,7 +2189,7 @@ ) ) ) - (set! (-> s3-1 pos quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 pos) s5-0) (quaternion-identity! (-> s3-1 quat)) (set! (-> s3-1 flags) (task-arrow-flags)) (set! (-> s3-1 map-icon) (the-as uint 13)) @@ -2207,12 +2207,12 @@ (defmethod ctyport-attack-manager-method-51 ((this ctyport-attack-manager) (arg0 traffic-object-spawn-params)) (cond ((task-node-closed? (game-task-node city-port-attack-mission)) - (set! (-> arg0 position quad) (-> (new 'static 'vector :x -197263.36 :y 52101.12 :z 5516165.0 :w 1.0) quad)) + (vector-copy! (-> arg0 position) (new 'static 'vector :x -197263.36 :y 52101.12 :z 5516165.0 :w 1.0)) (quaternion-identity! (-> arg0 rotation)) (quaternion-rotate-y! (-> arg0 rotation) (-> arg0 rotation) -9102.223) ) (else - (set! (-> arg0 position quad) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans quad)) + (vector-copy! (-> arg0 position) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans)) (quaternion-copy! (-> arg0 rotation) (-> (the-as entity-actor (entity-by-name "cty-dax-missile-launcher-1")) quat) @@ -2304,7 +2304,7 @@ (defstate wait (ctyport-attack-manager) :virtual #t :code (behavior () - (while (or (not *target*) (not *spawn-actors*) (!= (status-of-level-and-borrows *level* 'lpatkcs #f) 'active)) + (while (or (not *target*) (not *spawn-actors*) (!= (level-status? *level* 'lpatkcs #f) 'active)) (if *target* (process-grab? *target* #f) ) @@ -2471,7 +2471,7 @@ ) (a0-10 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-10 quad) (-> (the-as process-focusable a1-3) rbody position quad)) + (vector-copy! a0-10 (-> (the-as process-focusable a1-3) rbody position)) (if (and (< f30-0 (vector-dot *cutscene-trigger-plane-normal* a0-10)) (< (vector-vector-xz-distance a0-10 *cutscene-trigger-plane-pt*) 225280.0) ) @@ -2728,7 +2728,7 @@ :event ctyport-attack-manager-event-handler :trans (behavior () ((-> (method-of-type task-manager active) trans)) - (if (!= (status-of-level-and-borrows *level* 'hiphog #f) 'active) + (if (!= (level-status? *level* 'hiphog #f) 'active) (go-virtual get-on-nuke) ) ) @@ -2754,7 +2754,7 @@ (time-elapsed? (-> *port-attack-speech* 0 play-time) (seconds 1)) ) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans quad)) + (vector-copy! (-> gp-0 pos) (-> (entity-by-name "cty-dax-missile-launcher-1") extra trans)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -2857,7 +2857,7 @@ 0.0 (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *x-vector* quad)) + (vector-copy! s4-0 *x-vector*) (let ((f30-0 (-> arg0 initial-angle))) (cond ((-> arg0 inout?) @@ -2875,7 +2875,7 @@ ) ) (else - (set! (-> s5-0 quad) (-> arg0 origin quad)) + (vector-copy! s5-0 (-> arg0 origin)) ) ) (if (-> arg0 spin?) @@ -2935,7 +2935,7 @@ ;; INFO: Used lq/sq (defun copy-record-pos () (dotimes (v1-0 *recorded-length*) - (set! (-> *ctyport-package-positions* v1-0 pos quad) (-> *recorded-pos* v1-0 quad)) + (vector-copy! (-> *ctyport-package-positions* v1-0 pos) (-> *recorded-pos* v1-0)) ) #f ) @@ -3018,6 +3018,7 @@ ;; definition for method 11 of type cty-dax-missile-launcher (defmethod init-from-entity! ((this cty-dax-missile-launcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) diff --git a/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc b/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc index 71785fa01e8..9533fa654c7 100644 --- a/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/attack/h-torpedo_REF.gc @@ -194,7 +194,7 @@ (set! (-> *torpedo-wake-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *torpedo-wake-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *torpedo-wake-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *torpedo-wake-trail* use-tape-mode?) #t) @@ -682,7 +682,7 @@ (f2-0 8192.0) (f0-0 1024.0) ) - (set! (-> s5-0 start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 start-pos) (-> this rbody position)) (+! (-> s5-0 start-pos y) f2-0) (vector-reset! (-> s5-0 move-dist)) (set! (-> s5-0 move-dist y) (- (+ f2-0 f1-0))) @@ -1240,11 +1240,11 @@ (let ((v1-45 (cond ((logtest? (-> *part-group-id-table* 529 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 529)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 529)) ) ) @@ -1623,7 +1623,7 @@ (defmethod get-tracked-object-pos ((this light-trail-tracker-torpedo) (arg0 process-focusable) (arg1 vector)) (let ((v1-0 arg0)) (when v1-0 - (set! (-> arg1 quad) (-> v1-0 root trans quad)) + (vector-copy! arg1 (-> v1-0 root trans)) (set! (-> arg1 y) 4505.6) (vector+float*! arg1 arg1 (-> v1-0 node-list data 0 bone transform fvec) 49152.0) ) @@ -1774,14 +1774,14 @@ (quaternion-rotate-local-z! s1-0 s1-0 (-> this cam-roll)) (quaternion-normalize! s1-0) (quaternion->matrix s5-0 s1-0) - (set! (-> s5-0 trans quad) (-> this rbody matrix trans quad)) + (vector-copy! (-> s5-0 trans) (-> this rbody matrix trans)) (vector-matrix*! (-> s3-0 0 saved-pt) (the-as vector (-> this info camera look-pos-array)) s5-0) (vector+float*! (-> s3-0 0 saved-pt) (-> s3-0 0 saved-pt) s2-0 0.0) ) (let ((v1-18 (-> s3-0 0 tracking))) (set! (-> v1-18 inv-mat rvec quad) (-> s5-0 rvec quad)) - (set! (-> v1-18 inv-mat uvec quad) (-> s5-0 uvec quad)) - (set! (-> v1-18 inv-mat fvec quad) (-> s5-0 fvec quad)) + (vector-copy! (-> v1-18 inv-mat uvec) (-> s5-0 uvec)) + (vector-copy! (-> v1-18 inv-mat fvec) (-> s5-0 fvec)) ) ) (set! (-> gp-0 slave 0 saved-pt y) (fmax 6144.0 (-> gp-0 slave 0 saved-pt y))) diff --git a/test/decompiler/reference/jak3/levels/city/port/ctyport-part_REF.gc b/test/decompiler/reference/jak3/levels/city/port/ctyport-part_REF.gc index 65ddf5fe702..1f991bebd59 100644 --- a/test/decompiler/reference/jak3/levels/city/port/ctyport-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/port/ctyport-part_REF.gc @@ -2290,6 +2290,7 @@ ;; definition for method 11 of type hiphog-exterior-marquee (defmethod init-from-entity! ((this hiphog-exterior-marquee) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause enemy)) @@ -2382,6 +2383,7 @@ ;; definition for method 11 of type farthy (defmethod init-from-entity! ((this farthy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this root pause-adjust-distance) 1228800.0) diff --git a/test/decompiler/reference/jak3/levels/city/protect/assault-enemies_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/assault-enemies_REF.gc index 13ab93db065..a532bc527ba 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/assault-enemies_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/assault-enemies_REF.gc @@ -227,7 +227,7 @@ (defmethod go-from-behavior ((this assault-metalhead-flitter) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else @@ -269,7 +269,7 @@ (defmethod go-from-behavior ((this assault-metalhead-grunt) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else @@ -343,7 +343,7 @@ (ja-eval) ) (cond - ((enemy-method-109 self) + ((out-of-bounds? self) (go-die self) ) ((< (vector-vector-xz-distance (-> self root trans) (-> self center-pos)) 16384.0) @@ -370,12 +370,12 @@ ;; definition for method 212 of type assault-citizen-norm ;; INFO: Used lq/sq (defmethod go-from-behavior ((this assault-citizen-norm) (arg0 assault-object-spawn-params)) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (set! (-> this hit-points) (the float (the int (lerp-scale-clamp 10.0 20.0 (the float (-> arg0 suck-level)) 4.0 12.0))) ) (set! (-> this attacker-info max-num-attackers) (the-as uint 1)) - (set! (-> this center-pos quad) (-> (the-as vector (-> arg0 user-data)) quad)) + (vector-copy! (-> this center-pos) (the-as vector (-> arg0 user-data))) (set! (-> this min-flee-time) (-> arg0 flee-time)) (go (method-of-object this flee-madly)) ) @@ -398,7 +398,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-11 quad)) + (vector-copy! (-> a0-3 target-pos) v1-11) ) 0 ) @@ -428,7 +428,7 @@ (a2-0 (-> self nav state)) (a1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-0 (-> a2-0 target-pos)) (when (< (t9-1 a0-2 a1-0) 12288.0) (let* ((gp-0 vector-rotate-around-y!) (s5-0 (new 'stack-no-clear 'vector)) @@ -451,7 +451,7 @@ (let ((v1-23 (-> self nav state))) (logclear! (-> v1-23 flags) (nav-state-flag directional-mode)) (logior! (-> v1-23 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-23 target-pos quad) (-> gp-1 quad)) + (vector-copy! (-> v1-23 target-pos) gp-1) ) ) 0 @@ -462,6 +462,7 @@ ;; definition for method 82 of type assault-citizen-norm (defmethod event-handler ((this assault-citizen-norm) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (let ((a0-3 (find-offending-process-focusable arg0 (the-as attack-info (-> arg3 param 1))))) @@ -481,7 +482,7 @@ :virtual #t :trans (behavior () (call-parent-state-handler trans) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-virtual die) ) ) @@ -588,11 +589,11 @@ (defmethod go-from-behavior ((this assault-roboguard) (arg0 assault-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else - (set! (-> this move-dest quad) (-> (the-as vector (-> arg0 user-data)) quad)) + (vector-copy! (-> this move-dest) (the-as vector (-> arg0 user-data))) (go (method-of-object this roll-initial)) ) ) @@ -651,9 +652,7 @@ :virtual #t :enter (behavior () (let ((a0-0 (new 'stack-no-clear 'vector))) - (set! (-> a0-0 quad) - (-> (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)) quad) - ) + (vector-copy! a0-0 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans))) (set! (-> a0-0 y) 0.0) (let ((a1-3 (vector-normalize! a0-0 1.0))) (quaternion-look-at! (-> self root quat) a1-3 *up-vector*) @@ -664,7 +663,7 @@ ) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> a0-2 target-pos) v1-5) ) 0 (nav-enemy-method-181 self) @@ -682,7 +681,7 @@ (let ((gp-0 (-> self nav state)) (v1-28 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-0 heading quad) (-> v1-28 quad)) + (vector-copy! (-> gp-0 heading) v1-28) ) 0 (let ((f30-0 81920.0)) @@ -694,7 +693,7 @@ ) ) ) - (set! (-> s5-0 velocity quad) (-> gp-2 quad)) + (vector-copy! (-> s5-0 velocity) gp-2) ) 0 (let ((v1-37 (-> self nav))) @@ -728,7 +727,7 @@ (a2-0 (-> self nav state)) (v1-7 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-7 quad) (-> a2-0 velocity quad)) + (vector-copy! v1-7 (-> a2-0 velocity)) (set! (-> a0-4 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z)))))) ) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) @@ -971,7 +970,7 @@ (return (the-as handle #f)) ) (quaternion-identity! (-> s5-0 rotation)) - (set! (-> s5-0 position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s5-0 position) (target-pos 0)) (set! (-> s5-0 lev) (-> *assault-levels* arg0)) (set! (-> s5-0 velocity quad) (the-as uint128 0)) (set! (-> s5-0 behavior) (the-as uint 1)) @@ -996,7 +995,7 @@ ;; definition for method 212 of type assault-crimson-guard ;; INFO: Used lq/sq (defmethod go-from-behavior ((this assault-crimson-guard) (arg0 assault-object-spawn-params)) - (set! (-> this center-pos quad) (-> (the-as vector (-> arg0 user-data)) quad)) + (vector-copy! (-> this center-pos) (the-as vector (-> arg0 user-data))) (call-parent-method this arg0) ) @@ -1035,6 +1034,7 @@ ;; definition for method 82 of type assault-crimson-guard (defmethod event-handler ((this assault-crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('weaken) (set! (-> this hit-points) (fmin 1.0 (-> this hit-points))) @@ -1048,6 +1048,7 @@ ;; definition for method 59 of type assault-crimson-guard ;; WARN: Return type mismatch object vs none. (defmethod enemy-common-post ((this assault-crimson-guard)) + "Common implementation of post. Runs ja-post." (call-parent-method this) (when (and (or (not (logtest? (-> this draw status) (draw-control-status on-screen))) (< 102400.0 (vector-vector-xz-distance (-> this root trans) (-> this center-pos))) @@ -1095,7 +1096,7 @@ ) (logclear! (-> a0-5 flags) (nav-state-flag directional-mode)) (logior! (-> a0-5 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-5 target-pos quad) (-> v1-12 quad)) + (vector-copy! (-> a0-5 target-pos) v1-12) ) 0 ) @@ -1198,7 +1199,7 @@ (set! (-> self pickup-amount) (-> *FACT-bank* health-default-inc)) (set! (-> self pickup-type) (pickup-type health)) (initialize-allocations self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-effects self (-> self pickup-type)) (initialize-options self 0 1024.0 (the-as fact-info #f)) (update-transforms (-> self root)) @@ -1286,7 +1287,7 @@ ) (set! (-> this root) s2-0) ) - (set! (-> this root trans quad) (-> arg0 quad)) + (vector-copy! (-> this root trans) arg0) (set! (-> this ammo-type) arg1) (set! (-> this gun-type) arg2) (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) @@ -1437,7 +1438,7 @@ (when (nonzero? (-> self collect-effect)) (cond ((logtest? (-> self collect-effect flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to *target* @@ -1446,7 +1447,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to *target* @@ -1567,6 +1568,7 @@ ;; definition for method 59 of type assault-bombbot (defmethod enemy-common-post ((this assault-bombbot)) + "Common implementation of post. Runs ja-post." (call-parent-method this) (none) ) @@ -1607,6 +1609,7 @@ ;; definition for method 121 of type assault-bombbot ;; WARN: Return type mismatch float vs none. (defmethod init-enemy! ((this assault-bombbot)) + "Typical place for shared init code. Runs from entity or process style init." (with-pp (set! (-> pp level) (level-get *level* 'lctyass)) (call-parent-method this) @@ -1642,8 +1645,8 @@ (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-orient-by-quat! s3-0 (-> s4-0 pos-offset) (-> this root quat)) (vector+! s3-0 s3-0 (-> this root trans)) - (set! (-> s4-0 next-position quad) (-> s3-0 quad)) - (set! (-> s4-0 position quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 next-position) s3-0) + (vector-copy! (-> s4-0 position) s3-0) ) (set! (-> s4-0 delta-y) 0.0) ) @@ -1765,7 +1768,7 @@ (set! (-> *assault-bombbot-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *assault-bombbot-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *assault-bombbot-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *assault-bombbot-trail* use-tape-mode?) #f) @@ -1846,7 +1849,7 @@ (set! (-> *assault-bombbot-trail-2* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *assault-bombbot-trail-2* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *assault-bombbot-trail-2* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *assault-bombbot-trail-2* use-tape-mode?) #f) @@ -1927,11 +1930,11 @@ (defmethod projectile-method-26 ((this assault-bombbot-shot)) (cond ((logtest? (-> *part-group-id-table* 1435 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1435)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1435)) ) ) @@ -2026,7 +2029,7 @@ (set! (-> gp-0 damage) f0-1) ) (logior! (-> gp-0 options) (projectile-options po14)) - (set! (-> gp-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 pos) arg0) (vector-normalize-copy! (-> gp-0 vel) v1-1 1.0) ) (the-as (pointer projectile) (spawn-projectile assault-bombbot-shot gp-0 this *default-dead-pool*)) @@ -2053,7 +2056,7 @@ ) (cond (gp-0 - (set! (-> this target-pos quad) (-> (get-trans gp-0 3) quad)) + (vector-copy! (-> this target-pos) (get-trans gp-0 3)) (let ((v1-3 (-> this target-pos))) (let ((a0-4 (-> gp-0 control trans))) (let ((a1-4 (-> gp-0 control transv))) @@ -2069,9 +2072,9 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-3 quad) vf6) ) - (set! (-> this start-target-pos quad) (-> this target-pos quad)) - (set! (-> this start-target-vel quad) (-> gp-0 control transv quad)) - (try-update-focus (-> this focus) gp-0 this) + (vector-copy! (-> this start-target-pos) (-> this target-pos)) + (vector-copy! (-> this start-target-vel) (-> gp-0 control transv)) + (focus-on! (-> this focus) gp-0 this) ) (else (clear-focused (-> this focus)) @@ -2169,7 +2172,7 @@ ;; definition for method 208 of type assault-bombbot ;; INFO: Used lq/sq (defmethod bombbot-method-208 ((this assault-bombbot) (arg0 vector) (arg1 vector)) - (set! (-> arg1 quad) (-> this target-pos quad)) + (vector-copy! arg1 (-> this target-pos)) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) 0.0 (let* ((f0-1 (vector-normalize-ret-len! s4-1 1.0)) @@ -2227,7 +2230,7 @@ ) (when (< (-> self next-target) (current-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 w) 204800.0) (bombbot-method-196 self a1-0) ) @@ -2239,8 +2242,8 @@ (when v1-33 (when (< (current-time) (+ (-> self next-target) (seconds -2))) (set-time! (-> self start-target)) - (set! (-> self start-target-pos quad) (-> v1-33 root trans quad)) - (set! (-> self start-target-vel quad) (-> v1-33 root transv quad)) + (vector-copy! (-> self start-target-pos) (-> v1-33 root trans)) + (vector-copy! (-> self start-target-vel) (-> v1-33 root transv)) (vector-! (-> self target-delta) (-> v1-33 root trans) (-> self root trans)) ) (let ((a2-2 (-> self target-pos))) @@ -2259,7 +2262,7 @@ (.svf (&-> a2-2 quad) vf6) ) (if (= (-> v1-33 type) target) - (set! (-> self target-pos quad) (-> self start-target-pos quad)) + (vector-copy! (-> self target-pos) (-> self start-target-pos)) ) (if (< (+ (-> self next-target) (seconds -1)) (current-time)) (bombbot-method-197 self) @@ -2322,7 +2325,7 @@ ) (logclear! (-> v1-29 flags) (nav-state-flag directional-mode)) (logior! (-> v1-29 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-29 target-pos quad) (-> a0-20 position quad)) + (vector-copy! (-> v1-29 target-pos) (-> a0-20 position)) ) 0 (nav-enemy-method-187 self) diff --git a/test/decompiler/reference/jak3/levels/city/protect/assault-shared_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/assault-shared_REF.gc index 9558c4508a8..7c38e7f7b21 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/assault-shared_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/assault-shared_REF.gc @@ -201,7 +201,7 @@ (new 'static 'talker-speech-class :name "dax238" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xe :neg #x1 :on-close #f @@ -242,7 +242,7 @@ (new 'static 'talker-speech-class :name "grds178a" :channel (gui-channel guard) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x13 :neg #x1 :on-close #f @@ -251,7 +251,7 @@ (new 'static 'talker-speech-class :name "grds178b" :channel (gui-channel guard) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x14 :neg #x1 :on-close #f diff --git a/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc index 2d469b40d03..31fec2527c0 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/assault-task_REF.gc @@ -264,7 +264,7 @@ ) ) (let ((a0-8 s2-1)) - (set! (-> a0-8 quad) (-> s2-1 quad)) + (vector-copy! a0-8 s2-1) (set! (-> a0-8 y) 0.0) (vector-normalize! a0-8 1.0) ) @@ -338,7 +338,7 @@ (when v1-10 (let ((v1-11 (-> v1-10 slave))) (when v1-11 - (set! (-> self original-cam-point quad) (-> v1-11 0 saved-pt quad)) + (vector-copy! (-> self original-cam-point) (-> v1-11 0 saved-pt)) (matrix->quaternion (-> self original-cam-quat) (the-as matrix (-> v1-11 0 tracking))) ) ) @@ -385,7 +385,7 @@ (when a0-4 (let ((a0-5 (-> a0-4 slave))) (when a0-5 - (set! (-> a0-5 0 saved-pt quad) (-> self current-room cam-info pos quad)) + (vector-copy! (-> a0-5 0 saved-pt) (-> self current-room cam-info pos)) (let* ((v1-11 (-> a0-5 0 tracking)) (a3-1 (-> self current-room cam-info mat)) (a0-8 (-> a3-1 rvec quad)) @@ -460,7 +460,7 @@ ) ) (let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> self current-room node-positions gp-0 quad)) + (vector-copy! a1-5 (-> self current-room node-positions gp-0)) (move-to-point! (-> *target* control) a1-5) ) ) @@ -469,7 +469,7 @@ (when v1-40 (let ((v1-41 (-> v1-40 slave))) (when v1-41 - (set! (-> v1-41 0 saved-pt quad) (-> self current-room cam-info pos quad)) + (vector-copy! (-> v1-41 0 saved-pt) (-> self current-room cam-info pos)) (let* ((v0-9 (-> v1-41 0 tracking)) (a2-0 (-> self current-room cam-info mat)) (v1-45 (-> a2-0 rvec quad)) @@ -503,7 +503,7 @@ (let ((v1-4 (new 'stack-no-clear 'player-controller-init-params))) (set! (-> v1-4 mode) 'active) (set! (-> v1-4 flags) (player-controller-flag pc1 lock-features letterbox pc4)) - (set! (-> v1-4 targ-pos quad) (-> self current-room center-pos quad)) + (vector-copy! (-> v1-4 targ-pos) (-> self current-room center-pos)) (logclear! (-> v1-4 flags) (player-controller-flag lock-features)) (set! (-> v1-4 notify-proc) (process->handle self)) (send-event (handle->process (-> self h-player-controller)) 'set-params v1-4) @@ -569,7 +569,7 @@ (when v1-47 (let ((v1-48 (-> v1-47 slave))) (when v1-48 - (set! (-> v1-48 0 saved-pt quad) (-> self current-room cam-info pos quad)) + (vector-copy! (-> v1-48 0 saved-pt) (-> self current-room cam-info pos)) (let* ((v0-10 (-> v1-48 0 tracking)) (a2-0 (-> self current-room cam-info mat)) (v1-52 (-> a2-0 rvec quad)) @@ -1069,7 +1069,7 @@ ) (init-vf0-vector) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *x-vector* quad)) + (vector-copy! s4-0 *x-vector*) (let ((s3-0 (new 'stack-no-clear 'vector)) (f30-0 (/ 65536.0 (the float arg0))) (s2-0 (new 'stack-no-clear 'vector)) @@ -1098,7 +1098,7 @@ (let ((v1-12 (new 'stack-no-clear 'vector)) (s0-1 (new 'stack-no-clear 'collide-query)) ) - (set! (-> v1-12 quad) (-> s3-0 quad)) + (vector-copy! v1-12 s3-0) (vector+float*! (-> s0-1 start-pos) s3-0 *up-vector* 24576.0) (set! (-> s0-1 move-dist quad) (the-as uint128 0)) (set! (-> s0-1 move-dist y) -49152.0) @@ -1113,7 +1113,7 @@ (set! (-> v1-17 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s0-1) 0.0) - (set! (-> s3-0 quad) (-> s0-1 best-other-tri intersect quad)) + (vector-copy! s3-0 (-> s0-1 best-other-tri intersect)) ) ) (vector-! s2-0 s3-0 (-> this current-room center-pos)) @@ -1123,7 +1123,7 @@ (when (handle->process s0-2) (set! sv-880 (new 'stack 'assault-object-spawn-params)) (set! (-> sv-880 flags) (traffic-spawn-flags)) - (set! (-> sv-880 position quad) (-> s3-0 quad)) + (vector-copy! (-> sv-880 position) s3-0) (set! (-> sv-880 behavior) (the-as uint 2)) (set! (-> sv-880 flags) (traffic-spawn-flags)) (set! (-> sv-880 suck-level) (get-suck-level this)) @@ -1168,7 +1168,7 @@ ) (init-vf0-vector) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *x-vector* quad)) + (vector-copy! s4-0 *x-vector*) (let ((s3-0 (new 'stack-no-clear 'vector)) (f30-0 (/ 65536.0 (the float arg0))) (s2-0 (new 'stack-no-clear 'vector)) @@ -1197,7 +1197,7 @@ (let ((v1-13 (new 'stack-no-clear 'vector)) (s0-1 (new 'stack-no-clear 'collide-query)) ) - (set! (-> v1-13 quad) (-> s3-0 quad)) + (vector-copy! v1-13 s3-0) (vector+float*! (-> s0-1 start-pos) s3-0 *up-vector* 24576.0) (set! (-> s0-1 move-dist quad) (the-as uint128 0)) (set! (-> s0-1 move-dist y) -49152.0) @@ -1212,7 +1212,7 @@ (set! (-> v1-18 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s0-1) 0.0) - (set! (-> s3-0 quad) (-> s0-1 best-other-tri intersect quad)) + (vector-copy! s3-0 (-> s0-1 best-other-tri intersect)) ) ) (vector-! s2-0 s3-0 (-> this current-room center-pos)) @@ -1222,7 +1222,7 @@ (when (handle->process s0-2) (set! sv-880 (new 'stack 'assault-object-spawn-params)) (set! (-> sv-880 flags) (traffic-spawn-flags)) - (set! (-> sv-880 position quad) (-> s3-0 quad)) + (vector-copy! (-> sv-880 position) s3-0) (set! (-> sv-880 behavior) (the-as uint 2)) (set! (-> sv-880 flags) (traffic-spawn-flags)) (set! (-> sv-880 suck-level) (get-suck-level this)) @@ -1284,14 +1284,14 @@ (if (= s1-0 -1) (set! s1-0 0) ) - (set! (-> s5-0 quad) (-> this current-room node-positions s1-0 quad)) + (vector-copy! s5-0 (-> this current-room node-positions s1-0)) (vector-! s4-0 (-> this current-room center-pos) s5-0) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (let ((v1-14 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> v1-14 quad) (-> s5-0 quad)) + (vector-copy! v1-14 s5-0) (vector+float*! (-> s0-0 start-pos) s5-0 *up-vector* 16384.0) (set! (-> s0-0 move-dist quad) (the-as uint128 0)) (set! (-> s0-0 move-dist y) -32768.0) @@ -1306,7 +1306,7 @@ (set! (-> v1-19 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s0-0) 0.0) - (set! (-> s5-0 quad) (-> s0-0 best-other-tri intersect quad)) + (vector-copy! s5-0 (-> s0-0 best-other-tri intersect)) (+! (-> s5-0 y) 8192.0) ) ) @@ -1323,7 +1323,7 @@ (let ((s3-1 (get-last-unused-val! (-> *assault-squad* spawn-records s2-0)))) (when (>= s3-1 0) (let ((s1-1 (new 'stack 'assault-bombbot-spawn-params))) - (set! (-> s1-1 position quad) (-> s5-0 quad)) + (vector-copy! (-> s1-1 position) s5-0) (quaternion-look-at! (-> s1-1 quat) s4-0 *up-vector*) (set! (-> s1-1 path) (-> *assault-bombbot-paths* 0)) (set! (-> s1-1 path node 0 position quad) (-> s5-0 quad)) @@ -1344,7 +1344,7 @@ (when (handle->process s2-1) (let ((s0-1 (new 'stack 'assault-object-spawn-params))) (set! (-> s0-1 flags) (traffic-spawn-flags)) - (set! (-> s0-1 position quad) (-> s5-0 quad)) + (vector-copy! (-> s0-1 position) s5-0) (set! (-> s0-1 behavior) (the-as uint 2)) (when (and (< 2 s1-0) (= (-> this current-room-index) 4)) (+! (-> s0-1 position y) 61440.0) @@ -1565,10 +1565,10 @@ ) (while (or (not *target*) (not *spawn-actors*) - (!= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) - (!= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) - (!= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) - (!= (status-of-level-and-borrows *level* 'lctypalt #f) 'active) + (!= (level-status? *level* 'ctypesa #f) 'active) + (!= (level-status? *level* 'ctypesb #f) 'active) + (!= (level-status? *level* 'ctypesc #f) 'active) + (!= (level-status? *level* 'lctypalt #f) 'active) ) (suspend) ) @@ -1613,7 +1613,7 @@ (s3-1 (new 'stack-no-clear 'vector)) ) (let ((a0-9 s2-1)) - (set! (-> a0-9 quad) (-> s2-1 quad)) + (vector-copy! a0-9 s2-1) (set! (-> a0-9 y) 0.0) (vector-normalize! a0-9 1.0) ) @@ -1632,7 +1632,7 @@ (when a0-17 (when (nav-mesh-method-10 a0-17 s4-3 s3-1 (the-as nav-poly #f)) (set! (-> s4-3 y) (-> s3-1 y)) - (set! (-> s3-1 quad) (-> s4-3 quad)) + (vector-copy! s3-1 s4-3) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/city/protect/cty-protect_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/cty-protect_REF.gc index 4b870eaa8aa..8f1e4d502b6 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/cty-protect_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/cty-protect_REF.gc @@ -282,7 +282,7 @@ ) ) ) - (set! (-> arg0 quad) (-> *protect-path* s5-0 quad)) + (vector-copy! arg0 (-> *protect-path* s5-0)) ) arg0 ) @@ -308,7 +308,7 @@ (set! (-> s5-0 num-stages) 2) (set! (-> s5-0 self-index) arg1) (set! (-> s5-0 difficulty) arg2) - (set! (-> s5-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 pos) arg0) (quaternion-identity! (-> s5-0 quat)) (let ((f0-1 (get-protect-suck-t))) (set! (-> s5-0 difficulty-scalar) (lerp 0.29 1.0 (- 1.0 f0-1))) @@ -373,7 +373,7 @@ (let ((gp-0 (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) *zero-vector* #f))) (dotimes (s5-0 2) (set! (-> self gunships s5-0) (spawn-gunship self gp-0 s5-0 1.0)) - (set! (-> gp-0 quad) (-> (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) gp-0 #f) quad)) + (vector-copy! gp-0 (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) gp-0 #f)) ) ) ) @@ -399,7 +399,7 @@ (defmethod gunship-spawn ((this task-manager-protect-hq) (arg0 protect-gunship-enemy-spawn-params)) (let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params))) (set! (-> gp-0 velocity quad) (the-as uint128 0)) - (set! (-> gp-0 position quad) (-> arg0 pos quad)) + (vector-copy! (-> gp-0 position) (-> arg0 pos)) (quaternion-copy! (-> gp-0 rotation) (-> arg0 quat)) (set! (-> gp-0 behavior) (the-as uint 6)) (set! (-> gp-0 object-type) @@ -413,7 +413,7 @@ (set! (-> gp-0 nav-branch) #f) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((s2-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-0 quad) (-> arg0 pos quad)) + (vector-copy! s3-0 (-> arg0 pos)) (vector+float*! (-> s2-0 start-pos) (-> arg0 pos) *up-vector* 24576.0) (set! (-> s2-0 move-dist quad) (the-as uint128 0)) (set! (-> s2-0 move-dist y) -81920.0) @@ -428,7 +428,7 @@ (set! (-> v1-11 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) - (set! (-> s3-0 quad) (-> s2-0 best-other-tri intersect quad)) + (vector-copy! s3-0 (-> s2-0 best-other-tri intersect)) ) ) (set! (-> gp-0 nav-mesh) (find-nearest-nav-mesh-protect s3-0 (the-as float #x7f800000))) @@ -500,6 +500,7 @@ ;; definition for method 11 of type prot-crate (defmethod init-from-entity! ((this prot-crate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this entity) arg0) @@ -535,7 +536,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'static 'fact-info)) ) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) 1.0) (set! (-> s4-0 pickup-type) (pickup-type ammo-random)) (let ((f30-0 (get-protect-suck-t))) diff --git a/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc index ebbec5e2170..a0bba1939b5 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/flying-turret_REF.gc @@ -76,34 +76,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -273,6 +273,7 @@ ;; definition for method 120 of type flying-turret ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this flying-turret)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -322,6 +323,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs process. (defmethod update-focus ((this flying-turret)) + "Potentially update the focus, if there is something better to focus on." (the-as process (when (handle->process (-> this focus handle)) (let* ((s5-1 (handle->process (-> this focus handle))) (a0-9 (if (type? s5-1 process-focusable) @@ -330,7 +332,7 @@ ) (s5-0 (-> this focus-pos)) ) - (set! (-> s5-0 quad) (-> (get-trans a0-9 3) quad)) + (vector-copy! s5-0 (get-trans a0-9 3)) s5-0 ) ) @@ -379,7 +381,7 @@ (not (logtest? (-> (the-as process-focusable a0-27) focus-status) (focus-status disable dead inactive))) ) (let* ((s5-1 this) - (s4-0 (method-of-object s5-1 enemy-method-70)) + (s4-0 (method-of-object s5-1 set-focus!)) (s3-0 (handle->process (-> this current-enemy))) ) (s4-0 @@ -442,7 +444,7 @@ (let ((v1-8 (vector-float*! (new 'stack-no-clear 'vector) (-> this thrust-dir) (-> this speed-target))) (a0-6 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-6 quad) (-> this root transv quad)) + (vector-copy! a0-6 (-> this root transv)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) v1-8 a0-6)) (f30-0 0.0) ) @@ -467,7 +469,7 @@ (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> this root transv quad)) + (vector-copy! s3-0 (-> this root transv)) (when s1-0 (set! (-> s3-0 y) 0.0) (clamp-vector-to-mesh-no-gaps (-> this nav) s4-0 s1-0 s3-0 s2-0) @@ -509,7 +511,7 @@ (s2-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> s4-2 quad)) + (vector-copy! s3-1 s4-2) (when s0-0 (set! (-> s3-1 y) 0.0) (clamp-vector-to-mesh-no-gaps (-> this nav) s1-1 s0-0 s3-1 s2-1) @@ -533,7 +535,7 @@ (let ((s2-2 (new 'stack-no-clear 'vector)) (s4-3 (quaternion-identity! (new 'stack-no-clear 'quaternion))) ) - (set! (-> s2-2 quad) (-> this thrust-dir quad)) + (vector-copy! s2-2 (-> this thrust-dir)) (set! (-> s2-2 y) 0.0) (vector-normalize! s2-2 1.0) (let ((s3-2 (new 'stack-no-clear 'quaternion)) @@ -548,7 +550,7 @@ ) (when (zero? (-> this thrust-mode)) (let ((s3-3 (new 'stack-no-clear 'vector))) - (set! (-> s3-3 quad) (-> s5-1 quad)) + (vector-copy! s3-3 s5-1) (let ((s5-2 (new 'stack-no-clear 'vector))) (let ((s2-3 *up-vector*)) (set! (-> s3-3 y) 0.0) @@ -585,7 +587,7 @@ (let ((s4-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> this root trans quad)) + (vector-copy! gp-0 (-> this root trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector+float*! gp-0 gp-0 (-> s4-0 fvec) -3276.8) (vector+float*! gp-0 gp-0 (-> s4-0 uvec) -409.6) @@ -613,6 +615,7 @@ ;; definition for method 59 of type flying-turret ;; INFO: Used lq/sq (defmethod enemy-common-post ((this flying-turret)) + "Common implementation of post. Runs ja-post." (with-pp (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) (if (not (and (-> this next-state) (= (-> this next-state name) 'exit-transport))) @@ -692,7 +695,7 @@ (flying-turret-method-225 this) (set-vector! (-> this ground-point) (-> this root trans x) (-> this ground-height) (-> this root trans z) 1.0) (let ((a1-13 (new 'stack-no-clear 'vector))) - (set! (-> a1-13 quad) (-> this ground-point quad)) + (vector-copy! a1-13 (-> this ground-point)) (set-virtual-cur-pos! (-> this nav state) a1-13) ) (let ((f0-56 (+ (-> this desired-height-offset) (-> this ground-height)))) @@ -769,12 +772,13 @@ ;; definition for method 121 of type flying-turret (defmethod init-enemy! ((this flying-turret)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flying-turret" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flying-turret-nav-enemy-info*) + (setup-enemy! this *flying-turret-nav-enemy-info*) (call-parent-method this) (set! (-> this align) (new 'process 'align-control this)) (set! (-> this anim-shuffle) 2) @@ -811,15 +815,15 @@ (let ((a2-0 (-> arg0 state)) (v1-8 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-8 quad) (-> a2-0 heading quad)) + (vector-copy! v1-8 (-> a2-0 heading)) (let ((f30-0 (-> arg0 state speed))) - (set! (-> this thrust-dir quad) (-> v1-8 quad)) + (vector-copy! (-> this thrust-dir) v1-8) (let ((t9-0 vector-vector-xz-distance) (a0-7 (-> this root trans)) (a2-3 (-> this nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-3 target-pos quad)) + (vector-copy! a1-1 (-> a2-3 target-pos)) (let ((f0-1 (t9-0 a0-7 a1-1))) (set! (-> this speed-target) f30-0) (if (!= (-> this chase-mode) 3) @@ -861,7 +865,7 @@ (s2-0 (new 'stack-no-clear 'vector)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> s4-0 focus-pos quad)) + (vector-copy! s3-0 (-> s4-0 focus-pos)) (cspace<-parented-transformq-joint! arg0 arg1) (vector-! s2-0 s3-0 (-> arg0 bone transform trans)) ) @@ -951,8 +955,8 @@ (set! (-> gp-0 vehicle-impulse-factor) 2.0) (logior! (-> gp-0 options) (projectile-options po16)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -965,7 +969,7 @@ (defmethod fire-shot-from-joint-idx ((this flying-turret) (arg0 int)) (local-vars (a0-12 city-attacker-info)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this node-list data arg0 bone transform uvec quad)) + (vector-copy! s5-0 (-> this node-list data arg0 bone transform uvec)) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0)))) (set! (-> s5-0 y) 0.0) (when (or (< (-> this num-shots-fired) 3) (not (logtest? (-> this draw status) (draw-control-status on-screen)))) @@ -1092,6 +1096,7 @@ ;; definition for method 82 of type flying-turret (defmethod event-handler ((this flying-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('notify) (case (-> arg3 param 0) @@ -1143,7 +1148,7 @@ ) (cond ((< (* f1-0 f1-0) f0-0) - (set! (-> self move-dest quad) (-> self focus-pos quad)) + (vector-copy! (-> self move-dest) (-> self focus-pos)) (set! (-> self chase-mode) (the-as uint 0)) 0 ) @@ -1152,7 +1157,7 @@ ) ) (set! (-> self chase-mode) (the-as uint 1)) - (set! (-> self move-dest quad) (-> self root trans quad)) + (vector-copy! (-> self move-dest) (-> self root trans)) ) ) ) @@ -1178,7 +1183,7 @@ (set! (-> self num-shots-fired) 0) (set! (-> self hit-player?) #f) ) - (set! (-> self move-dest quad) (-> self root trans quad)) + (vector-copy! (-> self move-dest) (-> self root trans)) ) ) ) @@ -1298,7 +1303,7 @@ ) (logclear! (-> a0-71 flags) (nav-state-flag directional-mode)) (logior! (-> a0-71 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-71 target-pos quad) (-> v1-142 quad)) + (vector-copy! (-> a0-71 target-pos) v1-142) ) 0 ) @@ -1382,11 +1387,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 221)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 221)) ) ) @@ -1394,7 +1399,7 @@ (let ((v1-36 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> v1-36 hit-xz-reaction) 0.5) (set! (-> v1-36 hit-y-reaction) 0.6) - (set! (-> v1-36 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> v1-36 fountain-rand-transv-lo) (-> self incoming attack-position)) ) ) (if (not (-> *setting-control* user-current gun-special-mode)) @@ -1440,7 +1445,7 @@ (defmethod go-from-behavior ((this flying-turret) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (when (handle->process (-> arg0 handle)) (let ((s5-1 (vector+float*! (new 'stack-no-clear 'vector) @@ -1454,7 +1459,7 @@ (let ((v1-13 (-> this nav state))) (logclear! (-> v1-13 flags) (nav-state-flag directional-mode)) (logior! (-> v1-13 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-13 target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> v1-13 target-pos) s5-1) ) ) 0 @@ -1485,7 +1490,7 @@ (let ((a0-4 (-> self nav state)) (v1-15 *null-vector*) ) - (set! (-> a0-4 velocity quad) (-> v1-15 quad)) + (vector-copy! (-> a0-4 velocity) v1-15) ) 0 (let ((v1-18 (-> self nav))) @@ -1500,7 +1505,7 @@ (a3-0 (-> self nav state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 target-pos quad)) + (vector-copy! a2-0 (-> a3-0 target-pos)) (t9-0 a0-0 (the-as bucket-id a1-0) a2-0 (meters 2) *color-red*) ) (let ((t9-1 vector-vector-xz-distance) @@ -1508,7 +1513,7 @@ (a2-1 (-> self nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-1 target-pos quad)) + (vector-copy! a1-1 (-> a2-1 target-pos)) (if (< (t9-1 a0-1 a1-1) 16384.0) (go-virtual active) ) @@ -1527,7 +1532,7 @@ (case arg0 ((3) (let ((s5-1 (new 'static 'vector))) - (set! (-> s5-1 quad) (-> this root trans quad)) + (vector-copy! s5-1 (-> this root trans)) (vector<-cspace! s5-1 (-> this node-list data (-> this enemy-info bullseye-joint))) (set! (-> s5-1 w) 10240.0) s5-1 diff --git a/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc index 408df58b3aa..bf2ba20af98 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/protect-gunship_REF.gc @@ -1402,7 +1402,7 @@ (case arg0 ((3) (let ((gp-1 (new 'static 'vector))) - (set! (-> gp-1 quad) (-> this root trans quad)) + (vector-copy! gp-1 (-> this root trans)) (vector+float*! gp-1 gp-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) 1638.4) (vector+float*! gp-1 gp-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) -6144.0) (set! (-> gp-1 w) 10240.0) @@ -1434,21 +1434,21 @@ (logclear! (-> self mask) (process-mask enemy)) (cond ((logtest? (-> *part-group-id-table* 997 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 997)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 997)) ) ) (cond ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) ) ) @@ -1796,8 +1796,8 @@ (set! (-> self base-difficulty) (-> arg0 difficulty)) (set! (-> self difficulty-scalar) (-> arg0 difficulty-scalar)) (init (-> self missile-info)) - (set! (-> self root trans quad) (-> arg0 pos quad)) - (set! (-> self basetrans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) + (vector-copy! (-> self basetrans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (set! (-> self num-stages) 4) (set-vector! (-> self root scale) 0.4 0.4 0.4 1.0) @@ -1867,7 +1867,7 @@ ;; INFO: Used lq/sq (defbehavior gunship-exploder-init-by-other gunship-exploder ((arg0 vector) (arg1 quaternion)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self @@ -1898,18 +1898,18 @@ (sound-play "gship-explode") (cond ((logtest? (-> *part-group-id-table* 1453 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1453)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1453)) ) ) ) :code (behavior () (process-spawn gunship-exploder (-> self root trans) (-> self root quat) :name "gunship-exploder" :to self) - (set! (-> self root trans quad) (-> self ground-pt quad)) + (vector-copy! (-> self root trans) (-> self ground-pt)) (let ((gp-1 (new 'static 'fact-info))) (set! (-> gp-1 process) self) (set! (-> gp-1 pickup-type) (pickup-type ammo-random)) @@ -2105,9 +2105,9 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-gunship-missile" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) - (set! (-> self dest-pos quad) (-> arg0 dest-pos quad)) - (set! (-> self launch-dir quad) (-> arg0 launch-dir quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) + (vector-copy! (-> self dest-pos) (-> arg0 dest-pos)) + (vector-copy! (-> self launch-dir) (-> arg0 launch-dir)) (set! (-> self index) (-> arg0 index)) (let ((a1-9 (matrix-f-compose (new 'stack-no-clear 'matrix) (-> self launch-dir)))) (matrix->quaternion (-> self root quat) a1-9) @@ -2139,7 +2139,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('attack-targ) - (set! (-> self dest-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self dest-pos) (the-as vector (-> block param 0))) (set! (-> self attack-time) (the float (-> block param 1))) (go-virtual attack-targ) ) @@ -2216,11 +2216,11 @@ (transform-post) (cond ((logtest? (-> *part-group-id-table* 104 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self dest-pos quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self dest-pos)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 104)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self dest-pos quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self dest-pos)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 104)) ) ) @@ -2237,7 +2237,7 @@ (f0-4 (fmax 0.0 (fmin 1.0 f1-2))) (f30-0 (lerp 10240.0 17920.0 f0-4)) ) - (set! (-> gp-0 quad) (-> self dest-pos quad)) + (vector-copy! gp-0 (-> self dest-pos)) (set! (-> gp-0 w) (* 2.0 f30-0)) (let ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-0 384)) @@ -2335,7 +2335,7 @@ (defmethod gunship-missile-method-31 ((this gunship-missile)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) - (set! (-> gp-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> gp-0 trans) (-> this root trans)) (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -3686.4) (vector+float*! (-> gp-0 trans) (-> gp-0 trans) (-> gp-0 fvec) -4096.0) (init-with-mat! (-> this particle-trail) gp-0) @@ -2377,9 +2377,9 @@ ;; WARN: Return type mismatch int vs handle. (defmethod spawn-missile ((this protect-gunship) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int)) (let ((s5-0 (new 'stack-no-clear 'gunship-missile-init-params))) - (set! (-> s5-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 pos) arg0) (vector-normalize-copy! (-> s5-0 launch-dir) arg1 1.0) - (set! (-> s5-0 dest-pos quad) (-> arg2 quad)) + (vector-copy! (-> s5-0 dest-pos) arg2) (set! (-> s5-0 index) arg4) (set! (-> s5-0 time-to-targ) arg3) (the-as handle (ppointer->handle (process-spawn gunship-missile s5-0 :name "gunship-missile" :to this))) @@ -2516,7 +2516,7 @@ (dotimes (s3-2 s4-3) (when *target* (let ((s2-1 (new 'stack-no-clear 'vector))) - (set! (-> s2-1 quad) (-> (get-trans *target* 1) quad)) + (vector-copy! s2-1 (get-trans *target* 1)) 0.0 0.75 (let ((f30-3 (vector-length (get-transv *target*))) @@ -2535,7 +2535,7 @@ (f26-2 (+ f26-1 (* f24-0 (+ -1.0 (the-as float v1-116))))) (s1-3 (new 'stack-no-clear 'vector)) ) - (set! (-> s1-3 quad) (-> *x-vector* quad)) + (vector-copy! s1-3 *x-vector*) 0.0 (let* ((v1-121 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-122 (the-as number (logior #x3f800000 v1-121))) @@ -2559,7 +2559,7 @@ (let ((v1-138 (new 'stack-no-clear 'vector)) (s2-2 (new 'stack-no-clear 'collide-query)) ) - (set! (-> v1-138 quad) (-> this missile-info missile-dest-positions s5-5 quad)) + (vector-copy! v1-138 (-> this missile-info missile-dest-positions s5-5)) (vector+float*! (-> s2-2 start-pos) v1-138 *up-vector* 24576.0) (set! (-> s2-2 move-dist quad) (the-as uint128 0)) (set! (-> s2-2 move-dist y) -81920.0) @@ -2574,23 +2574,23 @@ (set! (-> v1-141 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-2) 0.0) - (set! (-> this missile-info missile-dest-positions s5-5 quad) (-> s2-2 best-other-tri intersect quad)) + (vector-copy! (-> this missile-info missile-dest-positions s5-5) (-> s2-2 best-other-tri intersect)) (set! (-> this missile-info missile-dest-positions s5-5 y) 0.0) ) ) (sound-play "gship-bombscan") (let ((v1-152 (new 'stack-no-clear 'vector))) - (set! (-> v1-152 quad) (-> this missile-info missile-dest-positions s5-5 quad)) + (vector-copy! v1-152 (-> this missile-info missile-dest-positions s5-5)) (+! (-> v1-152 y) 409.6) (set! (-> this missile-info beacon-handles s5-5) (ppointer->handle (cond ((logtest? (-> *part-group-id-table* 1452 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-152 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-152) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 1452)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-152 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-152) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 1452)) ) ) @@ -2670,7 +2670,7 @@ ) ) (else - (set! (-> s5-0 pos quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 pos) (-> this root trans)) (quaternion-copy! (-> s5-0 quat) (-> this root quat)) ) ) @@ -2688,7 +2688,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod probe-ground ((this protect-gunship)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> this ground-pt quad) (-> this basetrans quad)) + (vector-copy! (-> this ground-pt) (-> this basetrans)) (vector+float*! (-> s5-0 start-pos) (-> this ground-pt) *up-vector* 24576.0) (set! (-> s5-0 move-dist quad) (the-as uint128 0)) (set! (-> s5-0 move-dist y) -81920.0) @@ -2703,7 +2703,7 @@ (set! (-> v1-5 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) - (set! (-> this ground-pt quad) (-> s5-0 best-other-tri intersect quad)) + (vector-copy! (-> this ground-pt) (-> s5-0 best-other-tri intersect)) (set! (-> this ground-pt y) 7372.8) ) ) @@ -2735,7 +2735,7 @@ (protect-gunship-method-37 this) (set! (-> this want) (the-as uint 0)) (set! (-> this target) (the-as uint 0)) - (set! (-> this root trans quad) (-> this basetrans quad)) + (vector-copy! (-> this root trans) (-> this basetrans)) (let* ((f0-0 0.4) (f1-1 (* 0.0033333334 (the float (current-time)))) (f0-1 (* f0-0 (- f1-1 (* (the float (the int (/ f1-1 2.5))) 2.5)))) @@ -2743,7 +2743,7 @@ (set! (-> this root trans y) (+ 1228.8 (* 1228.8 (cos (* 65536.0 f0-1))) (-> this basetrans y))) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this last-thrust quad)) + (vector-copy! s5-0 (-> this last-thrust)) 0.0 0.0 (vector+! s5-0 s5-0 (-> this root transv)) @@ -2923,7 +2923,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-7 quad)) + (vector-copy! (-> a0-3 target-pos) v1-7) ) 0 (set! (-> this nav flags) (nav-control-flag display-marks)) @@ -3207,14 +3207,14 @@ ) (logclear! (-> a0-1 flags) (nav-state-flag directional-mode)) (logior! (-> a0-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-1 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> a0-1 target-pos) v1-5) ) 0 (open-doors self) ) :exit (behavior () (set! (-> self suppress-times (log2 16)) (+ (current-time) (seconds 5))) - (set! (-> self last-repo-pos quad) (-> self basetrans quad)) + (vector-copy! (-> self last-repo-pos) (-> self basetrans)) (set! (-> self next-spawn-time) (+ (current-time) (the int (* 300.0 (lerp 7.5 5.0 (-> self difficulty)))))) ) :trans (behavior () @@ -3370,7 +3370,7 @@ (.svf (&-> sv-176 quad) vf6) 0.0 (let ((a0-25 sv-176)) - (set! (-> a0-25 quad) (-> sv-176 quad)) + (vector-copy! a0-25 sv-176) (set! (-> a0-25 y) 0.0) (vector-normalize! a0-25 1.0) ) @@ -3480,7 +3480,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-2 quad)) + (vector-copy! (-> a0-3 target-pos) v1-2) ) 0 ) @@ -3491,7 +3491,7 @@ ;; INFO: Used lq/sq (defmethod fire-laser ((this protect-gunship) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-float*! (-> s5-0 move-dist) arg1 491520.0) (let ((v1-3 s5-0)) (set! (-> v1-3 radius) 40.96) @@ -3605,9 +3605,9 @@ (a2-0 (-> self nav state)) (a1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-0 (-> a2-0 target-pos)) (if (< (t9-4 a0-4 a1-0) 20480.0) - (set! (-> self last-repo-pos quad) (-> self basetrans quad)) + (vector-copy! (-> self last-repo-pos) (-> self basetrans)) ) ) (when (time-elapsed? (-> self choose-new-point-time) (seconds 3)) @@ -3630,7 +3630,7 @@ ) (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-10 target-pos quad) (-> v1-30 quad)) + (vector-copy! (-> a0-10 target-pos) v1-30) ) 0 ) @@ -3667,7 +3667,7 @@ (* (-> self current-laser-rotate-speed) (seconds-per-frame)) ) (let ((gp-4 (new 'stack-no-clear 'vector))) - (set! (-> gp-4 quad) (-> self root trans quad)) + (vector-copy! gp-4 (-> self root trans)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (the int (lerp 2.0 4.5 (-> self difficulty)))) ) @@ -3678,8 +3678,8 @@ (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((s1-0 *target*)) (when s1-0 - (set! (-> s2-0 quad) (-> (target-pos 0) quad)) - (set! (-> s3-0 quad) (-> (get-trans s1-0 3) quad)) + (vector-copy! s2-0 (target-pos 0)) + (vector-copy! s3-0 (get-trans s1-0 3)) (let ((s0-3 (vector-! (new 'stack-no-clear 'vector) s2-0 (-> self root trans))) (s1-2 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> self root trans))) ) @@ -3770,12 +3770,12 @@ (let ((a0-1 (-> this nav state)) (a1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> a0-1 target-pos quad)) + (vector-copy! a1-0 (-> a0-1 target-pos)) 0.0 (let ((a0-4 (-> this nav state)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> a0-4 heading quad)) + (vector-copy! s5-0 (-> a0-4 heading)) 0.0 (let* ((f0-2 (vector-vector-xz-distance (-> this basetrans) a1-0)) (f0-3 (fmin 102400.0 f0-2)) @@ -3901,7 +3901,7 @@ ) :exit (behavior () (set-time! (-> self last-land-time)) - (set! (-> self last-repo-pos quad) (-> self basetrans quad)) + (vector-copy! (-> self last-repo-pos) (-> self basetrans)) ) :trans (behavior () (let ((a0-0 (-> self state parent))) diff --git a/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc b/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc index 1d678d96630..3c5ea2366a7 100644 --- a/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/protect/roboguard-city_REF.gc @@ -252,34 +252,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 20480.0 - :knocked-soft-vxz-hi 28672.0 - :knocked-soft-vy-lo 36864.0 - :knocked-soft-vy-hi 45056.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 49152.0 - :knocked-hard-vxz-hi 57344.0 - :knocked-hard-vy-lo 49152.0 - :knocked-hard-vy-hi 57344.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 28672.0 - :knocked-yellow-vy-lo 36864.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 114688.0 - :knocked-red-vy-lo 53248.0 - :knocked-red-vy-hi 69632.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 20480.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 5) + :knocked-soft-vxz-hi (meters 7) + :knocked-soft-vy-lo (meters 9) + :knocked-soft-vy-hi (meters 11) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 12) + :knocked-hard-vxz-hi (meters 14) + :knocked-hard-vy-lo (meters 12) + :knocked-hard-vy-hi (meters 14) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 7) + :knocked-yellow-vy-lo (meters 9) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 28) + :knocked-red-vy-lo (meters 13) + :knocked-red-vy-hi (meters 17) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 5) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -375,6 +375,7 @@ ;; definition for method 120 of type roboguard-city ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this roboguard-city)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -438,7 +439,7 @@ (let ((v1-3 (joint-node roboguard-city-lod0-jg chest)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (vector-copy! gp-0 (-> v1-3 bone transform fvec)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) (set! (-> gp-0 y) 0.0) (set! (-> s5-1 y) 0.0) @@ -598,7 +599,7 @@ (let ((gp-0 (get-current-enemy self))) (when gp-0 (let* ((s5-0 self) - (s4-0 (method-of-object s5-0 enemy-method-70)) + (s4-0 (method-of-object s5-0 set-focus!)) (s3-0 (handle->process (-> self target-status handle))) ) (s4-0 @@ -650,9 +651,9 @@ ;; INFO: Used lq/sq (defmethod roboguard-city-method-233 ((this roboguard-city) (arg0 vector) (arg1 vector)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> this root trans quad)) + (vector-copy! a1-1 (-> this root trans)) (set! (-> a1-1 w) (-> this root nav-radius)) - (when (not (add-root-sphere-to-hash! (-> this nav) a1-1 255)) + (when (not (check-sphere-blocked! (-> this nav) a1-1 255)) (let* ((s3-0 (new 'stack-no-clear 'vector)) (s2-0 (closest-point-on-mesh (-> this nav) s3-0 arg0 (the-as nav-poly #f))) (s4-1 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) @@ -934,13 +935,13 @@ (let ((gp-0 (-> self nav state)) (v1-19 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-0 heading quad) (-> v1-19 quad)) + (vector-copy! (-> gp-0 heading) v1-19) ) 0 (let ((gp-1 (-> self nav state)) (v1-24 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-1 velocity quad) (-> v1-24 quad)) + (vector-copy! (-> gp-1 velocity) v1-24) ) 0 (set-time! (-> self state-time)) @@ -979,7 +980,7 @@ ) (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-pos quad) (-> v1-25 quad)) + (vector-copy! (-> a0-9 target-pos) v1-25) ) 0 (when (time-elapsed? (-> self state-time) (-> self reaction-time)) @@ -999,7 +1000,7 @@ (a2-0 (-> self nav state)) (v1-7 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-7 quad) (-> a2-0 velocity quad)) + (vector-copy! v1-7 (-> a2-0 velocity)) (set! (-> a0-4 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z)))))) ) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!) @@ -1152,13 +1153,13 @@ (let ((gp-0 (-> self nav state)) (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-0 heading quad) (-> v1-12 quad)) + (vector-copy! (-> gp-0 heading) v1-12) ) 0 (let ((gp-1 (-> self nav state)) (v1-17 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-1 velocity quad) (-> v1-17 quad)) + (vector-copy! (-> gp-1 velocity) v1-17) ) 0 (let ((v1-20 (-> self nav))) @@ -1178,7 +1179,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> gp-0 target-pos) v1-5) ) 0 ) @@ -1217,13 +1218,13 @@ (let ((gp-0 (-> self nav state)) (v1-18 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-0 heading quad) (-> v1-18 quad)) + (vector-copy! (-> gp-0 heading) v1-18) ) 0 (let ((gp-1 (-> self nav state)) (v1-23 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) - (set! (-> gp-1 velocity quad) (-> v1-23 quad)) + (vector-copy! (-> gp-1 velocity) v1-23) ) 0 ) @@ -1279,7 +1280,7 @@ ) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-2 target-pos) v1-1) ) 0 (nav-enemy-method-187 self) @@ -1382,7 +1383,7 @@ (< f0-0 (* f1-0 f1-0)) ) ) - (send-attack self s3-1 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) + (send-attack-from-tshape self s3-1 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) ) ) ) @@ -1407,7 +1408,7 @@ (< f0-2 (* f1-4 f1-4)) ) ) - (send-attack self s5-2 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) + (send-attack-from-tshape self s5-2 (the-as touching-shapes-entry #f) (-> self persistent-attack-id)) ) ) ) @@ -1668,6 +1669,7 @@ ;; definition for method 81 of type roboguard-city (defmethod go-die ((this roboguard-city)) + "Go to the die state." (go (method-of-object this explode)) ) @@ -1683,7 +1685,7 @@ (t9-0) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1692,6 +1694,7 @@ ;; definition for method 78 of type roboguard-city (defmethod go-hostile ((this roboguard-city)) + "Go to the hostile state, actively trying to attack the target." (local-vars (v1-3 enemy-flag) (v1-5 enemy-flag)) (logior! (-> this enemy-flags) (enemy-flag vulnerable)) (let ((v1-2 (-> this enemy-flags))) @@ -1745,11 +1748,11 @@ (let ((v1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node roboguard-city-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -1758,7 +1761,7 @@ (let ((v1-32 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> v1-32 hit-xz-reaction) 0.95) (set! (-> v1-32 hit-y-reaction) 0.6) - (set! (-> v1-32 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> v1-32 fountain-rand-transv-lo) (-> self incoming attack-position)) ) ) (cleanup-for-death self) @@ -1829,8 +1832,8 @@ (set! (-> gp-0 vehicle-impulse-factor) 2.0) (logior! (-> gp-0 options) (projectile-options po16)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -1866,6 +1869,7 @@ ;; definition for method 85 of type roboguard-city (defmethod knocked-anim ((this roboguard-city) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (let ((v1-0 #t)) (case (-> this incoming knocked-type) @@ -1906,6 +1910,7 @@ ;; definition for method 86 of type roboguard-city (defmethod knocked-land-anim ((this roboguard-city) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-0 #t)) (case (-> this incoming knocked-type) (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) @@ -1945,6 +1950,7 @@ ;; definition for method 82 of type roboguard-city (defmethod event-handler ((this roboguard-city) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (set-time! (-> this pursuit-start-time)) @@ -1964,7 +1970,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1991,16 +1997,18 @@ ;; definition for method 140 of type roboguard-city ;; WARN: Return type mismatch int vs process. (defmethod update-focus ((this roboguard-city)) + "Potentially update the focus, if there is something better to focus on." (the-as process 0) ) ;; definition for method 59 of type roboguard-city ;; INFO: Used lq/sq (defmethod enemy-common-post ((this roboguard-city)) + "Common implementation of post. Runs ja-post." (roboguard-city-method-237 this) (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans s5-0 3)) (los-control-method-9 (-> this los) s5-0 (-> this focus-pos) 819.2 4096.0) ) ) @@ -2038,7 +2046,7 @@ (let ((a1-9 (-> this nav state)) (v1-35 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-35 quad) (-> a1-9 heading quad)) + (vector-copy! v1-35 (-> a1-9 heading)) 0.0 (let* ((f0-8 (vector-dot s5-3 v1-35)) (f0-9 (+ 1.0 f0-8)) @@ -2077,6 +2085,7 @@ ;; definition for method 67 of type roboguard-city (defmethod coin-flip? ((this roboguard-city)) + "Return #t half the time, #f the other." #f ) @@ -2202,6 +2211,7 @@ ;; definition for method 121 of type roboguard-city ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this roboguard-city)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-city" (the-as (pointer level) #f))) @@ -2211,7 +2221,7 @@ (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) ) - (init-enemy-defaults! this *roboguard-city-nav-enemy-info*) + (setup-enemy! this *roboguard-city-nav-enemy-info*) (let ((t9-4 (method-of-type kg-squad-member init-enemy!))) (t9-4 this) ) @@ -2324,7 +2334,7 @@ (logclear! (-> this flags) (citizen-flag persistent in-pursuit)) ) (let ((v1-26 (new 'stack-no-clear 'vector))) - (set! (-> v1-26 quad) (-> this root trans quad)) + (vector-copy! v1-26 (-> this root trans)) (+! (-> v1-26 y) 8192.0) ) (let* ((s5-0 (handle->process (-> this target-status handle))) @@ -2338,7 +2348,7 @@ (not (logtest? (-> (the-as process-focusable a0-36) focus-status) (focus-status disable dead inactive))) ) (let* ((s5-1 this) - (s4-0 (method-of-object s5-1 enemy-method-70)) + (s4-0 (method-of-object s5-1 set-focus!)) (s3-0 (handle->process (-> this target-status handle))) ) (s4-0 @@ -2416,7 +2426,8 @@ ) ;; definition for method 65 of type roboguard-city -(defmethod penetrate->next-state ((this roboguard-city) (arg0 process) (arg1 event-message-block) (arg2 float)) +(defmethod msg-for-incoming-attack ((this roboguard-city) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." (cond ((logtest? (penetrate emp-blast) (-> this incoming penetrate-using)) (set-time! (-> this dizzy-start-time)) @@ -2452,7 +2463,7 @@ ) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else diff --git a/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-obs_REF.gc b/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-obs_REF.gc index c3a5d23f477..42e42569a1a 100644 --- a/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/slums/ctyslumc-obs_REF.gc @@ -290,6 +290,7 @@ ;; definition for method 11 of type ctyslumc-flag (defmethod init-from-entity! ((this ctyslumc-flag) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -305,7 +306,7 @@ (defbehavior ctyslumc-flag-init-by-other ctyslumc-flag ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyslumc-flag" (the-as (pointer level) #f))) diff --git a/test/decompiler/reference/jak3/levels/city/slums/neon-baron-part_REF.gc b/test/decompiler/reference/jak3/levels/city/slums/neon-baron-part_REF.gc index 4284220507b..407ecc684df 100644 --- a/test/decompiler/reference/jak3/levels/city/slums/neon-baron-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/slums/neon-baron-part_REF.gc @@ -3585,8 +3585,9 @@ ;; definition for method 11 of type neon-baron ;; INFO: Used lq/sq (defmethod init-from-entity! ((this neon-baron) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (matrix-rotate-y! (-> this mat) (quaternion-y-angle (-> arg0 quat))) - (set! (-> this mat trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this mat trans) (-> arg0 extra trans)) (set! (-> this master-enable) (the-as uint -1)) (set! (-> this flags) (neon-baron-flag nb0 nb3)) (set! (-> this mode) (the-as uint 0)) @@ -3599,7 +3600,3 @@ (update-mode this) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc index 64562584d97..10b0e865e96 100644 --- a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-battery_REF.gc @@ -177,6 +177,7 @@ ;; definition for method 11 of type cty-sniper-button-top (defmethod init-from-entity! ((this cty-sniper-button-top) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-drawable-from-entity! this arg0) (initialize-skeleton this @@ -194,7 +195,7 @@ ;; INFO: Used lq/sq (defbehavior cty-sniper-button-top-init-by-other cty-sniper-button-top ((arg0 vector) (arg1 quaternion)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self @@ -420,6 +421,7 @@ ;; definition for method 11 of type cty-sniper-button (defmethod init-from-entity! ((this cty-sniper-button) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -878,11 +880,11 @@ (sound-play "destroy-battery") (cond ((logtest? (-> *part-group-id-table* 1464 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1464)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1464)) ) ) @@ -943,6 +945,7 @@ ;; definition for method 11 of type cty-sniper-battery ;; INFO: Used lq/sq (defmethod init-from-entity! ((this cty-sniper-battery) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1038,7 +1041,7 @@ (set! (-> s4-0 event-self) 'touched) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self diff --git a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc index 4c03081e0cb..fc413c1242c 100644 --- a/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/sniper/cty-sniper-turret_REF.gc @@ -96,7 +96,7 @@ (when (not (logtest? (-> self actor-group 0 data v1-5 actor extra perm status) (entity-perm-status subtask-complete)) ) (if (-> self minimap) - (set! (-> self minimap position quad) (-> self actor-group 0 data v1-5 actor trans quad)) + (vector-copy! (-> self minimap position) (-> self actor-group 0 data v1-5 actor trans)) (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 15) (the-as int #f) (the-as vector #f) 0)) ) (set! v1-4 #f) @@ -292,7 +292,7 @@ (suspend) ) (set-time-limit self) - (while (and (= (status-of-level-and-borrows *level* 'hiphog #t) 'active) + (while (and (= (level-status? *level* 'hiphog #t) 'active) (or (not (level-get-target-inside *level*)) (!= (-> (level-get-target-inside *level*) name) 'ctyport)) ) (suspend) @@ -1235,7 +1235,7 @@ (a1-4 (-> *part-id-table* 4849)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -1288,7 +1288,7 @@ ) (-> *part-id-table* 4847 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) (* f28-1 f30-1)) (launch-particles (-> *part-id-table* 4847) s4-1 :origin-is-matrix #t) (set! (-> *part-id-table* 4847 init-specs 3 initial-valuef) f30-1) @@ -1369,7 +1369,7 @@ (let ((v1-5 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-5 sphere quad) (-> self root trans quad)) (set! (-> v1-5 sphere r) 40960.0) - (set! (-> v1-5 velocity quad) (-> self root transv quad)) + (vector-copy! (-> v1-5 velocity) (-> self root transv)) (set! (-> v1-5 notify-radius) 122880.0) (set! (-> v1-5 danger-level) 1.0) (set! (-> v1-5 decay-rate) 0.0) @@ -1486,7 +1486,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this cty-sniper-turret-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'fac-robotank-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) cty-sniper-turret-shot-move) @@ -1523,8 +1523,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -1874,8 +1874,8 @@ ;; INFO: Used lq/sq (defbehavior cty-sniper-turret-reticle-init-by-other cty-sniper-turret-reticle ((arg0 vector) (arg1 vector) (arg2 texture-id)) (cty-sniper-turret-reticle-method-19 self) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self root scale quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self root scale) arg1) (matrix->quaternion (-> self root quat) (math-camera-matrix)) (set! (-> self wander-offset 0 quad) (the-as uint128 0)) (set! (-> self wander-offset 1 quad) (the-as uint128 0)) @@ -1954,7 +1954,7 @@ (let ((v1-14 (-> this ring-inner data))) (vector+! s2-0 gp-0 s0-0) (vector+! s2-0 s2-0 s1-0) - (set! (-> v1-14 0 pos quad) (-> s2-0 quad)) + (vector-copy! (-> v1-14 0 pos) s2-0) (set! (-> v1-14 0 stq z) 0.0) (set! (-> v1-14 0 stq x) 0.0) (set! (-> v1-14 0 stq y) 0.0) @@ -1963,7 +1963,7 @@ (let ((v1-15 (-> v1-14 1))) (vector+float*! s2-0 gp-0 s0-0 -1.0) (vector+! s2-0 s2-0 s1-0) - (set! (-> v1-15 pos quad) (-> s2-0 quad)) + (vector-copy! (-> v1-15 pos) s2-0) (set! (-> v1-15 stq z) 0.0) (set! (-> v1-15 stq x) 1.0) (set! (-> v1-15 stq y) 0.0) @@ -1972,7 +1972,7 @@ (let ((v1-16 (&+ v1-15 32))) (vector+! s2-0 gp-0 s0-0) (vector+float*! s2-0 s2-0 s1-0 -1.0) - (set! (-> v1-16 pos quad) (-> s2-0 quad)) + (vector-copy! (-> v1-16 pos) s2-0) (set! (-> v1-16 stq z) 0.0) (set! (-> v1-16 stq x) 0.0) (set! (-> v1-16 stq y) 1.0) @@ -1981,7 +1981,7 @@ (let ((v1-17 (&+ v1-16 32))) (vector+float*! s2-0 gp-0 s0-0 -1.0) (vector+float*! s2-0 s2-0 s1-0 -1.0) - (set! (-> v1-17 pos quad) (-> s2-0 quad)) + (vector-copy! (-> v1-17 pos) s2-0) (set! (-> v1-17 stq z) 0.0) (set! (-> v1-17 stq x) 1.0) (set! (-> v1-17 stq y) 1.0) @@ -2009,7 +2009,7 @@ (let ((v1-24 (-> this ring-middle data))) (vector+! s2-1 gp-0 s0-1) (vector+! s2-1 s2-1 s1-1) - (set! (-> v1-24 0 pos quad) (-> s2-1 quad)) + (vector-copy! (-> v1-24 0 pos) s2-1) (set! (-> v1-24 0 stq z) 0.0) (set! (-> v1-24 0 stq x) 0.0) (set! (-> v1-24 0 stq y) 0.0) @@ -2018,7 +2018,7 @@ (let ((v1-25 (-> v1-24 1))) (vector+float*! s2-1 gp-0 s0-1 -1.0) (vector+! s2-1 s2-1 s1-1) - (set! (-> v1-25 pos quad) (-> s2-1 quad)) + (vector-copy! (-> v1-25 pos) s2-1) (set! (-> v1-25 stq z) 0.0) (set! (-> v1-25 stq x) 1.0) (set! (-> v1-25 stq y) 0.0) @@ -2027,7 +2027,7 @@ (let ((v1-26 (&+ v1-25 32))) (vector+! s2-1 gp-0 s0-1) (vector+float*! s2-1 s2-1 s1-1 -1.0) - (set! (-> v1-26 pos quad) (-> s2-1 quad)) + (vector-copy! (-> v1-26 pos) s2-1) (set! (-> v1-26 stq z) 0.0) (set! (-> v1-26 stq x) 0.0) (set! (-> v1-26 stq y) 1.0) @@ -2036,7 +2036,7 @@ (let ((v1-27 (&+ v1-26 32))) (vector+float*! s2-1 gp-0 s0-1 -1.0) (vector+float*! s2-1 s2-1 s1-1 -1.0) - (set! (-> v1-27 pos quad) (-> s2-1 quad)) + (vector-copy! (-> v1-27 pos) s2-1) (set! (-> v1-27 stq z) 0.0) (set! (-> v1-27 stq x) 1.0) (set! (-> v1-27 stq y) 1.0) @@ -2061,7 +2061,7 @@ (let ((v1-34 (-> this ring-outer data))) (vector+! s2-2 gp-0 s0-2) (vector+! s2-2 s2-2 s1-2) - (set! (-> v1-34 0 pos quad) (-> s2-2 quad)) + (vector-copy! (-> v1-34 0 pos) s2-2) (set! (-> v1-34 0 stq z) 0.0) (set! (-> v1-34 0 stq x) 0.0) (set! (-> v1-34 0 stq y) 0.0) @@ -2070,7 +2070,7 @@ (let ((v1-35 (-> v1-34 1))) (vector+float*! s2-2 gp-0 s0-2 -1.0) (vector+! s2-2 s2-2 s1-2) - (set! (-> v1-35 pos quad) (-> s2-2 quad)) + (vector-copy! (-> v1-35 pos) s2-2) (set! (-> v1-35 stq z) 0.0) (set! (-> v1-35 stq x) 1.0) (set! (-> v1-35 stq y) 0.0) @@ -2079,7 +2079,7 @@ (let ((v1-36 (&+ v1-35 32))) (vector+! s2-2 gp-0 s0-2) (vector+float*! s2-2 s2-2 s1-2 -1.0) - (set! (-> v1-36 pos quad) (-> s2-2 quad)) + (vector-copy! (-> v1-36 pos) s2-2) (set! (-> v1-36 stq z) 0.0) (set! (-> v1-36 stq x) 0.0) (set! (-> v1-36 stq y) 1.0) @@ -2088,7 +2088,7 @@ (let ((v1-37 (&+ v1-36 32))) (vector+float*! s2-2 gp-0 s0-2 -1.0) (vector+float*! s2-2 s2-2 s1-2 -1.0) - (set! (-> v1-37 pos quad) (-> s2-2 quad)) + (vector-copy! (-> v1-37 pos) s2-2) (set! (-> v1-37 stq z) 0.0) (set! (-> v1-37 stq x) 1.0) (set! (-> v1-37 stq y) 1.0) @@ -2137,7 +2137,7 @@ (case arg2 (('update) (-> arg3 param 0) - (set! (-> self root trans quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> self root trans) (the-as vector (-> arg3 param 0))) (matrix->quaternion (-> self root quat) (math-camera-matrix)) ) (('collide-dist) @@ -2585,8 +2585,8 @@ (set! (-> s5-2 charge) 1.0) (set! (-> s5-2 options) (projectile-options)) (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) - (set! (-> s5-2 pos quad) (-> s4-0 quad)) - (set! (-> s5-2 vel quad) (-> s3-2 quad)) + (vector-copy! (-> s5-2 pos) s4-0) + (vector-copy! (-> s5-2 vel) s3-2) (set! (-> s5-2 notify-handle) (process->handle this)) (set! (-> s5-2 owner-handle) (the-as handle #f)) (set! (-> s5-2 target-handle) (the-as handle #f)) @@ -2925,7 +2925,7 @@ (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> s4-1 quad)) + (vector-copy! s5-0 s4-1) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (set! (-> s5-0 y) 0.0) @@ -3199,7 +3199,7 @@ ) (vector+! s3-0 s3-0 (target-pos 0)) (+! (-> s3-0 y) 20480.0) - (set! (-> *camera* slave 0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> *camera* slave 0 trans) s3-0) ) (vector-! gp-1 (-> self root trans) (target-pos 0)) (vector-! s5-2 (camera-pos) (target-pos 0)) @@ -3278,7 +3278,7 @@ (logclear! (-> *target* focus-status) (focus-status ignore)) ) (logior! (-> self flags) (cty-sniper-turret-flag cst11)) - (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) + (vector-copy! (-> self firing-sight-pos) (-> self sight-pos)) (send-event (handle->process (-> self reticle)) 'lock) (let ((a1-17 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-17 from) (process->ppointer self)) @@ -3406,18 +3406,18 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 1465 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1465)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1465)) ) ) (suspend) (let ((gp-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *up-vector* quad)) + (vector-copy! s5-0 *up-vector*) (vector-normalize-copy! (-> gp-2 fountain-rand-transv-lo) s5-0 81920.0) (vector-normalize-copy! (-> gp-2 fountain-rand-transv-hi) s5-0 245760.0) ) @@ -3554,9 +3554,9 @@ ) (set! (-> this root) s1-0) ) - (set! (-> this root trans quad) (-> arg0 quad)) + (vector-copy! (-> this root trans) arg0) (quaternion-copy! (-> this root quat) arg1) - (set! (-> this offset quad) (-> arg2 quad)) + (vector-copy! (-> this offset) arg2) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-sniper-turret" (the-as (pointer level) #f))) @@ -3578,7 +3578,7 @@ (quaternion-copy! (-> this rotate-quat) arg1) (set! (-> this rotate-rate) 0.0) (set! (-> this rotate-mult) arg3) - (set! (-> this pos-cam-offset quad) (-> (new 'static 'vector :y 61440.0 :w 1.0) quad)) + (vector-copy! (-> this pos-cam-offset) (new 'static 'vector :y 61440.0 :w 1.0)) (set-time! (-> this gun-timer)) (set! (-> this flags) (cty-sniper-turret-flag)) (set! (-> this fov-mult) 1.0) @@ -3611,6 +3611,7 @@ ;; definition for method 11 of type cty-sniper-turret ;; INFO: Used lq/sq (defmethod init-from-entity! ((this cty-sniper-turret) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this entity) arg0) (set! sv-16 (new 'static 'res-tag)) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-chick_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-chick_REF.gc index 77299d957c5..08187c3467a 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-chick_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-chick_REF.gc @@ -171,34 +171,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 20480.0 - :knocked-soft-vy-hi 40960.0 - :knocked-medium-vxz-lo 40960.0 - :knocked-medium-vxz-hi 73728.0 - :knocked-medium-vy-lo 24576.0 - :knocked-medium-vy-hi 53248.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 102400.0 - :knocked-hard-vy-lo 40960.0 - :knocked-hard-vy-hi 81920.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 8192.0 - :knocked-yellow-vxz-hi 16384.0 - :knocked-yellow-vy-lo 12288.0 - :knocked-yellow-vy-hi 24576.0 - :knocked-red-vxz-lo 12288.0 - :knocked-red-vxz-hi 24576.0 - :knocked-red-vy-lo 20480.0 - :knocked-red-vy-hi 36864.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 32768.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 5) + :knocked-soft-vy-hi (meters 10) + :knocked-medium-vxz-lo (meters 10) + :knocked-medium-vxz-hi (meters 18) + :knocked-medium-vy-lo (meters 6) + :knocked-medium-vy-hi (meters 13) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 25) + :knocked-hard-vy-lo (meters 10) + :knocked-hard-vy-hi (meters 20) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 2) + :knocked-yellow-vxz-hi (meters 4) + :knocked-yellow-vy-lo (meters 3) + :knocked-yellow-vy-hi (meters 6) + :knocked-red-vxz-lo (meters 3) + :knocked-red-vxz-hi (meters 6) + :knocked-red-vy-lo (meters 5) + :knocked-red-vy-hi (meters 9) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 8) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd player-list) @@ -467,6 +467,7 @@ ;; definition for method 67 of type citizen-chick (defmethod coin-flip? ((this citizen-chick)) + "Return #t half the time, #f the other." #f ) @@ -479,6 +480,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this citizen-chick)) + "Get the yaw angle for the current knock." (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) @@ -486,7 +488,7 @@ (when a0-5 (get-trans a0-5 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -499,7 +501,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this root transv quad)) + (vector-copy! s5-1 (-> this root transv)) (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) @@ -540,6 +542,7 @@ ;; definition for method 87 of type citizen-chick (defmethod knocked-anim-handler ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (case (-> this incoming knocked-type) @@ -591,11 +594,12 @@ ;; definition for method 85 of type citizen-chick (defmethod knocked-anim ((this citizen-chick) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) - (v1-3 (enemy-method-131 this 1 a2-0)) + (v1-3 (rnd-int-excluding-masked this 1 a2-0)) (a1-7 (-> this draw @@ -622,7 +626,7 @@ (((knocked-type blue-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) - (v1-12 (enemy-method-131 this 3 a2-2)) + (v1-12 (rnd-int-excluding-masked this 3 a2-2)) (a1-14 (-> this draw @@ -669,6 +673,7 @@ ;; definition for method 86 of type citizen-chick (defmethod knocked-land-anim ((this citizen-chick) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -775,6 +780,7 @@ ;; definition for method 120 of type citizen-chick ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this citizen-chick)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -834,12 +840,13 @@ ;; definition for method 121 of type citizen-chick ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this citizen-chick)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-chick" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *citizen-chick-nav-enemy-info*) + (setup-enemy! this *citizen-chick-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -847,7 +854,7 @@ (set! (-> this draw lod-set lod 0 dist) 204800.0) (set! (-> this draw lod-set lod 1 dist) 491520.0) (set! (-> this info) *citizen-chick-global-info*) - (try-update-focus (-> this focus) *target* this) + (focus-on! (-> this focus) *target* this) (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) (set! (-> this anim-shuffle) 26) (let ((v1-18 (rnd-int this 3))) @@ -1004,7 +1011,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-enemy_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-enemy_REF.gc index 0be089f7c9d..933d5dfdcd8 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-enemy_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-enemy_REF.gc @@ -29,6 +29,7 @@ ;; definition for method 59 of type citizen-enemy (defmethod enemy-common-post ((this citizen-enemy)) + "Common implementation of post. Runs ja-post." (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-0 options) (overlaps-others-options)) (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) @@ -50,13 +51,14 @@ ) ;; definition for method 84 of type citizen-enemy -(defmethod send-attack-on-jump-or-knocked ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'knocked) (= v1-3 'jump)) ) ) - ((method-of-type citizen send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type citizen enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -91,7 +93,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -106,6 +108,7 @@ ;; definition for method 82 of type citizen-enemy (defmethod event-handler ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('event-death) #f @@ -153,7 +156,7 @@ (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> a1-0 velocity) (-> this root transv)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) (set! (-> a1-0 decay-rate) 0.0) @@ -171,7 +174,7 @@ ;; WARN: Return type mismatch int vs object. (defmethod find-new-focus ((this citizen-enemy)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) 122880.0) (let ((s4-0 (the-as process-drawable #f))) (let ((f30-0 122880.0)) @@ -217,7 +220,7 @@ ) ) (when s4-0 - (try-update-focus (-> this focus) (the-as process-focusable s4-0) this) + (focus-on! (-> this focus) (the-as process-focusable s4-0) this) (go-hostile this) ) ) @@ -301,11 +304,13 @@ ;; definition for method 81 of type citizen-enemy (defmethod go-die ((this citizen-enemy)) + "Go to the die state." ((method-of-type nav-enemy go-die) this) ) ;; definition for method 78 of type citizen-enemy (defmethod go-hostile ((this citizen-enemy)) + "Go to the hostile state, actively trying to attack the target." (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) (go (method-of-object this hostile)) ) @@ -315,7 +320,3 @@ (defmethod go-stare ((this citizen-enemy)) (go (method-of-object this active)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-fat_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-fat_REF.gc index 58bec21f125..5b022d50ede 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-fat_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-fat_REF.gc @@ -171,34 +171,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 20480.0 - :knocked-soft-vy-hi 40960.0 - :knocked-medium-vxz-lo 40960.0 - :knocked-medium-vxz-hi 73728.0 - :knocked-medium-vy-lo 24576.0 - :knocked-medium-vy-hi 53248.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 102400.0 - :knocked-hard-vy-lo 40960.0 - :knocked-hard-vy-hi 81920.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 8192.0 - :knocked-yellow-vxz-hi 16384.0 - :knocked-yellow-vy-lo 12288.0 - :knocked-yellow-vy-hi 24576.0 - :knocked-red-vxz-lo 12288.0 - :knocked-red-vxz-hi 24576.0 - :knocked-red-vy-lo 20480.0 - :knocked-red-vy-hi 36864.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 32768.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 5) + :knocked-soft-vy-hi (meters 10) + :knocked-medium-vxz-lo (meters 10) + :knocked-medium-vxz-hi (meters 18) + :knocked-medium-vy-lo (meters 6) + :knocked-medium-vy-hi (meters 13) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 25) + :knocked-hard-vy-lo (meters 10) + :knocked-hard-vy-hi (meters 20) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 2) + :knocked-yellow-vxz-hi (meters 4) + :knocked-yellow-vy-lo (meters 3) + :knocked-yellow-vy-hi (meters 6) + :knocked-red-vxz-lo (meters 3) + :knocked-red-vxz-hi (meters 6) + :knocked-red-vy-lo (meters 5) + :knocked-red-vy-hi (meters 9) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 8) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9956 :y 0.0755 :z -0.0549 :w 34275.477) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -431,6 +431,7 @@ ;; definition for method 67 of type citizen-fat (defmethod coin-flip? ((this citizen-fat)) + "Return #t half the time, #f the other." #f ) @@ -443,6 +444,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this citizen-fat)) + "Get the yaw angle for the current knock." (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) @@ -450,7 +452,7 @@ (when a0-5 (get-trans a0-5 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -463,7 +465,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this root transv quad)) + (vector-copy! s5-1 (-> this root transv)) (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) @@ -504,6 +506,7 @@ ;; definition for method 87 of type citizen-fat (defmethod knocked-anim-handler ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (case (-> this incoming knocked-type) @@ -555,11 +558,12 @@ ;; definition for method 85 of type citizen-fat (defmethod knocked-anim ((this citizen-fat) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) - (v1-3 (enemy-method-131 this 1 a2-0)) + (v1-3 (rnd-int-excluding-masked this 1 a2-0)) (a1-7 (-> this draw @@ -586,7 +590,7 @@ (((knocked-type blue-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) - (v1-12 (enemy-method-131 this 3 a2-2)) + (v1-12 (rnd-int-excluding-masked this 3 a2-2)) (a1-14 (-> this draw @@ -633,6 +637,7 @@ ;; definition for method 86 of type citizen-fat (defmethod knocked-land-anim ((this citizen-fat) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -776,6 +781,7 @@ ;; definition for method 120 of type citizen-fat ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this citizen-fat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -835,12 +841,13 @@ ;; definition for method 121 of type citizen-fat ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this citizen-fat)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-fat" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *citizen-fat-nav-enemy-info*) + (setup-enemy! this *citizen-fat-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -848,7 +855,7 @@ (set! (-> this draw lod-set lod 0 dist) 204800.0) (set! (-> this draw lod-set lod 1 dist) 491520.0) (set! (-> this info) *citizen-fat-global-info*) - (try-update-focus (-> this focus) *target* this) + (focus-on! (-> this focus) *target* this) (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) (set! (-> this anim-shuffle) 12) (let ((v1-18 (rnd-int this 3))) @@ -1053,7 +1060,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-h_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-h_REF.gc index fb7f3d31b00..4e0ea2e5f12 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-h_REF.gc @@ -52,7 +52,6 @@ in-ditch ) (:methods - (init-enemy-defaults! (_type_ nav-enemy-info) none :replace) (set-squad (_type_) none) (citizen-method-194 (_type_) none) (citizen-method-195 (_type_) none) @@ -182,7 +181,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc index 98ad4f34a5b..932a745fdb9 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen-norm_REF.gc @@ -179,34 +179,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 49152.0 - :knocked-soft-vy-lo 36864.0 - :knocked-soft-vy-hi 73728.0 - :knocked-medium-vxz-lo 81920.0 - :knocked-medium-vxz-hi 143360.0 - :knocked-medium-vy-lo 49152.0 - :knocked-medium-vy-hi 102400.0 - :knocked-hard-vxz-lo 102400.0 - :knocked-hard-vxz-hi 122880.0 - :knocked-hard-vy-lo 81920.0 - :knocked-hard-vy-hi 102400.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 16384.0 - :knocked-yellow-vxz-hi 32768.0 - :knocked-yellow-vy-lo 24576.0 - :knocked-yellow-vy-hi 49152.0 - :knocked-red-vxz-lo 40960.0 - :knocked-red-vxz-hi 61440.0 - :knocked-red-vy-lo 36864.0 - :knocked-red-vy-hi 73728.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 12) + :knocked-soft-vy-lo (meters 9) + :knocked-soft-vy-hi (meters 18) + :knocked-medium-vxz-lo (meters 20) + :knocked-medium-vxz-hi (meters 35) + :knocked-medium-vy-lo (meters 12) + :knocked-medium-vy-hi (meters 25) + :knocked-hard-vxz-lo (meters 25) + :knocked-hard-vxz-hi (meters 30) + :knocked-hard-vy-lo (meters 20) + :knocked-hard-vy-hi (meters 25) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 4) + :knocked-yellow-vxz-hi (meters 8) + :knocked-yellow-vy-lo (meters 6) + :knocked-yellow-vy-hi (meters 12) + :knocked-red-vxz-lo (meters 10) + :knocked-red-vxz-hi (meters 15) + :knocked-red-vy-lo (meters 9) + :knocked-red-vy-hi (meters 18) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 8) + :knocked-blue-vy-hi (meters 12) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 35283.07) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -441,6 +441,7 @@ ;; definition for method 67 of type citizen-norm (defmethod coin-flip? ((this citizen-norm)) + "Return #t half the time, #f the other." #f ) @@ -448,6 +449,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this citizen-norm)) + "Get the yaw angle for the current knock." (the-as degrees (cond @@ -462,7 +464,7 @@ (when a0-6 (get-trans a0-6 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -475,7 +477,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this root transv quad)) + (vector-copy! s5-1 (-> this root transv)) (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) @@ -519,6 +521,7 @@ ;; definition for method 87 of type citizen-norm (defmethod knocked-anim-handler ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (case (-> this incoming knocked-type) @@ -570,6 +573,7 @@ ;; definition for method 85 of type citizen-norm (defmethod knocked-anim ((this citizen-norm) (arg0 enemy-knocked-info)) + "start the knocked animation." (local-vars (v1-36 knocked-type)) (cond ((logtest? (-> this flags) (citizen-flag knocked-out-car)) @@ -601,7 +605,7 @@ ((begin (set! v1-36 (-> this incoming knocked-type)) (= v1-36 (knocked-type yellow-shot))) (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-2 (ash 1 (-> this info prev-yellow-hit))) - (v1-39 (enemy-method-131 this 1 a2-2)) + (v1-39 (rnd-int-excluding-masked this 1 a2-2)) (a1-11 (-> this draw @@ -628,7 +632,7 @@ ((= v1-36 (knocked-type blue-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-4 (ash 1 (-> this info prev-blue-hit))) - (v1-48 (enemy-method-131 this 3 a2-4)) + (v1-48 (rnd-int-excluding-masked this 3 a2-4)) (a1-18 (-> this draw @@ -680,6 +684,7 @@ ;; definition for method 86 of type citizen-norm (defmethod knocked-land-anim ((this citizen-norm) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.1)) (set! (-> arg0 anim-speed) 1.0) (let ((a0-2 (-> this skel root-channel 0))) @@ -828,7 +833,7 @@ (case (-> arg0 behavior) ((11) (speech-control-method-12 *speech-control* this (speech-type civ-m-player-stealing-vehicle)) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (quaternion-copy! (-> this root quat) (-> arg0 rotation)) (set! (-> this vehicle) (-> arg0 handle)) (ja-channel-set! 1) @@ -922,6 +927,7 @@ ;; definition for method 120 of type citizen-norm ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this citizen-norm)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -987,19 +993,20 @@ ;; definition for method 121 of type citizen-norm ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this citizen-norm)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *citizen-norm-nav-enemy-info*) + (setup-enemy! this *citizen-norm-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 (set! (-> this draw lod-set lod 0 dist) 204800.0) (set! (-> this draw lod-set lod 1 dist) 491520.0) - (try-update-focus (-> this focus) *target* this) + (focus-on! (-> this focus) *target* this) (-> this neck) (set! (-> this info) *citizen-norm-global-info*) (set! (-> this anim-shuffle) 11) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc index 80ef2e8fd9e..3ec1e47b838 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/citizen_REF.gc @@ -106,13 +106,14 @@ ;; definition for method 64 of type citizen ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod get-awareness-of-proc ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) + "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (when arg1 (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))) (when (< f0-0 (-> arg1 rating)) (set! (-> arg1 rating) f0-0) (set! (-> arg1 proc) arg0) - (set! (-> arg1 aware) (enemy-aware ea3)) + (set! (-> arg1 aware) (enemy-aware hostile)) ) ) ) @@ -121,7 +122,8 @@ ;; definition for method 68 of type citizen ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod get-enemy-aware ((this citizen) (arg0 enemy-aware)) +(defmethod modify-awareness ((this citizen) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." (the-as enemy-aware 3) ) @@ -133,21 +135,25 @@ ;; definition for method 78 of type citizen ;; WARN: Return type mismatch none vs object. (defmethod go-hostile ((this citizen)) + "Go to the hostile state, actively trying to attack the target." (go-inactive this) ) ;; definition for method 79 of type citizen (defmethod go-flee ((this citizen)) + "Go to the flee state, running away." (go (method-of-object this flee)) ) ;; definition for method 80 of type citizen -(defmethod go-best-state ((this citizen)) +(defmethod go-state-for-focused ((this citizen)) + "Go to the appropriate state for the current awareness of the focused process." (go (method-of-object this active)) ) ;; definition for method 65 of type citizen -(defmethod penetrate->next-state ((this citizen) (arg0 process) (arg1 event-message-block) (arg2 float)) +(defmethod msg-for-incoming-attack ((this citizen) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." (if (logtest? (penetrate jak-dark-nuke) (-> this incoming penetrate-using)) 'traffic-off-force (call-parent-method this arg0 arg1 arg2) @@ -157,6 +163,7 @@ ;; definition for method 81 of type citizen ;; WARN: Return type mismatch none vs object. (defmethod go-die ((this citizen)) + "Go to the die state." (send-event (ppointer->process (-> this parent)) 'child-killed) (go-inactive this) ) @@ -198,7 +205,10 @@ ) ;; definition for method 63 of type citizen -(defmethod enemy-method-63 ((this citizen) (arg0 float)) +(defmethod apply-incoming-hitpoint-mods ((this citizen) (arg0 float)) + "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (let ((v0-1 (call-parent-method this arg0))) (when (and (logtest? (-> this incoming penetrate-using) (penetrate board)) (not (logtest? (-> this incoming penetrate-using) (penetrate spin))) @@ -322,6 +332,7 @@ ;; INFO: Used lq/sq ;; WARN: disable def twice: 164. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-3 object)) (case arg2 (('hit 'hit-flinch 'hit-knocked) @@ -370,7 +381,7 @@ ) (logclear! (-> a0-20 flags) (nav-state-flag directional-mode)) (logior! (-> a0-20 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-20 target-pos quad) (-> (the-as vector v1-21) quad)) + (vector-copy! (-> a0-20 target-pos) (the-as vector v1-21)) ) 0 (if (and (and (-> this next-state) (= (-> this next-state name) 'wait)) (-> this wait-return-state)) @@ -429,9 +440,9 @@ (logclear! (-> this flags) (citizen-flag in-mission)) ) (set! (-> this root penetrated-by) (get-penetrated-by this)) - (set! (-> this root trans quad) (-> s5-1 position quad)) + (vector-copy! (-> this root trans) (-> s5-1 position)) (quaternion-copy! (-> this root quat) (-> s5-1 rotation)) - (set! (-> this root transv quad) (-> s5-1 velocity quad)) + (vector-copy! (-> this root transv) (-> s5-1 velocity)) (let ((a0-46 (-> s5-1 nav-mesh))) (when a0-46 (change-to a0-46 this) @@ -450,14 +461,14 @@ ) (logclear! (-> a0-50 flags) (nav-state-flag directional-mode)) (logior! (-> a0-50 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-50 target-pos quad) (-> v1-84 quad)) + (vector-copy! (-> a0-50 target-pos) v1-84) ) 0 ) ) (citizen-method-195 this) (citizen-method-194 this) - (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) (set! (-> this gnd-height) (-> this root gspot-pos y)) (go-from-behavior this s5-1) ) @@ -483,7 +494,7 @@ (set! (-> this root transv z) 0.0) (when (-> this enemy-info move-to-ground) (if (focus-test? this under-water) - (accelerate-fall! this (-> this root transv)) + (adjust-transv-under-water! this (-> this root transv)) (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) ) @@ -508,6 +519,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this citizen)) + "Common implementation of post. Runs ja-post." (with-pp (when (and (not (logtest? (-> this flags) (citizen-flag in-mission))) *cty-faction-manager* @@ -548,17 +560,17 @@ ) (cond (a0-11 - (set! (-> s5-3 quad) (-> (get-trans a0-11 2) quad)) + (vector-copy! s5-3 (get-trans a0-11 2)) ) (*target* - (set! (-> s5-3 quad) (-> (get-trans *target* 2) quad)) + (vector-copy! s5-3 (get-trans *target* 2)) ) (else - (set! (-> s5-3 quad) (-> (camera-pos) quad)) + (vector-copy! s5-3 (camera-pos)) ) ) (if (and (-> this next-state) (= (-> this next-state name) 'flee)) - (set! (-> s5-3 quad) (-> this danger-pos quad)) + (vector-copy! s5-3 (-> this danger-pos)) ) (when (< (vector-vector-distance s5-3 (-> this root trans)) 122880.0) (set-look-at-mode! this 1) @@ -633,6 +645,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod move-above-ground! ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) + "Move the enemy. May keep the enemy snapped to the ground depending on flags." (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -644,14 +657,14 @@ (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) - (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) - (set! (-> arg1 old-gspot-normal quad) (-> gp-0 gspot-normal quad)) + (vector-copy! (-> arg1 old-gspot-pos) (-> gp-0 gspot-pos)) + (vector-copy! (-> arg1 old-gspot-normal) (-> gp-0 gspot-normal)) (set! (-> gp-0 trans-old-old-old quad) (-> gp-0 trans-old-old quad)) (set! (-> gp-0 trans-old-old quad) (-> gp-0 trans-old quad)) (set! (-> gp-0 trans-old quad) (-> gp-0 trans quad)) (set! (-> gp-0 prev-status) (-> gp-0 status)) (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) - (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) + (vector-copy! (-> arg1 new-pos) (-> gp-0 trans)) (when (not (logtest? (logxor (-> this traffic-id) (the-as int (-> this probe-counter))) 7)) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (logclear! (-> gp-0 status) (collide-status on-ground)) @@ -674,9 +687,9 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a2-2 quad) vf6) (when (t9-1 a0-10 a1-2 a2-2 (-> arg1 gnd-collide-with) 16384.0 81920.0 1024.0) - (set! (-> gp-0 gspot-pos quad) (-> gp-0 trans quad)) + (vector-copy! (-> gp-0 gspot-pos) (-> gp-0 trans)) (set! (-> gp-0 gspot-pos y) (-> s2-0 best-other-tri intersect y)) - (set! (-> gp-0 gspot-normal quad) (-> s2-0 best-other-tri normal quad)) + (vector-copy! (-> gp-0 gspot-normal) (-> s2-0 best-other-tri normal)) (logior! (-> gp-0 status) (collide-status on-ground)) (set! (-> gp-0 ground-pat) (-> s2-0 best-other-tri pat)) ) @@ -705,7 +718,7 @@ (set! (-> gp-0 ground-impact-vel) (- (vector-dot arg0 (-> gp-0 dynam gravity-normal)))) (set! (-> arg0 y) 0.0) ) - (set! (-> gp-0 trans quad) (-> arg1 new-pos quad)) + (vector-copy! (-> gp-0 trans) (-> arg1 new-pos)) (when (-> arg1 do-move?) (cond ((-> arg1 on-ground?) @@ -713,11 +726,11 @@ (a0-18 (-> gp-0 gspot-normal)) (v1-42 (-> arg1 pat)) ) - (set! (-> gp-0 ground-touch-point quad) (-> a1-3 quad)) - (set! (-> gp-0 poly-normal quad) (-> a0-18 quad)) - (set! (-> gp-0 surface-normal quad) (-> a0-18 quad)) - (set! (-> gp-0 local-normal quad) (-> a0-18 quad)) - (set! (-> gp-0 ground-poly-normal quad) (-> a0-18 quad)) + (vector-copy! (-> gp-0 ground-touch-point) a1-3) + (vector-copy! (-> gp-0 poly-normal) a0-18) + (vector-copy! (-> gp-0 surface-normal) a0-18) + (vector-copy! (-> gp-0 local-normal) a0-18) + (vector-copy! (-> gp-0 ground-poly-normal) a0-18) (set! (-> gp-0 poly-pat) v1-42) (set! (-> gp-0 cur-pat) v1-42) (set! (-> gp-0 ground-pat) v1-42) @@ -744,9 +757,9 @@ ) (when (not (logtest? (-> gp-0 root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-52 (-> gp-0 dynam gravity-normal))) - (set! (-> gp-0 local-normal quad) (-> v1-52 quad)) - (set! (-> gp-0 surface-normal quad) (-> v1-52 quad)) - (set! (-> gp-0 poly-normal quad) (-> v1-52 quad)) + (vector-copy! (-> gp-0 local-normal) v1-52) + (vector-copy! (-> gp-0 surface-normal) v1-52) + (vector-copy! (-> gp-0 poly-normal) v1-52) ) (set! (-> gp-0 coverage) 0.0) (set! (-> gp-0 touch-angle) 0.0) @@ -769,7 +782,7 @@ (a3-0 (-> arg0 state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (vector-copy! a2-0 (-> a3-0 heading)) (t9-0 this v1-1 a2-0) ) 0 @@ -807,7 +820,7 @@ (cond ((logtest? (enemy-flag ef39) (-> this enemy-flags)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) - (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (vector-copy! (-> this root gspot-pos) (-> this root trans)) (set! (-> this gnd-height) (-> this root gspot-pos y)) ) (else @@ -825,20 +838,21 @@ ;; definition for method 122 of type citizen ;; WARN: Return type mismatch int vs object. -(defmethod go-idle2 ((this citizen)) +(defmethod go-fallback-init ((this citizen)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this active)) 0 ) ;; definition for method 119 of type citizen -;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-defaults! ((this citizen) (arg0 nav-enemy-info)) +;; WARN: Return type mismatch int vs object. +(defmethod setup-enemy! ((this citizen) (arg0 nav-enemy-info)) (set-squad this) (if (not (-> this squad)) (format 0 "citizen::initialize-enemy: error: no squad-control~%") ) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-2 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-2 (method-of-type nav-enemy setup-enemy!))) (t9-2 this arg0) ) (set! (-> this speed-scale) (rnd-float-range this 0.9 1.1)) @@ -851,12 +865,12 @@ ) (set! (-> this travel-anim-scale-speed) 1.0) 0 - (none) ) ;; definition for method 11 of type citizen ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this citizen) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -867,7 +881,7 @@ (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask enemy)) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 rotation)) (if (not (logtest? (-> arg0 flags) (traffic-spawn-flags tsf0))) (traffic-entity-hack (-> arg0 object-type)) @@ -1006,11 +1020,11 @@ ) (let ((s1-0 (-> this nav state current-poly))) (let ((a1-2 (-> this nav state))) - (set! (-> s5-0 quad) (-> a1-2 heading quad)) + (vector-copy! s5-0 (-> a1-2 heading)) ) (set! (-> s5-0 y) 0.0) (vector-xz-normalize! s5-0 20480.0) - (set! (-> s4-0 quad) (-> s5-0 quad)) + (vector-copy! s4-0 s5-0) (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s1-0 s4-0 s2-0) ) (cond @@ -1024,7 +1038,7 @@ (vector-rotate90-around-y! s1-2 s1-2) (if (< 0.0 (vector-dot s1-2 s0-1)) (vector-negate! arg0 s1-2) - (set! (-> arg0 quad) (-> s1-2 quad)) + (vector-copy! arg0 s1-2) ) ) (vector-xz-normalize! arg0 8192.0) @@ -1045,9 +1059,9 @@ (let ((s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (let ((a1-1 (-> this nav state))) - (set! (-> s2-0 quad) (-> a1-1 heading quad)) + (vector-copy! s2-0 (-> a1-1 heading)) ) (set! (-> s2-0 y) 0.0) (vector-xz-normalize! s2-0 20480.0) @@ -1066,7 +1080,7 @@ (vector-rotate90-around-y! s2-2 s2-2) (if (< 0.0 (vector-dot s2-2 s1-1)) (vector-negate! arg1 s2-2) - (set! (-> arg1 quad) (-> s2-2 quad)) + (vector-copy! arg1 s2-2) ) ) (vector-xz-normalize! arg1 (* 5.0 (- (-> arg0 w) (vector-vector-xz-distance arg0 s5-0)))) @@ -1084,7 +1098,7 @@ (vector-xz-normalize! s5-1 20480.0) (if (< 0.0 f30-1) (vector-negate! arg1 s5-1) - (set! (-> arg1 quad) (-> s5-1 quad)) + (vector-copy! arg1 s5-1) ) ) ) @@ -1111,7 +1125,7 @@ (set! (-> arg0 quad) (the-as uint128 0)) (when (-> this cp-valid?) (set! (-> this cp-valid?) #f) - (set! (-> s2-0 quad) (-> this cp-vec quad)) + (vector-copy! s2-0 (-> this cp-vec)) (set! (-> s2-0 y) 0.0) (vector-xz-normalize! s2-0 1.0) (vector-rotate90-around-y! s2-0 s2-0) @@ -1144,21 +1158,21 @@ (cond ((< 0.0 (vector-dot s2-0 s3-1)) (if (< 4096.0 f0-11) - (set! (-> s1-0 quad) (-> s0-0 quad)) - (set! (-> s1-0 quad) (-> sv-320 quad)) + (vector-copy! s1-0 s0-0) + (vector-copy! s1-0 sv-320) ) ) ((< 4096.0 f1-10) - (set! (-> s1-0 quad) (-> sv-320 quad)) + (vector-copy! s1-0 sv-320) ) (else - (set! (-> s1-0 quad) (-> s0-0 quad)) + (vector-copy! s1-0 s0-0) ) ) ) - (set! (-> arg0 quad) (-> s1-0 quad)) + (vector-copy! arg0 s1-0) (let ((a1-11 (new 'stack-no-clear 'vector))) - (set! (-> a1-11 quad) (-> this root trans quad)) + (vector-copy! a1-11 (-> this root trans)) (set! (-> a1-11 y) 0.0) (let ((f0-15 (- f28-0 (vector-vector-xz-distance s4-0 a1-11)))) (if (< f0-15 0.0) @@ -1220,12 +1234,12 @@ (a0-1 (-> arg1 branch src-node)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> a0-1 position quad)) + (vector-copy! s4-0 (-> a0-1 position)) (set! (-> s4-0 w) 1.0) (let ((a0-4 (-> arg1 branch dest-node)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> a0-4 position quad)) + (vector-copy! s3-0 (-> a0-4 position)) (set! (-> s3-0 w) 1.0) (set! (-> s4-0 y) 0.0) (set! (-> s3-0 y) 0.0) @@ -1264,7 +1278,7 @@ (let ((s1-3 (vector-! (new 'stack-no-clear 'vector) s3-0 (the-as vector (-> s2-0 cp-sphere)))) (s0-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s0-2 quad) (-> s2-0 cp-vec quad)) + (vector-copy! s0-2 (-> s2-0 cp-vec)) (set! (-> s0-2 y) 0.0) (vector-normalize! s0-2 1.0) (set! (-> s1-3 y) 0.0) @@ -1316,8 +1330,8 @@ (gp-0 (new 'stack-no-clear 'iter-seg)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this cp-vec quad)) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this cp-vec)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) 81920.0) (set! (-> gp-0 seg) #f) (set! (-> gp-0 score) (the-as float #xff800000)) @@ -1363,10 +1377,10 @@ (defmethod citizen-method-205 ((this citizen)) (when (-> this cp-valid?) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this cp-force quad)) + (vector-copy! s4-0 (-> this cp-force)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((a1-0 (-> this nav state))) - (set! (-> s5-0 quad) (-> a1-0 heading quad)) + (vector-copy! s5-0 (-> a1-0 heading)) ) (set! (-> s5-0 y) 0.0) (vector-xz-normalize! s5-0 1.0) @@ -1394,12 +1408,12 @@ (let ((a1-1 (-> arg1 branch src-node)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> a1-1 position quad)) + (vector-copy! v1-2 (-> a1-1 position)) (set! (-> v1-2 w) 1.0) (let ((a2-0 (-> arg1 branch dest-node)) (a0-4 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-4 quad) (-> a2-0 position quad)) + (vector-copy! a0-4 (-> a2-0 position)) (set! (-> a0-4 w) 1.0) (set! (-> v1-2 y) 0.0) (set! (-> a0-4 y) 0.0) @@ -1436,12 +1450,12 @@ (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> this cp-vec quad)) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> this cp-vec)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) arg1) (set! (-> gp-0 seg) #f) (set! (-> gp-0 score) (the-as float #xff800000)) - (set! (-> gp-0 desired-dir quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 desired-dir) arg0) (vector-normalize! (-> gp-0 desired-dir) 1.0) (set! (-> gp-0 self) this) (nav-segment-callback @@ -1540,13 +1554,13 @@ (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) ) 0 - (set! (-> self wait-time) (set-reaction-time! self (seconds 1) (seconds 5))) + (set! (-> self wait-time) (rnd-time-frame self (seconds 1) (seconds 5))) (if (= (-> self water-anim) -1) (go-inactive self) ) (when (focus-test? self touch-water) (let ((a1-3 (new 'stack-no-clear 'vector))) - (set! (-> a1-3 quad) (-> self root trans quad)) + (vector-copy! a1-3 (-> self root trans)) (set! (-> a1-3 y) (+ 40.96 (-> self water-surface-height))) (splash-spawn 0.2 a1-3 1) ) @@ -1564,7 +1578,7 @@ (ja-no-eval :group! (-> self draw art-group data (-> self water-anim)) :num! (seek! max 0.5) :frame-num 0.0) (until (ja-done? 0) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (set! (-> gp-0 y) (+ 40.96 (-> self water-surface-height))) (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) (zero? (-> self draw cur-lod))) (let ((f0-6 (y-angle (-> self root)))) @@ -1683,7 +1697,7 @@ ) (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-18 target-pos quad) (-> v1-17 quad)) + (vector-copy! (-> a0-18 target-pos) v1-17) ) 0 ) @@ -1695,14 +1709,14 @@ (let ((a0-21 (-> self nav state)) (v1-26 *null-vector*) ) - (set! (-> a0-21 velocity quad) (-> v1-26 quad)) + (vector-copy! (-> a0-21 velocity) v1-26) ) 0 (let ((v1-29 (-> self nav))) (set! (-> v1-29 target-speed) (* (-> self speed-scale) (-> self speed-walk))) ) 0 - (set! (-> self wait-time) (set-reaction-time! self (seconds 4) (seconds 30))) + (set! (-> self wait-time) (rnd-time-frame self (seconds 4) (seconds 30))) (if (zero? (-> self controller branch)) (citizen-method-208 self (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) ) @@ -1744,7 +1758,7 @@ 0 (when (= (-> self nav state speed) 0.0) (set! (-> self wait-return-state) (the-as (state citizen) (-> self state))) - (set! (-> self wait-time) (set-reaction-time! self (seconds 1) (seconds 5))) + (set! (-> self wait-time) (rnd-time-frame self (seconds 1) (seconds 5))) (go-virtual wait) ) ) @@ -1794,7 +1808,7 @@ (let ((a0-5 (-> self nav state)) (a1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-2 quad) (-> a0-5 heading quad)) + (vector-copy! a1-2 (-> a0-5 heading)) (vector-float*! a1-2 a1-2 -1.0) (citizen-method-208 self a1-2) ) @@ -1806,7 +1820,7 @@ ) (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-10 target-pos quad) (-> v1-21 quad)) + (vector-copy! (-> a0-10 target-pos) v1-21) ) 0 ) @@ -1819,7 +1833,7 @@ (a2-2 (-> self nav state)) (a1-12 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-12 quad) (-> a2-2 target-pos quad)) + (vector-copy! a1-12 (-> a2-2 target-pos)) (let ((f0-2 (t9-4 a0-16 a1-12)) (f1-3 4096.0) ) @@ -1926,6 +1940,7 @@ ;; definition for method 66 of type citizen (defmethod get-penetrated-by ((this citizen)) + "Figure out the penetrated-by mask for this process." (logior (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (the int (-> this hit-points))) (penetrate vehicle) ) @@ -1940,6 +1955,7 @@ ) ;; definition for method 152 of type citizen -(defmethod enemy-method-152 ((this citizen)) +(defmethod gem-chance ((this citizen)) + "The chance of this enemy having a gem." 0.5 ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc index 6591056465e..90ffd07d171 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/civilian_REF.gc @@ -179,7 +179,8 @@ ) ;; definition for method 89 of type civilian -(defmethod within-gspot-range? ((this civilian)) +(defmethod invalid-height? ((this civilian)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) @@ -191,7 +192,7 @@ (let ((a1-1 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-1 sphere quad) (-> this root trans quad)) (set! (-> a1-1 sphere r) 40960.0) - (set! (-> a1-1 velocity quad) (-> this root transv quad)) + (vector-copy! (-> a1-1 velocity) (-> this root transv)) (set! (-> a1-1 notify-radius) 122880.0) (set! (-> a1-1 danger-level) 1.0) (set! (-> a1-1 decay-rate) 0.0) @@ -206,19 +207,24 @@ ) ;; definition for method 114 of type civilian -(defmethod send-attack-to-all-tshapes ((this civilian) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this civilian) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." 0 ) ;; definition for method 78 of type civilian ;; WARN: Return type mismatch none vs object. (defmethod go-hostile ((this civilian)) + "Go to the hostile state, actively trying to attack the target." (cleanup-for-death this) ) ;; definition for method 81 of type civilian ;; WARN: Return type mismatch none vs object. (defmethod go-die ((this civilian)) + "Go to the die state." (cleanup-for-death this) ) @@ -274,7 +280,7 @@ ;; INFO: Used lq/sq (defmethod civilian-method-230 ((this civilian) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> this root trans quad)) + (vector-copy! v1-0 (-> this root trans)) (set! (-> v1-0 w) 81920.0) (let ((s5-0 (find-segment this v1-0 arg0))) (if s5-0 @@ -287,13 +293,15 @@ ;; definition for method 20 of type civilian ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this civilian)) +(defmethod get-search-info-flag ((this civilian)) + "Get search-info-flag for this process." (the-as search-info-flag 0) ) ;; definition for method 82 of type civilian ;; INFO: Used lq/sq (defmethod event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('combo) #f @@ -334,7 +342,7 @@ (let ((v1-22 (the-as traffic-danger-info (-> arg3 param 0)))) (set! (-> this cp-valid?) #t) (set! (-> this cp-sphere quad) (-> v1-22 sphere quad)) - (set! (-> this cp-vec quad) (-> v1-22 velocity quad)) + (vector-copy! (-> this cp-vec) (-> v1-22 velocity)) (let ((v1-23 (-> v1-22 danger-type))) (cond ((zero? v1-23) @@ -414,7 +422,7 @@ (a2-1 s3-0) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-1 position quad)) + (vector-copy! a1-1 (-> a2-1 position)) (set! (-> a1-1 w) 1.0) (let ((s1-0 (t9-0 a0-1 a1-1)) (s2-0 (-> s3-0 branch-count)) @@ -480,15 +488,15 @@ (when s5-0 (vehicle-controller-method-11 gp-0) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> gp-0 turn-exit-point quad)) + (vector-copy! s4-1 (-> gp-0 turn-exit-point)) (vehicle-controller-method-10 gp-0 s5-0) - (set! (-> gp-0 path-prev-point quad) (-> s4-1 quad)) + (vector-copy! (-> gp-0 path-prev-point) s4-1) ) (set! (-> gp-0 branch) s5-0) (let ((a1-3 (-> s5-0 dest-node)) (v1-23 (-> gp-0 turn-exit-point)) ) - (set! (-> v1-23 quad) (-> a1-3 position quad)) + (vector-copy! v1-23 (-> a1-3 position)) (set! (-> v1-23 w) 1.0) ) ) @@ -497,7 +505,7 @@ ) ) (when (< (-> self cp-next-time) (current-time)) - (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 2) (seconds 4)))) + (set! (-> self cp-next-time) (+ (current-time) (rnd-time-frame self (seconds 2) (seconds 4)))) (citizen-method-203 self (-> self cp-force)) ) (add-offset-to-target! (-> self nav state) (-> self cp-force)) @@ -517,10 +525,10 @@ ) (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-18 target-pos quad) (-> v1-42 quad)) + (vector-copy! (-> a0-18 target-pos) v1-42) ) 0 - (set! (-> (new 'stack-no-clear 'vector) quad) (-> self nav state target-pos quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> self nav state target-pos)) (nav-enemy-method-187 self) (none) ) @@ -636,15 +644,15 @@ (cond ((< 0.0 (vector-dot s1-1 gp-1)) (if (< 8192.0 f0-7) - (set! (-> s4-0 quad) (-> s3-0 quad)) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s3-0) + (vector-copy! s4-0 s2-0) ) ) ((< 8192.0 f1-7) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s2-0) ) (else - (set! (-> s4-0 quad) (-> s3-0 quad)) + (vector-copy! s4-0 s3-0) ) ) ) @@ -663,7 +671,7 @@ (if (< 0.8 f0-15) (set! f0-15 0.8) ) - (set! (-> gp-1 quad) (-> s4-0 quad)) + (vector-copy! gp-1 s4-0) (vector-xz-normalize! gp-1 (* 16384.0 f0-15)) ) ) @@ -679,7 +687,7 @@ ) (logclear! (-> a0-27 flags) (nav-state-flag directional-mode)) (logior! (-> a0-27 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-27 target-pos quad) (-> v1-41 quad)) + (vector-copy! (-> a0-27 target-pos) v1-41) ) ) 0 @@ -725,7 +733,7 @@ ) (logclear! (-> a0-6 flags) (nav-state-flag directional-mode)) (logior! (-> a0-6 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-6 target-pos quad) (-> v1-23 quad)) + (vector-copy! (-> a0-6 target-pos) v1-23) ) 0 (nav-enemy-method-187 self) @@ -755,8 +763,8 @@ (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk))) ) 0 - (set! (-> self next-time) (+ (current-time) (set-reaction-time! self (seconds 1) (seconds 2)))) - (set! (-> self last-second-pos quad) (-> self root trans quad)) + (set! (-> self next-time) (+ (current-time) (rnd-time-frame self (seconds 1) (seconds 2)))) + (vector-copy! (-> self last-second-pos) (-> self root trans)) (set! (-> self last-distance) (vector-vector-xz-distance (-> self dest-point) (-> self root trans))) (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.0 0.0 1.0 1.0) @@ -799,7 +807,7 @@ (s1-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self cp-vec quad)) + (vector-copy! gp-0 (-> self cp-vec)) (set! (-> gp-0 y) 0.0) (vector-xz-normalize! gp-0 1.0) (vector-rotate90-around-y! gp-0 gp-0) @@ -832,19 +840,19 @@ (cond ((< 0.0 (vector-dot gp-0 s5-1)) (if (< 4096.0 f0-9) - (set! (-> s4-0 quad) (-> s3-0 quad)) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s3-0) + (vector-copy! s4-0 s2-0) ) ) ((< 4096.0 f1-8) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s2-0) ) (else - (set! (-> s4-0 quad) (-> s3-0 quad)) + (vector-copy! s4-0 s3-0) ) ) ) - (set! (-> gp-0 quad) (-> s4-0 quad)) + (vector-copy! gp-0 s4-0) ) ) ) @@ -864,7 +872,7 @@ ) (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-21 target-pos quad) (-> v1-34 quad)) + (vector-copy! (-> a0-21 target-pos) v1-34) ) ) 0 @@ -878,7 +886,7 @@ (citizen-method-205 self) (when (< (-> self cp-next-time) (current-time)) (citizen-method-203 self (-> self cp-force)) - (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 4) (seconds 8)))) + (set! (-> self cp-next-time) (+ (current-time) (rnd-time-frame self (seconds 4) (seconds 8)))) ) (let ((gp-1 (new 'stack-no-clear 'vector))) (citizen-method-201 self gp-1) @@ -901,7 +909,7 @@ ) (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-pos quad) (-> v1-25 quad)) + (vector-copy! (-> a0-9 target-pos) v1-25) ) 0 (nav-enemy-method-187 self) @@ -931,7 +939,7 @@ (set! (-> v1-9 target-speed) (* (-> self speed-scale) (-> self speed-walk))) ) 0 - (set! (-> self cp-next-time) (+ (current-time) (set-reaction-time! self (seconds 4) (seconds 8)))) + (set! (-> self cp-next-time) (+ (current-time) (rnd-time-frame self (seconds 4) (seconds 8)))) (set! (-> self cp-force quad) (the-as uint128 0)) (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.0 1.0 0.0 1.0) @@ -1105,11 +1113,11 @@ 0 (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a1-4 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-4 heading quad)) + (vector-copy! gp-0 (-> a1-4 heading)) ) (vector-normalize! gp-0 614400.0) (vector+! (-> self dive-target-point) (-> self root trans) gp-0) - (set! (-> self dive-target-point quad) (-> gp-0 quad)) + (vector-copy! (-> self dive-target-point) gp-0) ) (if *citizen-debug* (set-vector! (-> self draw color-mult) 0.5 0.5 1.0 1.0) @@ -1158,7 +1166,7 @@ (v1-1 *null-vector*) ) (logior! (-> a0-0 flags) (nav-state-flag directional-mode)) - (set! (-> a0-0 travel quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 travel) v1-1) ) 0 (if (-> self dive-finished?) @@ -1256,7 +1264,7 @@ (v1-1 *null-vector*) ) (logior! (-> a0-0 flags) (nav-state-flag directional-mode)) - (set! (-> a0-0 travel quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 travel) v1-1) ) 0 (enemy-common-post self) @@ -1300,10 +1308,10 @@ (v1-5 *null-vector*) ) (logior! (-> a0-3 flags) (nav-state-flag directional-mode)) - (set! (-> a0-3 travel quad) (-> v1-5 quad)) + (vector-copy! (-> a0-3 travel) v1-5) ) 0 - (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (move-to-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) (set! (-> self gnd-height) (-> self root gspot-pos y)) (vector-reset! (-> self root transv)) (if *citizen-debug* @@ -1334,7 +1342,7 @@ (suspend) (ja-eval) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-virtual flee) ) @@ -1378,12 +1386,12 @@ (go-virtual flee) ) :post (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (let ((a0-1 (-> self nav state)) (v1-3 *null-vector*) ) (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) - (set! (-> a0-1 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-1 travel) v1-3) ) 0 (enemy-common-post self) @@ -1427,12 +1435,12 @@ (go-virtual flee) ) :post (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (let ((a0-1 (-> self nav state)) (v1-3 *null-vector*) ) (logior! (-> a0-1 flags) (nav-state-flag directional-mode)) - (set! (-> a0-1 travel quad) (-> v1-3 quad)) + (vector-copy! (-> a0-1 travel) v1-3) ) 0 (enemy-common-post self) @@ -1445,7 +1453,7 @@ (let ((gp-0 (-> self root))) (cond ((focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) ) (else (let ((a1-1 (new-stack-vector0))) @@ -1469,7 +1477,10 @@ ;; definition for method 90 of type civilian ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-90 ((this civilian) (arg0 ragdoll-proc)) +(defmethod copy-ragdoll-orientation-to-root ((this civilian) (arg0 ragdoll-proc)) + "Apply rotational offset from ragdolling back to the enemy. + Used when disabling a ragdoll to update the enemy + orientation to match the end of ragdoll orientation." (let* ((s3-0 (-> arg0 ragdoll)) (s2-0 (-> s3-0 ragdoll-joints)) (s1-0 @@ -1541,7 +1552,7 @@ (t9-0) ) ) - (reset-penetrate! self) + (reset-penetrate-later! self) ) ) @@ -1581,7 +1592,7 @@ (v1-10 *null-vector*) ) (logior! (-> a0-5 flags) (nav-state-flag directional-mode)) - (set! (-> a0-5 travel quad) (-> v1-10 quad)) + (vector-copy! (-> a0-5 travel) v1-10) ) 0 (set! (-> self vehicle) (the-as handle #f)) @@ -1778,8 +1789,8 @@ ) (let ((s3-0 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (set! (-> s2-0 quad) (-> self root trans quad)) - (set! (-> s1-0 quad) (-> gp-0 quad)) + (vector-copy! s2-0 (-> self root trans)) + (vector-copy! s1-0 gp-0) (vector-! s5-0 gp-0 (-> s0-0 root trans)) (vector-z-quaternion! s4-0 (-> self root quat)) (let ((f30-1 (* 0.5 (vector-vector-xz-distance s2-0 s1-0)))) @@ -1790,7 +1801,7 @@ (let ((v1-21 (-> self nav state))) (logclear! (-> v1-21 flags) (nav-state-flag directional-mode)) (logior! (-> v1-21 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-21 target-pos quad) (-> s3-0 quad)) + (vector-copy! (-> v1-21 target-pos) s3-0) ) ) 0 @@ -1884,7 +1895,7 @@ ) ) (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> self root trans quad)) + (vector-copy! gp-2 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! (-> self draw art-group data (-> self info get-in-car-anim)) :num! (seek! (ja-aframe 5.0 0) 0.86956525) @@ -1968,7 +1979,7 @@ (case message (('exit-vehicle) (let ((a0-1 (the-as object (-> block param 0)))) - (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) + (vector-copy! (-> self event-param-point) (the-as vector a0-1)) ) (if (time-elapsed? (-> self state-time) (seconds 1)) (go-virtual exit-vehicle) @@ -2056,7 +2067,7 @@ ) (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-7 target-pos quad) (-> v1-14 quad)) + (vector-copy! (-> a0-7 target-pos) v1-14) ) 0 (citizen-method-195 self) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/guard_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/guard_REF.gc index 98af2d26c7b..7d94ce9c123 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/guard_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/guard_REF.gc @@ -153,34 +153,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 61440.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 15) + :knocked-soft-vy-hi (meters 15) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 24) + :knocked-hard-vy-hi (meters 26) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 15) + :knocked-red-vy-hi (meters 15) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -273,7 +273,7 @@ (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) - (set! (-> s0-0 quad) (-> this root trans quad)) + (vector-copy! s0-0 (-> this root trans)) (cond ((logtest? (enemy-flag drawn-mirrored) (-> this enemy-flags)) (let ((a1-6 s0-0)) @@ -374,6 +374,7 @@ ;; definition for method 59 of type crimson-guard ;; WARN: Return type mismatch time-frame vs none. (defmethod enemy-common-post ((this crimson-guard)) + "Common implementation of post. Runs ja-post." (when (nonzero? (-> this controller branch)) (let* ((v1-2 *cty-faction-manager*) (a1-0 (-> this controller branch clock-type)) @@ -409,12 +410,14 @@ ;; definition for method 81 of type crimson-guard (defmethod go-die ((this crimson-guard)) + "Go to the die state." (set! *guard-died-recently?* #t) ((method-of-type nav-enemy go-die) this) ) ;; definition for method 80 of type crimson-guard -(defmethod go-best-state ((this crimson-guard)) +(defmethod go-state-for-focused ((this crimson-guard)) + "Go to the appropriate state for the current awareness of the focused process." (if (not (logtest? (-> this flags) (citizen-flag hostile))) (go (method-of-object this active)) (go-hostile this) @@ -423,6 +426,7 @@ ;; definition for method 62 of type crimson-guard (defmethod get-damage-from-attack ((this crimson-guard) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let ((v0-0 ((method-of-type nav-enemy get-damage-from-attack) this arg0 arg1))) (-> arg1 param 1) v0-0 @@ -431,7 +435,8 @@ ;; definition for method 20 of type crimson-guard ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this crimson-guard)) +(defmethod get-search-info-flag ((this crimson-guard)) + "Get search-info-flag for this process." (the-as search-info-flag (cond ((not (-> *setting-control* user-current gun-target-guards?)) 1 @@ -453,6 +458,7 @@ ;; INFO: Used lq/sq ;; WARN: disable def twice: 182. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-0 object)) (case arg2 (('victory) @@ -566,7 +572,7 @@ (let ((v1-69 (the-as traffic-danger-info (-> arg3 param 0)))) (set! (-> this cp-valid?) #t) (set! (-> this cp-sphere quad) (-> v1-69 sphere quad)) - (set! (-> this cp-vec quad) (-> v1-69 velocity quad)) + (vector-copy! (-> this cp-vec) (-> v1-69 velocity)) (let ((v1-70 (-> v1-69 danger-type))) (cond ((zero? v1-70) @@ -662,6 +668,7 @@ ;; definition for method 86 of type crimson-guard (defmethod knocked-land-anim ((this crimson-guard) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((>= 0.0 (-> this hit-points)) (ja-channel-push! 1 (seconds 0.1)) @@ -772,7 +779,7 @@ (set! (-> s4-0 shield-type) (shield-type shield-type-0)) (set! (-> s4-0 enable-time) (seconds 3)) (set! (-> s4-0 disable-time) (seconds 1.5)) - (set! (-> s4-0 offset-vec quad) (-> *up-vector* quad)) + (vector-copy! (-> s4-0 offset-vec) *up-vector*) (vector-float*! (-> s4-0 offset-vec) (-> s4-0 offset-vec) 8192.0) (let ((s3-0 (the-as process #f))) (let* ((s2-0 (get-process *default-dead-pool* shield-sphere #x4000 1)) @@ -801,7 +808,7 @@ (logior! (-> this flags) (citizen-flag persistent)) ) (let ((s4-1 (-> this focus)) - (s3-1 (method-of-type enemy-focus enemy-focus-method-13)) + (s3-1 (method-of-type enemy-focus focus-on-with-awareness!)) (s5-1 (handle->process (-> arg0 handle))) ) (s3-1 @@ -810,7 +817,7 @@ s5-1 ) ) - (enemy-aware ea3) + (enemy-aware hostile) ) ) (go (method-of-object this arrest)) @@ -827,7 +834,7 @@ (s5-2 (get-focus s4-2)) ) (if (and (>= (the-as uint (get-alert-level s4-2)) (the-as uint 1)) s5-2) - (try-update-focus (-> this focus) s5-2 this) + (focus-on! (-> this focus) s5-2 this) ) ) (go (method-of-object this exit-transport)) @@ -846,7 +853,7 @@ (go-hostile this) ) ((11) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (quaternion-copy! (-> this root quat) (-> arg0 rotation)) (set! (-> this vehicle) (-> arg0 handle)) (ja-channel-set! 1) @@ -898,7 +905,7 @@ (let ((f0-0 1228.8) (f30-0 6144.0) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-! (-> s5-0 move-dist) arg1 arg0) (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) @@ -932,7 +939,7 @@ ) ) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (let ((a0-19 (-> s5-0 start-pos))) (let ((v1-15 (-> s5-0 move-dist))) (let ((a1-10 -0.1)) @@ -1058,11 +1065,11 @@ (logclear! (-> this flags) (citizen-flag in-pursuit)) ) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> this root trans quad)) + (vector-copy! a1-4 (-> this root trans)) (+! (-> a1-4 y) 8192.0) (let ((s4-1 (squad-control-method-17 (-> this squad) a1-4 (-> this traffic-id) (-> this target-status)))) (let* ((s3-0 this) - (s2-0 (method-of-object s3-0 enemy-method-70)) + (s2-0 (method-of-object s3-0 set-focus!)) (s1-0 (handle->process (-> this target-status handle))) ) (s2-0 @@ -1084,8 +1091,8 @@ :delay (nop!) ) ) - (set! (-> this target-pos quad) (-> this target-status position quad)) - (set! (-> this target-vel-vec quad) (-> this target-status velocity quad)) + (vector-copy! (-> this target-pos) (-> this target-status position)) + (vector-copy! (-> this target-vel-vec) (-> this target-status velocity)) (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) (when (logtest? (-> s4-1 flags) (squad-target-flag updated)) (if (crimson-guard-method-256 this) @@ -1112,7 +1119,7 @@ (vector+! (-> this target-pos-predict-miss) (-> this root trans) s5-2) ) (vector-! (-> this target-self) (-> this target-pos) (-> this root trans)) - (set! (-> this target-self-xz quad) (-> this target-self quad)) + (vector-copy! (-> this target-self-xz) (-> this target-self)) (set! (-> this target-self-xz y) 0.0) (set! (-> this target-self-dist) (vector-length (-> this target-self))) (set! (-> this target-self-xz-dist) (vector-length (-> this target-self-xz))) @@ -1282,7 +1289,7 @@ (set! (-> arg2 sv-16) (fmin sv-28 (-> arg1 circle-range sv-16))) ) (else - (set! (-> this move-position quad) (-> this root trans quad)) + (vector-copy! (-> this move-position) (-> this root trans)) ) ) (!= sv-16 -1) @@ -1294,7 +1301,7 @@ (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> a1-0 velocity) (-> this root transv)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) (set! (-> a1-0 decay-rate) 0.0) @@ -1311,7 +1318,7 @@ (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> this target-pos quad)) + (vector-copy! s4-0 (-> this target-pos)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0))) (vector-normalize! s3-1 409600.0) (set! (-> this los-status) @@ -1406,15 +1413,15 @@ #f ) ((let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> s4-0 quad)) + (vector-copy! a1-4 s4-0) (set! (-> a1-4 w) (-> arg0 root nav-radius)) - (add-root-sphere-to-hash! (-> arg0 nav) a1-4 #x10046e) + (check-sphere-blocked! (-> arg0 nav) a1-4 #x10046e) ) #f ) (else (let ((a1-5 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-5 start-pos quad) (-> arg1 trans quad)) + (vector-copy! (-> a1-5 start-pos) (-> arg1 trans)) (vector-! (-> a1-5 move-dist) s4-0 (-> a1-5 start-pos)) (let ((v1-10 a1-5)) (set! (-> v1-10 radius) 2048.0) @@ -1562,9 +1569,9 @@ (let ((f28-0 f0-8)) (new 'stack-no-clear 'vector) (let ((a1-8 (new 'stack-no-clear 'vector))) - (set! (-> a1-8 quad) (-> s1-0 quad)) + (vector-copy! a1-8 s1-0) (set! (-> a1-8 w) 8192.0) - (when (not (add-root-sphere-to-hash! (-> this nav) a1-8 32)) + (when (not (check-sphere-blocked! (-> this nav) a1-8 32)) (when (< f30-0 f28-0) (set! f30-0 f28-0) (set! sv-784 (new 'stack-no-clear 'vector)) @@ -1594,7 +1601,7 @@ (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) - (set! (-> arg0 quad) (-> s1-0 quad)) + (vector-copy! arg0 s1-0) ) ) ) @@ -1610,38 +1617,41 @@ ;; definition for method 102 of type crimson-guard ;; INFO: Used lq/sq -(defmethod go-directed2 ((this crimson-guard)) +(defmethod go-next-state-auto ((this crimson-guard)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (let ((s5-0 (-> this nav state)) (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (set! (-> s5-0 heading quad) (-> v1-2 quad)) + (vector-copy! (-> s5-0 heading) v1-2) ) 0 (let ((s5-1 (-> this nav state)) (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (logior! (-> s5-1 flags) (nav-state-flag directional-mode)) - (set! (-> s5-1 travel quad) (-> v1-7 quad)) + (vector-copy! (-> s5-1 travel) v1-7) ) 0 (let ((s5-2 (-> this nav state)) (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (set! (-> s5-2 velocity quad) (-> v1-12 quad)) + (vector-copy! (-> s5-2 velocity) v1-12) ) 0 (crimson-guard-method-261 this) - (set! (-> this move-position quad) (-> this target-pos quad)) + (vector-copy! (-> this move-position) (-> this target-pos)) (go-hostile this) ) ;; definition for method 98 of type crimson-guard (defmethod jump-wind-up-anim ((this crimson-guard) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" #f ) ;; definition for method 96 of type crimson-guard (defmethod jump-in-air-anim ((this crimson-guard) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -1659,6 +1669,7 @@ ;; definition for method 97 of type crimson-guard (defmethod jump-land-anim ((this crimson-guard) (arg0 enemy-jump-info)) + "Play the landing anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) @@ -1675,53 +1686,51 @@ ) ;; definition for method 99 of type crimson-guard -(defmethod jump-anim-handler ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this crimson-guard) (arg0 jump-stage) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) - (let ((v1-0 arg0)) - (cond - ((zero? v1-0) - (not (jump-wind-up-anim this arg1)) - ) - ((= v1-0 1) - (set! s5-0 (ja-done? 0)) - (let ((s4-1 (-> this skel root-channel 0))) - (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) - (set! (-> s4-1 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 - ) - ((= v1-0 2) - (jump-in-air-anim this arg1) - #f - ) - ((= v1-0 3) - (set! s5-0 (ja-done? 0)) - (let ((s4-2 (-> this skel root-channel 0))) - (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) - (set! (-> s4-2 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 + (case arg0 + (((jump-stage init)) + (not (jump-wind-up-anim this arg1)) + ) + (((jump-stage winding-up)) + (set! s5-0 (ja-done? 0)) + (let ((s4-1 (-> this skel root-channel 0))) + (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-1 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) ) - ((= v1-0 4) - (not (jump-land-anim this arg1)) + (ja-blend-eval) + s5-0 + ) + (((jump-stage takeoff)) + (jump-in-air-anim this arg1) + #f + ) + (((jump-stage in-air)) + (set! s5-0 (ja-done? 0)) + (let ((s4-2 (-> this skel root-channel 0))) + (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) + (set! (-> s4-2 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) ) - ((= v1-0 5) - (set! s5-0 (ja-done? 0)) - (let ((s4-3 (-> this skel root-channel 0))) - (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) - (set! (-> s4-3 param 1) (-> arg1 anim-speed)) - (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) - ) - (ja-blend-eval) - s5-0 + (ja-blend-eval) + s5-0 + ) + (((jump-stage touchdown)) + (not (jump-land-anim this arg1)) + ) + (((jump-stage landing)) + (set! s5-0 (ja-done? 0)) + (let ((s4-3 (-> this skel root-channel 0))) + (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) + (set! (-> s4-3 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) ) - (else - #t - ) + (ja-blend-eval) + s5-0 + ) + (else + #t ) ) ) @@ -1729,6 +1738,7 @@ ;; definition for method 120 of type crimson-guard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this crimson-guard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'crimson-guard-collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1813,6 +1823,7 @@ ;; definition for method 121 of type crimson-guard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this crimson-guard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard" (the-as (pointer level) #f))) @@ -1822,7 +1833,7 @@ (set! (-> this state-stack) (new 'process 'boxed-array state 6)) (set! (-> this state-stack length) 0) (set! (-> this info) *crimson-guard-global-info*) - (init-enemy-defaults! this *crimson-guard-nav-enemy-info*) + (setup-enemy! this *crimson-guard-nav-enemy-info*) (let ((v1-9 (-> this nav))) (set! (-> v1-9 speed-scale) 1.0) ) @@ -2027,7 +2038,7 @@ (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 25) (the-as int #f) (the-as vector #t) 0)) ) (set! (-> this move-index) -1) - (set! (-> this reaction-time) (set-reaction-time! this (seconds 0.1) (seconds 0.15))) + (set! (-> this reaction-time) (rnd-time-frame this (seconds 0.1) (seconds 0.15))) (ja-channel-set! 0) 0 (none) @@ -2119,7 +2130,10 @@ ) ;; definition for method 114 of type crimson-guard -(defmethod send-attack-to-all-tshapes ((this crimson-guard) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this crimson-guard) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when s4-0 (let ((s3-0 (-> s4-0 head))) @@ -2127,7 +2141,7 @@ (get-touched-prim s3-0 (-> arg0 root) s4-0) (when (logtest? (-> (get-touched-prim s3-0 (-> this root) s4-0) prim-core action) (collide-action deadly)) (let* ((a0-3 this) - (t9-2 (method-of-object a0-3 send-attack)) + (t9-2 (method-of-object a0-3 send-attack-from-tshape)) (a1-3 arg0) (a2-3 s4-0) (v1-10 *game-info*) @@ -2149,13 +2163,14 @@ ;; definition for method 112 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod get-incoming-attack! ((this crimson-guard) - (arg0 process-drawable) - (arg1 event-message-block) - (arg2 penetrate) - (arg3 attack-info) - (arg4 touching-shapes-entry) - ) +(defmethod handle-incoming-attack! ((this crimson-guard) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + "Set up this enemy to handle an incoming attack event." (call-parent-method this arg0 arg1 arg2 arg3 arg4) 0 (none) @@ -2163,6 +2178,7 @@ ;; definition for method 66 of type crimson-guard (defmethod get-penetrated-by ((this crimson-guard)) + "Figure out the penetrated-by mask for this process." (let ((gp-0 4160)) (if (and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'knocked) (= v1-3 'get-up-front) (= v1-3 'get-up-back)) @@ -2196,7 +2212,7 @@ (a3-0 (-> arg0 state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (vector-copy! a2-0 (-> a3-0 heading)) (t9-0 this v1-1 a2-0) ) 0 @@ -2205,7 +2221,8 @@ ;; definition for method 50 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this crimson-guard) (arg0 int)) +(defmethod update-collision-action ((this crimson-guard) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" 0 (none) ) @@ -2271,7 +2288,8 @@ ;; definition for method 69 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-69 ((this crimson-guard)) +(defmethod focus-on-attacker! ((this crimson-guard)) + "If possible, update this enemies focus to the attacker." 0 (none) ) @@ -2297,7 +2315,8 @@ ) ;; definition for method 52 of type crimson-guard -(defmethod damage-enemy! ((this crimson-guard) (arg0 object) (arg1 event-message-block)) +(defmethod damage-enemy-from-attack! ((this crimson-guard) (arg0 object) (arg1 event-message-block)) + "Given an attack message, apply damage." (when (-> *setting-control* user-current gun-target-guards?) (let ((v1-4 (handle->process (-> this incoming attacker-handle)))) (when v1-4 @@ -2331,7 +2350,3 @@ (defmethod crimson-guard-method-271 ((this crimson-guard)) #f ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc index 316e0a00108..c8f8b530600 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-flitter_REF.gc @@ -150,34 +150,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 275251.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 67.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -235,6 +235,7 @@ ;; definition for method 85 of type metalhead-flitter (defmethod knocked-anim ((this metalhead-flitter) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (let ((a0-2 (-> this skel root-channel 0))) @@ -278,6 +279,7 @@ ;; definition for method 86 of type metalhead-flitter (defmethod knocked-land-anim ((this metalhead-flitter) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type blue-shot)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -301,7 +303,7 @@ ;; definition for method 76 of type metalhead-flitter (defmethod go-stare2 ((this metalhead-flitter)) - (if (and (= (-> this focus aware) (enemy-aware ea2)) (not (nav-enemy-method-174 this))) + (if (and (= (-> this focus aware) (enemy-aware aware2)) (not (nav-enemy-method-174 this))) (go (method-of-object this pacing)) (go (method-of-object this stare)) ) @@ -341,11 +343,11 @@ (('ruins) (cond ((logtest? (-> *part-group-id-table* 255 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 255)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 255)) ) ) @@ -353,11 +355,11 @@ (('strip) (cond ((logtest? (-> *part-group-id-table* 256 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 256)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 256)) ) ) @@ -405,11 +407,11 @@ (when (< (-> self base-height) (-> self root trans y)) (cond ((logtest? (-> *part-group-id-table* 257 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 257)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 257)) ) ) @@ -465,7 +467,8 @@ ) ;; definition for method 108 of type metalhead-flitter -(defmethod enemy-method-108 ((this metalhead-flitter) (arg0 process-focusable)) +(defmethod should-flee-from? ((this metalhead-flitter) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (focus-test? arg0 mech) ) @@ -485,18 +488,18 @@ (f30-0 (vector-length s4-1)) ) (cond - ((enemy-method-108 this s3-0) + ((should-flee-from? this s3-0) (go-flee this) ) ((and (< f30-0 32768.0) (not (metalhead-flitter-method-226 this s3-0))) (go (method-of-object this circling)) ) ((and (< f30-0 (-> this enemy-info notice-nav-radius)) (time-elapsed? (-> this state-time) (seconds 0.2))) - (set! (-> this target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> this target-pos) s5-1) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s4-1 quad)) + (vector-copy! s3-1 s4-1) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> this root transv quad)) + (vector-copy! s5-2 (-> this root transv)) (vector-normalize! s5-2 f30-0) (if (>= (vector-dot s3-1 s5-2) 0.98) (go (method-of-object this attack)) @@ -505,7 +508,7 @@ ) ) ((< f30-0 32768.0) - (set! (-> this target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> this target-pos) s5-1) ) ((or (time-elapsed? (-> this last-change-dir) (-> this change-dir-time)) (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) @@ -529,7 +532,7 @@ ) (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-0 s5-1 s3-2) - (set! (-> this target-pos quad) (-> s2-0 quad)) + (vector-copy! (-> this target-pos) s2-0) ) ) ) @@ -602,7 +605,7 @@ (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) (until #f - (when (not (enemy-method-105 self 2730.6667 #t)) + (when (not (pointing-toward-focus? self 2730.6667 #t)) (let ((v1-5 self)) (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) ) @@ -611,7 +614,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data 9)) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -677,7 +680,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -759,7 +762,7 @@ ) (logclear! (-> s5-1 flags) (nav-state-flag directional-mode)) (logior! (-> s5-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> s5-1 target-pos quad) (-> v1-10 quad)) + (vector-copy! (-> s5-1 target-pos) v1-10) ) 0 (set! s5-2 (-> self attack-pos)) @@ -807,7 +810,7 @@ (ja :num! (seek!)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-travel-post ) @@ -828,7 +831,7 @@ (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) (until #f - (when (not (enemy-method-105 self 2730.6667 #t)) + (when (not (pointing-toward-focus? self 2730.6667 #t)) (let ((v1-5 self)) (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) ) @@ -837,7 +840,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data 9)) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -889,12 +892,12 @@ :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) (if (the-as process-focusable gp-0) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-11 (-> self focus aware))) (cond - ((= v1-11 (enemy-aware ea3)) + ((= v1-11 (enemy-aware hostile)) (cond ((when gp-0 (let* ((gp-1 self) @@ -917,7 +920,7 @@ ) ) ) - ((= v1-11 (enemy-aware ea2)) + ((= v1-11 (enemy-aware aware2)) (go-stare self) ) ((>= 1 (the-as int v1-11)) @@ -968,6 +971,7 @@ ;; definition for method 120 of type metalhead-flitter ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this metalhead-flitter)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1022,12 +1026,13 @@ ;; definition for method 121 of type metalhead-flitter ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this metalhead-flitter)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-flitter" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *metalhead-flitter-nav-enemy-info*) + (setup-enemy! this *metalhead-flitter-nav-enemy-info*) (set! (-> this move-angle) 10922.667) (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) #t diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-grunt_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-grunt_REF.gc index de59e378baf..90d977b7fa3 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-grunt_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-grunt_REF.gc @@ -181,34 +181,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 51609.6 - :knocked-soft-vxz-hi 87654.4 - :knocked-soft-vy-lo 49152.0 - :knocked-soft-vy-hi 73728.0 - :knocked-medium-vxz-lo 73728.0 - :knocked-medium-vxz-hi 98304.0 - :knocked-medium-vy-lo 65536.0 - :knocked-medium-vy-hi 73728.0 - :knocked-hard-vxz-lo 41779.2 - :knocked-hard-vxz-hi 60620.8 - :knocked-hard-vy-lo 93388.8 - :knocked-hard-vy-hi 103219.2 - :knocked-huge-vxz-lo 82739.2 - :knocked-huge-vxz-hi 126156.8 - :knocked-huge-vy-lo 101580.8 - :knocked-huge-vy-hi 111411.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 12288.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 49152.0 - :knocked-red-vy-hi 73728.0 - :knocked-blue-vxz-lo 20480.0 - :knocked-blue-vxz-hi 24576.0 - :knocked-blue-vy-lo 12288.0 - :knocked-blue-vy-hi 40960.0 + :knocked-soft-vxz-lo (meters 12.6) + :knocked-soft-vxz-hi (meters 21.4) + :knocked-soft-vy-lo (meters 12) + :knocked-soft-vy-hi (meters 18) + :knocked-medium-vxz-lo (meters 18) + :knocked-medium-vxz-hi (meters 24) + :knocked-medium-vy-lo (meters 16) + :knocked-medium-vy-hi (meters 18) + :knocked-hard-vxz-lo (meters 10.2) + :knocked-hard-vxz-hi (meters 14.8) + :knocked-hard-vy-lo (meters 22.8) + :knocked-hard-vy-hi (meters 25.2) + :knocked-huge-vxz-lo (meters 20.2) + :knocked-huge-vxz-hi (meters 30.8) + :knocked-huge-vy-lo (meters 24.8) + :knocked-huge-vy-hi (meters 27.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 3) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 12) + :knocked-red-vy-hi (meters 18) + :knocked-blue-vxz-lo (meters 5) + :knocked-blue-vxz-hi (meters 6) + :knocked-blue-vy-lo (meters 3) + :knocked-blue-vy-hi (meters 10) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 10625.897) :scale (new 'static 'vector :x 0.6399 :y 0.6399 :z 0.6399) @@ -721,6 +721,7 @@ ;; definition for method 82 of type metalhead-grunt (defmethod event-handler ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -732,7 +733,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -779,7 +780,8 @@ ) ;; definition for method 74 of type metalhead-grunt -(defmethod go-ambush-delay ((this metalhead-grunt)) +(defmethod go-ambush ((this metalhead-grunt)) + "May go to ambush-delay first, if set in the res-lump." (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -846,13 +848,14 @@ ) ;; definition for method 102 of type metalhead-grunt -(defmethod go-directed2 ((this metalhead-grunt)) +(defmethod go-next-state-auto ((this metalhead-grunt)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type mh-squad-member go-directed2) this) + ((method-of-type mh-squad-member go-next-state-auto) this) ) ) ) @@ -904,7 +907,7 @@ ) (if (< v1-1 (-> a0-0 curve num-cverts)) (set! (-> self jumping-ambush-path-pt) v1-1) - (go-best-state self) + (go-state-for-focused self) ) ) (until #f @@ -955,7 +958,7 @@ ) 0 (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + (s5-0 (rnd-time-frame self 1 (seconds 0.027))) ) (let ((v1-37 (ja-group))) (if (not (and v1-37 (= v1-37 gp-0))) @@ -979,7 +982,7 @@ ) 0 (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (s5-1 (rnd-time-frame self (seconds 0.007) (seconds 0.017))) ) (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -1012,7 +1015,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -1109,7 +1112,7 @@ ) ) (sound-play "grunt-warn") - (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + (set! (-> self next-warn-time) (+ gp-0 (rnd-time-frame self (seconds 1) (seconds 1.2)))) ) ) ) @@ -1153,7 +1156,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-10 *game-info*) (a0-5 (+ (-> v1-10 attack-id) 1)) ) @@ -1168,7 +1171,7 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (when (logtest? (-> self enemy-flags) (enemy-flag victory)) (logclear! (-> self enemy-flags) (enemy-flag victory)) (sound-play "grunt-hit") @@ -1256,7 +1259,7 @@ (if (not gp-0) (go-stare self) ) - (set! (-> self focus-pos quad) (-> (get-trans gp-0 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans gp-0 0)) ) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-21 *game-info*) @@ -1292,7 +1295,7 @@ (until (ja-done? 0) (let ((a0-9 (the-as process-focusable (handle->process (-> self focus handle))))) (if a0-9 - (set! (-> self focus-pos quad) (-> (get-trans a0-9 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans a0-9 0)) ) ) (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) @@ -1408,6 +1411,7 @@ ;; definition for method 120 of type metalhead-grunt ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this metalhead-grunt)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1535,12 +1539,13 @@ ;; definition for method 121 of type metalhead-grunt ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this metalhead-grunt)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-grunt" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this (get-nav-info this)) + (setup-enemy! this (get-nav-info this)) (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) @@ -1593,7 +1598,7 @@ (suspend) (ja :num! (seek!)) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1627,7 +1632,3 @@ (go-inactive self) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc index d8595e35796..83579eb1614 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/citizen/metalhead-predator_REF.gc @@ -95,7 +95,7 @@ ;; definition for method 31 of type metalhead-predator-shot ;; INFO: Used lq/sq (defmethod init-proj-settings! ((this metalhead-predator-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'predator-shot) (set! (-> this max-speed) 532480.0) (set! (-> this move) metalhead-shot-move) @@ -233,34 +233,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 81920.0 - :knocked-soft-vxz-hi 81920.0 - :knocked-soft-vy-lo 69632.0 - :knocked-soft-vy-hi 69632.0 - :knocked-medium-vxz-lo 81920.0 - :knocked-medium-vxz-hi 81920.0 - :knocked-medium-vy-lo 69632.0 - :knocked-medium-vy-hi 69632.0 - :knocked-hard-vxz-lo 81920.0 - :knocked-hard-vxz-hi 81920.0 - :knocked-hard-vy-lo 69632.0 - :knocked-hard-vy-hi 69632.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 53248.0 - :knocked-yellow-vy-lo 40960.0 - :knocked-yellow-vy-hi 53248.0 - :knocked-red-vxz-lo 102400.0 - :knocked-red-vxz-hi 102400.0 - :knocked-red-vy-lo 81920.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 + :knocked-soft-vxz-lo (meters 20) + :knocked-soft-vxz-hi (meters 20) + :knocked-soft-vy-lo (meters 17) + :knocked-soft-vy-hi (meters 17) + :knocked-medium-vxz-lo (meters 20) + :knocked-medium-vxz-hi (meters 20) + :knocked-medium-vy-lo (meters 17) + :knocked-medium-vy-hi (meters 17) + :knocked-hard-vxz-lo (meters 20) + :knocked-hard-vxz-hi (meters 20) + :knocked-hard-vy-lo (meters 17) + :knocked-hard-vy-hi (meters 17) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 13) + :knocked-yellow-vy-lo (meters 10) + :knocked-yellow-vy-hi (meters 13) + :knocked-red-vxz-lo (meters 25) + :knocked-red-vxz-hi (meters 25) + :knocked-red-vy-lo (meters 20) + :knocked-red-vy-hi (meters 20) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 8) + :knocked-blue-vy-hi (meters 12) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -433,10 +433,11 @@ ;; definition for method 59 of type metalhead-predator ;; INFO: Used lq/sq (defmethod enemy-common-post ((this metalhead-predator)) + "Common implementation of post. Runs ja-post." (when (< 1 (the-as int (-> this focus aware))) (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans s5-0 5) quad)) + (vector-copy! (-> this focus-pos) (get-trans s5-0 5)) (los-control-method-9 (-> this los) s5-0 (-> this focus-pos) 819.2 4096.0) ) ) @@ -451,6 +452,7 @@ ;; definition for method 82 of type metalhead-predator ;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (set! (-> this shock-effect-end) (+ (current-time) (seconds 1))) @@ -469,6 +471,7 @@ ;; definition for method 85 of type metalhead-predator (defmethod knocked-anim ((this metalhead-predator) (arg0 enemy-knocked-info)) + "start the knocked animation." (cond ((= (-> this hit-points) 0.0) (case (-> this incoming knocked-type) @@ -562,6 +565,7 @@ ;; definition for method 86 of type metalhead-predator (defmethod knocked-land-anim ((this metalhead-predator) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this hit-points) 0.0) (case (-> this incoming knocked-type) @@ -648,7 +652,7 @@ (let ((f0-0 1228.8) (f30-0 6144.0) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-! (-> s5-0 move-dist) arg1 arg0) (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) @@ -681,7 +685,7 @@ ) ) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (let ((v1-14 s5-0)) (set! (-> v1-14 radius) f30-0) (set! (-> v1-14 collide-with) (collide-spec enemy hit-by-player-list hit-by-others-list)) @@ -755,7 +759,7 @@ ) (when s3-0 (seek! (-> this miss-amount) (* 0.2 (vector-length (-> s3-0 root transv))) 4096.0) - (set! (-> s2-0 quad) (-> (get-trans s3-0 3) quad)) + (vector-copy! s2-0 (get-trans s3-0 3)) (set! sv-272 (new 'stack-no-clear 'vector)) (let ((v1-28 (-> s5-0 pos)) (a0-19 s2-0) @@ -1012,7 +1016,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-9 *game-info*) (a0-5 (+ (-> v1-9 attack-id) 1)) ) @@ -1033,7 +1037,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -1085,6 +1089,7 @@ ;; definition for method 120 of type metalhead-predator ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this metalhead-predator)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1171,12 +1176,13 @@ ;; definition for method 121 of type metalhead-predator ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this metalhead-predator)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalhead-predator" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *metalhead-predator-nav-enemy-info*) + (setup-enemy! this *metalhead-predator-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc index 9569bcc00e4..6eca59fb260 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/traffic-engine_REF.gc @@ -1027,7 +1027,7 @@ (set! (-> v1-1 0 sphere quad) (-> s5-0 control trans quad)) (set! (-> v1-1 0 sphere r) f0-1) ) - (set! (-> v1-1 0 velocity quad) (-> s5-0 control transv quad)) + (vector-copy! (-> v1-1 0 velocity) (-> s5-0 control transv)) (let ((f0-3 (- (-> v1-1 0 danger-level) (* (-> v1-1 0 decay-rate) (seconds-per-frame))))) (set! (-> v1-1 0 danger-level) (fmax 0.0 f0-3)) ) @@ -1036,7 +1036,7 @@ (f30-0 0.0) (s4-0 (new 'stack-no-clear 'inline-array 'traffic-suppression-box 2)) ) - (set! (-> s4-0 0 bbox max quad) (-> s5-0 control transv quad)) + (vector-copy! (-> s4-0 0 bbox max) (-> s5-0 control transv)) (vector-z-quaternion! (the-as vector (-> s4-0 1)) (get-quat s5-0 3)) (set! (-> s4-0 1 data 16) (the-as uint 3)) (cond @@ -1109,7 +1109,7 @@ (set! (-> s2-1 sphere quad) (-> s5-0 control trans quad)) (set! (-> s2-1 danger-type) (-> s4-0 1 data 16)) (set! (-> s2-1 sphere r) f30-0) - (set! (-> s2-1 velocity quad) (-> s4-0 0 bbox min quad)) + (vector-copy! (-> s2-1 velocity) (-> s4-0 0 bbox min)) (let ((gp-1 (fill-actor-list-for-sphere (-> this object-hash) (-> s2-1 sphere) @@ -1155,7 +1155,7 @@ (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 40)) (a1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> s4-0 sphere quad)) + (vector-copy! a1-0 (-> s4-0 sphere)) (set! (-> a1-0 w) (-> s4-0 notify-radius)) (let ((s2-0 (fill-actor-list-for-box (-> this object-hash) a1-0 s3-0 40))) (dotimes (s1-0 s2-0) @@ -1279,14 +1279,14 @@ (when (nonzero? (-> a2-0 pilot)) (let ((a2-1 (handle->process (-> a2-0 pilot vehicle)))) (when a2-1 - (set! (-> s5-0 quad) (-> (the-as process-focusable a2-1) root root-prim prim-core world-sphere quad)) + (vector-copy! s5-0 (-> (the-as process-focusable a2-1) root root-prim prim-core world-sphere)) (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) a2-1)) ) ) ) ) (else - (set! (-> s5-0 quad) (-> a2-0 control trans quad)) + (vector-copy! s5-0 (-> a2-0 control trans)) (set! (-> s5-0 w) 20480.0) (fill-actor-list-for-vec+r (-> this object-hash) s5-0 (the-as (pointer collide-shape) a2-0)) ) @@ -1303,7 +1303,7 @@ ) ((begin (let ((v1-32 (-> (the-as process-focusable s3-0) root))) - (set! (-> s5-0 quad) (-> v1-32 trans quad)) + (vector-copy! s5-0 (-> v1-32 trans)) (set! (-> s5-0 w) (-> v1-32 root-prim prim-core world-sphere w)) ) (sphere-in-loaded-city-infos? this s5-0 0) @@ -1333,7 +1333,7 @@ ) (else (let ((v1-53 (-> (the-as process-focusable s3-1) root))) - (set! (-> s5-0 quad) (-> v1-53 trans quad)) + (vector-copy! s5-0 (-> v1-53 trans)) (set! (-> s5-0 w) (-> v1-53 root-prim prim-core world-sphere w)) ) (when (logtest? (-> (the-as citizen s3-1) flags) (citizen-flag in-formation)) @@ -1521,7 +1521,7 @@ ;; INFO: Used lq/sq (defmethod find-best-segment ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) (let ((gp-0 (new 'stack-no-clear 'traffic-find-segment-struct))) - (set! (-> gp-0 dir quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 dir) arg1) (set! (-> gp-0 best-rating) -10000000000000000000000000000000000000.0) (set! (-> gp-0 best-seg) #f) (callback-on-nav-segments-in-sphere @@ -1774,7 +1774,7 @@ (while (>= (the-as uint s2-0) (the-as uint s3-0)) (let ((s1-0 (-> this object-type-info-array s3-0))) (if (and (logtest? (-> s1-0 flags) (traffic-type-flag ttf3)) - (= (status-of-level-and-borrows *level* (-> s1-0 level) 'ignore-borrow) 'active) + (= (level-status? *level* (-> s1-0 level) 'ignore-borrow) 'active) ) (+! s4-0 (-> s1-0 parking-spot-prob)) ) @@ -1789,7 +1789,7 @@ (while (>= (the-as uint s2-1) (the-as uint s3-1)) (let ((s1-1 (-> this object-type-info-array s3-1))) (when (and (logtest? (-> s1-1 flags) (traffic-type-flag ttf3)) - (= (status-of-level-and-borrows *level* (-> s1-1 level) #f) 'active) + (= (level-status? *level* (-> s1-1 level) #f) 'active) ) (+! s5-0 (-> s1-1 parking-spot-prob)) (if (< s4-1 s5-0) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/traffic-manager_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/traffic-manager_REF.gc index 8036575c585..0b97765adda 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/traffic-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/traffic-manager_REF.gc @@ -71,7 +71,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod traffic-manager-method-16 ((this traffic-manager)) (traffic-manager-method-22 this) - (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (= (level-status? *level* 'ctywide #f) 'active) (set-setting! 'gem-pool-index #f 0.0 1) ) (update-traffic (-> this traffic-engine)) @@ -159,7 +159,7 @@ (dotimes (s5-0 29) (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) (logclear! (-> s4-0 flags) (traffic-type-flag ttf3)) - (if (= (status-of-level-and-borrows *level* (-> s4-0 level) #f) 'active) + (if (= (level-status? *level* (-> s4-0 level) #f) 'active) (logior! (-> s4-0 flags) (traffic-type-flag ttf3)) ) ) @@ -420,7 +420,7 @@ ;; definition for method 21 of type traffic-manager ;; WARN: Return type mismatch int vs none. (defmethod traffic-manager-method-21 ((this traffic-manager)) - (if (= (status-of-level-and-borrows *level* 'ctywide #f) 'active) + (if (= (level-status? *level* 'ctywide #f) 'active) (set-setting! 'gem-pool-index #f 0.0 1) ) (let ((s5-1 (new 'stack-no-clear 'array 'int8 29))) @@ -1321,7 +1321,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc index b680d827b3f..c527dcacf5a 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/bike_REF.gc @@ -1510,18 +1510,7 @@ (not (logtest? (-> this v-flags) (vehicle-flag dead))) ) (let ((s5-0 (new 'stack-no-clear 'bike-stack-var0))) - (let* ((v1-6 (-> s5-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-7 (-> a3-0 rvec quad)) - (a1-1 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-6 rvec quad) a0-7) - (set! (-> v1-6 uvec quad) a1-1) - (set! (-> v1-6 fvec quad) a2-0) - (set! (-> v1-6 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat) (-> this node-list data 0 bone transform)) (set-vector! (-> s5-0 vec4) 0.0 -1.0 0.0 1.0) (vector-rotate*! (-> s5-0 vec4) (-> s5-0 vec4) (-> s5-0 mat)) (let ((s4-0 (new 'static 'inline-array vector 2 @@ -1539,8 +1528,8 @@ (when (< 0.0 (-> this roll-thrust s2-0)) (vector-rotate*! (-> s5-0 vec4) (-> s3-0 s2-0) (-> s5-0 mat)) (vector-matrix*! (-> s5-0 vec3) (-> s4-0 s2-0) (-> s5-0 mat)) - (set! (-> s5-0 vec5 quad) (-> this rbody matrix uvec quad)) - (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (vector-copy! (-> s5-0 vec5) (-> this rbody matrix uvec)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 vec3)) (set! (-> s5-0 vec2 y) 1638.4) (set! (-> s5-0 vec2 z) 12288.0) (let ((f0-9 (* (-> this roll-thrust s2-0) (-> this force-scale) (-> this info info inv-mass))) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-control_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-control_REF.gc index 4fcc1673fc1..7790ecbe0b3 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-control_REF.gc @@ -152,7 +152,7 @@ (set! (-> this max-turn-speed) (sqrtf (* (fmax 16384.0 arg1) (-> this turn-accel)))) (let ((v1-1 (new 'stack-no-clear 'inline-array 'vector 2))) (vector-! (-> v1-1 1) (-> this turn-exit-point) arg0) - (set! (-> v1-1 0 quad) (-> this turn-exit-dir quad)) + (vector-copy! (-> v1-1 0) (-> this turn-exit-dir)) (set! (-> v1-1 0 x) (-> this turn-exit-dir z)) (set! (-> v1-1 0 z) (- (-> this turn-exit-dir x))) (logior! (-> this flags) (vehicle-controller-flag left-turn)) @@ -179,7 +179,7 @@ (set! (-> this dest-circle w) arg1) 0 (vehicle-controller-method-16 this (-> this path-prev-point) (-> this turn-enter-point)) - (set! (-> this target-point quad) (-> this turn-enter-point quad)) + (vector-copy! (-> this target-point) (-> this turn-enter-point)) (vector-! (-> this turn-enter-dir) (-> this turn-enter-point) (-> this path-prev-point)) (set! (-> this turn-enter-dir y) 0.0) (vector-normalize! (-> this turn-enter-dir) 1.0) @@ -202,11 +202,11 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod vehicle-controller-method-19 ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) - (set! (-> this path-prev-point quad) (-> arg0 quad)) + (vector-copy! (-> this path-prev-point) arg0) (vector-vector-distance arg0 arg2) (set! (-> this target-speed) (vector-length arg3)) - (set! (-> this turn-exit-point quad) (-> arg2 quad)) - (set! (-> this turn-exit-dir quad) (-> arg3 quad)) + (vector-copy! (-> this turn-exit-point) arg2) + (vector-copy! (-> this turn-exit-dir) arg3) (set! (-> this turn-exit-dir y) 0.0) (vector-normalize! (-> this turn-exit-dir) 1.0) (vehicle-controller-method-20 this arg0 (the-as float arg1)) @@ -220,7 +220,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod vehicle-controller-method-13 ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) (vehicle-controller-method-10 this arg0) - (set! (-> this path-prev-point quad) (-> arg1 quad)) + (vector-copy! (-> this path-prev-point) arg1) (set! (-> this branch) arg0) (let ((v1-3 arg0)) (set! (-> this target-speed) (* 1024.0 (the float (-> v1-3 speed-limit)))) @@ -229,7 +229,7 @@ (let ((a1-2 s4-1) (v1-6 (-> this turn-exit-point)) ) - (set! (-> v1-6 quad) (-> a1-2 position quad)) + (vector-copy! v1-6 (-> a1-2 position)) (set! (-> v1-6 w) 1.0) ) (let ((v1-7 s4-1) @@ -301,7 +301,7 @@ ) (when gp-0 (vehicle-controller-method-11 this) - (set! (-> s4-0 quad) (-> this turn-exit-point quad)) + (vector-copy! s4-0 (-> this turn-exit-point)) (vehicle-controller-method-13 this gp-0 s4-0) ) gp-0 @@ -341,7 +341,7 @@ (f0-15 (/ (* f28-0 f1-6) f30-0)) ) (let ((f1-9 (/ (* f1-6 f1-6) f30-0))) - (set! (-> arg1 quad) (-> arg0 quad)) + (vector-copy! arg1 arg0) (let ((a1-5 arg1)) (let ((v1-12 arg1)) (let ((a0-5 (-> s4-0 0))) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc index 2b9f08f2d06..1dd48082df0 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-effects_REF.gc @@ -149,18 +149,7 @@ ) ) (let ((s5-0 (new 'stack-no-clear 'vehicle-stack-type3))) - (let* ((v1-38 (-> s5-0 mat0)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-14 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-38 rvec quad) a0-14) - (set! (-> v1-38 uvec quad) a1-3) - (set! (-> v1-38 fvec quad) a2-1) - (set! (-> v1-38 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat0) (-> this node-list data 0 bone transform)) (set-vector! (-> s5-0 vec1) 0.0 0.0 -1.0 1.0) (vector-rotate*! (-> s5-0 vec1) (-> s5-0 vec1) (-> s5-0 mat0)) (set! (-> this fog-fade) (calc-fade-from-fog (-> this root trans))) @@ -177,7 +166,7 @@ (a1-8 (-> s5-0 vec0)) (f0-15 (-> v1-46 position w)) ) - (set! (-> v1-46 position quad) (-> a1-8 quad)) + (vector-copy! (-> v1-46 position) a1-8) (set! (-> v1-46 position w) f0-15) ) 0 @@ -213,7 +202,7 @@ (a1-20 (-> s5-0 vec0)) (f0-29 (-> v1-70 position w)) ) - (set! (-> v1-70 position quad) (-> a1-20 quad)) + (vector-copy! (-> v1-70 position) a1-20) (set! (-> v1-70 position w) f0-29) ) 0 @@ -255,7 +244,7 @@ (a1-33 s4-2) (a2-9 *launch-matrix*) ) - (set! (-> a2-9 trans quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> a2-9 trans) (-> s5-0 vec0)) (t9-23 a0-41 a1-33 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (set! (-> this exhaust-part-accum s3-0) (the-as sparticle-launch-control (-> s4-2 birthaccum))) @@ -308,7 +297,7 @@ (a1-43 sv-228) (a2-12 *launch-matrix*) ) - (set! (-> a2-12 trans quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> a2-12 trans) (-> s5-0 vec0)) (t9-35 a0-51 a1-43 a2-12 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (+! (-> s5-0 byte0) 1) @@ -319,7 +308,7 @@ (a1-44 sv-224) (a2-13 *launch-matrix*) ) - (set! (-> a2-13 trans quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> a2-13 trans) (-> s5-0 vec0)) (t9-36 a0-52 a1-44 a2-13 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (set! (-> this smoke-part-accum s4-3) (the-as sparticle-launch-control (-> sv-224 birthaccum))) @@ -335,7 +324,7 @@ (a0-55 (-> this info particle-common sp-system2d)) (a2-15 *launch-matrix*) ) - (set! (-> a2-15 trans quad) (-> this impact-pos quad)) + (vector-copy! (-> a2-15 trans) (-> this impact-pos)) (t9-38 a0-55 a1-46 a2-15 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -358,11 +347,11 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'vehicle-thruster-work))) - (set! (-> s5-0 vec2 quad) (-> arg1 trans quad)) + (vector-copy! (-> s5-0 vec2) (-> arg1 trans)) (quaternion-copy! (-> s5-0 quat1) (-> arg1 quat)) (quaternion-rotate-local-x! (-> s5-0 quat1) (-> s5-0 quat1) 32768.0) (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) - (set! (-> s5-0 vec4 quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec4) (-> s5-0 vec0)) (let ((f0-0 (rand-vu-float-range 1.0 1.33))) (set! (-> s5-0 float0) (* f0-0 (-> arg1 length) (-> arg1 thrust))) (set! (-> s5-0 float1) (fmin (* (-> arg1 width) f0-0) (/ (-> s5-0 float0) 2))) @@ -387,7 +376,7 @@ (a1-7 (-> s5-0 vec3)) (f0-5 (-> v1-5 position w)) ) - (set! (-> v1-5 position quad) (-> a1-7 quad)) + (vector-copy! (-> v1-5 position) a1-7) (set! (-> v1-5 position w) f0-5) ) 0 @@ -416,7 +405,7 @@ ) (set! (-> arg0 part-thruster-x initial-valuef) (-> s5-0 float1)) (set! (-> arg0 part-spec2 initial-valuef) (-> s5-0 float0)) - (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 vec3)) (launch-particles :system (-> arg0 sp-system3d) (-> arg0 part-thruster) @@ -425,7 +414,7 @@ ) (quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667) (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) - (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 vec3)) (launch-particles :system (-> arg0 sp-system3d) (-> arg0 part-thruster) @@ -434,7 +423,7 @@ ) (quaternion-rotate-local-z! (-> s5-0 quat1) (-> s5-0 quat1) 10922.667) (quaternion->matrix (the-as matrix (-> s5-0 quat0)) (-> s5-0 quat1)) - (set! (-> s5-0 vec1 quad) (-> s5-0 vec3 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 vec3)) (launch-particles :system (-> arg0 sp-system3d) (-> arg0 part-thruster) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc index f04c7e3fd43..96159b3b400 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-physics_REF.gc @@ -8,7 +8,7 @@ (let ((f0-1 (- (-> arg0 y) (-> arg0 w)))) (when (< f0-1 (-> this water-height)) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 rvec quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 rvec) arg0) (let ((s3-0 (-> this info)) (f1-3 (fmin (-> this water-height) (+ (-> arg0 y) (-> arg0 w)))) ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-rider_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-rider_REF.gc index 2a552bddd0d..29dbea462a4 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-rider_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-rider_REF.gc @@ -170,7 +170,7 @@ (squad-control-method-18 (-> self squad) 2 *target*) (set! (-> gp-0 object-type) (traffic-type guard-a)) ) - (set! (-> gp-0 position quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 position) (-> self root trans)) (quaternion-copy! (-> gp-0 rotation) (-> self root quat)) (send-event *traffic-manager* 'activate-object gp-0) ) @@ -258,6 +258,7 @@ ;; definition for method 11 of type vehicle-rider ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this vehicle-rider) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -266,7 +267,7 @@ (defbehavior vehicle-rider-init-by-other vehicle-rider ((arg0 traffic-object-spawn-params)) (set! (-> self squad) *ff-squad-control*) (initialize-collision self) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 rotation)) (logior! (-> self focus-status) (focus-status pilot-riding)) (setup-lods self) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc index 69c35a06338..f5201f7ddd2 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-util_REF.gc @@ -185,6 +185,7 @@ ;; definition for method 11 of type vehicle ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this vehicle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -246,21 +247,10 @@ (if (logtest? (vehicle-flag ai-driving) (-> this v-flags)) (set! (-> s5-0 floats 4) (* 1.5 (-> s5-0 floats 4))) ) - (set! (-> s5-0 mat 0 uvec quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s5-0 mat 0 uvec) (target-pos 0)) (+! (-> s5-0 mat 0 uvec y) 8192.0) - (let* ((v1-14 (-> s5-0 mat 1)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-5 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-14 rvec quad) a0-5) - (set! (-> v1-14 uvec quad) a1-0) - (set! (-> v1-14 fvec quad) a2-0) - (set! (-> v1-14 trans quad) a3-1) - ) - (set! (-> s5-0 mat 0 fvec quad) (-> s5-0 mat 1 trans quad)) + (matrix-copy! (-> s5-0 mat 1) (-> this node-list data 0 bone transform)) + (vector-copy! (-> s5-0 mat 0 fvec) (-> s5-0 mat 1 trans)) (set! (-> s5-0 floats 2) (- (-> s5-0 mat 0 uvec y) (-> s5-0 mat 0 fvec y))) (let ((f0-9 (vector-vector-xz-distance-squared (-> s5-0 mat 0 uvec) (-> s5-0 mat 0 fvec))) (f1-7 (-> s5-0 floats 4)) @@ -284,7 +274,7 @@ (f1-12 81920.0) ) (when (< f0-14 (* f1-12 f1-12)) - (set! (-> s5-0 cquery start-pos quad) (-> s5-0 mat 0 uvec quad)) + (vector-copy! (-> s5-0 cquery start-pos) (-> s5-0 mat 0 uvec)) (vector-! (-> s5-0 cquery move-dist) (-> s5-0 mat 0 fvec) (-> s5-0 mat 0 uvec)) (let ((v1-38 (-> s5-0 cquery))) (set! (-> v1-38 radius) 4096.0) @@ -485,7 +475,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod vehicle-method-66 ((this vehicle) (arg0 vector) (arg1 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> this info rider seat-array arg1 position quad)) + (vector-copy! v1-0 (-> this info rider seat-array arg1 position)) (set! (-> v1-0 w) 1.0) (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) ) @@ -611,7 +601,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod get-linear-accel! ((this vehicle) (arg0 vector)) - (set! (-> arg0 quad) (-> this lin-acceleration quad)) + (vector-copy! arg0 (-> this lin-acceleration)) 0 (none) ) @@ -865,9 +855,9 @@ (vector-normalize! (-> s4-1 0 trans) 1.0) (vector-cross! (-> s4-1 1 fvec) (-> s4-1 0 trans) (-> s4-1 0 uvec)) (set! (-> s4-1 1 rvec quad) (-> s4-1 0 trans quad)) - (set! (-> s4-1 1 uvec quad) (-> s4-1 0 uvec quad)) - (set! (-> s4-1 1 fvec quad) (-> s4-1 0 fvec quad)) - (set! (-> s4-1 1 trans quad) (-> s4-1 0 rvec quad)) + (vector-copy! (-> s4-1 1 uvec) (-> s4-1 0 uvec)) + (vector-copy! (-> s4-1 1 fvec) (-> s4-1 0 fvec)) + (vector-copy! (-> s4-1 1 trans) (-> s4-1 0 rvec)) (if (logtest? (-> *part-group-id-table* 225 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1156,7 +1146,7 @@ (when (not (logtest? (-> s5-0 flags) (rigid-body-flag enable-physics))) (logior! (-> s5-0 flags) (rigid-body-flag enable-physics)) (rigid-body-control-method-28 s5-0 (-> this root trans) (-> this root quat)) - (set! (-> s5-0 lin-velocity quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 lin-velocity) (-> this root transv)) (vector-float*! (-> s5-0 lin-momentum) (-> s5-0 lin-velocity) (-> this info info mass)) (vector-reset! (-> s5-0 ang-momentum)) (vector-reset! (-> this lin-acceleration)) @@ -1372,7 +1362,7 @@ (let ((s4-0 (handle->process (-> this rider-array s5-0)))) (when (and s4-0 (focus-test? (the-as process-focusable s4-0) pilot-riding)) (vehicle-method-66 this (-> (the-as process-focusable s4-0) root trans) s5-0) - (set! (-> (the-as process-focusable s4-0) root transv quad) (-> this root transv quad)) + (vector-copy! (-> (the-as process-focusable s4-0) root transv) (-> this root transv)) (let ((f0-1 (the float (-> this info rider seat-array s5-0 angle)))) (quaternion-rotate-local-y! (-> (the-as process-focusable s4-0) root quat) (-> this root quat) f0-1) ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc index b73855e2010..f643163f14a 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc @@ -49,7 +49,7 @@ ) (init-vf0-vector) (logior! (-> this v-flags) (vehicle-flag impact)) - (set! (-> this impact-pos quad) (-> arg0 point quad)) + (vector-copy! (-> this impact-pos) (-> arg0 point)) (let ((s4-0 (new 'stack-no-clear 'matrix))) (matrix-inverse-of-rot-trans! (the-as matrix (-> s4-0 rvec)) (-> this rbody matrix)) (vector-matrix*! (-> this impact-local-pos) (-> this impact-pos) (the-as matrix (-> s4-0 rvec))) @@ -388,10 +388,10 @@ ) ) (when *target* - (set! (-> s5-0 vec0 quad) (-> *target* draw shadow-ctrl settings shadow-dir quad)) + (vector-copy! (-> s5-0 vec0) (-> *target* draw shadow-ctrl settings shadow-dir)) (let ((v1-75 (-> this draw shadow-ctrl settings shadow-dir))) (set! (-> s5-0 vec0 w) (-> v1-75 w)) - (set! (-> v1-75 quad) (-> s5-0 vec0 quad)) + (vector-copy! v1-75 (-> s5-0 vec0)) ) ) (let ((s4-0 (new 'stack-no-clear 'inline-array 'collide-query 2))) @@ -490,7 +490,7 @@ ) (set! (-> v1-96 action-mask) (collide-action solid)) ) - (set! (-> s4-0 0 start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> s4-0 0 start-pos) (-> this rbody position)) (vector-! (-> s4-0 0 move-dist) (the-as vector (-> s4-0 1 bbox)) (-> s4-0 0 start-pos)) (let ((f0-23 (fill-and-probe-using-line-sphere *collide-cache* (-> s4-0 0)))) (if (>= f0-23 0.0) @@ -498,11 +498,11 @@ ) ) ) - (set! (-> s3-0 0 saved-pt quad) (-> s4-0 1 bbox min quad)) + (vector-copy! (-> s3-0 0 saved-pt) (-> s4-0 1 bbox min)) (let ((v1-107 (-> s3-0 0 tracking))) (set! (-> v1-107 inv-mat rvec quad) (-> s4-0 1 best-other-tri vertex 0 quad)) - (set! (-> v1-107 inv-mat uvec quad) (-> s4-0 1 best-other-tri vertex 1 quad)) - (set! (-> v1-107 inv-mat fvec quad) (-> s4-0 1 best-other-tri vertex 2 quad)) + (vector-copy! (-> v1-107 inv-mat uvec) (-> s4-0 1 best-other-tri vertex 1)) + (vector-copy! (-> v1-107 inv-mat fvec) (-> s4-0 1 best-other-tri vertex 2)) ) ) ) @@ -532,18 +532,7 @@ (set! (-> a0-72 rvec z) -1.0) (set! (-> a0-72 rvec w) 1.0) ) - (let* ((a0-73 (-> v1-132 0)) - (t0-10 (-> this rbody matrix)) - (a1-37 (-> t0-10 rvec quad)) - (a2-24 (-> t0-10 uvec quad)) - (a3-12 (-> t0-10 fvec quad)) - (t0-11 (-> t0-10 trans quad)) - ) - (set! (-> a0-73 rvec quad) a1-37) - (set! (-> a0-73 uvec quad) a2-24) - (set! (-> a0-73 fvec quad) a3-12) - (set! (-> a0-73 trans quad) t0-11) - ) + (matrix-copy! (-> v1-132 0) (-> this rbody matrix)) (vector-rotate*! s5-1 (the-as vector (-> v1-132 1)) (-> v1-132 0)) ) (persist-with-delay @@ -628,7 +617,7 @@ (set! (-> s5-0 mat trans w) (-> s5-0 mat fvec x)) ) (set! (-> this water-height) (-> s5-0 mat trans w)) - (set! (-> s5-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 cquery start-pos) (-> this rbody position)) (vector-float*! (-> s5-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) (let ((v1-15 (-> s5-0 cquery))) (set! (-> v1-15 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) @@ -696,26 +685,15 @@ (defmethod clear-impulse-force-flag! ((this vehicle)) (with-pp (let ((v1-0 (new 'stack-no-clear 'matrix))) - (set! (-> v1-0 rvec quad) (-> this root transv quad)) + (vector-copy! (-> v1-0 rvec) (-> this root transv)) (vector-! (-> v1-0 uvec) (-> this rbody lin-velocity) (-> v1-0 rvec)) (vector-float*! (-> this lin-acceleration) (-> v1-0 uvec) (-> pp clock frames-per-second)) ) - (set! (-> this root transv quad) (-> this rbody lin-velocity quad)) + (vector-copy! (-> this root transv) (-> this rbody lin-velocity)) (quaternion-copy! (-> this root quat) (the-as quaternion (-> this rbody rot))) (rigid-body-control-method-25 (-> this rbody) (-> this root trans)) - (let* ((v1-11 (-> this node-list data 0 bone transform)) - (a3-0 (-> this rbody matrix)) - (a0-12 (-> a3-0 rvec quad)) - (a1-8 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-11 rvec quad) a0-12) - (set! (-> v1-11 uvec quad) a1-8) - (set! (-> v1-11 fvec quad) a2-1) - (set! (-> v1-11 trans quad) a3-1) - ) - (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (matrix-copy! (-> this node-list data 0 bone transform) (-> this rbody matrix)) + (vector-copy! (-> this node-list data 0 bone transform trans) (-> this root trans)) (vehicle-method-77 this) (rigid-body-object-method-30 this) (update-transforms (-> this root)) @@ -1108,7 +1086,7 @@ (init-rbody-impact-from-tshape! this (-> s5-0 0) arg2) (cond ((logtest? (attack-mask attacker-velocity) (-> arg1 mask)) - (set! (-> s5-0 0 velocity quad) (-> arg1 attacker-velocity quad)) + (vector-copy! (-> s5-0 0 velocity) (-> arg1 attacker-velocity)) ) (else (let ((s0-0 arg0)) @@ -1191,7 +1169,7 @@ (when (not (logtest? (vehicle-flag ignore-impulse) (-> this v-flags))) (impulse-handler this) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s5-0 0 velocity quad)) + (vector-copy! s3-1 (-> s5-0 0 velocity)) (vector-normalize! s3-1 1.0) (vector-float*! s3-1 s3-1 (-> s5-0 0 impulse)) (apply-impact! (-> this rbody) (the-as vector (-> s5-0 0)) s3-1) diff --git a/test/decompiler/reference/jak3/levels/city/vinroom/power-game_REF.gc b/test/decompiler/reference/jak3/levels/city/vinroom/power-game_REF.gc index 520f575240d..c743ec6490a 100644 --- a/test/decompiler/reference/jak3/levels/city/vinroom/power-game_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/vinroom/power-game_REF.gc @@ -903,7 +903,7 @@ (new 'static 'talker-speech-class :name "dax766" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -912,7 +912,7 @@ (new 'static 'talker-speech-class :name "dax767" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :neg #x1 :on-close #f @@ -1291,6 +1291,7 @@ ;; definition for method 11 of type power-game (defmethod init-from-entity! ((this power-game) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1405,7 +1406,7 @@ ;; definition for method 31 of type power-game ;; INFO: Used lq/sq (defmethod get-center-pos! ((this power-game) (arg0 vector) (arg1 float) (arg2 float)) - (set! (-> arg0 quad) (-> this corner 0 quad)) + (vector-copy! arg0 (-> this corner 0)) (+! (-> arg0 x) (* 16384.0 arg1)) (+! (-> arg0 z) (* 16384.0 arg2)) arg0 @@ -1538,19 +1539,19 @@ (cond ((zero? v1-0) (set! v0-0 arg0) - (set! (-> v0-0 quad) (-> (new 'static 'vector :z -1.0 :w 1.0) quad)) + (vector-copy! v0-0 (new 'static 'vector :z -1.0 :w 1.0)) ) ((= v1-0 1) (set! v0-0 arg0) - (set! (-> v0-0 quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + (vector-copy! v0-0 (new 'static 'vector :x 1.0 :w 1.0)) ) ((= v1-0 2) (set! v0-0 arg0) - (set! (-> v0-0 quad) (-> (new 'static 'vector :z 1.0 :w 1.0) quad)) + (vector-copy! v0-0 (new 'static 'vector :z 1.0 :w 1.0)) ) (else (set! v0-0 arg0) - (set! (-> v0-0 quad) (-> (new 'static 'vector :x -1.0 :w 1.0) quad)) + (vector-copy! v0-0 (new 'static 'vector :x -1.0 :w 1.0)) ) ) ) @@ -1580,7 +1581,7 @@ ;; INFO: Used lq/sq (defmethod power-game-method-42 ((this power-game) (arg0 vector) (arg1 int) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-copy! v1-0 arg0) (let ((f0-0 0.0) (f1-0 16.0) (f2-0 (-> v1-0 x)) @@ -1610,18 +1611,7 @@ (set! (-> s3-0 y) 0.0) (set! (-> s3-0 z) (cos (-> *cpad-list* cpads 0 stick0-dir))) (set! (-> s3-0 w) 0.0) - (let* ((s1-0 s2-0) - (a2-0 (matrix-local->world #t #f)) - (v1-4 (-> a2-0 rvec quad)) - (a0-4 (-> a2-0 uvec quad)) - (a1-2 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s1-0 rvec quad) v1-4) - (set! (-> s1-0 uvec quad) a0-4) - (set! (-> s1-0 fvec quad) a1-2) - (set! (-> s1-0 trans quad) a2-1) - ) + (matrix-copy! s2-0 (matrix-local->world #t #f)) (vector-matrix*! s3-0 s3-0 s2-0) (warp-vector-into-surface! gp-0 s3-0 *up-vector* s2-0) ) @@ -1752,7 +1742,7 @@ (s1-3 s0-6 (the-as bucket-id sv-128) sv-144 a3-6 (the-as rgba t0-1) t1-0 (the-as rgba t2-0)) ) ) - (set! (-> s2-0 quad) (-> s3-0 quad)) + (vector-copy! s2-0 s3-0) (+! arg3 -1) ) ) @@ -1797,7 +1787,7 @@ (power-game-method-35 this (-> s5-0 x) (-> s5-0 z) s4-1) (cond ((not (time-elapsed? (-> this game-start-time) (seconds 0.1))) - (set! (-> sv-56 cam-pos quad) (-> sv-52 quad)) + (vector-copy! (-> sv-56 cam-pos) sv-52) ) (else (if (< (fabs (-> sv-48 x)) 4.0) @@ -1986,7 +1976,7 @@ (s4-0 (-> this local)) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 quad) (-> this local quad)) + (vector-copy! s2-0 (-> this local)) (vector+float*! (-> this local) (-> this local) v1-13 (* (-> this speed) (seconds-per-frame))) (cond ((power-game-method-42 s5-0 s2-0 (-> this dir) (-> this dir)) @@ -2026,7 +2016,7 @@ (let ((f0-9 (-> s4-0 data s3-0))) (set! (-> s4-0 data s3-0) (the float (the int (+ 0.5 f0-9)))) ) - (set! (-> this turn-pos quad) (-> this local quad)) + (vector-copy! (-> this turn-pos) (-> this local)) (set! (-> this slide-lock) #f) ) ) @@ -2037,7 +2027,7 @@ (when (= (-> this local data s5-1) (-> this slide-dest data s5-1)) (set! (-> this slide-dir) -1) (when (>= (-> this slide-count) (-> this slide-dist)) - (set! (-> this turn-pos quad) (-> this local quad)) + (vector-copy! (-> this turn-pos) (-> this local)) (set! (-> this slide-count) 0) (set! (-> this slide-lock) #f) ) @@ -2163,7 +2153,7 @@ ((-> self slide-lock) ) ((power-game-method-40 gp-0 s5-0) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) 8.0) (when (power-game-method-42 gp-0 (-> self slide-dest) -1 s5-0) (power-game-method-39 gp-0 (-> self dir)) @@ -2180,7 +2170,7 @@ ) ) ((power-game-method-40 gp-0 s4-0) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) 8.0) (when (power-game-method-42 gp-0 (-> self slide-dest) -1 s4-0) (power-game-method-39 gp-0 (-> self dir)) @@ -2294,11 +2284,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 911 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 911)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 911)) ) ) @@ -2317,7 +2307,7 @@ (defbehavior power-game-player-init power-game-player ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-power-game-player" (the-as (pointer level) #f))) @@ -2411,7 +2401,7 @@ ((= s3-0 s2-0) ) ((or (and (> s0-0 0) (< s2-0 s3-0)) (and (< s0-0 0) (< s3-0 s2-0))) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s4-1 (-> self slide-dist)) (when (power-game-method-42 s5-1 (-> self slide-dest) -1 s1-0) @@ -2427,7 +2417,7 @@ ) ) ((or (and (> s0-0 0) (< s3-0 s2-0)) (and (< s0-0 0) (< s2-0 s3-0))) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s3-3 (-> self slide-dist)) (when (power-game-method-42 s5-1 (-> self slide-dest) -1 s4-0) @@ -2495,7 +2485,7 @@ (defbehavior power-game-chaser-init power-game-chaser ((arg0 vector) (arg1 entity-actor) (arg2 handle)) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-power-game-chaser" (the-as (pointer level) #f))) @@ -2648,7 +2638,7 @@ ) (cond ((rand-vu-percent? 0.01) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s4-1 (-> self slide-dist)) (when (power-game-method-42 gp-0 (-> self slide-dest) -1 s5-0) @@ -2665,7 +2655,7 @@ ) ) ((rand-vu-percent? 0.01) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s5-1 (-> self slide-dist)) (when (power-game-method-42 gp-0 (-> self slide-dest) -1 s4-0) @@ -2748,11 +2738,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 908 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 908)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 908)) ) ) @@ -2775,7 +2765,7 @@ (local-vars (v1-11 symbol)) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-power-game-switcher" (the-as (pointer level) #f))) @@ -2926,7 +2916,7 @@ ((= (-> self lane-target) s5-1) ) ((or (and (> s3-0 0) (< s5-1 (-> self lane-target))) (and (< s3-0 0) (< (-> self lane-target) s5-1))) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s3-1 (-> self slide-dist)) (when (power-game-method-42 s4-0 (-> self slide-dest) -1 s1-0) @@ -2943,7 +2933,7 @@ ) ) ((or (and (> s3-0 0) (< (-> self lane-target) s5-1)) (and (< s3-0 0) (< s5-1 (-> self lane-target)))) - (set! (-> self slide-dest quad) (-> self local quad)) + (vector-copy! (-> self slide-dest) (-> self local)) (set! (-> self slide-speed) (* 8.0 (the float (-> self slide-dist)))) (dotimes (s3-2 (-> self slide-dist)) (when (power-game-method-42 s4-0 (-> self slide-dest) -1 s2-0) @@ -3067,7 +3057,7 @@ (let ((f30-0 (you-suck-scale *game-info* #f 175))) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-power-game-zapper" (the-as (pointer level) #f))) @@ -3219,11 +3209,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 910 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 910)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 910)) ) ) @@ -3242,7 +3232,7 @@ (set! (-> self pickup-type) arg3) (process-entity-set! self arg1) (set! (-> self root) (the-as collide-shape (new 'process 'trsqv))) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (if (zero? arg3) (initialize-skeleton self @@ -3273,11 +3263,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 909 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 909)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 909)) ) ) @@ -3288,7 +3278,7 @@ (defstate hide (power-game) :virtual #t :trans (behavior () - (when (= (status-of-level-and-borrows *level* 'powergd #f) 'active) + (when (= (level-status? *level* 'powergd #f) 'active) (case (-> (get-current-task-event (-> self task)) action) (((game-task-action idle) (game-task-action talk)) (go-virtual idle) @@ -3845,7 +3835,7 @@ ) :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 diff --git a/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc index 12b198cde26..97ba0594524 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc @@ -326,7 +326,7 @@ (set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH)) (set! (-> s1-0 scale y) (/ arg1 METER_LENGTH)) (set! (-> s1-0 scale z) 1.0) - (set! (-> s2-2 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-copy! (-> s2-2 uvec) (new 'static 'vector :y 1.0 :w 1.0)) (vector-cross! (-> s2-2 fvec) (-> s2-2 rvec) (-> s2-2 uvec)) (vector-normalize! (-> s2-2 fvec) 1.0) (matrix->quaternion (-> s1-0 quat) s2-2) @@ -351,6 +351,7 @@ ;; definition for method 11 of type comb-field (defmethod init-from-entity! ((this comb-field) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this breach) #f) (set! (-> this hum-sound-id) (new 'static 'sound-id)) (set! (-> this pass) (res-lump-value arg0 'pickup-type pickup-type :time -1000000000.0)) diff --git a/test/decompiler/reference/jak3/levels/comb/comb-mood_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-mood_REF.gc index be0a516e6d9..6127dab995d 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-mood_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-mood_REF.gc @@ -254,16 +254,16 @@ ;; WARN: Return type mismatch vector vs none. (defun set-comb-field-color! ((arg0 vector)) (let ((v1-1 (-> *comb-field-texture-anim-array* array-data 0))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-1 data 0 start-color) arg0) + (vector-copy! (-> v1-1 data 0 end-color) arg0) + (vector-copy! (-> v1-1 data 1 start-color) arg0) + (vector-copy! (-> v1-1 data 1 end-color) arg0) ) (let ((v1-5 (-> *comb-field-texture-anim-array* array-data 1))) - (set! (-> v1-5 data 1 start-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 1 end-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 2 start-color quad) (-> arg0 quad)) - (set! (-> v1-5 data 2 end-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-5 data 1 start-color) arg0) + (vector-copy! (-> v1-5 data 1 end-color) arg0) + (vector-copy! (-> v1-5 data 2 start-color) arg0) + (vector-copy! (-> v1-5 data 2 end-color) arg0) ) (none) ) @@ -273,8 +273,8 @@ ;; WARN: Return type mismatch vector vs none. (defun set-comb-field-flash! ((arg0 vector)) (let ((v1-1 (-> *comb-field-texture-anim-array* array-data 1))) - (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) - (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) + (vector-copy! (-> v1-1 data 0 start-color) arg0) + (vector-copy! (-> v1-1 data 0 end-color) arg0) ) (none) ) @@ -302,7 +302,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc index 70cc503643c..bf488ade175 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc @@ -173,6 +173,7 @@ ;; definition for method 11 of type comb-pillar (defmethod init-from-entity! ((this comb-pillar) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -294,7 +295,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod set-attack-vel! ((this comb-pillar) (arg0 vector)) - (set! (-> this attack-vel quad) (-> arg0 quad)) + (vector-copy! (-> this attack-vel) arg0) (if (< 81920.0 (vector-length (-> this attack-vel))) (vector-normalize! (-> this attack-vel) 81920.0) ) @@ -522,6 +523,7 @@ ;; definition for method 11 of type comb-block (defmethod init-from-entity! ((this comb-block) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -634,7 +636,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod set-attack-vel! ((this comb-block) (arg0 vector)) - (set! (-> this attack-vel quad) (-> arg0 quad)) + (vector-copy! (-> this attack-vel) arg0) (if (< 81920.0 (vector-length (-> this attack-vel))) (vector-normalize! (-> this attack-vel) 81920.0) ) @@ -721,7 +723,7 @@ :code (behavior () (sound-play "sentry-explode") (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self node-list data 5 bone transform trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 40960.0) (set! (-> gp-1 scale) 1.0) @@ -917,9 +919,9 @@ (set! (-> gp-0 spans data v1-6 inner-random-offset-size) 4096.0) ) (set! (-> gp-0 span-pts-start data 0 quad) (-> arg0 quad)) - (set! (-> gp-0 span-pts-start data 2 quad) (-> arg0 quad)) - (set! (-> gp-0 span-pts-start data 1 quad) (-> arg1 quad)) - (set! (-> gp-0 span-pts-start data 3 quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 span-pts-start data 2) arg0) + (vector-copy! (-> gp-0 span-pts-start data 1) arg1) + (vector-copy! (-> gp-0 span-pts-start data 3) arg1) (set! (-> gp-0 spans data 0 random-offset-size-start) 0.0) (set! (-> gp-0 spans data 1 random-offset-size-start) 0.0) (set! (-> gp-0 spans data 2 random-offset-size-start) 0.0) @@ -937,6 +939,7 @@ ;; definition for method 11 of type comb-energy-ring (defmethod init-from-entity! ((this comb-energy-ring) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (the-as penetrate -1)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -1224,8 +1227,8 @@ (quaternion-rotate-local-y! s4-0 (-> this root quat) 16384.0) (quaternion->matrix s5-0 s4-0) ) - (set! (-> s5-0 trans quad) (-> this root trans quad)) - (set! (-> this plane quad) (-> s5-0 rvec quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) + (vector-copy! (-> this plane) (-> s5-0 rvec)) ) (set! (-> this plane w) (- (vector-dot (-> this plane) (-> this root trans)))) (update-transforms (-> this root)) @@ -1238,6 +1241,7 @@ ;; definition for method 11 of type comb-turbo (defmethod init-from-entity! ((this comb-turbo) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (init-fields! this) diff --git a/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc index f5118d51aff..450279d5789 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc @@ -31,7 +31,7 @@ (a1-4 (-> *part-id-table* 4241)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -84,7 +84,7 @@ (f28-1 (-> *part-id-table* 4239 init-specs 4 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 4239) s4-1 :origin-is-matrix #t) @@ -105,28 +105,28 @@ (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> s4-0 trans quad)) + (vector-copy! gp-0 (-> s4-0 trans)) (vector+! gp-0 gp-0 v1-1) (cond ((-> this hit-actor?) (sound-play "sentry-hit") (cond ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) ) ) ) ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) ) ) @@ -269,6 +269,7 @@ ;; definition for method 11 of type comb-sentry ;; INFO: Used lq/sq (defmethod init-from-entity! ((this comb-sentry) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -295,7 +296,7 @@ (the-as pair 0) ) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this up-dir quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-copy! (-> this up-dir) (new 'static 'vector :y 1.0 :w 1.0)) (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) (if (nonzero? (-> this path)) (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) @@ -407,7 +408,7 @@ (a1-3 (-> gp-0 vec)) (f0-0 (-> v1-2 position w)) ) - (set! (-> v1-2 position quad) (-> a1-3 quad)) + (vector-copy! (-> v1-2 position) a1-3) (set! (-> v1-2 position w) f0-0) ) 0 @@ -420,7 +421,7 @@ (a1-10 (-> gp-0 vec)) (f0-5 (-> v1-10 position w)) ) - (set! (-> v1-10 position quad) (-> a1-10 quad)) + (vector-copy! (-> v1-10 position) a1-10) (set! (-> v1-10 position w) f0-5) ) 0 @@ -441,30 +442,19 @@ (sound-play "sentry-fire") (let ((s5-1 (new 'stack-no-clear 'comb-sentry-stack-var0))) (set! (-> s5-1 byte0) 0) - (let* ((v1-1 (-> s5-1 mat)) - (a3-1 (-> this node-list data 0 bone transform)) - (a0-5 (-> a3-1 rvec quad)) - (a1-1 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-1 rvec quad) a0-5) - (set! (-> v1-1 uvec quad) a1-1) - (set! (-> v1-1 fvec quad) a2-1) - (set! (-> v1-1 trans quad) a3-2) - ) + (matrix-copy! (-> s5-1 mat) (-> this node-list data 0 bone transform)) (let ((v1-2 (new 'static 'inline-array vector 1 (new 'static 'vector :z 14336.0 :w 1.0)))) (vector-matrix*! (-> s5-1 vec2) (-> v1-2 (-> s5-1 byte0)) (-> s5-1 mat)) ) 0 - (set! (-> s5-1 vec3 quad) (-> s5-1 mat fvec quad)) + (vector-copy! (-> s5-1 vec3) (-> s5-1 mat fvec)) (vector-float*! (-> s5-1 vec4) (-> s5-1 vec3) 2048000.0) (set! (-> s5-1 params ent) (-> this entity)) (set! (-> s5-1 params charge) 1.0) (set! (-> s5-1 params options) (projectile-options)) (logclear! (-> s5-1 params options) (projectile-options po14 po15 po16)) (set! (-> s5-1 params pos quad) (-> s5-1 vec2 quad)) - (set! (-> s5-1 params vel quad) (-> s5-1 vec4 quad)) + (vector-copy! (-> s5-1 params vel) (-> s5-1 vec4)) (set! (-> s5-1 params notify-handle) (the-as handle #f)) (set! (-> s5-1 params owner-handle) (the-as handle #f)) (set! (-> s5-1 params target-handle) (the-as handle #f)) @@ -528,10 +518,10 @@ (set! (-> this should-attack) #t) ) (let ((v1-23 (new 'stack-no-clear 'matrix))) - (set! (-> v1-23 rvec quad) (-> s5-0 root trans quad)) - (set! (-> v1-23 uvec quad) (-> s5-0 root transv quad)) + (vector-copy! (-> v1-23 rvec) (-> s5-0 root trans)) + (vector-copy! (-> v1-23 uvec) (-> s5-0 root transv)) (vector+float*! (-> this target-pos) (-> v1-23 rvec) (-> v1-23 uvec) 0.1) - (set! (-> v1-23 fvec quad) (-> s5-0 node-list data 0 bone transform fvec quad)) + (vector-copy! (-> v1-23 fvec) (-> s5-0 node-list data 0 bone transform fvec)) (vector-! (-> v1-23 trans) (-> this root trans) (-> v1-23 rvec)) (set! (-> this target-dist) (vector-dot (-> v1-23 fvec) (-> v1-23 trans))) (let* ((v1-24 (-> v1-23 trans)) @@ -566,11 +556,11 @@ (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 5))) (vector-! (-> s5-1 0) (-> this target-pos) (-> this root trans)) (vector-normalize! (-> s5-1 0) 1.0) - (set! (-> s5-1 1 quad) (-> this up-dir quad)) + (vector-copy! (-> s5-1 1) (-> this up-dir)) (set! (-> s5-1 4 x) (vector-dot (-> s5-1 0) (-> s5-1 1))) (vector+float*! (-> s5-1 1) (-> s5-1 1) (-> s5-1 0) (- (-> s5-1 4 x))) (vector-normalize! (-> s5-1 1) 1.0) - (set! (-> this up-dir quad) (-> s5-1 1 quad)) + (vector-copy! (-> this up-dir) (-> s5-1 1)) (forward-up-nopitch->quaternion (the-as quaternion (-> s5-1 2)) (-> s5-1 0) (-> s5-1 1)) (+! (-> this angle) (* (-> this spin) (seconds-per-frame))) (set! (-> this angle) (the float (sar (shl (the int (-> this angle)) 48) 48))) @@ -647,7 +637,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod set-attack-vel! ((this comb-sentry) (arg0 vector)) - (set! (-> this attack-vel quad) (-> arg0 quad)) + (vector-copy! (-> this attack-vel) arg0) (if (< 81920.0 (vector-length (-> this attack-vel))) (vector-normalize! (-> this attack-vel) 81920.0) ) @@ -759,11 +749,11 @@ (sound-play "sentry-expl") (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217)) ) ) diff --git a/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc index 2fe002f3051..ad93601aa36 100644 --- a/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc @@ -299,24 +299,20 @@ (set! (-> this end-sphere quad) (-> (new 'static 'vector :x 14454784.0 :y -163840.0 :z 607027.2 :w 409600.0) quad) ) - (set! (-> this end-plane quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + (vector-copy! (-> this end-plane) (new 'static 'vector :x 1.0 :w 1.0)) (set! (-> this end-plane w) (- (vector-dot (-> this end-plane) (the-as vector (-> this end-sphere))))) (set! (-> this intro-sequence) (the-as basic #t)) (set! (-> this intro-sphere quad) (-> (new 'static 'vector :x 1083801.6 :y -81920.0 :z 45056.0 :w 122880.0) quad) ) - (set! (-> this intro-target quad) (-> this intro-sphere quad)) + (vector-copy! (-> this intro-target) (-> this intro-sphere)) (set! (-> this outro-sequence) (the-as basic #t)) (set! (-> this outro-sphere quad) (-> (new 'static 'vector :x 13798605.0 :y -226099.2 :z 614400.0 :w 491520.0) quad) ) - (set! (-> this outro-target quad) - (-> (new 'static 'vector :x 13798605.0 :y -4096000.0 :z 614400.0 :w 1.0) quad) - ) - (set! (-> this outro-target2 quad) - (-> (new 'static 'vector :x 13549568.0 :y -225280.0 :z 614400.0 :w 1.0) quad) - ) - (set! (-> this outro-plane2 quad) (-> this end-plane quad)) + (vector-copy! (-> this outro-target) (new 'static 'vector :x 13798605.0 :y -4096000.0 :z 614400.0 :w 1.0)) + (vector-copy! (-> this outro-target2) (new 'static 'vector :x 13549568.0 :y -225280.0 :z 614400.0 :w 1.0)) + (vector-copy! (-> this outro-plane2) (-> this end-plane)) (set! (-> this outro-plane2 w) (- (vector-dot (-> this outro-plane2) (-> this outro-target2)))) 0 (none) @@ -361,7 +357,7 @@ (set! (-> this end-sphere quad) (-> (new 'static 'vector :x 68403.2 :y -14056653.0 :z -3796582.5 :w 409600.0) quad) ) - (set! (-> this end-plane quad) (-> (new 'static 'vector :x -0.0162 :y -0.3505 :z -0.9364 :w 1.0) quad)) + (vector-copy! (-> this end-plane) (new 'static 'vector :x -0.0162 :y -0.3505 :z -0.9364 :w 1.0)) (set! (-> this end-plane w) (- (vector-dot (-> this end-plane) (the-as vector (-> this end-sphere))))) (set-blackout-frames (seconds 0.3)) 0 diff --git a/test/decompiler/reference/jak3/levels/comb/combx-obs_REF.gc b/test/decompiler/reference/jak3/levels/comb/combx-obs_REF.gc index 0682ae9b472..2f7fe9dd774 100644 --- a/test/decompiler/reference/jak3/levels/comb/combx-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/combx-obs_REF.gc @@ -106,6 +106,7 @@ ;; definition for method 11 of type combx-elevator (defmethod init-from-entity! ((this combx-elevator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (setup-skel-and-draw-masks this) @@ -219,7 +220,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc index 31c37ba6e45..d3742672c50 100644 --- a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc @@ -107,6 +107,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this pre-sled) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (vector+! (-> this root trans) (-> this root trans) (new 'static 'vector :w 1.0)) @@ -124,7 +125,7 @@ (set! (-> s4-0 guard-type) (the-as uint 11)) (set! (-> s4-0 entity) arg0) (vector-reset! (-> s4-0 velocity)) - (set! (-> s4-0 position quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 position) (-> this root trans)) (quaternion-copy! (-> s4-0 rotation) (-> this root quat)) (vehicle-spawn (vehicle-type h-sled) s4-0) ) @@ -163,7 +164,7 @@ ) ) (if (< (-> s4-0 byte0) 2) - (set! (-> s4-0 vec (-> s4-0 byte0) quad) (-> s4-0 vec 2 quad)) + (vector-copy! (-> s4-0 vec (-> s4-0 byte0)) (-> s4-0 vec 2)) ) (dotimes (s3-0 2) (let ((s2-0 (-> s4-0 vec1 s3-0))) @@ -174,7 +175,7 @@ (set! f0-5 (* -1.0 f0-5)) ) (if (>= f0-5 0.866) - (set! (-> arg0 quad) (-> s2-0 quad)) + (vector-copy! arg0 s2-0) ) ) ) @@ -218,7 +219,7 @@ (a1-4 (-> *part-id-table* 4235)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -269,7 +270,7 @@ (-> *part-id-table* 4233 init-specs 3 initial-valuef) (-> *part-id-table* 4233 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (launch-particles (-> *part-id-table* 4233) s4-1 :origin-is-matrix #t) ) ) @@ -286,15 +287,15 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector-copy! v1-2 (-> gp-0 trans)) (vector+! v1-2 v1-2 a0-3) (cond ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) ) ) @@ -337,7 +338,7 @@ (* -1.01 (vector-dot arg3 (-> arg0 surface-normal))) ) (vector-normalize! (-> s4-0 0) 1024000.0) - (set! (-> arg2 quad) (-> s4-0 0 quad)) + (vector-copy! arg2 (-> s4-0 0)) ) (-> arg0 status) ) @@ -445,7 +446,7 @@ (set! (-> this damage) 1.0) (set! (-> this timeout) (seconds 1)) (set! (-> this sound-id) (new-sound-id)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (none) ) @@ -1027,18 +1028,7 @@ (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) (let ((s4-1 (new 'stack-no-clear 'comb-sentry-stack-var0))) (set! (-> s4-1 byte0) (-> this i-barrel)) - (let* ((v1-5 (-> s4-1 mat)) - (a3-1 (-> this rbody matrix)) - (a0-4 (-> a3-1 rvec quad)) - (a1-1 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-5 rvec quad) a0-4) - (set! (-> v1-5 uvec quad) a1-1) - (set! (-> v1-5 fvec quad) a2-1) - (set! (-> v1-5 trans quad) a3-2) - ) + (matrix-copy! (-> s4-1 mat) (-> this rbody matrix)) (let ((v1-6 (new 'static 'inline-array vector 2 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) @@ -1063,7 +1053,7 @@ (set! (-> s4-1 params options) (projectile-options)) (logclear! (-> s4-1 params options) (projectile-options po14 po15 po16)) (set! (-> s4-1 params pos quad) (-> s4-1 vec2 quad)) - (set! (-> s4-1 params vel quad) (-> s4-1 vec4 quad)) + (vector-copy! (-> s4-1 params vel) (-> s4-1 vec4)) (set! (-> s4-1 params notify-handle) (the-as handle #f)) (set! (-> s4-1 params owner-handle) (the-as handle #f)) (set! (-> s4-1 params target-handle) (the-as handle #f)) @@ -1229,7 +1219,7 @@ (set! (-> this draw lod-set lod 3 dist) 2457600.0) (set! (-> this rider-hand-joint-array 0) 3) (set! (-> this rider-hand-joint-array 1) 3) - (set! (-> this path-pos quad) (-> this root trans quad)) + (vector-copy! (-> this path-pos) (-> this root trans)) (set! (-> this shoot-delay) (the-as uint 30)) (set! (-> this in-tunnel) #f) (dotimes (s5-1 4) @@ -1300,14 +1290,14 @@ (let ((gp-0 (new 'stack-no-clear 'h-sled-physics-work))) (mem-set32! (the-as pointer (-> gp-0 mat)) 6 0) (set! (-> gp-0 p-body y) (seconds-per-frame)) - (set! (-> gp-0 mat fvec quad) (-> this rbody position quad)) - (set! (-> gp-0 mat trans quad) (-> this rbody lin-velocity quad)) - (set! (-> gp-0 steering-axis quad) (-> this rbody matrix fvec quad)) - (set! (-> gp-0 local-pos quad) (-> this rbody matrix rvec quad)) + (vector-copy! (-> gp-0 mat fvec) (-> this rbody position)) + (vector-copy! (-> gp-0 mat trans) (-> this rbody lin-velocity)) + (vector-copy! (-> gp-0 steering-axis) (-> this rbody matrix fvec)) + (vector-copy! (-> gp-0 local-pos) (-> this rbody matrix rvec)) (set! (-> gp-0 tmp x) (vector-length (-> gp-0 mat trans))) (set! (-> gp-0 p-body x) (vector-dot (-> gp-0 mat trans) (-> gp-0 steering-axis))) (set! (-> gp-0 tmp z) (-> this ai-target-speed)) - (set! (-> gp-0 world-pos quad) (-> this ai-target-pos quad)) + (vector-copy! (-> gp-0 world-pos) (-> this ai-target-pos)) (vector-! (-> gp-0 lift-dir) (-> gp-0 world-pos) (-> gp-0 mat fvec)) (set! (-> gp-0 tmp w) (* 0.00036621094 @@ -1354,7 +1344,7 @@ ;; definition for method 48 of type h-sled ;; INFO: Used lq/sq (defmethod on-impact ((this h-sled) (arg0 rigid-body-impact)) - (set! (-> this impact-normal quad) (-> arg0 normal quad)) + (vector-copy! (-> this impact-normal) (-> arg0 normal)) (call-parent-method this arg0) (none) ) @@ -1404,7 +1394,7 @@ ) (('in-tunnel) (set! (-> this in-tunnel) (the-as symbol (-> arg3 param 0))) - (set! (-> this whoosh-pos quad) (-> this root trans quad)) + (vector-copy! (-> this whoosh-pos) (-> this root trans)) (set! v0-4 (current-time)) (set! (-> this whoosh-time) (the-as time-frame v0-4)) v0-4 @@ -1434,15 +1424,15 @@ (let ((a0-4 (camera-matrix))) (vector-float*! (-> s5-0 rvec) (-> a0-4 uvec) -1.0) ) - (set! (-> s5-0 uvec quad) (-> this tunnel-dir quad)) + (vector-copy! (-> s5-0 uvec) (-> this tunnel-dir)) (vector+float*! (-> s5-0 rvec) (-> s5-0 rvec) (-> s5-0 uvec) (- (vector-dot (-> s5-0 rvec) (-> s5-0 uvec)))) (vector-normalize! (-> s5-0 rvec) 1.0) - (set! (-> this gravity-dir quad) (-> s5-0 rvec quad)) + (vector-copy! (-> this gravity-dir) (-> s5-0 rvec)) ) (if (or (not (logtest? (-> this v-flags) (vehicle-flag on-ground))) (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) ) - (set! (-> this gravity-dir quad) (-> (new 'static 'vector :y -1.0 :w 1.0) quad)) + (vector-copy! (-> this gravity-dir) (new 'static 'vector :y -1.0 :w 1.0)) ) (cond ((logtest? (vehicle-flag ignition) (-> this v-flags)) @@ -1552,7 +1542,7 @@ (set! (-> s5-0 fvec x) (fmax 0.0 (fmin 2.0 (* 0.0000030517579 (vector-dot (-> this tunnel-dir) (-> this root transv))))) ) - (set! (-> s5-0 uvec quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 uvec) (-> this root trans)) (vector-! (-> s5-0 rvec) (-> s5-0 uvec) (-> this whoosh-pos)) (when (< 131072.0 (vector-dot (-> this tunnel-dir) (-> s5-0 rvec))) (sound-play-by-name @@ -1564,7 +1554,7 @@ (sound-group) #t ) - (set! (-> this whoosh-pos quad) (-> s5-0 uvec quad)) + (vector-copy! (-> this whoosh-pos) (-> s5-0 uvec)) (set-time! (-> this whoosh-time)) ) (set! (-> s5-0 fvec x) @@ -1693,21 +1683,21 @@ (let ((v1-18 (-> this info physics-model lift-thruster-array s1-0)) (s0-0 (-> (the-as h-sled-physics-work arg1) probe-work-array s1-0)) ) - (set! (-> s0-0 local-pos quad) (-> v1-18 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-18 rot quad)) + (vector-copy! (-> s0-0 local-pos) (-> v1-18 local-pos)) + (vector-copy! (-> s0-0 local-normal) (-> v1-18 rot)) (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> (the-as h-sled-physics-work arg1) mat)) - (set! (-> s0-0 probe-pos quad) (-> s0-0 world-pos quad)) + (vector-copy! (-> s0-0 probe-pos) (-> s0-0 world-pos)) (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) (vector-reset! (-> s0-0 ground-normal)) (vector-reset! (-> s0-0 u-dir)) (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos)) (set! (-> s0-0 probe-uu) (probe-using-line-sphere *collide-cache* s2-0)) (cond ((and (>= (-> s0-0 probe-uu) 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) (logclear! (-> this v-flags) (vehicle-flag in-air)) (logior! (-> this v-flags) (vehicle-flag on-ground)) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) + (vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal)) (vector+! (-> this sum-ground-normal) (-> this sum-ground-normal) (-> s0-0 ground-normal)) (sled-find-mesh-dir (-> s0-0 u-dir) (-> this path-dir) (-> s2-0 best-other-tri)) ) @@ -1726,7 +1716,7 @@ ) ) ) - (set! (-> this prev-tunnel-dir quad) (-> this tunnel-dir quad)) + (vector-copy! (-> this prev-tunnel-dir) (-> this tunnel-dir)) (vector-reset! (-> this tunnel-dir)) (dotimes (v1-55 (-> this info physics-model lift-thruster-count)) (let ((a2-5 (-> (the-as h-sled-physics-work arg1) probe-work-array v1-55))) @@ -1743,7 +1733,7 @@ (.mov v1-59 vf1) (if (< f0-9 v1-59) (vector-normalize! (-> this tunnel-dir) 1.0) - (set! (-> this tunnel-dir quad) (-> this path-dir quad)) + (vector-copy! (-> this tunnel-dir) (-> this path-dir)) ) ) (let ((f0-10 0.0)) @@ -1755,7 +1745,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-63 vf1) (when (< f0-10 v1-63) - (set! (-> this normal-dir quad) (-> this sum-ground-normal quad)) + (vector-copy! (-> this normal-dir) (-> this sum-ground-normal)) (vector-normalize! (-> this normal-dir) 1.0) (vector-float*! (-> this gravity-dir) (-> this normal-dir) -1.0) (vector-cross! (-> this side-dir) (-> this normal-dir) (-> this tunnel-dir)) @@ -1771,8 +1761,8 @@ ) (dotimes (s2-2 (-> this info physics-model lift-thruster-count)) (let ((v1-78 (-> (the-as h-sled-physics-work arg1) probe-work-array s2-2))) - (set! (-> (the-as h-sled-physics-work arg1) world-pos quad) (-> v1-78 world-pos quad)) - (set! (-> (the-as h-sled-physics-work arg1) velocity quad) (-> v1-78 velocity quad)) + (vector-copy! (-> (the-as h-sled-physics-work arg1) world-pos) (-> v1-78 world-pos)) + (vector-copy! (-> (the-as h-sled-physics-work arg1) velocity) (-> v1-78 velocity)) (let ((s1-1 (new 'stack-no-clear 'vector))) (when (< (-> v1-78 probe-uu) 1.0) (set! (-> s1-1 x) (- 0.5 (-> v1-78 probe-uu))) @@ -1843,7 +1833,7 @@ (set! (-> s1-0 fvec x) (path-control-method-24 (-> this path) (-> s3-0 position))) (displacement-between-two-points-normalized! (-> this path) (-> s1-0 rvec) (-> s1-0 fvec x)) (get-point-in-path! (-> this path) (-> s1-0 uvec) (-> s1-0 fvec x) 'interp) - (set! (-> this path-pos quad) (-> s1-0 uvec quad)) + (vector-copy! (-> this path-pos) (-> s1-0 uvec)) (vector-float*! (-> this path-dir) (-> s1-0 rvec) -1.0) ) 0 @@ -1856,14 +1846,14 @@ (dotimes (v1-20 4) (let ((a0-15 (-> s4-0 probe-work-array v1-20))) (if (< (-> a0-15 probe-uu) 1.0) - (set! (-> this ground-pos-array v1-20 quad) (-> a0-15 ground-pos quad)) + (vector-copy! (-> this ground-pos-array v1-20) (-> a0-15 ground-pos)) ) ) ) (let ((s1-1 (new 'stack-no-clear 'matrix))) - (set! (-> s1-1 fvec quad) (-> s3-0 matrix fvec quad)) - (set! (-> s1-1 uvec quad) (-> s3-0 matrix uvec quad)) - (set! (-> s1-1 trans quad) (-> s3-0 matrix rvec quad)) + (vector-copy! (-> s1-1 fvec) (-> s3-0 matrix fvec)) + (vector-copy! (-> s1-1 uvec) (-> s3-0 matrix uvec)) + (vector-copy! (-> s1-1 trans) (-> s3-0 matrix rvec)) (vector-! (-> s1-1 rvec) (-> this tunnel-dir) (-> s1-1 fvec)) (vector+float*! (-> s1-1 rvec) (-> s1-1 rvec) (-> s1-1 uvec) (- (vector-dot (-> s1-1 rvec) (-> s1-1 uvec)))) (vector+float*! (-> s4-0 world-pos) (-> s3-0 position) (-> s1-1 fvec) 4096.0) @@ -1879,8 +1869,8 @@ ) (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) (let ((v1-39 (new 'stack-no-clear 'matrix))) - (set! (-> v1-39 rvec quad) (-> s3-0 matrix rvec quad)) - (set! (-> v1-39 rvec quad) (-> this side-dir quad)) + (vector-copy! (-> v1-39 rvec) (-> s3-0 matrix rvec)) + (vector-copy! (-> v1-39 rvec) (-> this side-dir)) (set! (-> v1-39 uvec w) (vector-dot (-> v1-39 rvec) (-> s3-0 lin-velocity))) (set! (-> v1-39 uvec z) (* (fabs (-> v1-39 uvec w)) (-> s2-0 info mass) (/ 1.0 arg0))) (set! (-> v1-39 uvec y) @@ -1916,7 +1906,7 @@ (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) (when (logtest? (vehicle-flag ignition) (-> this v-flags)) (vector-matrix*! (-> s4-0 world-pos) (-> s2-0 physics-model engine-thrust-local-pos) (-> s4-0 mat)) - (set! (-> s4-0 dir quad) (-> s4-0 mat fvec quad)) + (vector-copy! (-> s4-0 dir) (-> s4-0 mat fvec)) (let ((f0-42 (* (-> this engine-thrust) (-> s2-0 handling max-engine-thrust) (-> s2-0 info mass)))) (vector-float*! (-> s4-0 force) (-> s4-0 dir) f0-42) ) @@ -1936,7 +1926,7 @@ ) (apply-impact! s3-0 (-> s4-0 world-pos) (-> s4-0 force)) ) - (set! (-> s4-0 dir quad) (-> this tunnel-dir quad)) + (vector-copy! (-> s4-0 dir) (-> this tunnel-dir)) (let ((f0-47 (vector-dot (-> s4-0 dir) (-> s3-0 lin-velocity)))) (vector-float*! (-> s4-0 force) @@ -1946,18 +1936,18 @@ ) (add-force! s3-0 (-> s4-0 force)) ) - (set! (-> s4-0 local-pos quad) (-> (new 'static 'vector :z -16384.0 :w 1.0) quad)) + (vector-copy! (-> s4-0 local-pos) (new 'static 'vector :z -16384.0 :w 1.0)) (vector-matrix*! (-> s4-0 world-pos) (-> s4-0 local-pos) (-> s4-0 mat)) (rigid-body-control-method-23 s3-0 (-> s4-0 world-pos) (-> s4-0 velocity)) (vector-reset! (-> s4-0 force)) - (set! (-> s4-0 dir quad) (-> s4-0 mat uvec quad)) + (vector-copy! (-> s4-0 dir) (-> s4-0 mat uvec)) (vector+float*! (-> s4-0 force) (-> s4-0 force) (-> s4-0 dir) (* -1.0 (vector-dot (-> s4-0 dir) (-> s4-0 velocity))) ) - (set! (-> s4-0 dir quad) (-> s4-0 mat rvec quad)) + (vector-copy! (-> s4-0 dir) (-> s4-0 mat rvec)) (vector+float*! (-> s4-0 force) (-> s4-0 force) @@ -1995,7 +1985,7 @@ (disable-physics! self) (rigid-body-object-method-43 self) (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) @@ -2070,18 +2060,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'h-sled-stack-var1))) - (let* ((v1-0 (-> s5-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-3 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-3) - (set! (-> v1-0 uvec quad) a1-0) - (set! (-> v1-0 fvec quad) a2-0) - (set! (-> v1-0 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat) (-> this node-list data 0 bone transform)) (let ((s4-0 (new 'static 'inline-array vector 8 (new 'static 'vector :x 6144.0 :y 4096.0 :z -20480.0 :w 1.0) (new 'static 'vector :x -6144.0 :y 4096.0 :z -20480.0 :w 1.0) @@ -2106,7 +2085,7 @@ (a1-3 (-> s5-0 vec0)) (f0-0 (-> v1-7 position w)) ) - (set! (-> v1-7 position quad) (-> a1-3 quad)) + (vector-copy! (-> v1-7 position) a1-3) (set! (-> v1-7 position w) f0-0) ) 0 @@ -2132,7 +2111,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov a0-13 vf1) (when (< f0-8 a0-13) - (set! (-> s5-0 mat trans quad) (-> v1-21 quad)) + (vector-copy! (-> s5-0 mat trans) v1-21) (spawn-from-mat (-> this parts s4-1) (-> s5-0 mat)) ) ) diff --git a/test/decompiler/reference/jak3/levels/comb/pecker/pecker-ingame_REF.gc b/test/decompiler/reference/jak3/levels/comb/pecker/pecker-ingame_REF.gc index ed4990acb10..6c97811ef0a 100644 --- a/test/decompiler/reference/jak3/levels/comb/pecker/pecker-ingame_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/pecker/pecker-ingame_REF.gc @@ -110,6 +110,7 @@ ;; definition for method 11 of type pecker-ingame (defmethod init-from-entity! ((this pecker-ingame) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((v1-1 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (cond ((zero? v1-1) @@ -139,7 +140,3 @@ (set! (-> this path-u) 0.0) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/railx-obs_REF.gc b/test/decompiler/reference/jak3/levels/comb/railx-obs_REF.gc index 052aabec373..222174d1fac 100644 --- a/test/decompiler/reference/jak3/levels/comb/railx-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/comb/railx-obs_REF.gc @@ -46,6 +46,7 @@ ;; definition for method 11 of type rail-warp-gate (defmethod init-from-entity! ((this rail-warp-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -645,7 +646,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc b/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc index cfce9277a9b..2f5d27a1524 100644 --- a/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc +++ b/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc @@ -206,19 +206,8 @@ ;; INFO: Used lq/sq (defmethod ladder-method-25 ((this ladder) (arg0 matrix) (arg1 float)) (let ((s4-0 (-> this node-list data 4 bone transform)) - (s3-0 (new 'stack-no-clear 'matrix)) + (s3-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> this node-list data 5 bone transform))) ) - (let* ((a2-1 (-> this node-list data 5 bone transform)) - (v1-4 (-> a2-1 rvec quad)) - (a0-1 (-> a2-1 uvec quad)) - (a1-1 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> s3-0 rvec quad) v1-4) - (set! (-> s3-0 uvec quad) a0-1) - (set! (-> s3-0 fvec quad) a1-1) - (set! (-> s3-0 trans quad) a2-2) - ) (vector+! (-> s3-0 trans) (-> s3-0 trans) @@ -237,6 +226,7 @@ ;; definition for method 11 of type ladder (defmethod init-from-entity! ((this ladder) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (init-skel! this) diff --git a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-shot_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-shot_REF.gc index 7fe825e1841..56e57c09884 100644 --- a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-shot_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-shot_REF.gc @@ -346,11 +346,11 @@ (defmethod projectile-method-26 ((this ashelin-shot)) (cond ((logtest? (-> *part-group-id-table* 222 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 222)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 222)) ) ) @@ -415,7 +415,7 @@ (let ((v1-9 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-5 (-> arg0 hit-pos)) ) - (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector-copy! a1-5 (-> s5-0 trans)) (vector+! a1-5 a1-5 v1-9) (move-to-point! (-> arg0 root) a1-5) ) @@ -492,14 +492,10 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this ashelin-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 307200.0) (set! (-> this move) ashelin-shot-move) (set! (-> this timeout) (seconds 1.335)) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-states_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-states_REF.gc index 93c5ad0b6f0..cb3d83dd5ac 100644 --- a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-states_REF.gc @@ -372,7 +372,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 center quad)) + (vector-copy! (-> a0-0 target-pos) (-> v1-1 center)) ) 0 (nav-enemy-travel-post) @@ -458,7 +458,7 @@ (nav-enemy-method-178 self) (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (if (not (handle->process (-> self focus handle))) - (go-best-state self) + (go-state-for-focused self) ) (set! (-> self travel-anim-interp) 0.0) ) @@ -468,7 +468,7 @@ :code (behavior () (bot-method-235 self #t) (if (or (not (bot-method-226 self)) (not (ashelin-method-247 self #f))) - (go-best-state self) + (go-state-for-focused self) ) (let ((v1-12 (ja-group))) (if (and v1-12 (or (= v1-12 ashelin-standing-idle-ja) (= v1-12 ashelin-standing-fire-ja))) @@ -496,7 +496,7 @@ (ashelin-method-256 self) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -549,7 +549,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-6 quad)) + (vector-copy! (-> gp-0 target-pos) v1-6) ) 0 (nav-enemy-travel-post) @@ -609,7 +609,7 @@ (let ((a0-14 (-> self nav state)) (v1-33 gp-1) ) - (set! (-> a0-14 heading quad) (-> v1-33 quad)) + (vector-copy! (-> a0-14 heading) v1-33) ) 0 (let ((v1-36 (-> self nav))) @@ -639,7 +639,7 @@ (ja-no-eval :group! ashelin-back-spring-loop-ja :num! (seek! max 1.4) :frame-num 0.0) (until (ja-done? 0) (let ((a1-12 (-> self nav state))) - (set! (-> gp-1 quad) (-> a1-12 heading quad)) + (vector-copy! gp-1 (-> a1-12 heading)) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -671,7 +671,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -679,7 +679,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -738,7 +738,7 @@ (let ((a0-14 (-> self nav state)) (v1-31 gp-1) ) - (set! (-> a0-14 heading quad) (-> v1-31 quad)) + (vector-copy! (-> a0-14 heading) v1-31) ) 0 (let ((v1-34 (-> self nav))) @@ -768,7 +768,7 @@ (ja-no-eval :group! ashelin-cartwheel-left-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((a1-11 (-> self nav state))) - (set! (-> gp-1 quad) (-> a1-11 heading quad)) + (vector-copy! gp-1 (-> a1-11 heading)) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -794,7 +794,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -802,7 +802,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -861,7 +861,7 @@ (let ((a0-14 (-> self nav state)) (v1-31 gp-1) ) - (set! (-> a0-14 heading quad) (-> v1-31 quad)) + (vector-copy! (-> a0-14 heading) v1-31) ) 0 (let ((v1-34 (-> self nav))) @@ -891,7 +891,7 @@ (ja-no-eval :group! ashelin-tumble-right-loop-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((a1-11 (-> self nav state))) - (set! (-> gp-1 quad) (-> a1-11 heading quad)) + (vector-copy! gp-1 (-> a1-11 heading)) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -917,7 +917,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 (-> self nav state)) @@ -925,7 +925,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -974,7 +974,7 @@ (set! (-> self enemy-flags) v1-11) (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) (logclear! (-> self focus-status) (focus-status hit)) - (go-best-state self) + (go-state-for-focused self) ) ) diff --git a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash_REF.gc index e3d3f2cef23..cd6ec86ca43 100644 --- a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash_REF.gc @@ -184,34 +184,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 57344.0 - :knocked-soft-vxz-hi 57344.0 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 81920.0 - :knocked-medium-vxz-lo 57344.0 - :knocked-medium-vxz-hi 57344.0 - :knocked-medium-vy-lo 81920.0 - :knocked-medium-vy-hi 81920.0 - :knocked-hard-vxz-lo 57344.0 - :knocked-hard-vxz-hi 57344.0 - :knocked-hard-vy-lo 81920.0 - :knocked-hard-vy-hi 81920.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 57344.0 - :knocked-yellow-vxz-hi 57344.0 - :knocked-yellow-vy-lo 81920.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 57344.0 - :knocked-red-vxz-hi 57344.0 - :knocked-red-vy-lo 81920.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 40960.0 + :knocked-soft-vxz-lo (meters 14) + :knocked-soft-vxz-hi (meters 14) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 20) + :knocked-medium-vxz-lo (meters 14) + :knocked-medium-vxz-hi (meters 14) + :knocked-medium-vy-lo (meters 20) + :knocked-medium-vy-hi (meters 20) + :knocked-hard-vxz-lo (meters 14) + :knocked-hard-vxz-hi (meters 14) + :knocked-hard-vy-lo (meters 20) + :knocked-hard-vy-hi (meters 20) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 14) + :knocked-yellow-vxz-hi (meters 14) + :knocked-yellow-vy-lo (meters 20) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 14) + :knocked-red-vxz-hi (meters 14) + :knocked-red-vy-lo (meters 20) + :knocked-red-vy-hi (meters 20) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 10) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -252,6 +252,7 @@ ;; definition for method 66 of type ashelin (defmethod get-penetrated-by ((this ashelin)) + "Figure out the penetrated-by mask for this process." (let* ((t9-0 (method-of-type bot get-penetrated-by)) (v0-0 (t9-0 this)) ) @@ -291,14 +292,15 @@ ;; definition for method 112 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod get-incoming-attack! ((this ashelin) - (arg0 process-drawable) - (arg1 event-message-block) - (arg2 penetrate) - (arg3 attack-info) - (arg4 touching-shapes-entry) - ) - (let ((t9-0 (method-of-type bot get-incoming-attack!))) +(defmethod handle-incoming-attack! ((this ashelin) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + "Set up this enemy to handle an incoming attack event." + (let ((t9-0 (method-of-type bot handle-incoming-attack!))) (t9-0 this arg0 arg1 arg2 arg3 arg4) ) (if (!= (-> this incoming knocked-type) (knocked-type blue-shot)) @@ -308,7 +310,8 @@ ) ;; definition for method 110 of type ashelin -(defmethod send-attack ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (if (and (= (-> arg0 type) target) (-> this next-state) (let ((v1-4 (-> this next-state name))) @@ -316,12 +319,13 @@ ) ) #f - ((method-of-type bot send-attack) this arg0 arg1 arg2) + ((method-of-type bot send-attack-from-tshape) this arg0 arg1 arg2) ) ) ;; definition for method 106 of type ashelin (defmethod find-best-focus ((this ashelin)) + "Search for the best thing to focus on." (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -404,7 +408,7 @@ ) (cond (s5-1 - (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (focus-on! (-> this focus) (the-as process-focusable s5-1) this) (if (and (logtest? (-> this bot-flags) (bot-flag attacked)) (!= (-> s5-1 type) target)) (logclear! (-> this bot-flags) (bot-flag attacked)) ) @@ -436,6 +440,7 @@ ;; definition for method 120 of type ashelin ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this ashelin)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -492,6 +497,7 @@ ;; definition for method 121 of type ashelin ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this ashelin)) + "Typical place for shared init code. Runs from entity or process style init." (init-fields! this) (set! (-> this channel) (gui-channel ashelin)) (set! (-> this travel-anim-interp) 0.0) @@ -504,7 +510,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *ashelin-nav-enemy-info*) + (setup-enemy! this *ashelin-nav-enemy-info*) (let ((v1-12 (-> this neck))) (set! (-> v1-12 up) (the-as uint 1)) (set! (-> v1-12 nose) (the-as uint 2)) @@ -722,7 +728,7 @@ (a0-8 (new 'stack-no-clear 'vector)) ) (vector-float*! a2-0 (the-as vector (-> this frontline)) (- (-> this frontline w))) - (set! (-> a0-8 quad) (-> this root trans quad)) + (vector-copy! a0-8 (-> this root trans)) (set! (-> a0-8 y) 0.0) (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> this frontline)) 8192.0) ) @@ -759,10 +765,11 @@ ;; definition for method 78 of type ashelin (defmethod go-hostile ((this ashelin)) + "Go to the hostile state, actively trying to attack the target." (bot-method-235 this #t) (cond ((not (bot-method-226 this)) - (go-best-state this) + (go-state-for-focused this) ) ((ashelin-method-250 this #t #f) (go (method-of-object this standing-idle)) @@ -777,7 +784,8 @@ ) ;; definition for method 80 of type ashelin -(defmethod go-best-state ((this ashelin)) +(defmethod go-state-for-focused ((this ashelin)) + "Go to the appropriate state for the current awareness of the focused process." (if (bot-method-226 this) (go-hostile this) (go-idle this) @@ -786,6 +794,7 @@ ;; definition for method 73 of type ashelin (defmethod go-idle ((this ashelin)) + "Go to an idle state." (if (bot-method-226 this) (go (method-of-object this standing-idle)) (go (method-of-object this waiting-idle)) @@ -793,7 +802,8 @@ ) ;; definition for method 122 of type ashelin -(defmethod go-idle2 ((this ashelin)) +(defmethod go-fallback-init ((this ashelin)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this hidden)) ) @@ -820,7 +830,7 @@ ) (set! (-> s4-0 timeout) (seconds 4)) (vector<-cspace! (-> s4-0 pos) (-> this node-list data 22)) - (set! (-> s4-0 vel quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 vel) arg0) (vector-! (-> s4-0 vel) (-> s4-0 vel) (-> s4-0 pos)) (vector-normalize! (-> s4-0 vel) 307200.0) (spawn-projectile ashelin-shot s4-0 this *default-dead-pool*) @@ -961,6 +971,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this ashelin)) + "Get the yaw angle for the current knock." (local-vars (v1-36 art-element)) (let ((f28-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) @@ -969,7 +980,7 @@ (when a0-4 (get-trans a0-4 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -1023,6 +1034,7 @@ ;; definition for method 85 of type ashelin (defmethod knocked-anim ((this ashelin) (arg0 enemy-knocked-info)) + "start the knocked animation." (local-vars (a2-0 int)) (case (-> this incoming knocked-type) (((knocked-type blue-shot)) @@ -1044,7 +1056,7 @@ ) ) ) - (let* ((v1-9 (enemy-method-131 this 6 a2-0)) + (let* ((v1-9 (rnd-int-excluding-masked this 6 a2-0)) (s5-2 (-> this draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9 anim-index))) ) (set! (-> *ashelin-global-info* prev-blue-hit) v1-9) @@ -1091,6 +1103,7 @@ ;; definition for method 86 of type ashelin (defmethod knocked-land-anim ((this ashelin) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-0 (-> this incoming knocked-type))) (cond ((= v1-0 (knocked-type blue-shot)) @@ -1176,6 +1189,7 @@ ;; definition for method 87 of type ashelin (defmethod knocked-anim-handler ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (cond ((= arg0 3) (let ((s5-0 (ja-done? 0))) @@ -1323,9 +1337,9 @@ (set! (-> sv-272 z) (cos arg1)) (set! (-> sv-272 w) 1.0) (vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3) - (set! (-> s0-0 pref-dir quad) (-> s0-0 travel quad)) + (vector-copy! (-> s0-0 pref-dir) (-> s0-0 travel)) (avoid-spheres-1! (-> this nav) s0-0) - (set! (-> arg0 quad) (-> s0-0 out-travel 0 quad)) + (vector-copy! arg0 (-> s0-0 out-travel 0)) ) 0 (when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z))))) @@ -1426,7 +1440,7 @@ ) ) (when (>= s5-0 0) - (set! (-> this victory-speech-time) (+ (set-reaction-time! this (seconds 4) (seconds 7)) (current-time))) + (set! (-> this victory-speech-time) (+ (rnd-time-frame this (seconds 4) (seconds 7)) (current-time))) (play-speech-by-id this s5-0) ) ) @@ -1436,7 +1450,8 @@ ;; definition for method 147 of type ashelin ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod check-victory ((this ashelin)) +(defmethod clear-stale-victory ((this ashelin)) + "Remove victory flag if needed." (if (time-elapsed? (-> this hit-focus-time) (seconds 2)) (logclear! (-> this enemy-flags) (enemy-flag victory)) ) diff --git a/test/decompiler/reference/jak3/levels/common/ai/bot-h_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/bot-h_REF.gc index 1b3ffce6786..7cebba0b57f 100644 --- a/test/decompiler/reference/jak3/levels/common/ai/bot-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/ai/bot-h_REF.gc @@ -841,7 +841,7 @@ (set! s2-0 0) ) ) - (let* ((s1-0 (enemy-method-131 arg0 (-> this speech-indexes length) s2-0)) + (let* ((s1-0 (rnd-int-excluding-masked arg0 (-> this speech-indexes length) s2-0)) (s0-0 (-> this speech-indexes s1-0)) (v1-47 (-> arg1 s0-0 flags)) ) diff --git a/test/decompiler/reference/jak3/levels/common/ai/bot-states_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/bot-states_REF.gc index 3f45cddb335..a08b475922e 100644 --- a/test/decompiler/reference/jak3/levels/common/ai/bot-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/ai/bot-states_REF.gc @@ -62,7 +62,7 @@ (set! (-> self enemy-flags) v1-41) (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) (logclear! (-> self focus-status) (focus-status hit)) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -296,7 +296,3 @@ :code sleep-code :post nav-enemy-simple-post ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc index ce798a1d3c6..a09af7fa00f 100644 --- a/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc @@ -109,7 +109,10 @@ ) ;; definition for method 114 of type bot -(defmethod send-attack-to-all-tshapes ((this bot) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this bot) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." 0 ) @@ -299,14 +302,15 @@ ;; definition for method 112 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod get-incoming-attack! ((this bot) - (arg0 process-drawable) - (arg1 event-message-block) - (arg2 penetrate) - (arg3 attack-info) - (arg4 touching-shapes-entry) - ) - (let ((t9-0 (method-of-type nav-enemy get-incoming-attack!))) +(defmethod handle-incoming-attack! ((this bot) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + "Set up this enemy to handle an incoming attack event." + (let ((t9-0 (method-of-type nav-enemy handle-incoming-attack!))) (t9-0 this arg0 arg1 arg2 arg3 arg4) ) (logclear! (-> this bot-flags) (bot-flag bf03 bf04)) @@ -359,6 +363,7 @@ ;; definition for method 62 of type bot (defmethod get-damage-from-attack ((this bot) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let* ((t9-0 (method-of-type nav-enemy get-damage-from-attack)) (v0-0 (t9-0 this arg0 arg1)) (v1-1 (-> this bot-flags)) @@ -381,8 +386,9 @@ ) ;; definition for method 65 of type bot -(defmethod penetrate->next-state ((this bot) (arg0 process) (arg1 event-message-block) (arg2 float)) - (let* ((t9-0 (method-of-type nav-enemy penetrate->next-state)) +(defmethod msg-for-incoming-attack ((this bot) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." + (let* ((t9-0 (method-of-type nav-enemy msg-for-incoming-attack)) (v0-0 (t9-0 this arg0 arg1 arg2)) ) (if (logtest? (-> this bot-flags) (bot-flag bf03)) @@ -427,19 +433,22 @@ ;; definition for method 64 of type bot ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-awareness! ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod get-awareness-of-proc ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) + "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (the-as enemy-aware 3) ) ;; definition for method 68 of type bot ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod get-enemy-aware ((this bot) (arg0 enemy-aware)) +(defmethod modify-awareness ((this bot) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." (the-as enemy-aware 3) ) ;; definition for method 140 of type bot ;; WARN: Return type mismatch object vs process. (defmethod update-focus ((this bot)) + "Potentially update the focus, if there is something better to focus on." (local-vars (s5-1 process)) (let ((s5-0 (-> this focus))) (cond @@ -473,6 +482,7 @@ ;; definition for method 106 of type bot (defmethod find-best-focus ((this bot)) + "Search for the best thing to focus on." (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 @@ -555,7 +565,7 @@ ) (cond (s5-1 - (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (focus-on! (-> this focus) (the-as process-focusable s5-1) this) (if (and (logtest? (-> this bot-flags) (bot-flag attacked)) (!= (-> s5-1 type) target)) (logclear! (-> this bot-flags) (bot-flag attacked)) ) @@ -586,9 +596,9 @@ ) (set! (-> gp-0 proc) #f) (set! (-> gp-0 rating) 409600000.0) - (set! (-> gp-0 aware) (enemy-aware ea0)) + (set! (-> gp-0 aware) (enemy-aware unaware)) (when (< 0.0 f0-0) - (set! (-> s3-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this root trans)) (set! (-> s3-0 w) (-> this notice-enemy-dist)) (set! *actor-list-length* 0) (if (logtest? s4-0 512) @@ -723,7 +733,8 @@ ;; definition for method 20 of type bot ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this bot)) +(defmethod get-search-info-flag ((this bot)) + "Get search-info-flag for this process." (the-as search-info-flag 0) ) @@ -731,6 +742,7 @@ ;; INFO: Used lq/sq ;; WARN: disable def twice: 272. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-0 object)) (case arg2 (('combo) @@ -857,7 +869,7 @@ #t ) (('follow-dir) - (set! (-> this follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! (-> this follow-dir) (the-as vector (-> arg3 param 1))) #t ) (else @@ -906,7 +918,7 @@ ) (else (if (and (-> this next-state) (= (-> this next-state name) 'hidden)) - (go-best-state this) + (go-state-for-focused this) ) ) ) @@ -931,7 +943,8 @@ ) ;; definition for method 110 of type bot -(defmethod send-attack ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (cond ((and (= (-> arg0 type) target) (not (logtest? (-> this bot-flags) (bot-flag attacked)))) (when (send-event arg0 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) @@ -944,7 +957,7 @@ ) ) (set! (-> this root penetrated-by) (the-as penetrate -1)) - (reset-penetrate! this) + (reset-penetrate-later! this) #t ) ) @@ -971,13 +984,14 @@ ) ;; definition for method 84 of type bot -(defmethod send-attack-on-jump-or-knocked ((this bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this bot) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'knocked) (= v1-3 'jump)) ) ) - ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type nav-enemy enemy-touched-handler) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -1012,7 +1026,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -1104,7 +1118,7 @@ (set-time! (-> this started-warning-time)) ) (if (and (>= (current-time) (-> this next-too-far-warn-time)) (bot-method-216 this)) - (set! (-> this next-too-far-warn-time) (+ (current-time) (set-reaction-time! + (set! (-> this next-too-far-warn-time) (+ (current-time) (rnd-time-frame this (the-as time-frame (-> this warn-min-delay)) (the-as time-frame (-> this warn-max-delay)) @@ -1129,7 +1143,7 @@ ;; WARN: Return type mismatch time-frame vs none. (defmethod reset-warn-time ((this bot)) (set! (-> this started-warning-time) 0) - (set! (-> this next-too-far-warn-time) (+ (current-time) (set-reaction-time! + (set! (-> this next-too-far-warn-time) (+ (current-time) (rnd-time-frame this (the-as time-frame (-> this warn-min-delay)) (the-as time-frame (-> this warn-max-delay)) @@ -1141,6 +1155,7 @@ ;; definition for method 59 of type bot (defmethod enemy-common-post ((this bot)) + "Common implementation of post. Runs ja-post." (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) (set! (-> this travel-prev-ry1) (quaternion-y-angle (-> this root quat))) (let ((f0-3 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) @@ -1443,6 +1458,7 @@ ;; definition for method 121 of type bot ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this bot)) + "Typical place for shared init code. Runs from entity or process style init." (process-entity-status! this (entity-perm-status bit-4) #t) (set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) (logclear! (-> this mask) (process-mask enemy)) @@ -1501,7 +1517,7 @@ (when (logtest? (-> this bot-flags) (bot-flag bf00)) (let ((a1-0 (handle->process (-> this focus handle)))) (and a1-0 - (= (-> this focus aware) (enemy-aware ea3)) + (= (-> this focus aware) (enemy-aware hostile)) (attacked-by-player? this (the-as process-focusable a1-0)) (not (logtest? (-> this focus-status) (focus-status grabbed))) ) @@ -1522,8 +1538,8 @@ (set! (-> gp-0 fproc) (the-as process-focusable s3-0)) (set! (-> gp-0 los) 0) (when (the-as process-focusable s3-0) - (set! (-> gp-0 pos quad) (-> (get-trans (the-as process-focusable s3-0) 0) quad)) - (set! (-> gp-0 bullseye quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) + (vector-copy! (-> gp-0 pos) (get-trans (the-as process-focusable s3-0) 0)) + (vector-copy! (-> gp-0 bullseye) (get-trans (the-as process-focusable s3-0) 3)) (vector-z-quaternion! (-> gp-0 my-facing-xz-dir) (-> this root quat)) (set! (-> gp-0 my-facing-xz-dir y) 0.0) (vector-normalize! (-> gp-0 my-facing-xz-dir) 1.0) @@ -1540,7 +1556,7 @@ ) (when (and arg0 s3-0 (zero? (-> gp-0 los))) (let ((s4-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-1 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-1 start-pos) (-> this root trans)) (+! (-> s4-1 start-pos y) 8192.0) (vector-! (-> s4-1 move-dist) (-> gp-0 bullseye) (-> s4-1 start-pos)) (let ((f0-19 (fmax 1.0 (+ -1638.4 (vector-length (-> s4-1 move-dist)))))) @@ -1610,7 +1626,7 @@ (quaternion-copy! (-> arg0 src-quat) (-> s5-0 quat)) (vector-z-quaternion! (-> arg0 facing-dir) (-> s5-0 quat)) (set! (-> arg0 facing-ry) (atan (-> arg0 facing-dir x) (-> arg0 facing-dir z))) - (set! (-> arg0 targ-pos quad) (-> (get-trans arg1 3) quad)) + (vector-copy! (-> arg0 targ-pos) (get-trans arg1 3)) (set! (-> arg0 targ-ry) (atan (- (-> arg0 targ-pos x) (-> s5-0 trans x)) (- (-> arg0 targ-pos z) (-> s5-0 trans z))) ) @@ -1675,11 +1691,12 @@ ;; definition for method 91 of type bot ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-91 ((this bot) (arg0 enemy-jump-info)) +(defmethod check-jump-blocked? ((this bot) (arg0 enemy-jump-info)) + "Is this jump blocked by something?" (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (vector-copy! v1-0 (-> arg0 dest-pos)) (set! (-> v1-0 w) (-> this nav-radius-backup)) - (add-root-sphere-to-hash! (-> this nav) v1-0 #x10006a) + (check-sphere-blocked! (-> this nav) v1-0 #x10006a) ) ) @@ -1694,7 +1711,7 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-0 quad) (-> this root trans quad)) + (vector-copy! v1-0 (-> this root trans)) (+! (-> v1-0 y) 9216.0) (vector-! s1-0 arg0 v1-0) (vector-normalize! s1-0 1.0) @@ -1924,6 +1941,7 @@ ;; definition for method 67 of type bot (defmethod coin-flip? ((this bot)) + "Return #t half the time, #f the other." #f ) diff --git a/test/decompiler/reference/jak3/levels/common/battle_REF.gc b/test/decompiler/reference/jak3/levels/common/battle_REF.gc index 4f35812a34d..0c174f98bdc 100644 --- a/test/decompiler/reference/jak3/levels/common/battle_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/battle_REF.gc @@ -773,7 +773,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (f0-0 (-> this info spawner-blocked-by-collide-radius)) ) - (set! (-> gp-0 quad) (-> arg0 attack-pos quad)) + (vector-copy! gp-0 (-> arg0 attack-pos)) (set! (-> gp-0 w) f0-0) (let ((s5-0 (-> this info spawner-collide-with)) (f30-0 (* f0-0 f0-0)) @@ -1034,7 +1034,7 @@ (else (set! (-> arg0 creature-index) 0) (let ((v1-7 (-> arg0 entity))) - (set! (-> s3-0 quad) (-> v1-7 extra trans quad)) + (vector-copy! s3-0 (-> v1-7 extra trans)) (quaternion-copy! s4-0 (-> v1-7 quat)) ) ) @@ -1043,7 +1043,7 @@ (s2-1 (!= s2-0 #f)) (s0-1 (get-random-breed this arg0)) ) - (set! (-> s1-1 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s1-1 trans) s3-0) (quaternion-copy! (-> s1-1 quat) s4-0) (set! (-> s1-1 entity) (-> arg0 entity)) (set! (-> s1-1 directed?) #t) @@ -1642,7 +1642,7 @@ ) ) (else - (set! (-> arg0 attack-pos quad) (-> arg0 entity extra trans quad)) + (vector-copy! (-> arg0 attack-pos) (-> arg0 entity extra trans)) ) ) ) @@ -1779,10 +1779,11 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this battle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'trsqv))) (set! (-> this root) s4-0) - (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> s4-0 trans) (-> arg0 extra trans)) (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) (vector-identity! (-> s4-0 scale)) ) diff --git a/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc index 1eaafc3b5fb..08fc09f61d2 100644 --- a/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/elec-gate_REF.gc @@ -216,7 +216,7 @@ (let ((a0-5 (-> s2-0 bolt)) (v1-6 s3-0) ) - (set! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1) quad) (-> v1-6 quad)) + (vector-copy! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1)) v1-6) ) (when (-> gp-0 ring-spec) (let ((s1-0 (-> gp-0 ring-spec num-points)) @@ -952,6 +952,7 @@ ;; definition for method 11 of type elec-gate ;; INFO: Used lq/sq (defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this entity) arg0) @@ -987,12 +988,12 @@ ) (vector-cross! v1-31 v1-31 *up-vector*) (set! (-> this dividing-wall pos quad) (-> s5-3 quad)) - (set! (-> this dividing-wall dir quad) (-> v1-31 quad)) + (vector-copy! (-> this dividing-wall dir) v1-31) (vector+float*! (the-as vector (-> this plane)) s5-3 v1-31 12288.0) - (set! (-> this plane 0 dir quad) (-> v1-31 quad)) + (vector-copy! (-> this plane 0 dir) v1-31) (vector-float*! v1-31 v1-31 -1.0) (vector+float*! (the-as vector (-> this plane 1)) s5-3 v1-31 12288.0) - (set! (-> this plane 1 dir quad) (-> v1-31 quad)) + (vector-copy! (-> this plane 1 dir) v1-31) ) (set! (-> this wall-xz) (vector-vector-distance @@ -1059,6 +1060,7 @@ ;; definition for method 11 of type sewer-elec-gate (defmethod init-from-entity! ((this sewer-elec-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this gate-index) (res-lump-value (-> this entity) 'index int :time -1000000000.0)) (call-parent-method this arg0) ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal-shot_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal-shot_REF.gc index 98f972784fc..a5c47c3b287 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal-shot_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal-shot_REF.gc @@ -27,11 +27,11 @@ (defmethod projectile-method-26 ((this dp-bipedal-grenade-shot)) (cond ((logtest? (-> *part-group-id-table* 246 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 246)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 246)) ) ) @@ -79,7 +79,7 @@ (a1-3 (new 'stack 'collide-query)) ) 0.0 - (set! (-> a1-3 start-pos quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> a1-3 start-pos) (-> self root root-prim prim-core world-sphere)) (vector-! (-> a1-3 move-dist) (the-as vector (-> (the-as collide-shape s4-1) root-prim prim-core)) @@ -271,7 +271,7 @@ (set! (-> gp-0 attack-id) a2-12) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) (the-as @@ -280,7 +280,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal_REF.gc index 947dd72b187..040caedce4f 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/dp-bipedal_REF.gc @@ -431,34 +431,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 73728.0 - :knocked-medium-vxz-hi 102400.0 - :knocked-medium-vy-lo 81920.0 - :knocked-medium-vy-hi 122880.0 - :knocked-hard-vxz-lo 81920.0 - :knocked-hard-vxz-hi 122880.0 - :knocked-hard-vy-lo 90112.0 - :knocked-hard-vy-hi 143360.0 - :knocked-huge-vxz-lo 102400.0 - :knocked-huge-vxz-hi 143360.0 - :knocked-huge-vy-lo 102400.0 - :knocked-huge-vy-hi 163840.0 - :knocked-yellow-vxz-lo 32768.0 - :knocked-yellow-vxz-hi 40960.0 - :knocked-yellow-vy-lo 36864.0 - :knocked-yellow-vy-hi 57344.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 65536.0 - :knocked-red-vy-lo 65536.0 - :knocked-red-vy-hi 102400.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 18) + :knocked-medium-vxz-hi (meters 25) + :knocked-medium-vy-lo (meters 20) + :knocked-medium-vy-hi (meters 30) + :knocked-hard-vxz-lo (meters 20) + :knocked-hard-vxz-hi (meters 30) + :knocked-hard-vy-lo (meters 22) + :knocked-hard-vy-hi (meters 35) + :knocked-huge-vxz-lo (meters 25) + :knocked-huge-vxz-hi (meters 35) + :knocked-huge-vy-lo (meters 25) + :knocked-huge-vy-hi (meters 40) + :knocked-yellow-vxz-lo (meters 8) + :knocked-yellow-vxz-hi (meters 10) + :knocked-yellow-vy-lo (meters 9) + :knocked-yellow-vy-hi (meters 14) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 16) + :knocked-red-vy-lo (meters 16) + :knocked-red-vy-hi (meters 25) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 34422.13) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -1045,6 +1045,7 @@ ;; definition for method 120 of type dp-bipedal ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this dp-bipedal)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1132,6 +1133,7 @@ ;; definition for method 62 of type dp-bipedal (defmethod get-damage-from-attack ((this dp-bipedal) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (if (type? arg0 guard-shot) 0.5 ((method-of-type nav-enemy get-damage-from-attack) this arg0 arg1) @@ -1238,14 +1240,14 @@ (defmethod dp-bipedal-method-209 ((this dp-bipedal) (arg0 vector) (arg1 float)) (local-vars (s4-0 vector)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> arg0 quad)) + (vector-copy! a1-1 arg0) (set! (-> a1-1 w) arg1) - (and (not (add-root-sphere-to-hash! (-> this nav) a1-1 #x100068)) + (and (not (check-sphere-blocked! (-> this nav) a1-1 #x100068)) (let ((a0-5 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) arg0))) (and (< (vector-x-angle a0-5) 5461.3335) (begin (set! s4-0 (new 'stack-no-clear 'vector)) - (set! (-> s4-0 quad) (-> arg0 quad)) + (vector-copy! s4-0 arg0) (+! (-> s4-0 y) 15974.399) (region-check-has-los s4-0 (-> this focus-bullseye) 8192.0) ) @@ -1269,9 +1271,9 @@ ) (not (dp-bipedal-method-209 self (-> self formation-position) 13977.6)) ) - (set! (-> self focus-formation-source quad) (-> self focus-pos quad)) + (vector-copy! (-> self focus-formation-source) (-> self focus-pos)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self focus-formation-source)))) (when (< 0.0 (vector-length s5-1)) (dotimes (s4-0 (-> *dp-bipedal-formation-table* length)) @@ -1285,7 +1287,7 @@ (when (and (closest-point-on-mesh (-> self nav) s3-0 s3-0 (the-as nav-poly #f)) (dp-bipedal-method-209 self s3-0 13977.6) ) - (set! (-> gp-0 quad) (-> s3-0 quad)) + (vector-copy! gp-0 s3-0) #t (goto cfg-26) ) @@ -1294,7 +1296,7 @@ ) ) (label cfg-26) - (set! (-> self formation-position quad) (-> gp-0 quad)) + (vector-copy! (-> self formation-position) gp-0) ) ) 0 @@ -1315,7 +1317,7 @@ ) (logclear! (-> a0-1 flags) (nav-state-flag directional-mode)) (logior! (-> a0-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-1 target-pos quad) (-> v1-4 quad)) + (vector-copy! (-> a0-1 target-pos) v1-4) ) 0 (nav-enemy-method-187 self) @@ -1333,7 +1335,7 @@ (-> self focus-pos) (* (vector-length (ja-linear-vel 0)) (seconds-per-frame)) ) - (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (move-to-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) ) ) (nav-enemy-simple-post) @@ -1643,11 +1645,11 @@ (set! (-> self effect-rate) 0.4) (cond ((logtest? (-> *part-group-id-table* 242 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 242)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root root-prim prim-core world-sphere)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 242)) ) ) @@ -1721,7 +1723,7 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) - (let ((gp-0 (set-reaction-time! self 1 (seconds 0.01)))) + (let ((gp-0 (rnd-time-frame self 1 (seconds 0.01)))) (dotimes (s5-0 gp-0) (ja-no-eval :group! dp-bipedal-idle0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1770,7 +1772,7 @@ (when (time-elapsed? (-> self state-time) (seconds 0.05)) (let ((v1-25 (new 'stack-no-clear 'inline-array 'vector 1))) (let ((a2-0 (-> self nav state))) - (set! (-> v1-25 0 quad) (-> a2-0 target-pos quad)) + (vector-copy! (-> v1-25 0) (-> a2-0 target-pos)) ) (when (< (vector-vector-xz-distance (-> self root trans) (-> v1-25 0)) 4096.0) (if (should-check-los? (-> self los) (seconds 0.3)) @@ -1889,7 +1891,7 @@ (set! (-> gp-0 shield-strength) 10) (set! (-> gp-0 shield-type) (shield-type shield-type-0)) (if (new 'static 'vector :z -7168.0 :w 1.0) - (set! (-> gp-0 offset-vec quad) (-> (new 'static 'vector :z -7168.0 :w 1.0) quad)) + (vector-copy! (-> gp-0 offset-vec) (new 'static 'vector :z -7168.0 :w 1.0)) (vector-reset! (-> gp-0 offset-vec)) ) (let ((s5-0 (the-as process #f))) @@ -1932,7 +1934,7 @@ ((>= 1 (the-as int v1-10)) (go-virtual active) ) - ((= v1-10 (enemy-aware ea4)) + ((= v1-10 (enemy-aware flee)) (go-flee self) ) ) @@ -2015,7 +2017,7 @@ (set-collide-spec! self #t) (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-7 *game-info*) (v0-2 (+ (-> v1-7 attack-id) 1)) ) @@ -2032,7 +2034,7 @@ (set-collide-spec! self #f) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) ) :code (behavior () (ja-channel-push! 1 (seconds 0.05)) @@ -2158,7 +2160,7 @@ :virtual #t :trans (behavior () (if (and (time-elapsed? (-> self state-time) (seconds 0.01)) - (and (not (handle->process (-> self ragdoll-proc))) (within-gspot-range? self)) + (and (not (handle->process (-> self ragdoll-proc))) (invalid-height? self)) ) (go-die self) ) @@ -2197,7 +2199,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -2208,12 +2210,12 @@ (a1-1 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> gp-0 gspot-pos quad)) + (vector-copy! s5-0 (-> gp-0 gspot-pos)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> gp-0 gspot-normal quad)) + (vector-copy! s4-0 (-> gp-0 gspot-normal)) (when (not (find-ground gp-0 a1-1 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f))) - (set! (-> gp-0 gspot-pos quad) (-> s5-0 quad)) - (set! (-> gp-0 gspot-normal quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 gspot-pos) s5-0) + (vector-copy! (-> gp-0 gspot-normal) s4-0) ) ) ) @@ -2356,7 +2358,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-11 quad)) + (vector-copy! (-> a0-3 target-pos) v1-11) ) 0 (nav-enemy-travel-post) @@ -2405,7 +2407,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.05)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! dp-bipedal-turret-jump-on-start-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -2562,7 +2564,7 @@ (a1-2 (-> self move-dest)) (f0-0 (-> v1-14 extra-nav-sphere w)) ) - (set! (-> v1-14 extra-nav-sphere quad) (-> a1-2 quad)) + (vector-copy! (-> v1-14 extra-nav-sphere) a1-2) (set! (-> v1-14 extra-nav-sphere w) f0-0) ) 0 @@ -2596,7 +2598,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! dp-bipedal-turret-jump-off-jump-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -2614,7 +2616,7 @@ (suspend) (nav-enemy-falling-post) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -2632,8 +2634,8 @@ ;; INFO: Used lq/sq (defun trajectory-prediction ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float) (arg6 float)) (let ((s2-0 (new 'stack-no-clear 'inline-array 'vector 6))) - (set! (-> s2-0 0 quad) (-> arg3 quad)) - (set! (-> s2-0 1 quad) (-> arg4 quad)) + (vector-copy! (-> s2-0 0) arg3) + (vector-copy! (-> s2-0 1) arg4) (vector-! (-> s2-0 5) (-> s2-0 0) arg1) (set! (-> s2-0 2 x) (vector-length (-> s2-0 5))) (vector-normalize! (-> s2-0 5) 1.0) @@ -2793,11 +2795,13 @@ ;; definition for method 73 of type dp-bipedal (defmethod go-idle ((this dp-bipedal)) + "Go to an idle state." (go (method-of-object this de-ambush)) ) ;; definition for method 78 of type dp-bipedal (defmethod go-hostile ((this dp-bipedal)) + "Go to the hostile state, actively trying to attack the target." (cond ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> this enemy-flags))) (nav-enemy-method-174 this) @@ -2826,6 +2830,7 @@ ;; definition for method 85 of type dp-bipedal (defmethod knocked-anim ((this dp-bipedal) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (set! (-> arg0 anim-speed) 1.5) @@ -2879,6 +2884,7 @@ ;; definition for method 86 of type dp-bipedal (defmethod knocked-land-anim ((this dp-bipedal) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.1)) @@ -2934,7 +2940,8 @@ ) ;; definition for method 123 of type dp-bipedal -(defmethod enemy-method-123 ((this dp-bipedal)) +(defmethod allow-ragdoll? ((this dp-bipedal)) + "Can this enemy ragdoll now?" (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) (= (-> this hit-points) 0.0) @@ -2949,15 +2956,17 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs vector. (defmethod ragdoll-spawn! ((this dp-bipedal) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." (let ((t9-0 (method-of-type nav-enemy ragdoll-spawn!))) (t9-0 this arg0 arg1) ) (let ((v1-2 (handle->process (-> this ragdoll-proc)))) (the-as vector (when v1-2 (set-vector! (-> (the-as ragdoll-proc v1-2) ragdoll gravity) 0.0 -1.4 0.0 1.0) - (set! (-> (the-as ragdoll-proc v1-2) ragdoll gravity-target quad) - (-> (the-as ragdoll-proc v1-2) ragdoll gravity quad) - ) + (vector-copy! + (-> (the-as ragdoll-proc v1-2) ragdoll gravity-target) + (-> (the-as ragdoll-proc v1-2) ragdoll gravity) + ) (set! (-> (the-as ragdoll-proc v1-2) ragdoll maximum-stretch) 0.8) ) ) @@ -2992,6 +3001,7 @@ ;; definition for method 59 of type dp-bipedal ;; INFO: Used lq/sq (defmethod enemy-common-post ((this dp-bipedal)) + "Common implementation of post. Runs ja-post." (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) (if (or (logtest? (-> this fact enemy-options) (enemy-option user0)) (and (logtest? (-> this draw status) (draw-control-status on-screen)) @@ -3023,8 +3033,8 @@ (when (< 1 (the-as int (-> this focus aware))) (let ((s5-2 (handle->process (-> this focus handle)))) (when s5-2 - (set! (-> this focus-bullseye quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-2) 0) quad)) + (vector-copy! (-> this focus-bullseye) (get-trans (the-as process-focusable s5-2) 3)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s5-2) 0)) (vector-! (-> this focus-dir) (-> this focus-pos) (-> this root trans)) (vector-normalize! (-> this focus-dir) 1.0) (-> this focus-dir) @@ -3078,7 +3088,8 @@ ) ;; definition for method 108 of type dp-bipedal -(defmethod enemy-method-108 ((this dp-bipedal) (arg0 process-focusable)) +(defmethod should-flee-from? ((this dp-bipedal) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (focus-test? arg0 invulnerable) (and (focus-test? arg0 mech) (< (vector-vector-distance (-> this root trans) (get-trans arg0 1)) 28672.0)) ) @@ -3106,6 +3117,7 @@ ;; definition for method 148 of type dp-bipedal (defmethod go-gun-dark-2-stretch ((this dp-bipedal)) + "Go to the gun-dark-2-stretch state." (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -3128,6 +3140,7 @@ ;; definition for method 82 of type dp-bipedal (defmethod event-handler ((this dp-bipedal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked 'hit-flinch) (logclear! (-> this mask) (process-mask actor-pause)) @@ -3139,7 +3152,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -3180,6 +3193,7 @@ ;; definition for method 67 of type dp-bipedal (defmethod coin-flip? ((this dp-bipedal)) + "Return #t half the time, #f the other." #f ) @@ -3211,13 +3225,14 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this dp-bipedal)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dp-bipedal" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *dp-bipedal-nav-enemy-info*) + (setup-enemy! this *dp-bipedal-nav-enemy-info*) (set! (-> this state-stack) (new 'process 'boxed-array state 4)) (set! (-> this state-stack length) 0) (set! (-> this root pause-adjust-distance) 163840.0) @@ -3328,7 +3343,7 @@ (let ((a2-1 (new 'stack-no-clear 'array 'collide-shape 1)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> self entity extra trans quad)) + (vector-copy! a1-1 (-> self entity extra trans)) (set! (-> a1-1 w) 24576.0) (zero? (fill-actor-list-for-box *actor-hash* a1-1 a2-1 1)) ) @@ -3336,7 +3351,7 @@ (let ((s5-0 (-> self entity)) (gp-2 (new 'stack-no-clear 'enemy-init-by-other-params)) ) - (set! (-> gp-2 trans quad) (-> s5-0 extra trans quad)) + (vector-copy! (-> gp-2 trans) (-> s5-0 extra trans)) (quaternion-copy! (-> gp-2 quat) (-> s5-0 quat)) (set! (-> gp-2 entity) s5-0) (set! (-> gp-2 directed?) #f) @@ -3376,7 +3391,8 @@ ;; definition for method 11 of type dp-bipedal-spawner ;; INFO: Used lq/sq (defmethod init-from-entity! ((this dp-bipedal-spawner) (arg0 entity-actor)) - (set! (-> this spawn-pos quad) (-> arg0 extra trans quad)) + "Set up a newly created process from the entity that created it." + (vector-copy! (-> this spawn-pos) (-> arg0 extra trans)) (set! (-> this spawn-timer) 0) (set! (-> this enemies-spawned) 0) (set! (-> this enemies-to-spawn) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc index 9341eb55d6f..51c38ab1790 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/darkprec/neo-wasp_REF.gc @@ -35,7 +35,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this neo-wasp-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'neo-wasp-shot) (set! (-> this max-speed) 491520.0) (set! (-> this move) metalhead-shot-move) @@ -213,34 +213,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 101580.8 - :knocked-hard-vy-lo 60620.8 - :knocked-hard-vy-hi 95027.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 24.8) + :knocked-hard-vy-lo (meters 14.8) + :knocked-hard-vy-hi (meters 23.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -257,6 +257,7 @@ ;; definition for method 82 of type neo-wasp (defmethod event-handler ((this neo-wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -268,7 +269,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -288,6 +289,7 @@ ;; definition for method 56 of type neo-wasp (defmethod knocked-handler ((this neo-wasp) (arg0 vector)) + "Called when this enemy is knocked." (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type explode-or-darkjak)) @@ -324,7 +326,8 @@ ) ;; definition for method 122 of type neo-wasp -(defmethod go-idle2 ((this neo-wasp)) +(defmethod go-fallback-init ((this neo-wasp)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) (go (method-of-object this ambush)) (go (method-of-object this notice)) @@ -333,22 +336,26 @@ ;; definition for method 78 of type neo-wasp (defmethod go-hostile ((this neo-wasp)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this hostile)) ) ;; definition for method 80 of type neo-wasp -(defmethod go-best-state ((this neo-wasp)) +(defmethod go-state-for-focused ((this neo-wasp)) + "Go to the appropriate state for the current awareness of the focused process." (go-hostile this) ) ;; definition for method 71 of type neo-wasp (defmethod go-dormant ((this neo-wasp)) + "Go to the dormant state. This disables drawing/processing/collision, and runs no logic." (send-event (ppointer->process (-> this parent)) 'going-dormant) ((method-of-type hover-enemy go-dormant) this) ) ;; definition for method 59 of type neo-wasp (defmethod enemy-common-post ((this neo-wasp)) + "Common implementation of post. Runs ja-post." (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this on-screen-timer)) ) @@ -576,7 +583,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> self focus-pos quad)) + (vector-copy! v1-4 (-> self focus-pos)) (+! (-> v1-4 y) (-> self attack-miss-dist-curr)) (vector-! gp-0 v1-4 a0-2) ) @@ -622,7 +629,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> self focus-pos quad)) + (vector-copy! v1-4 (-> self focus-pos)) (+! (-> v1-4 y) (-> self attack-miss-dist-curr)) (vector-! gp-0 v1-4 a0-2) ) @@ -702,11 +709,11 @@ (spawn-debris self) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -755,7 +762,7 @@ (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-1 hit-xz-reaction) 0.95) (set! (-> a1-1 hit-y-reaction) 0.6) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> this incoming attack-position quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> this incoming attack-position)) (vector-! (-> a1-1 fountain-rand-transv-lo) (-> a1-1 fountain-rand-transv-lo) (-> this root transv)) (debris-spawn this a1-1 *neo-wasp-debris-params* (the-as process-drawable #f)) ) @@ -782,7 +789,7 @@ (and (time-elapsed? (-> this on-screen-timer) (seconds 0.5)) (< (vector-vector-distance s4-1 (-> this focus-pos)) 225280.0) (and (< (fabs (vector-x-angle s3-2)) 7281.778) - (enemy-method-104 this (-> this focus-pos) 4551.1113) + (pointing-toward? this (-> this focus-pos) 4551.1113) (should-check-los? (-> this los) (seconds 0.4)) ) ) @@ -798,6 +805,7 @@ ;; definition for method 85 of type neo-wasp (defmethod knocked-anim ((this neo-wasp) (arg0 enemy-knocked-info)) + "start the knocked animation." (cond ((rnd-chance? this 0.5) (set! (-> this knocked-anim) 10) @@ -823,6 +831,7 @@ ;; definition for method 86 of type neo-wasp (defmethod knocked-land-anim ((this neo-wasp) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -836,18 +845,21 @@ ) ;; definition for method 88 of type neo-wasp -(defmethod enemy-method-88 ((this neo-wasp) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this neo-wasp) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" (-> this root) (>= (-> arg0 on-surface-count) 1) ) ;; definition for method 89 of type neo-wasp -(defmethod within-gspot-range? ((this neo-wasp)) +(defmethod invalid-height? ((this neo-wasp)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) ;; definition for method 81 of type neo-wasp (defmethod go-die ((this neo-wasp)) + "Go to the die state." (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) (go (method-of-object this die-now)) @@ -947,14 +959,14 @@ (set! sv-152 (matrix-with-scale->quaternion (new 'stack-no-clear 'quaternion) (-> arg1 bone transform))) (set! sv-156 (new 'stack-no-clear 'quaternion)) (let ((v1-3 (new 'stack-no-clear 'vector))) - (set! (-> v1-3 quad) (-> arg0 root scale quad)) + (vector-copy! v1-3 (-> arg0 root scale)) (set! sv-160 v1-3) ) (vector-float*! sv-160 sv-160 arg4) (quaternion-rotate-local-x! sv-156 sv-152 (the-as float arg2)) (quaternion->matrix sv-148 sv-156) (scale-matrix! sv-148 sv-160 sv-148) - (set! (-> sv-148 trans quad) (-> sv-144 quad)) + (vector-copy! (-> sv-148 trans) sv-144) (spawn-from-mat (-> arg0 engine-part) sv-148) (none) ) @@ -988,6 +1000,7 @@ ;; definition for method 120 of type neo-wasp ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this neo-wasp)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1158,8 +1171,9 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this neo-wasp)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) - (when (= (status-of-level-and-borrows *level* 'precura #f) 'active) + (when (= (level-status? *level* 'precura #f) 'active) (let ((v1-4 (level-get *level* 'lprenme))) (if (and v1-4 (= (-> v1-4 status) 'active)) (set! (-> this level) v1-4) @@ -1167,7 +1181,7 @@ ) ) (hover-enemy-method-170 this) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (hover-enemy-method-176 this) (set! (-> this mech-flame-texture-id) (the-as sound-id (lookup-texture-id-by-name "mech-flame" (the-as string #f))) @@ -1353,7 +1367,7 @@ (let ((s5-0 (-> self entity)) (gp-0 (new 'stack-no-clear 'enemy-init-by-other-params)) ) - (set! (-> gp-0 trans quad) (-> s5-0 extra trans quad)) + (vector-copy! (-> gp-0 trans) (-> s5-0 extra trans)) (quaternion-copy! (-> gp-0 quat) (-> s5-0 quat)) (set! (-> gp-0 entity) s5-0) (set! (-> gp-0 directed?) #f) @@ -1393,7 +1407,8 @@ ;; definition for method 11 of type neo-wasp-spawner ;; INFO: Used lq/sq (defmethod init-from-entity! ((this neo-wasp-spawner) (arg0 entity-actor)) - (set! (-> this spawn-pos quad) (-> arg0 extra trans quad)) + "Set up a newly created process from the entity that created it." + (vector-copy! (-> this spawn-pos) (-> arg0 extra trans)) (set-time! (-> this spawn-timer)) (set! (-> this enemies-spawned) 0) (set! (-> this enemies-to-spawn) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc index 8d8efd7656a..66d54811c8b 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/flitter_REF.gc @@ -548,34 +548,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 275251.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 67.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -633,6 +633,7 @@ ;; definition for method 85 of type flitter (defmethod knocked-anim ((this flitter) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (let ((a0-2 (-> this skel root-channel 0))) @@ -676,6 +677,7 @@ ;; definition for method 86 of type flitter (defmethod knocked-land-anim ((this flitter) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type blue-shot)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -699,7 +701,7 @@ ;; definition for method 76 of type flitter (defmethod go-stare2 ((this flitter)) - (if (and (= (-> this focus aware) (enemy-aware ea2)) + (if (and (= (-> this focus aware) (enemy-aware aware2)) (not (nav-enemy-method-174 this)) (not (and (-> this next-state) (= (-> this next-state name) 'pacing))) ) @@ -731,11 +733,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 1412 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1412)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1412)) ) ) @@ -796,11 +798,11 @@ (when (< (-> self base-height) (-> self root trans y)) (cond ((logtest? (-> *part-group-id-table* 257 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 257)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 257)) ) ) @@ -856,7 +858,8 @@ ) ;; definition for method 108 of type flitter -(defmethod enemy-method-108 ((this flitter) (arg0 process-focusable)) +(defmethod should-flee-from? ((this flitter) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (focus-test? arg0 mech) ) @@ -876,18 +879,18 @@ (f30-0 (vector-length s4-1)) ) (cond - ((enemy-method-108 this (the-as process-focusable s3-0)) + ((should-flee-from? this (the-as process-focusable s3-0)) (go-flee this) ) ((and (< f30-0 32768.0) (not (flitter-method-194 this (the-as process-focusable s3-0)))) (go (method-of-object this circling)) ) ((< f30-0 (-> this enemy-info notice-nav-radius)) - (set! (-> this target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> this target-pos) s5-1) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s4-1 quad)) + (vector-copy! s3-1 s4-1) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> this root transv quad)) + (vector-copy! s5-2 (-> this root transv)) (vector-normalize! s5-2 f30-0) (if (>= (vector-dot s3-1 s5-2) 0.98) (go (method-of-object this attack)) @@ -896,7 +899,7 @@ ) ) ((< f30-0 32768.0) - (set! (-> this target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> this target-pos) s5-1) ) ((or (time-elapsed? (-> this last-change-dir) (-> this change-dir-time)) (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) @@ -920,7 +923,7 @@ ) (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-0 s5-1 s3-2) - (set! (-> this target-pos quad) (-> s2-0 quad)) + (vector-copy! (-> this target-pos) s2-0) ) ) ) @@ -993,7 +996,7 @@ (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) (until #f - (when (not (enemy-method-105 self 2730.6667 #t)) + (when (not (pointing-toward-focus? self 2730.6667 #t)) (let ((v1-5 self)) (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) ) @@ -1002,7 +1005,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! flitter-turn-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -1053,12 +1056,12 @@ :trans (behavior () (let ((gp-0 (handle->process (-> self focus handle)))) (if gp-0 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-11 (-> self focus aware))) (cond - ((= v1-11 (enemy-aware ea3)) + ((= v1-11 (enemy-aware hostile)) (cond ((when gp-0 (let* ((gp-1 self) @@ -1081,7 +1084,7 @@ ) ) ) - ((= v1-11 (enemy-aware ea2)) + ((= v1-11 (enemy-aware aware2)) (go-stare self) ) ((>= 1 (the-as int v1-11)) @@ -1139,7 +1142,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1224,7 +1227,7 @@ ) (logclear! (-> s5-1 flags) (nav-state-flag directional-mode)) (logior! (-> s5-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> s5-1 target-pos quad) (-> v1-10 quad)) + (vector-copy! (-> s5-1 target-pos) v1-10) ) 0 (set! s5-2 (-> self attack-pos)) @@ -1273,7 +1276,7 @@ (ja :num! (seek!)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-travel-post ) @@ -1300,6 +1303,7 @@ ;; definition for method 120 of type flitter ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this flitter)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1353,12 +1357,13 @@ ;; definition for method 121 of type flitter ;; WARN: Return type mismatch connection-minimap vs none. (defmethod init-enemy! ((this flitter)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flitter-nav-enemy-info*) + (setup-enemy! this *flitter-nav-enemy-info*) (set! (-> this move-angle) 10922.667) (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) #t diff --git a/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc index cb1ec7e3595..811ac1a2021 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/grunt_REF.gc @@ -409,34 +409,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 73728.0 - :knocked-red-vy-hi 114688.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 18) + :knocked-red-vy-hi (meters 28) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 10625.897) :scale (new 'static 'vector :x 0.6399 :y 0.6399 :z 0.6399) @@ -907,6 +907,7 @@ ;; definition for method 82 of type grunt (defmethod event-handler ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -918,7 +919,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -965,7 +966,8 @@ ) ;; definition for method 74 of type grunt -(defmethod go-ambush-delay ((this grunt)) +(defmethod go-ambush ((this grunt)) + "May go to ambush-delay first, if set in the res-lump." (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -1053,13 +1055,14 @@ ) ;; definition for method 102 of type grunt -(defmethod go-directed2 ((this grunt)) +(defmethod go-next-state-auto ((this grunt)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type nav-enemy go-directed2) this) + ((method-of-type nav-enemy go-next-state-auto) this) ) ) ) @@ -1111,7 +1114,7 @@ ) (if (< v1-1 (-> a0-0 curve num-cverts)) (set! (-> self jumping-ambush-path-pt) v1-1) - (go-best-state self) + (go-state-for-focused self) ) ) (until #f @@ -1164,7 +1167,7 @@ ) 0 (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + (s5-0 (rnd-time-frame self 1 (seconds 0.027))) ) (let ((v1-37 (ja-group))) (if (not (and v1-37 (= v1-37 gp-0))) @@ -1188,7 +1191,7 @@ ) 0 (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (s5-1 (rnd-time-frame self (seconds 0.007) (seconds 0.017))) ) (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -1221,7 +1224,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -1318,7 +1321,7 @@ ) ) (sound-play "grunt-warn") - (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + (set! (-> self next-warn-time) (+ gp-0 (rnd-time-frame self (seconds 1) (seconds 1.2)))) ) ) ) @@ -1386,7 +1389,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-10 *game-info*) (v0-1 (+ (-> v1-10 attack-id) 1)) ) @@ -1402,7 +1405,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (when (logtest? (-> self enemy-flags) (enemy-flag victory)) (logclear! (-> self enemy-flags) (enemy-flag victory)) (sound-play "grunt-hit") @@ -1490,7 +1493,7 @@ (if (not gp-0) (go-stare self) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-21 *game-info*) @@ -1527,7 +1530,7 @@ (until (ja-done? 0) (let ((a0-9 (handle->process (-> self focus handle)))) (if a0-9 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-9) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-9) 0)) ) ) (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) @@ -1812,7 +1815,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1821,6 +1824,7 @@ ;; definition for method 125 of type grunt (defmethod ragdoll-settled? ((this grunt)) + "Has the ragdoll stopped moving?" (let ((t9-0 (method-of-type nav-enemy ragdoll-settled?))) (and (t9-0 this) (or (= (-> this root gspot-pos y) -40959590.0) (< (- (-> this root trans y) (-> this root gspot-pos y)) 4096.0) @@ -1851,6 +1855,7 @@ ;; definition for method 120 of type grunt ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this grunt)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1952,18 +1957,20 @@ ;; definition for method 67 of type grunt (defmethod coin-flip? ((this grunt)) + "Return #t half the time, #f the other." #f ) ;; definition for method 121 of type grunt ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this grunt)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) @@ -2012,7 +2019,8 @@ ;; definition for method 122 of type grunt ;; WARN: Return type mismatch int vs object. -(defmethod go-idle2 ((this grunt)) +(defmethod go-fallback-init ((this grunt)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (-> this fact enemy-options) (enemy-option user9)) (go (method-of-object this wait-for-focus)) (go (method-of-object this idle)) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-enemy_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-enemy_REF.gc index 76e32d45053..163969196c0 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-enemy_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-enemy_REF.gc @@ -7,6 +7,7 @@ ;; definition for method 82 of type hover-enemy ;; INFO: Used lq/sq (defmethod event-handler ((this hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked 'hit-flinch) (logclear! (-> this mask) (process-mask actor-pause)) @@ -18,7 +19,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -135,7 +136,7 @@ ) ) (set! (-> self main-joint-movement 0 quad) (-> a0-18 quad)) - (set! (-> self main-joint-movement 1 quad) (-> v1-22 quad)) + (vector-copy! (-> self main-joint-movement 1) v1-22) ) 0 (hover-enemy-method-163 self) @@ -180,7 +181,7 @@ ) ) (else - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) ) ) ) @@ -236,6 +237,7 @@ ;; definition for method 67 of type hover-enemy (defmethod coin-flip? ((this hover-enemy)) + "Return #t half the time, #f the other." #f ) @@ -253,7 +255,8 @@ ) ;; definition for method 107 of type hover-enemy -(defmethod is-pfoc-in-mesh? ((this hover-enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this hover-enemy) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (not arg1) (set! arg1 (get-trans arg0 1)) ) @@ -287,11 +290,12 @@ ;; definition for method 59 of type hover-enemy ;; INFO: Used lq/sq (defmethod enemy-common-post ((this hover-enemy)) + "Common implementation of post. Runs ja-post." (hover-enemy-method-169 this) (when (< 1 (the-as int (-> this focus aware))) (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-0) 1) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s5-0) 1)) (los-control-method-9 (-> this los) (the-as process-focusable s5-0) @@ -333,7 +337,7 @@ (set! sv-600 (new 'stack-no-clear 'collide-query)) (set! sv-604 (-> this draw shadow-ctrl settings shadow-dir)) (set! sv-608 (the-as float 61440.0)) - (set! (-> sv-600 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> sv-600 start-pos) (-> this root trans)) (vector-normalize-copy! (-> sv-600 move-dist) sv-604 sv-608) (let ((v1-19 sv-600)) (set! (-> v1-19 radius) 819.2) @@ -484,7 +488,7 @@ :virtual #t :trans (behavior () (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (< 1 (the-as int (-> self focus aware)))) - (go-ambush-delay self) + (go-ambush self) ) ) ) @@ -521,14 +525,14 @@ ) ) (if s1-0 - (set! (-> self focus-pos quad) (-> (get-trans s1-0 3) quad)) - (set! (-> self focus-pos quad) (-> s0-0 quad)) + (vector-copy! (-> self focus-pos) (get-trans s1-0 3)) + (vector-copy! (-> self focus-pos) s0-0) ) (vector-! s2-0 (-> self focus-pos) (-> s4-0 trans)) (vector-normalize! s2-0 1.0) (set-vector! (-> self rotation-vec) (- (vector-x-angle s2-0)) (vector-y-angle s2-0) 0.0 0.0) (hover-enemy-method-167 self) - (set! (-> s4-0 trans quad) (-> s5-0 quad)) + (vector-copy! (-> s4-0 trans) s5-0) (if (logtest? (-> self fact enemy-options) (enemy-option user0)) (vector-! (-> s4-0 trans) @@ -568,12 +572,12 @@ :event enemy-event-handler :enter (behavior () (if (or (zero? (-> self path)) (logtest? (-> self path flags) (path-control-flag not-found))) - (set! (-> self dest-pos quad) (-> self entity extra trans quad)) + (vector-copy! (-> self dest-pos) (-> self entity extra trans)) (get-point-in-path! (-> self path) (-> self dest-pos) 1.0 'interp) ) (let ((gp-0 (new 'stack-no-clear 'vector))) (if (hover-nav-control-method-24 (-> self hover) gp-0 (-> self dest-pos)) - (set! (-> self dest-pos quad) (-> gp-0 quad)) + (vector-copy! (-> self dest-pos) gp-0) ) ) (hover-enemy-method-175 self) @@ -663,7 +667,7 @@ ((>= 1 (the-as int v1-3)) (go-virtual land-approach) ) - ((and (= v1-3 (enemy-aware ea3)) (get-focus! self)) + ((and (= v1-3 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) ) @@ -707,7 +711,7 @@ (when (logtest? (-> gp-0 status) (collide-status on-surface)) (when (not (-> self hit-surface?)) (set! (-> self hit-surface?) #t) - (set! (-> self surface-normal quad) (-> gp-0 poly-normal quad)) + (vector-copy! (-> self surface-normal) (-> gp-0 poly-normal)) ) ) (when (and (-> self hit-surface?) (= (-> self hit-points) 0.0)) @@ -800,7 +804,7 @@ ) ) ) - (set! (-> self flying-death-spin-axis quad) (-> *y-vector* quad)) + (vector-copy! (-> self flying-death-spin-axis) *y-vector*) (vector-rotate-x! (-> self flying-death-spin-axis) (-> self flying-death-spin-axis) @@ -936,26 +940,29 @@ ) ;; definition for method 68 of type hover-enemy -(defmethod get-enemy-aware ((this hover-enemy) (arg0 enemy-aware)) +(defmethod modify-awareness ((this hover-enemy) (arg0 enemy-aware)) + "Apply modifications to awareness based on the reaction time of an enemy and other settings." arg0 ) ;; definition for method 73 of type hover-enemy (defmethod go-idle ((this hover-enemy)) + "Go to an idle state." (go (method-of-object this land-approach)) ) ;; definition for method 80 of type hover-enemy -(defmethod go-best-state ((this hover-enemy)) +(defmethod go-state-for-focused ((this hover-enemy)) + "Go to the appropriate state for the current awareness of the focused process." (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware ea3)) (get-focus! this)) + ((and (= s5-0 (enemy-aware hostile)) (get-focus! this)) (go-hostile this) ) ((>= 1 (the-as int s5-0)) (go (method-of-object this land-approach)) ) - ((= s5-0 (enemy-aware ea4)) + ((= s5-0 (enemy-aware flee)) (go-flee this) ) (else @@ -1006,13 +1013,15 @@ ) ;; definition for method 89 of type hover-enemy -(defmethod within-gspot-range? ((this hover-enemy)) +(defmethod invalid-height? ((this hover-enemy)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) ;; definition for method 125 of type hover-enemy ;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this hover-enemy)) + "Has the ragdoll stopped moving?" #f ) @@ -1097,9 +1106,10 @@ (set! (-> t0-2 y) (-> v1-22 hover-y-offset)) (set! (-> t0-2 z) (-> v1-22 hover-xz-offset)) (set! (-> t0-2 w) 1.0) - (set! (-> s5-0 quad) - (-> (the-as vector (t9-7 a0-10 a1-5 a2-4 a3-2 t0-2 (the-as (pointer res-tag) #f) *res-static-buf*)) quad) - ) + (vector-copy! + s5-0 + (the-as vector (t9-7 a0-10 a1-5 a2-4 a3-2 t0-2 (the-as (pointer res-tag) #f) *res-static-buf*)) + ) ) (set! (-> this restart-fly-anims) #t) (set! (-> this knocked-fall-dist) 2048.0) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-formation_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-formation_REF.gc index f8bbaf34d61..5abcb93a4aa 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-formation_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-formation_REF.gc @@ -82,9 +82,9 @@ (let ((s2-0 (get-trans (the-as process-focusable s1-0) 3)) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> (get-trans (the-as process-focusable s1-0) 1) quad)) + (vector-copy! s3-1 (get-trans (the-as process-focusable s1-0) 1)) (if (= (-> s3-1 y) -40959590.0) - (set! (-> s3-1 quad) (-> s2-0 quad)) + (vector-copy! s3-1 s2-0) (+! (-> s3-1 y) 6144.0) ) (cond @@ -98,14 +98,14 @@ (set! (-> arg0 y) (-> s3-1 y)) ) (else - (set! (-> arg0 quad) (-> s3-1 quad)) + (vector-copy! arg0 s3-1) (set! (-> arg0 w) 1.0) ) ) ) ) (else - (set! (-> arg0 quad) (-> this center quad)) + (vector-copy! arg0 (-> this center)) ) ) ) @@ -166,9 +166,10 @@ (displacement-between-points-at-percent-normalized! s5-0 s4-2 f30-1) (forward-up-nopitch->inv-matrix (-> this zone-to-world) s4-2 *up-vector*) ) - (set! (-> this zone-to-world trans quad) - (-> (get-point-at-percent-along-path! s5-0 (new 'stack-no-clear 'vector) f30-1 'interp) quad) - ) + (vector-copy! + (-> this zone-to-world trans) + (get-point-at-percent-along-path! s5-0 (new 'stack-no-clear 'vector) f30-1 'interp) + ) ) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) @@ -178,7 +179,7 @@ (vector-normalize! s4-5 1.0) (forward-up-nopitch->inv-matrix (-> this zone-to-world) s4-5 *up-vector*) ) - (set! (-> this zone-to-world trans quad) (-> s5-1 quad)) + (vector-copy! (-> this zone-to-world trans) s5-1) ) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) @@ -195,9 +196,10 @@ ) (forward-up-nopitch->inv-matrix (-> this zone-to-world) a1-16 *up-vector*) ) - (set! (-> this zone-to-world trans quad) - (-> (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) quad) - ) + (vector-copy! + (-> this zone-to-world trans) + (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) + ) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) ) @@ -217,11 +219,11 @@ (let ((s5-5 (vector-! (new 'stack-no-clear 'vector) s4-7 (-> this zone-to-world trans))) (s4-8 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-8 quad) (-> this zone-to-world trans quad)) + (vector-copy! s4-8 (-> this zone-to-world trans)) (set! (-> s5-5 y) 0.0) (vector-normalize! s5-5 1.0) (forward-up-nopitch->inv-matrix (-> this zone-to-world) s5-5 *up-vector*) - (set! (-> this zone-to-world trans quad) (-> s4-8 quad)) + (vector-copy! (-> this zone-to-world trans) s4-8) ) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) @@ -362,7 +364,7 @@ (let ((s4-0 (hover-formation-control-method-15 this (new 'stack-no-clear 'vector) arg0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> this zone-to-world trans quad)) + (vector-copy! s3-0 (-> this zone-to-world trans)) (let ((s5-1 (new 'stack-no-clear 'collide-query)) (gp-1 (new 'stack-no-clear 'collide-query)) ) @@ -373,14 +375,14 @@ (vector+! s4-0 s4-0 s2-0) (vector-normalize! (vector-! s2-0 s3-0 s4-0) (+ 204.8 f30-0)) (vector-! s3-0 s3-0 s2-0) - (set! (-> s5-1 start-pos quad) (-> s4-0 quad)) + (vector-copy! (-> s5-1 start-pos) s4-0) (vector-! (-> s5-1 move-dist) s3-0 (-> s5-1 start-pos)) (let ((f0-2 (vector-length (-> s5-1 move-dist)))) (if (< 81920.0 f0-2) (vector-float*! (-> s5-1 move-dist) (-> s5-1 move-dist) (/ 81920.0 f0-2)) ) ) - (set! (-> gp-1 start-pos quad) (-> s3-0 quad)) + (vector-copy! (-> gp-1 start-pos) s3-0) (vector-! (-> gp-1 move-dist) s4-0 (-> gp-1 start-pos)) (let ((f0-4 (vector-length (-> gp-1 move-dist)))) (if (< 81920.0 f0-4) @@ -443,7 +445,7 @@ ) (cond (a0-8 - (set! (-> s5-0 actor-position s4-0 quad) (-> (get-trans (the-as process-focusable a0-8) 3) quad)) + (vector-copy! (-> s5-0 actor-position s4-0) (get-trans (the-as process-focusable a0-8) 3)) (set! (-> s5-0 actor-valid? s4-0) #t) (+! (-> s5-0 count) 1) ) @@ -462,17 +464,17 @@ ) (let ((s2-0 (new 'stack-no-clear 'vector))) (when (and (> (-> s5-0 count) 0) (hover-formation-control-method-10 this s2-0 (the-as vector (-> this offset)) 0.0)) - (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) + (vector-copy! (-> s5-0 pos-table s4-1) s2-0) (+! s4-1 1) ) (let ((s1-0 0)) (while (not (or (>= s1-0 s3-2) (>= s4-1 (-> s5-0 count)))) (when (hover-formation-control-method-10 this s2-0 (-> this offset (logand (+ s1-0 1) 1)) f28-0) - (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) + (vector-copy! (-> s5-0 pos-table s4-1) s2-0) (+! s4-1 1) ) (when (hover-formation-control-method-10 this s2-0 (-> this offset (logand (+ s1-0 1) 1)) (- f28-0)) - (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) + (vector-copy! (-> s5-0 pos-table s4-1) s2-0) (+! s4-1 1) ) (+! f28-0 f30-0) @@ -630,7 +632,7 @@ (set! (-> a0-2 w) 1.0) (vector+! a1-2 (the-as vector v1-3) a0-2) ) - (set! (-> gp-0 center quad) (-> gp-0 entity extra trans quad)) + (vector-copy! (-> gp-0 center) (-> gp-0 entity extra trans)) (quaternion-copy! (-> gp-0 focus-quat) *unity-quaternion*) (let ((v1-6 (res-lump-value (-> gp-0 entity) 'options uint128 :time -1000000000.0))) (if (logtest? (the-as int v1-6) 256) @@ -652,7 +654,7 @@ (let ((f0-6 (res-lump-float (-> gp-0 entity) 'rotoffset))) (matrix-rotate-y! (-> gp-0 zone-to-world) f0-6) ) - (set! (-> gp-0 zone-to-world trans quad) (-> gp-0 center quad)) + (vector-copy! (-> gp-0 zone-to-world trans) (-> gp-0 center)) (matrix-inverse-of-rot-trans! (-> gp-0 world-to-zone) (-> gp-0 zone-to-world)) (set! (-> gp-0 formation-type) (res-lump-value (-> gp-0 entity) @@ -776,6 +778,7 @@ ;; definition for method 11 of type hover-formation ;; INFO: Used lq/sq (defmethod init-from-entity! ((this hover-formation) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-32 vector)) (stack-size-set! (-> this main-thread) 32) (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) @@ -830,6 +833,7 @@ ) ;; definition for method 3 of type flying-formation +;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this flying-formation)) (when (not this) (set! this this) @@ -844,7 +848,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control_REF.gc index ee0f964c3cf..68186992611 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control_REF.gc @@ -549,7 +549,7 @@ (set! (-> v1-2 next) #f) ) (set! (-> gp-0 curve-matrix rvec quad) (-> arg1 quad)) - (set! (-> gp-0 curve-matrix uvec quad) (-> arg2 quad)) + (vector-copy! (-> gp-0 curve-matrix uvec) arg2) (set! (-> gp-0 pos-index 0) arg3) (set! (-> gp-0 pos-index 1) arg4) (set! (-> gp-0 dist) @@ -922,7 +922,7 @@ (when (or (= gp-0 -1) (< f0-0 f30-0)) (set! gp-0 s0-0) (set! f30-0 f0-0) - (set! (-> arg1 quad) (-> sv-32 quad)) + (vector-copy! arg1 sv-32) ) ) ) @@ -957,7 +957,7 @@ (when (or (= sv-32 -1) (< f0-2 (the-as float sv-24))) (set! sv-32 s3-0) (set! sv-24 f0-2) - (set! (-> arg1 quad) (-> sv-64 quad)) + (vector-copy! arg1 sv-64) ) ) ) @@ -978,7 +978,7 @@ ) (cond ((>= (-> this edge a0-2 radius) f0-0) - (set! (-> arg1 quad) (-> arg0 quad)) + (vector-copy! arg1 arg0) ) (else (vector-float*! v1-3 v1-3 (/ (-> this edge a0-2 radius) f0-0)) @@ -1133,8 +1133,8 @@ (defmethod probe-background ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) - (set! (-> gp-0 start-pos quad) (-> arg0 quad)) - (set! (-> gp-0 move-dist quad) (-> v1-1 quad)) + (vector-copy! (-> gp-0 start-pos) arg0) + (vector-copy! (-> gp-0 move-dist) v1-1) (vector-normalize! (-> gp-0 move-dist) (fmin (vector-length v1-1) (fmax 16384.0 (* 2.0 arg2)))) ) (let ((v1-5 gp-0)) @@ -1296,10 +1296,10 @@ (set! sv-280 v1-32) ) (set! sv-288 0) - (set! (-> sv-276 0 quad) (-> arg0 quad)) - (set! (-> sv-276 1 quad) (-> s2-0 quad)) - (set! (-> sv-276 2 quad) (-> s3-0 quad)) - (set! (-> sv-276 3 quad) (-> arg1 quad)) + (vector-copy! (-> sv-276 0) arg0) + (vector-copy! (-> sv-276 1) s2-0) + (vector-copy! (-> sv-276 2) s3-0) + (vector-copy! (-> sv-276 3) arg1) (dotimes (s4-1 4) (let ((s3-2 (+ s4-1 1))) (while (< s3-2 4) @@ -1314,7 +1314,7 @@ (f0-4 (-> sv-52 sv-56 radius)) ) (while (begin (label cfg-30) (< v1-50 4)) - (set! (-> sv-280 sv-288 quad) (-> sv-276 v1-50 quad)) + (vector-copy! (-> sv-280 sv-288) (-> sv-276 v1-50)) (set! sv-288 (+ sv-288 1)) (+! v1-50 1) (while (< v1-50 4) @@ -1330,7 +1330,7 @@ ) (label cfg-32) (when (< sv-288 4) - (set! (-> sv-280 sv-288 quad) (-> sv-276 3 quad)) + (vector-copy! (-> sv-280 sv-288) (-> sv-276 3)) (set! sv-288 (+ sv-288 1)) ) (if (< 1 sv-288) @@ -1381,7 +1381,7 @@ (vector-float*! (-> v1-0 curve-matrix fvec) (-> a2-0 curve-matrix trans) -1.0) ) (arg0 - (set! (-> v1-0 curve-matrix fvec quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 curve-matrix fvec) arg0) ) (else (vector-! (-> v1-0 curve-matrix fvec) (-> v1-0 curve-matrix uvec) (the-as vector (-> v1-0 curve-matrix))) @@ -1518,11 +1518,11 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod hover-nav-control-method-10 ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) - (set! (-> this dest-pos quad) (-> arg0 quad)) + (vector-copy! (-> this dest-pos) arg0) (cond (arg2 - (set! (-> this dest-vel quad) (-> arg2 quad)) - (set! (-> this root transv quad) (-> arg2 quad)) + (vector-copy! (-> this dest-vel) arg2) + (vector-copy! (-> this root transv) arg2) ) (else (set! (-> this dest-vel quad) (the-as uint128 0)) @@ -1625,7 +1625,7 @@ (let ((a3-9 (get-point-in-path! s5-1 (new 'stack-no-clear 'vector) (the float (+ s3-1 1)) 'interp))) (nav-network-method-23 (-> this nav) (-> this path-info) s1-3 a3-9 -1 -1) ) - (set! (-> s2-4 quad) (-> s1-3 quad)) + (vector-copy! s2-4 s1-3) ) (+! s3-1 -1) ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc index 572b99d5126..dd49f4d6025 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/hover/robo-hover_REF.gc @@ -433,34 +433,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.135 :y 0.9566 :z 0.258 :w 1296.2657) :scale (new 'static 'vector :x 1.3 :y 1.3 :z 1.3) @@ -727,6 +727,7 @@ ;; definition for method 146 of type robo-hover ;; WARN: Return type mismatch int vs sound-id. (defmethod play-damage-sound ((this robo-hover) (arg0 int)) + "Pick and play the damage/death sound." (if (and (zero? arg0) (logtest? (penetrate enemy-yellow-shot) (-> this incoming penetrate-using))) (sound-play "hover-take-hit") (call-parent-method this arg0) @@ -834,7 +835,7 @@ :trans (behavior () (exit-ambush?) (if (or (los-control-method-11 (-> self los) (seconds 0.2)) - (not (enemy-method-104 self (-> self focus-pos) 9102.223)) + (not (pointing-toward? self (-> self focus-pos) 9102.223)) ) (go-virtual ambush-fly) ) @@ -934,7 +935,7 @@ ) ) ) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-6) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-6) 0)) ) (+! (-> gp-0 y) -20480.0) (hover-nav-control-method-12 (-> self hover) gp-0) @@ -1026,7 +1027,7 @@ ) :trans (behavior () (if (or (los-control-method-11 (-> self los) (seconds 0.2)) - (not (enemy-method-104 self (-> self focus-pos) 9102.223)) + (not (pointing-toward? self (-> self focus-pos) 9102.223)) ) (go-hostile self) ) @@ -1048,7 +1049,7 @@ (set! (-> self gun-blend) (seek-ease (-> self gun-blend) 1.0 (* 3.0 (seconds-per-frame)) 0.9 (* 0.4 (seconds-per-frame))) ) - (set! (-> self aim-position quad) (-> self focus-pos quad)) + (vector-copy! (-> self aim-position) (-> self focus-pos)) (set! (-> self aim-position y) (+ 6144.0 (-> self attack-miss-dist-curr) (-> self aim-position y))) (hover-enemy-hostile-post) ) @@ -1109,7 +1110,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1133,17 +1134,17 @@ (let ((a1-3 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-3 hit-xz-reaction) 0.95) (set! (-> a1-3 hit-y-reaction) 0.6) - (set! (-> a1-3 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> a1-3 fountain-rand-transv-lo) (-> self incoming attack-position)) (debris-spawn self a1-3 *robo-hover-debris-params* (the-as process-drawable #f)) ) (let ((v1-16 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node robo-hover-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-16 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-16) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-16 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-16) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -1165,6 +1166,7 @@ ;; definition for method 82 of type robo-hover (defmethod event-handler ((this robo-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v1-15 enemy-flag)) (case arg2 (('attack-invinc) @@ -1245,7 +1247,7 @@ (get-focus! this) (< f30-0 225280.0) (and (< (fabs (vector-x-angle s5-2)) 3640.889) - (enemy-method-104 this (-> this focus-pos) 5461.3335) + (pointing-toward? this (-> this focus-pos) 5461.3335) (should-check-los? (-> this los) (seconds 0.4)) ) ) @@ -1283,6 +1285,7 @@ ;; definition for method 56 of type robo-hover (defmethod knocked-handler ((this robo-hover) (arg0 vector)) + "Called when this enemy is knocked." (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type explode-or-darkjak)) @@ -1334,6 +1337,7 @@ ;; definition for method 59 of type robo-hover ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this robo-hover)) + "Common implementation of post. Runs ja-post." ((method-of-type hover-enemy enemy-common-post) this) 0 (none) @@ -1361,7 +1365,7 @@ (-> arg0 scale) (quaternion-rotate-local-z! (the-as quaternion sv-208) a1-3 sv-192) (quaternion->matrix s5-0 (the-as quaternion sv-208)) - (set! (-> s2-1 quad) (-> arg0 root scale quad)) + (vector-copy! s2-1 (-> arg0 root scale)) (scale-matrix! s5-0 s2-1 s5-0) (let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat))) (t9-6 vector-inv-orient-by-quat!) @@ -1403,7 +1407,7 @@ ) ) ) - (set! (-> s5-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 trans) s4-0) (spawn-from-mat (-> arg0 engine-part) s5-0) (let ((f0-17 (lerp-scale 0.4 1.0 f28-0 1638.4 f30-0))) (sound-play-by-name @@ -1516,6 +1520,7 @@ ;; definition for method 81 of type robo-hover (defmethod go-die ((this robo-hover)) + "Go to the die state." (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) (go (method-of-object this explode)) @@ -1544,6 +1549,7 @@ ;; definition for method 120 of type robo-hover ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this robo-hover)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1682,6 +1688,7 @@ ;; definition for method 67 of type robo-hover (defmethod coin-flip? ((this robo-hover)) + "Return #t half the time, #f the other." #f ) @@ -1766,9 +1773,10 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this robo-hover)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) (hover-enemy-method-170 this) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (hover-enemy-method-176 this) (set! (-> this neck up) (the-as uint 1)) (set! (-> this neck nose) (the-as uint 2)) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc index d4d66db38bb..d485a526a1f 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/kg-grunt_REF.gc @@ -670,34 +670,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -744,6 +744,7 @@ ;; definition for method 82 of type kg-grunt ;; INFO: Used lq/sq (defmethod event-handler ((this kg-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -755,7 +756,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -768,7 +769,7 @@ (let ((s5-1 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> s5-1 hit-xz-reaction) 0.95) (set! (-> s5-1 hit-y-reaction) 0.6) - (set! (-> s5-1 fountain-rand-transv-lo quad) (-> this incoming attack-position quad)) + (vector-copy! (-> s5-1 fountain-rand-transv-lo) (-> this incoming attack-position)) (dotimes (s4-0 8) (let ((v1-32 (rand-vu-int-count-excluding 18 (the-as int (-> this debris-mask))))) (logior! (-> this debris-mask) (ash 1 v1-32)) @@ -805,7 +806,8 @@ ) ;; definition for method 74 of type kg-grunt -(defmethod go-ambush-delay ((this kg-grunt)) +(defmethod go-ambush ((this kg-grunt)) + "May go to ambush-delay first, if set in the res-lump." (cond ((logtest? (-> this fact enemy-options) (enemy-option user10)) (go (method-of-object this falling-ambush)) @@ -838,17 +840,17 @@ (let ((a1-1 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-1 hit-xz-reaction) 0.95) (set! (-> a1-1 hit-y-reaction) 0.6) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> self incoming attack-position)) (debris-spawn self a1-1 *kg-grunt-debris-params* (the-as process-drawable #f)) ) (let ((v1-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node kg-grunt-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 220 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-6 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-6) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 220)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-6 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-6) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 220)) ) ) @@ -933,13 +935,14 @@ ) ;; definition for method 102 of type kg-grunt -(defmethod go-directed2 ((this kg-grunt)) +(defmethod go-next-state-auto ((this kg-grunt)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (case (-> this jump-why) ((2) (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type nav-enemy go-directed2) this) + ((method-of-type nav-enemy go-next-state-auto) this) ) ) ) @@ -991,7 +994,7 @@ ) (if (and (nonzero? a0-0) (< v1-1 (-> a0-0 curve num-cverts))) (set! (-> self jumping-ambush-path-pt) v1-1) - (go-best-state self) + (go-state-for-focused self) ) ) (until #f @@ -1047,7 +1050,7 @@ ) 0 (let ((gp-0 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + (s5-0 (rnd-time-frame self 1 (seconds 0.027))) ) (let ((v1-37 (ja-group))) (if (not (and v1-37 (= v1-37 gp-0))) @@ -1071,7 +1074,7 @@ ) 0 (let ((gp-1 (-> self draw art-group data (-> self patrol-anim anim-index))) - (s5-1 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (s5-1 (rnd-time-frame self (seconds 0.007) (seconds 0.017))) ) (ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) @@ -1104,7 +1107,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -1201,7 +1204,7 @@ ) ) (sound-play "kg-grunt-warn") - (set! (-> self next-warn-time) (+ gp-0 (set-reaction-time! self (seconds 1) (seconds 1.2)))) + (set! (-> self next-warn-time) (+ gp-0 (rnd-time-frame self (seconds 1) (seconds 1.2)))) ) ) ) @@ -1269,7 +1272,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-10 *game-info*) (v0-1 (+ (-> v1-10 attack-id) 1)) ) @@ -1285,7 +1288,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (when (logtest? (-> self enemy-flags) (enemy-flag victory)) (logclear! (-> self enemy-flags) (enemy-flag victory)) (sound-play "kg-grunt-hit") @@ -1373,7 +1376,7 @@ (if (not gp-0) (go-stare self) ) - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable gp-0) 0)) ) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-21 *game-info*) @@ -1410,7 +1413,7 @@ (until (ja-done? 0) (let ((a0-9 (handle->process (-> self focus handle)))) (if a0-9 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-9) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-9) 0)) ) ) (seek-to-point-toward-point! (-> self root) (-> self focus-pos) 546133.3 (seconds 0.1)) @@ -1623,6 +1626,7 @@ ;; definition for method 85 of type kg-grunt (defmethod knocked-anim ((this kg-grunt) (arg0 enemy-knocked-info)) + "start the knocked animation." (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) @@ -1642,7 +1646,7 @@ (set! a2-3 (logior v1-2 8)) ) ) - (let ((s4-0 (enemy-method-131 this 4 a2-3))) + (let ((s4-0 (rnd-int-excluding-masked this 4 a2-3))) (set! (-> *kg-grunt-global-info* prev-yellow-hit-anim-index) s4-0) (set! (-> this yellow-hit-anim) (-> *kg-grunt-global-info* yellow-hit-anim s4-0)) (let ((v1-11 (rnd-int this 3))) @@ -1704,7 +1708,7 @@ (set! a2-5 (logior v1-42 7)) ) ) - (let ((v1-46 (enemy-method-131 this 6 a2-5))) + (let ((v1-46 (rnd-int-excluding-masked this 6 a2-5))) (set! (-> *kg-grunt-global-info* prev-blue-hit-anim-index) v1-46) (set! (-> this blue-hit-anim) (-> *kg-grunt-global-info* blue-hit-anim v1-46)) ) @@ -1715,7 +1719,7 @@ (set! a2-6 (logior a2-6 4)) ) ) - (set! (-> this use-charge-anim-index) (enemy-method-131 this 3 a2-6)) + (set! (-> this use-charge-anim-index) (rnd-int-excluding-masked this 3 a2-6)) ) ) (let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index))) @@ -1744,7 +1748,7 @@ (set! s4-3 (logior s4-3 4)) ) ) - (set! v1-72 (enemy-method-131 this 3 s4-3)) + (set! v1-72 (rnd-int-excluding-masked this 3 s4-3)) ) ) ) @@ -1768,6 +1772,7 @@ ;; definition for method 86 of type kg-grunt (defmethod knocked-land-anim ((this kg-grunt) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this incoming knocked-type) (knocked-type blue-shot)) #f @@ -1795,6 +1800,7 @@ ;; definition for method 81 of type kg-grunt (defmethod go-die ((this kg-grunt)) + "Go to the die state." (go (method-of-object this explode)) ) @@ -1868,6 +1874,7 @@ ;; definition for method 120 of type kg-grunt ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this kg-grunt)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1970,6 +1977,7 @@ ;; definition for method 121 of type kg-grunt ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this kg-grunt)) + "Typical place for shared init code. Runs from entity or process style init." (if (and (-> this entity) (= (-> this entity extra level name) 'factoryd)) (initialize-skeleton this @@ -1983,7 +1991,7 @@ ) ) (logior! (-> this mask) (process-mask kg-robot)) - (init-enemy-defaults! this (get-nav-enemy-info this)) + (setup-enemy! this (get-nav-enemy-info this)) (let ((v1-17 (-> this neck))) (set! (-> v1-17 up) (the-as uint 1)) (set! (-> v1-17 nose) (the-as uint 2)) @@ -2018,7 +2026,8 @@ ;; definition for method 122 of type kg-grunt ;; WARN: Return type mismatch int vs object. -(defmethod go-idle2 ((this kg-grunt)) +(defmethod go-fallback-init ((this kg-grunt)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (-> this fact enemy-options) (enemy-option user9)) (go (method-of-object this wait-for-focus)) (go (method-of-object this idle)) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc index b777d7ae944..ca5b53cce70 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/mantis_REF.gc @@ -402,34 +402,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.3 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 106496.0 - :knocked-red-vxz-hi 106496.0 - :knocked-red-vy-lo 55296.0 - :knocked-red-vy-hi 55296.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 26) + :knocked-red-vxz-hi (meters 26) + :knocked-red-vy-lo (meters 13.5) + :knocked-red-vy-hi (meters 13.5) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9971 :y -0.0748 :z -0.0134 :w 36483.785) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -721,7 +721,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.2)) (until #f - (let ((gp-0 (set-reaction-time! self (seconds 0.01) (seconds 0.017)))) + (let ((gp-0 (rnd-time-frame self (seconds 0.01) (seconds 0.017)))) (dotimes (s5-0 gp-0) (ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -790,15 +790,15 @@ ) :code (behavior () (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> self root trans quad)) + (vector-copy! v1-0 (-> self root trans)) (+! (-> v1-0 y) -18841.6) (cond ((logtest? (-> *part-group-id-table* 1406 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-0 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1406)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-0 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1406)) ) ) @@ -813,7 +813,7 @@ (a1-7 (-> self root trans)) (f0-6 (-> v1-45 extra-nav-sphere w)) ) - (set! (-> v1-45 extra-nav-sphere quad) (-> a1-7 quad)) + (vector-copy! (-> v1-45 extra-nav-sphere) a1-7) (set! (-> v1-45 extra-nav-sphere w) f0-6) ) 0 @@ -1005,7 +1005,7 @@ (when (and (and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) - (and (time-elapsed? (-> self attack-timer) (seconds 5)) (enemy-method-104 self s4-0 8192.0) (< f30-1 32768.0)) + (and (time-elapsed? (-> self attack-timer) (seconds 5)) (pointing-toward? self s4-0 8192.0) (< f30-1 32768.0)) ) (cond ((< 24576.0 f30-1) @@ -1019,7 +1019,7 @@ ) ) ) - (if (enemy-method-104 self s4-0 10922.667) + (if (pointing-toward? self s4-0 10922.667) (mantis-method-199 self) ) (if (logtest? (-> self flags) (mantis-flag tracked)) @@ -1067,7 +1067,7 @@ (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) ) 0 - (dotimes (gp-0 (set-reaction-time! self 1 (seconds 0.007))) + (dotimes (gp-0 (rnd-time-frame self 1 (seconds 0.007))) (ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1128,7 +1128,7 @@ ) (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-21 target-pos quad) (-> v1-70 quad)) + (vector-copy! (-> a0-21 target-pos) v1-70) ) 0 ) @@ -1143,7 +1143,7 @@ (set! (-> v1-73 nav callback-info) (-> v1-73 enemy-info callback-info)) ) 0 - (dotimes (gp-2 (set-reaction-time! self (seconds 0.01) (seconds 0.017))) + (dotimes (gp-2 (rnd-time-frame self (seconds 0.01) (seconds 0.017))) (ja-no-eval :group! mantis-run0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1308,7 +1308,7 @@ ;; definition for function mantis-roll-post (defbehavior mantis-roll-post mantis () (let ((gp-0 (new 'stack-no-clear 'collide-query))) - (if (set-ground-pat! self gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f)) + (if (find-ground-and-set-pat! self gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f)) (set! (-> self root trans y) (-> gp-0 best-other-tri intersect y)) ) ) @@ -1448,7 +1448,7 @@ ) ) ) - (dotimes (gp-1 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (dotimes (gp-1 (rnd-time-frame self (seconds 0.007) (seconds 0.015))) (ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1464,7 +1464,8 @@ ;; definition for method 74 of type mantis ;; INFO: Used lq/sq -(defmethod go-ambush-delay ((this mantis)) +(defmethod go-ambush ((this mantis)) + "May go to ambush-delay first, if set in the res-lump." (let ((s5-0 (new 'stack-no-clear 'collide-query))) (if (enemy-above-ground? this s5-0 (-> this root trans) (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> this base-height) (-> s5-0 best-other-tri intersect y)) @@ -1500,6 +1501,7 @@ ;; definition for method 82 of type mantis (defmethod event-handler ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('track) (if (and (-> arg3 param 0) (time-elapsed? (-> this track-timer) (seconds 0.5))) @@ -1524,7 +1526,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1573,14 +1575,17 @@ ;; definition for method 136 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod set-ground-pat! ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) +(defmethod find-ground-and-set-pat! ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) + "Figure out what ground we're standing on and update the ground-pat. + Usually this will be done automatically by the collision system. + This method should be called after manually repositioning an enemy." (the-as pat-surface (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4 (the-as process #f)) (set! (-> this root ground-pat) (-> arg0 best-other-tri pat)) (when (time-elapsed? (-> this gspot-timer) (seconds 0.2)) (let ((a1-2 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-2 start-pos quad) (-> this root gspot-pos quad)) + (vector-copy! (-> a1-2 start-pos) (-> this root gspot-pos)) (+! (-> a1-2 start-pos y) 2048.0) (set-vector! (-> a1-2 move-dist) 0.0 -6144.0 0.0 0.0) (let ((v1-10 a1-2)) @@ -1643,7 +1648,7 @@ ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *up-vector* quad)) + (vector-copy! s4-0 *up-vector*) (let ((s3-0 (new 'stack-no-clear 'quaternion))) (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this gspot-normal) 10922.667) (vector-orient-by-quat! s4-0 s4-0 s3-0) @@ -1670,7 +1675,7 @@ (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-0 heading quad)) + (vector-copy! a1-1 (-> a2-0 heading)) (t9-0 this a1-1) ) 0 @@ -1681,6 +1686,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. (defmethod enemy-common-post ((this mantis)) + "Common implementation of post. Runs ja-post." (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) @@ -1689,7 +1695,7 @@ (let ((a0-4 (handle->process (-> this focus handle)))) (set! s5-0 (when a0-4 (set! s5-0 (-> this focus-pos)) - (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-4) 0) quad)) + (vector-copy! s5-0 (get-trans (the-as process-focusable a0-4) 0)) s5-0 ) ) @@ -1721,16 +1727,16 @@ #f ) ((let ((a1-5 (new 'stack-no-clear 'vector))) - (set! (-> a1-5 quad) (-> s3-0 quad)) + (vector-copy! a1-5 s3-0) (set! (-> a1-5 w) (-> arg0 root nav-radius)) - (add-root-sphere-to-hash! (-> arg0 nav) a1-5 1134) + (check-sphere-blocked! (-> arg0 nav) a1-5 1134) ) #f ) (else (let ((a1-6 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-6 start-pos quad) (-> arg1 trans quad)) - (set! (-> a1-6 move-dist quad) (-> arg2 quad)) + (vector-copy! (-> a1-6 start-pos) (-> arg1 trans)) + (vector-copy! (-> a1-6 move-dist) arg2) (let ((v1-14 a1-6)) (set! (-> v1-14 radius) 2048.0) (set! (-> v1-14 collide-with) (-> arg1 root-prim prim-core collide-with)) @@ -1922,8 +1928,8 @@ (when (< 0.8 (/ (vector-length s2-0) arg2)) (vector+! s5-1 s3-0 s2-0) (let ((a1-7 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-7 start-pos quad) (-> s3-0 quad)) - (set! (-> a1-7 move-dist quad) (-> s2-0 quad)) + (vector-copy! (-> a1-7 start-pos) s3-0) + (vector-copy! (-> a1-7 move-dist) s2-0) (+! (-> a1-7 start-pos y) (* 1.5 (-> arg0 enemy-info jump-height-min))) (let ((v1-17 a1-7)) (set! (-> v1-17 radius) 409.6) @@ -1937,8 +1943,8 @@ ) (when (< (fill-and-probe-using-line-sphere *collide-cache* a1-7) 0.0) (set! (-> s5-1 w) (-> arg0 root nav-radius)) - (when (not (add-root-sphere-to-hash! (-> arg0 nav) s5-1 #x10046e)) - (set! (-> arg4 quad) (-> s5-1 quad)) + (when (not (check-sphere-blocked! (-> arg0 nav) s5-1 #x10046e)) + (vector-copy! arg4 s5-1) (return arg4) v0-3 ) @@ -1968,6 +1974,7 @@ ;; definition for method 98 of type mantis (defmethod jump-wind-up-anim ((this mantis) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump start-anim))) (a0-4 (-> this skel root-channel 0)) @@ -1983,6 +1990,7 @@ ;; definition for method 96 of type mantis (defmethod jump-in-air-anim ((this mantis) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -1998,39 +2006,41 @@ ;; definition for method 101 of type mantis ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-101 ((this mantis) (arg0 int) (arg1 enemy-jump-info)) - (let ((v1-0 arg0)) - (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) - (let ((a0-4 this)) - (when (logtest? (enemy-flag ef38) (-> a0-4 enemy-flags)) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 dest-pos) (-> this root trans)))) - (vector-normalize! s5-1 1.0) - (let ((v1-5 (-> this jump direction))) - (cond - ((zero? v1-5) - ) - ((= v1-5 1) - (vector-negate! s5-1 s5-1) - ) - ((= v1-5 2) - (vector-rotate-y! s5-1 s5-1 -16384.0) - ) - ((= v1-5 3) - (vector-rotate-y! s5-1 s5-1 16384.0) - ) +(defmethod adjust-heading-for-jump ((this mantis) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Can be overriden. Yaw the enemy in response to an ongoing jump." + (case arg0 + (((jump-stage init) (jump-stage winding-up) (jump-stage takeoff) (jump-stage in-air)) + (let ((a0-4 this)) + (when (logtest? (enemy-flag ef38) (-> a0-4 enemy-flags)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 dest-pos) (-> this root trans)))) + (vector-normalize! s5-1 1.0) + (let ((v1-5 (-> this jump direction))) + (cond + ((zero? v1-5) ) - ) - (seek-toward-heading-vec! (-> this root) s5-1 (-> this nav max-rotation-rate) (seconds 0.02)) - ) - ) - ) - ) + ((= v1-5 1) + (vector-negate! s5-1 s5-1) + ) + ((= v1-5 2) + (vector-rotate-y! s5-1 s5-1 -16384.0) + ) + ((= v1-5 3) + (vector-rotate-y! s5-1 s5-1 16384.0) + ) + ) + ) + (seek-toward-heading-vec! (-> this root) s5-1 (-> this nav max-rotation-rate) (seconds 0.02)) + ) + ) + ) + ) ) (none) ) ;; definition for method 97 of type mantis (defmethod jump-land-anim ((this mantis) (arg0 enemy-jump-info)) + "Play the landing anim" (cond ((zero? (-> this jump land-anim)) #f @@ -2053,12 +2063,14 @@ ;; definition for method 67 of type mantis (defmethod coin-flip? ((this mantis)) + "Return #t half the time, #f the other." #f ) ;; definition for method 120 of type mantis ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod init-enemy-collision! ((this mantis)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2164,15 +2176,16 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this mantis)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mantis" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *mantis-nav-enemy-info*) + (setup-enemy! this *mantis-nav-enemy-info*) (set! (-> this flags) (mantis-flag)) - (set! (-> this my-up-vector quad) (-> *y-vector* quad)) - (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> this my-up-vector) *y-vector*) + (vector-copy! (-> this gspot-normal) *y-vector*) (set! (-> this gspot-timer) 0) (set! (-> this attack-timer) (+ (current-time) (seconds -5))) (set! (-> this track-timer) 0) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc index ea9ca4b9a7e..3eeee588adb 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/prebot-eco-creature_REF.gc @@ -300,34 +300,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 16384.0 - :knocked-red-vxz-hi 40960.0 - :knocked-red-vy-lo 49152.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 20480.0 - :knocked-blue-vxz-hi 28672.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 40960.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 4) + :knocked-red-vxz-hi (meters 10) + :knocked-red-vy-lo (meters 12) + :knocked-red-vy-hi (meters 15) + :knocked-blue-vxz-lo (meters 5) + :knocked-blue-vxz-hi (meters 7) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 10) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd player-list) @@ -702,31 +702,36 @@ (set! (-> *prebot-large-eco-creature-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type prebot-large-eco-creature -(defmethod go-ambush-delay ((this prebot-large-eco-creature)) +(defmethod go-ambush ((this prebot-large-eco-creature)) + "May go to ambush-delay first, if set in the res-lump." (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) - (go-idle2 this) - ((method-of-type nav-enemy go-ambush-delay) this) + (go-fallback-init this) + ((method-of-type nav-enemy go-ambush) this) ) ) ;; definition for method 71 of type prebot-large-eco-creature (defmethod go-dormant ((this prebot-large-eco-creature)) + "Go to the dormant state. This disables drawing/processing/collision, and runs no logic." (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) - (go-idle2 this) + (go-fallback-init this) ((method-of-type nav-enemy go-dormant) this) ) ) ;; definition for method 72 of type prebot-large-eco-creature (defmethod go-dormant-aware ((this prebot-large-eco-creature)) + "Go to the dormat aware state. + Similar to dormant, drawing/collision are disabled, but enemies can exit dormant-aware." (if (type? (ppointer->process (-> this parent)) prebot-large-eco-creature) - (go-idle2 this) + (go-fallback-init this) ((method-of-type nav-enemy go-dormant-aware) this) ) ) ;; definition for method 82 of type prebot-large-eco-creature (defmethod event-handler ((this prebot-large-eco-creature) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (let ((s4-0 (the-as object (-> arg3 param 1)))) @@ -798,12 +803,14 @@ ;; definition for method 67 of type prebot-large-eco-creature (defmethod coin-flip? ((this prebot-large-eco-creature)) + "Return #t half the time, #f the other." #f ) ;; definition for method 59 of type prebot-large-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this prebot-large-eco-creature)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -972,7 +979,7 @@ (logclear! (-> self flags) (eco-creature-flag ecf1)) (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-9 *game-info*) (a0-5 (+ (-> v1-9 attack-id) 1)) @@ -1001,7 +1008,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) nav-state (if (logtest? (-> self enemy-flags) (enemy-flag victory)) (logior! (-> self flags) (eco-creature-flag ecf1)) @@ -1051,7 +1058,7 @@ (t9-0) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1217,7 +1224,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1234,7 +1241,7 @@ :trans (behavior () (ja :num! (seek!)) (if (ja-done? 0) - (go-best-state self) + (go-state-for-focused self) ) ) :code sleep-code @@ -1327,13 +1334,13 @@ (set! (-> self which-trajectory) 0) (set! (-> self x-rotate) 0.0) (set! (-> self y-rotate) 0.0) - (set! (-> self root trans quad) (-> (the-as vector s5-0) quad)) - (set! (-> self launch-pos quad) (-> (the-as vector s5-0) quad)) - (set! (-> self launch quad) (-> (the-as vector s5-0) quad)) + (vector-copy! (-> self root trans) (the-as vector s5-0)) + (vector-copy! (-> self launch-pos) (the-as vector s5-0)) + (vector-copy! (-> self launch) (the-as vector s5-0)) (let* ((v1-36 (-> self nav)) (f0-25 (-> v1-36 extra-nav-sphere w)) ) - (set! (-> v1-36 extra-nav-sphere quad) (-> (the-as vector gp-0) quad)) + (vector-copy! (-> v1-36 extra-nav-sphere) (the-as vector gp-0)) (set! (-> v1-36 extra-nav-sphere w) f0-25) ) ) @@ -1478,7 +1485,8 @@ ) ;; definition for method 122 of type prebot-large-eco-creature -(defmethod go-idle2 ((this prebot-large-eco-creature)) +(defmethod go-fallback-init ((this prebot-large-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." (set! (-> this event-hook) (-> (method-of-object this fly-to-dest) event)) (go (method-of-object this fly-to-dest)) ) @@ -1486,6 +1494,7 @@ ;; definition for method 120 of type prebot-large-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this prebot-large-eco-creature)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1669,12 +1678,13 @@ ;; definition for method 121 of type prebot-large-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this prebot-large-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *prebot-large-eco-creature-nav-enemy-info*) + (setup-enemy! this *prebot-large-eco-creature-nav-enemy-info*) (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) @@ -1747,8 +1757,8 @@ (let ((gp-1 (new 'stack-no-clear 'enemy-init-by-other-params))) (let ((v1-2 (new 'stack-no-clear 'vector))) (-> self root transv) - (set! (-> v1-2 quad) (-> self root trans quad)) - (set! (-> gp-1 trans quad) (-> v1-2 quad)) + (vector-copy! v1-2 (-> self root trans)) + (vector-copy! (-> gp-1 trans) v1-2) ) (quaternion-copy! (-> gp-1 quat) (-> self root quat)) (set! (-> gp-1 entity) (-> self entity)) @@ -1956,34 +1966,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 49152.0 - :knocked-red-vy-lo 57344.0 - :knocked-red-vy-hi 69632.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 40960.0 - :knocked-blue-vy-lo 20480.0 - :knocked-blue-vy-hi 53248.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 12) + :knocked-red-vy-lo (meters 14) + :knocked-red-vy-hi (meters 17) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 10) + :knocked-blue-vy-lo (meters 5) + :knocked-blue-vy-hi (meters 13) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd player-list) @@ -2464,7 +2474,8 @@ ) ;; definition for method 122 of type prebot-medium-eco-creature -(defmethod go-idle2 ((this prebot-medium-eco-creature)) +(defmethod go-fallback-init ((this prebot-medium-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." (set-vector! (-> this root scale) (-> this initial-scale) (-> this initial-scale) (-> this initial-scale) 1.0) (go (method-of-object this knocked)) ) @@ -2472,6 +2483,7 @@ ;; definition for method 120 of type prebot-medium-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this prebot-medium-eco-creature)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2602,12 +2614,13 @@ ;; definition for method 121 of type prebot-medium-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this prebot-medium-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *prebot-medium-eco-creature-nav-enemy-info*) + (setup-enemy! this *prebot-medium-eco-creature-nav-enemy-info*) (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) @@ -2724,7 +2737,7 @@ ) (set! (-> self is-top) #f) (set! (-> self is-bottom) #f) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -2881,34 +2894,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 32768.0 - :knocked-red-vxz-hi 57344.0 - :knocked-red-vy-lo 65536.0 - :knocked-red-vy-hi 77824.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 61440.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 8) + :knocked-red-vxz-hi (meters 14) + :knocked-red-vy-lo (meters 16) + :knocked-red-vy-hi (meters 19) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 15) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd player-list) @@ -3285,6 +3298,7 @@ ;; definition for method 120 of type prebot-small-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this prebot-small-eco-creature)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -3415,12 +3429,13 @@ ;; definition for method 121 of type prebot-small-eco-creature ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this prebot-small-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-cav-eco-lg" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *prebot-small-eco-creature-nav-enemy-info*) + (setup-enemy! this *prebot-small-eco-creature-nav-enemy-info*) (logior! (-> this draw global-effect) (draw-control-global-effect rim-lights2)) (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) @@ -3488,14 +3503,16 @@ ;; definition for method 121 of type medium-eco-creature-launched ;; WARN: Return type mismatch vector vs none. (defmethod init-enemy! ((this medium-eco-creature-launched)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) (none) ) ;; definition for method 122 of type medium-eco-creature-launched -(defmethod go-idle2 ((this medium-eco-creature-launched)) - ((method-of-type prebot-large-eco-creature go-idle2) this) +(defmethod go-fallback-init ((this medium-eco-creature-launched)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type prebot-large-eco-creature go-fallback-init) this) ) ;; definition of type small-eco-creature-launched @@ -3519,14 +3536,16 @@ ;; definition for method 121 of type small-eco-creature-launched ;; WARN: Return type mismatch vector vs none. (defmethod init-enemy! ((this small-eco-creature-launched)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) (none) ) ;; definition for method 122 of type small-eco-creature-launched -(defmethod go-idle2 ((this small-eco-creature-launched)) - ((method-of-type prebot-large-eco-creature go-idle2) this) +(defmethod go-fallback-init ((this small-eco-creature-launched)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type prebot-large-eco-creature go-fallback-init) this) ) ;; definition of type large-eco-creature @@ -3548,13 +3567,15 @@ ) ;; definition for method 122 of type large-eco-creature -(defmethod go-idle2 ((this large-eco-creature)) - ((method-of-type nav-enemy go-idle2) this) +(defmethod go-fallback-init ((this large-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type nav-enemy go-fallback-init) this) ) ;; definition for method 121 of type large-eco-creature ;; WARN: Return type mismatch eco-creature-flag vs none. (defmethod init-enemy! ((this large-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (logior! (-> this flags) (eco-creature-flag ecf2)) (none) @@ -3579,13 +3600,15 @@ ) ;; definition for method 122 of type medium-eco-creature -(defmethod go-idle2 ((this medium-eco-creature)) - ((method-of-type nav-enemy go-idle2) this) +(defmethod go-fallback-init ((this medium-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type nav-enemy go-fallback-init) this) ) ;; definition for method 121 of type medium-eco-creature ;; WARN: Return type mismatch eco-creature-flag vs none. (defmethod init-enemy! ((this medium-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) (logior! (-> this flags) (eco-creature-flag ecf2)) @@ -3611,13 +3634,15 @@ ) ;; definition for method 122 of type small-eco-creature -(defmethod go-idle2 ((this small-eco-creature)) - ((method-of-type nav-enemy go-idle2) this) +(defmethod go-fallback-init ((this small-eco-creature)) + "If there's no specific settings for initial state, go to this state after spawning." + ((method-of-type nav-enemy go-fallback-init) this) ) ;; definition for method 121 of type small-eco-creature ;; WARN: Return type mismatch eco-creature-flag vs none. (defmethod init-enemy! ((this small-eco-creature)) + "Typical place for shared init code. Runs from entity or process style init." (call-parent-method this) (set-vector! (-> this root scale) (-> this final-scale) (-> this final-scale) (-> this final-scale) 1.0) (logior! (-> this flags) (eco-creature-flag ecf2)) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc index 58bb68928c7..c177a014a3c 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/roboguard_REF.gc @@ -352,34 +352,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 61440.0 - :knocked-soft-vy-lo 49152.0 - :knocked-soft-vy-hi 65536.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 73728.0 - :knocked-hard-vxz-hi 114688.0 - :knocked-hard-vy-lo 49152.0 - :knocked-hard-vy-hi 73728.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 28672.0 - :knocked-yellow-vy-lo 36864.0 - :knocked-yellow-vy-hi 4096.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 114688.0 - :knocked-red-vy-lo 53248.0 - :knocked-red-vy-hi 69632.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 20480.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 15) + :knocked-soft-vy-lo (meters 12) + :knocked-soft-vy-hi (meters 16) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 18) + :knocked-hard-vxz-hi (meters 28) + :knocked-hard-vy-lo (meters 12) + :knocked-hard-vy-hi (meters 18) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 7) + :knocked-yellow-vy-lo (meters 9) + :knocked-yellow-vy-hi (meters 1) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 28) + :knocked-red-vy-lo (meters 13) + :knocked-red-vy-hi (meters 17) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 5) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -475,6 +475,7 @@ ;; definition for method 120 of type roboguard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this roboguard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -537,7 +538,7 @@ (let ((v1-3 (joint-node roboguard-lod0-jg chest)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> v1-3 bone transform fvec quad)) + (vector-copy! gp-0 (-> v1-3 bone transform fvec)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> v1-3 bone transform trans)))) (set! (-> gp-0 y) 0.0) (set! (-> s5-1 y) 0.0) @@ -692,7 +693,7 @@ (defstate notice (roboguard) :virtual #t :exit (behavior () - (set! (-> self formation-position quad) (-> self root trans quad)) + (vector-copy! (-> self formation-position) (-> self root trans)) (let ((t9-0 (-> (method-of-type nav-enemy notice) exit))) (if t9-0 (t9-0) @@ -717,7 +718,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -774,7 +775,7 @@ ) (logclear! (-> a0-4 flags) (nav-state-flag directional-mode)) (logior! (-> a0-4 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-4 target-pos quad) (-> v1-8 quad)) + (vector-copy! (-> a0-4 target-pos) v1-8) ) 0 (nav-enemy-method-187 self) @@ -995,7 +996,7 @@ (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 bone transform uvec) -1.0) (let ((s5-1 (new 'stack-no-clear 'matrix))) (vector-! (-> s5-1 rvec) (-> self fire-at-pos) v1-2) - (set! (-> s5-1 uvec quad) (-> s5-1 rvec quad)) + (vector-copy! (-> s5-1 uvec) (-> s5-1 rvec)) (set! (-> s5-1 uvec y) 0.0) (vector-normalize! (-> s5-1 uvec) 1.0) (vector-normalize-copy! (-> s5-1 fvec) (-> s5-1 rvec) 1.0) @@ -1039,29 +1040,27 @@ ) ) (dotimes (gp-0 (- (-> self last-hit-points) (the int (-> self hit-points)))) - (let ((s5-0 (enemy-method-131 self 8 (the-as int (logior (-> self draw seg-mask) 1))))) + (let ((s5-0 (rnd-int-excluding-masked self 8 (the-as int (logior (-> self draw seg-mask) 1))))) (when (> s5-0 0) (let ((a1-2 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-2 hit-xz-reaction) 0.5) (set! (-> a1-2 hit-y-reaction) 0.3) - (set! (-> a1-2 fountain-rand-transv-lo quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! (-> a1-2 fountain-rand-transv-lo) (-> self root root-prim prim-core world-sphere)) (let ((s3-0 (-> *roboguard-debris-array-params* (+ s5-0 -1)))) (debris-spawn self a1-2 s3-0 (the-as process-drawable #f)) (cond ((logtest? (-> *part-group-id-table* 223 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) - quad - ) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) + ) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 223)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) - quad - ) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s3-0 joints 0 parent-joint-index))) + ) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 223)) ) ) @@ -1093,7 +1092,7 @@ (t9-0) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1181,7 +1180,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-14 quad) vf6) ) - (set! (-> s5-1 quad) (-> self incoming attack-direction quad)) + (vector-copy! s5-1 (-> self incoming attack-direction)) (vector-normalize-copy! (-> gp-1 fountain-rand-transv-lo) s5-1 -20480.0) (vector-normalize-copy! (-> gp-1 fountain-rand-transv-hi) s5-1 122880.0) ) @@ -1201,11 +1200,11 @@ (let ((v1-25 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node roboguard-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-25) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-25) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -1224,9 +1223,9 @@ ;; INFO: Used lq/sq (defmethod roboguard-method-194 ((this roboguard) (arg0 vector) (arg1 float)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> arg0 quad)) + (vector-copy! a1-1 arg0) (set! (-> a1-1 w) arg1) - (and (not (add-root-sphere-to-hash! (-> this nav) a1-1 #x100068)) + (and (not (check-sphere-blocked! (-> this nav) a1-1 #x100068)) (let ((a0-5 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) arg0))) (< (vector-x-angle a0-5) 5461.3335) ) @@ -1307,9 +1306,9 @@ ) (not (roboguard-method-194 this (-> this formation-position) 9011.2)) ) - (set! (-> this focus-formation-source quad) (-> this focus-pos quad)) + (vector-copy! (-> this focus-formation-source) (-> this focus-pos)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this formation-position) (-> this focus-formation-source))) ) (when (< 0.0 (vector-length s4-1)) @@ -1325,7 +1324,7 @@ (when (and (closest-point-on-mesh (-> this nav) s2-0 s2-0 (the-as nav-poly #f)) (roboguard-method-194 this s2-0 9011.2) ) - (set! (-> s5-0 quad) (-> s2-0 quad)) + (vector-copy! s5-0 s2-0) #t (goto cfg-26) ) @@ -1335,7 +1334,7 @@ ) (label cfg-26) (set! (-> this formation-angle-sign) (* -1.0 (-> this formation-angle-sign))) - (set! (-> this formation-position quad) (-> s5-0 quad)) + (vector-copy! (-> this formation-position) s5-0) ) ) 0 @@ -1365,6 +1364,7 @@ ;; definition for method 85 of type roboguard (defmethod knocked-anim ((this roboguard) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (case (-> this incoming knocked-type) (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) @@ -1395,6 +1395,7 @@ ;; definition for method 86 of type roboguard (defmethod knocked-land-anim ((this roboguard) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type none) (knocked-type mech-punch) (knocked-type yellow-shot) (knocked-type blue-shot)) (let ((v1-4 (-> this skel root-channel 0))) @@ -1425,6 +1426,7 @@ ;; definition for method 66 of type roboguard ;; WARN: Return type mismatch int vs penetrate. (defmethod get-penetrated-by ((this roboguard)) + "Figure out the penetrated-by mask for this process." (the-as penetrate 0) ) @@ -1435,7 +1437,9 @@ ;; definition for method 109 of type roboguard ;; INFO: Used lq/sq -(defmethod enemy-method-109 ((this roboguard)) +(defmethod out-of-bounds? ((this roboguard)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (let ((gp-0 (-> this root)) (s3-0 (-> this nav state)) ) @@ -1443,7 +1447,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (cond ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ) (else (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) @@ -1463,6 +1467,7 @@ ;; definition for method 82 of type roboguard (defmethod event-handler ((this roboguard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1474,7 +1479,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1657,13 +1662,14 @@ ;; definition for method 59 of type roboguard ;; INFO: Used lq/sq (defmethod enemy-common-post ((this roboguard)) + "Common implementation of post. Runs ja-post." (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) (vector-rotate-around-y! (the-as vector (-> this upper-rotation-matrix)) (the-as vector (-> this rotation-matrix)) (-> this torso-angle) ) - (set! (-> this upper-rotation-matrix uvec quad) (-> this rotation-matrix uvec quad)) + (vector-copy! (-> this upper-rotation-matrix uvec) (-> this rotation-matrix uvec)) (vector-rotate-around-y! (-> this upper-rotation-matrix fvec) (-> this rotation-matrix fvec) @@ -1673,7 +1679,7 @@ (when (-> this update-focus-pos) (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-0) 5) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s5-0) 5)) (los-control-method-9 (-> this los) (the-as process-focusable s5-0) (-> this focus-pos) 819.2 4096.0) ) ) @@ -1697,12 +1703,14 @@ ;; definition for method 67 of type roboguard (defmethod coin-flip? ((this roboguard)) + "Return #t half the time, #f the other." #f ) ;; definition for method 121 of type roboguard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this roboguard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard" (the-as (pointer level) #f))) @@ -1712,7 +1720,7 @@ (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) ) - (init-enemy-defaults! this *roboguard-nav-enemy-info*) + (setup-enemy! this *roboguard-nav-enemy-info*) (init-los! (-> this los) this @@ -1733,9 +1741,9 @@ ) (cspace<-parented-transformq-joint! arg0 arg1) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> s3-0 rotation-matrix rvec quad)) + (vector-copy! s2-0 (-> s3-0 rotation-matrix rvec)) (let ((s0-0 (new 'stack-no-clear 'vector))) - (set! (-> s0-0 quad) (-> s3-0 rotation-matrix fvec quad)) + (vector-copy! s0-0 (-> s3-0 rotation-matrix fvec)) (let ((s1-0 (new 'stack-no-clear 'vector))) (set! sv-96 (-> s3-0 focus-pos)) (let* ((v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) arg0)) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc index f9d8a046a30..6dfd0582883 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spyder_REF.gc @@ -236,34 +236,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 90112.0 - :knocked-soft-vxz-hi 131072.0 - :knocked-soft-vy-lo 114688.0 - :knocked-soft-vy-hi 155648.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 131072.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 139264.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 57344.0 - :knocked-blue-vy-hi 98304.0 + :knocked-soft-vxz-lo (meters 22) + :knocked-soft-vxz-hi (meters 32) + :knocked-soft-vy-lo (meters 28) + :knocked-soft-vy-hi (meters 38) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 32) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 34) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 14) + :knocked-blue-vy-hi (meters 24) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -306,6 +306,7 @@ ;; definition for method 82 of type spyder (defmethod event-handler ((this spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -317,7 +318,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -441,7 +442,7 @@ (vector+! s4-0 s5-0 s2-1) ) ) - (set! (-> this move-dest quad) (-> s5-0 quad)) + (vector-copy! (-> this move-dest) s5-0) (closest-point-on-mesh (-> this nav) (-> this move-dest) s4-0 (the-as nav-poly #f)) ) ) @@ -452,6 +453,7 @@ ;; definition for method 85 of type spyder (defmethod knocked-anim ((this spyder) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (let ((a0-2 (-> this skel root-channel 0))) @@ -471,7 +473,7 @@ (s5-0 (new 'static 'array int64 3 17 18 19)) (s4-0 (new 'static 'array int32 4 0 0 0 0)) (a2-1 (ash 1 (-> s4-0 0))) - (v1-20 (enemy-method-131 this a1-4 a2-1)) + (v1-20 (rnd-int-excluding-masked this a1-4 a2-1)) (s5-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-20 8) (the-as int s5-0)))))) ) (set! (-> s4-0 0) v1-20) @@ -522,6 +524,7 @@ ;; definition for method 86 of type spyder (defmethod knocked-land-anim ((this spyder) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (cond @@ -556,6 +559,7 @@ ;; definition for method 96 of type spyder (defmethod jump-in-air-anim ((this spyder) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) (let ((v1-6 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) @@ -590,7 +594,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior spyder-travel-post spyder () - (set! (-> self face-pos quad) (-> self move-dest quad)) + (vector-copy! (-> self face-pos) (-> self move-dest)) (logior! (-> self status-flags) (spyder-flag sf3)) (nav-enemy-travel-post) 0 @@ -606,7 +610,7 @@ (f30-0 (-> self nav max-rotation-rate)) ) (when gp-0 - (set! (-> self face-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! (-> self face-pos) (get-trans (the-as process-focusable gp-0) 0)) (let ((a0-4 self)) (if (logtest? (enemy-flag ef38) (-> a0-4 enemy-flags)) (seek-to-point-toward-point! @@ -652,7 +656,7 @@ (logclear! (-> this status-flags) (spyder-flag sf3)) ) (else - (set! (-> s4-1 quad) (-> s3-0 quad)) + (vector-copy! s4-1 s3-0) ) ) (set! (-> s4-1 y) 0.0) @@ -680,7 +684,7 @@ (defmethod spyder-method-196 ((this spyder) (arg0 vector)) (when (not (logtest? (-> this status-flags) (spyder-flag sf0))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> *up-vector* quad)) + (vector-copy! s4-0 *up-vector*) (let ((s3-0 (new 'stack-no-clear 'quaternion))) (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this root gspot-normal) 4551.1113) (vector-orient-by-quat! s4-0 s4-0 s3-0) @@ -700,12 +704,13 @@ ;; definition for method 59 of type spyder ;; INFO: Used lq/sq (defmethod enemy-common-post ((this spyder)) + "Common implementation of post. Runs ja-post." (spyder-method-197 this) (spyder-method-196 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (when (< 1 (the-as int (-> this focus aware))) (let ((s5-1 (handle->process (-> this focus handle)))) (when s5-1 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s5-1) 1) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s5-1) 1)) (los-control-method-9 (-> this los) (the-as process-focusable s5-1) @@ -818,7 +823,7 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (let ((v1-15 (new 'stack-no-clear 'vector))) - (set! (-> v1-15 quad) (-> *y-vector* quad)) + (vector-copy! v1-15 *y-vector*) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((a1-3 s3-0)) @@ -836,7 +841,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-3 quad) vf6) ) - (set! (-> s2-0 quad) (-> s3-0 quad)) + (vector-copy! s2-0 s3-0) (set! (-> s2-0 y) (-> this root trans y)) (let ((a2-10 (-> s5-0 start-pos))) (let ((a0-12 s2-0)) @@ -934,7 +939,7 @@ (let ((a0-1 (handle->process (-> self focus handle)))) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-1) 0)) (let* ((s5-0 (-> self root trans)) (f30-0 (vector-vector-distance s5-0 gp-0)) (f0-0 (vector-vector-xz-distance s5-0 (-> self move-dest))) @@ -961,7 +966,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (spyder-travel-post) @@ -1018,7 +1023,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> v1-0 quad)) + (vector-copy! (-> gp-0 pos) v1-0) (set! (-> gp-0 notify-handle) (process->handle this)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1057,7 +1062,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + (vector-copy! (-> v1-1 target-pos) a0-1) ) 0 (let ((v1-4 self)) @@ -1083,11 +1088,11 @@ ) ) :code (behavior () - (when (not (enemy-method-105 self 2730.6667 #t)) + (when (not (pointing-toward-focus? self 2730.6667 #t)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! spyder-patrol0-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 910.2222 #t) + (until (pointing-toward-focus? self 910.2222 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -1110,9 +1115,9 @@ (let ((a0-14 (handle->process (-> self focus handle)))) (when a0-14 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-14) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-14) 0)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> gp-0 quad)) + (vector-copy! s5-0 gp-0) (let ((f28-0 0.0)) (dotimes (s4-0 8) (let* ((f26-0 (fmin (-> self root trans y) (-> gp-0 y))) @@ -1124,7 +1129,7 @@ (vector+! s2-1 gp-0 s2-1) (set! (-> s2-1 y) f26-0) (set! (-> self fire-info 0 quad) (-> s3-0 quad)) - (set! (-> self fire-info 1 quad) (-> s2-1 quad)) + (vector-copy! (-> self fire-info 1) s2-1) ) (suspend-for (seconds 0.2) (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) @@ -1132,10 +1137,10 @@ (ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0) ) (let ((f28-1 (+ 12288.0 f28-0))) - (set! (-> gp-0 quad) (-> s5-0 quad)) + (vector-copy! gp-0 s5-0) (let ((a0-31 (handle->process (-> self focus handle)))) (if a0-31 - (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-31) 0) quad)) + (vector-copy! s5-0 (get-trans (the-as process-focusable a0-31) 0)) ) ) (set! f28-0 (fmax 0.0 (- f28-1 (vector-vector-distance gp-0 s5-0)))) @@ -1172,6 +1177,7 @@ ;; definition for method 78 of type spyder (defmethod go-hostile ((this spyder)) + "Go to the hostile state, actively trying to attack the target." (if (and (not (logtest? (-> this status-flags) (spyder-flag sf1))) (-> this next-state) (let ((v1-5 (-> this next-state name))) @@ -1231,7 +1237,7 @@ (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-0 heading quad)) + (vector-copy! a1-1 (-> a2-0 heading)) (t9-0 this a1-1) ) 0 @@ -1240,12 +1246,14 @@ ;; definition for method 67 of type spyder (defmethod coin-flip? ((this spyder)) + "Return #t half the time, #f the other." #f ) ;; definition for method 120 of type spyder ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this spyder)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1358,12 +1366,13 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this spyder)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-spyder" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *spyder-nav-enemy-info*) + (setup-enemy! this *spyder-nav-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -1377,12 +1386,12 @@ 0 (set-gravity-length (-> this root dynam) 573440.0) (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) - (set! (-> this my-up-vector quad) (-> *up-vector* quad)) + (vector-copy! (-> this my-up-vector) *up-vector*) (set! (-> this status-flags) (spyder-flag sf2)) (if (rand-vu-percent? 0.5) (logior! (-> this status-flags) (spyder-flag sf4)) ) - (set! (-> this start-pos quad) (-> this root trans quad)) + (vector-copy! (-> this start-pos) (-> this root trans)) (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "spyder-talk" :group 0 :fo-max 70) (-> this root trans) 0.0) ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc index 097df14a7ae..6d179d4f4aa 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spydroid-orig_REF.gc @@ -679,34 +679,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -749,6 +749,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this spydroid-orig)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -787,7 +788,7 @@ (let ((a0-13 (-> this lightning s3-0)) (v1-28 s4-0) ) - (set! (-> a0-13 state meet data (+ (-> a0-13 state points-to-draw) -1) quad) (-> v1-28 quad)) + (vector-copy! (-> a0-13 state meet data (+ (-> a0-13 state points-to-draw) -1)) v1-28) ) (when (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) (or (= v1-33 'die-falling) (= v1-33 'explode)) @@ -852,6 +853,7 @@ ;; definition for method 82 of type spydroid-orig ;; INFO: Used lq/sq (defmethod event-handler ((this spydroid-orig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v1-8 structure) (sv-144 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1019,7 +1021,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1090,14 +1092,14 @@ ) ) (let ((v1-25 (new 'stack-no-clear 'vector))) - (set! (-> v1-25 quad) (-> self root trans quad)) + (vector-copy! v1-25 (-> self root trans)) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-25) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-25 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-25) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -1201,7 +1203,7 @@ ) 0 (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-14 *game-info*) (a0-11 (+ (-> v1-14 attack-id) 1)) ) @@ -1224,7 +1226,7 @@ ) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) nav-state (if (logtest? (-> self enemy-flags) (enemy-flag victory)) (logior! (-> self flags) (spydroid-orig-flag sof2)) @@ -1313,7 +1315,7 @@ (t9-0) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1558,6 +1560,7 @@ ;; definition for method 120 of type spydroid-orig ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this spydroid-orig)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1620,6 +1623,7 @@ ;; definition for method 67 of type spydroid-orig (defmethod coin-flip? ((this spydroid-orig)) + "Return #t half the time, #f the other." #f ) @@ -1657,12 +1661,13 @@ ;; definition for method 121 of type spydroid-orig ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this spydroid-orig)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid-orig" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *spydroid-orig-nav-enemy-info*) + (setup-enemy! this *spydroid-orig-nav-enemy-info*) (dotimes (s5-1 4) (set! (-> this lightning s5-1) (new diff --git a/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc index ed2789bc704..acad0d262be 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/spydroid_REF.gc @@ -327,34 +327,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -396,6 +396,7 @@ ;; definition for method 59 of type spydroid ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this spydroid)) + "Common implementation of post. Runs ja-post." (spydroid-method-236 this) ((method-of-type kg-squad-member enemy-common-post) this) 0 @@ -404,6 +405,7 @@ ;; definition for method 82 of type spydroid (defmethod event-handler ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('jump) (set! (-> this floor) (-> (the-as enemy-jump-info (-> arg3 param 1)) anim-speed)) @@ -422,15 +424,17 @@ (sound-play "droid-explode") (cond ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) + ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 221)) ) (else - (set! (-> *launch-matrix* trans quad) - (-> (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (vector+float*! (new 'stack-no-clear 'vector) (-> self root trans) *up-vector* 2048.0) + ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 221)) ) ) @@ -462,11 +466,11 @@ (when (not (time-elapsed? (-> self state-time) (seconds 2))) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 219)) ) ) @@ -487,7 +491,7 @@ (let ((s4-0 (handle->process (-> this focus handle))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> (the-as process-focusable s4-0) root root-prim prim-core world-sphere quad)) + (vector-copy! s3-0 (-> (the-as process-focusable s4-0) root root-prim prim-core world-sphere)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> this root trans)))) 0.0 (set! (-> s5-1 y) 0.0) @@ -551,7 +555,7 @@ (let ((v1-26 (-> self nav state))) (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-26 target-pos quad) (-> s4-2 quad)) + (vector-copy! (-> v1-26 target-pos) s4-2) ) ) ) @@ -704,7 +708,7 @@ (let ((a0-2 (the-as process-focusable (handle->process (-> self focus handle))))) (when a0-2 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (get-trans a0-2 3) quad)) + (vector-copy! gp-0 (get-trans a0-2 3)) (set! f0-0 (spydroid-method-234 self gp-0)) ) (set! f28-0 (/ f0-0 METER_LENGTH)) @@ -750,7 +754,7 @@ :event enemy-event-handler :enter (behavior () (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (logior! (-> self focus-status) (focus-status dangerous)) (nav-enemy-method-182 self) (let* ((v1-7 *game-info*) @@ -768,7 +772,7 @@ (let ((a0-2 (the-as process-focusable (handle->process (-> self focus handle))))) (when a0-2 (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (get-trans a0-2 3) quad)) + (vector-copy! s5-0 (get-trans a0-2 3)) (vector-! gp-0 s5-0 (-> self root trans)) ) ) @@ -784,12 +788,12 @@ (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> s5-2 quad)) + (vector-copy! s3-0 s5-2) (when s1-0 (set! (-> s3-0 y) 0.0) (clamp-vector-to-mesh-no-gaps (-> self nav) s4-0 s1-0 s3-0 s2-0) (if (-> s2-0 found-boundary) - (set! (-> s5-2 quad) (-> s3-0 quad)) + (vector-copy! s5-2 s3-0) ) ) ) @@ -875,7 +879,7 @@ (let ((v1-28 (-> this alert-level))) (cond ((zero? v1-28) - (enemy-method-70 this (get-target-focus (-> this squad)) (the-as enemy-aware #f)) + (set-focus! this (get-target-focus (-> this squad)) (the-as enemy-aware #f)) ) ((= v1-28 3) (if (and (zero? (get-alert-level1 (-> this squad))) (= (-> this faction-mode) 0)) @@ -913,7 +917,7 @@ (let ((a0-10 (the-as process-focusable (handle->process (-> this focus handle)))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> (get-trans a0-10 3) quad)) + (vector-copy! s5-0 (get-trans a0-10 3)) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> this root trans)))) 0.0 0.0 @@ -933,7 +937,7 @@ (let ((f30-1 (vector-dot s4-1 s3-0))) (when (or (< 0.707 f30-1) (and (< -0.7 f30-1) (< f28-0 18432.0)) (< f28-0 16384.0)) (let ((a1-6 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-6 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> a1-6 start-pos) (-> this root trans)) (+! (-> a1-6 start-pos y) 4096.0) (vector-! (-> a1-6 move-dist) s5-0 (-> a1-6 start-pos)) (let ((v1-45 a1-6)) @@ -980,13 +984,13 @@ (('panic) (let ((gp-0 (the-as traffic-danger-info (-> block param 0)))) (when (spydroid-method-237 self gp-0) - (set! (-> self move-dest quad) (-> gp-0 sphere quad)) + (vector-copy! (-> self move-dest) (-> gp-0 sphere)) (let ((a0-4 (-> self nav state)) (v1-5 (-> self move-dest)) ) (logclear! (-> a0-4 flags) (nav-state-flag directional-mode)) (logior! (-> a0-4 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-4 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> a0-4 target-pos) v1-5) ) 0 ) @@ -1003,7 +1007,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (set-time! (-> self state-time)) @@ -1025,7 +1029,7 @@ ) (when (> (get-alert-level1 (-> self squad)) 0) (spydroid-method-231 self (the-as uint 3)) - (enemy-method-70 self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) + (set-focus! self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) (go-virtual hostile) ) ) @@ -1152,6 +1156,7 @@ ;; definition for method 120 of type spydroid ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this spydroid)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1216,6 +1221,7 @@ ;; definition for method 67 of type spydroid (defmethod coin-flip? ((this spydroid)) + "Return #t half the time, #f the other." #f ) @@ -1315,21 +1321,10 @@ ) (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> this node-list data (-> s3-0 joint)))) - (let* ((v1-13 s4-0) - (t0-0 (-> a1-1 bone transform)) - (a0-5 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-13 rvec quad) a0-5) - (set! (-> v1-13 uvec quad) a2-0) - (set! (-> v1-13 fvec quad) a3-0) - (set! (-> v1-13 trans quad) t0-1) - ) + (matrix-copy! s4-0 (-> a1-1 bone transform)) (vector<-cspace! (-> s4-0 trans) a1-1) ) - (set! (-> s2-0 quad) (-> s3-0 offset quad)) + (vector-copy! s2-0 (-> s3-0 offset)) (set! (-> s2-0 w) 1.0) (vector-matrix*! (-> s4-0 trans) s2-0 s4-0) ) @@ -1343,12 +1338,13 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this spydroid)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *spydroid-nav-enemy-info*) + (setup-enemy! this *spydroid-nav-enemy-info*) (call-parent-method this) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) @@ -1464,7 +1460,7 @@ (('panic) (let ((gp-0 (the-as traffic-danger-info (-> block param 0)))) (when (spydroid-method-237 self gp-0) - (set! (-> self move-dest quad) (-> gp-0 sphere quad)) + (vector-copy! (-> self move-dest) (-> gp-0 sphere)) (go-virtual search) ) ) @@ -1493,7 +1489,7 @@ ) (when (> (get-alert-level1 (-> self squad)) 0) (spydroid-method-231 self (the-as uint 3)) - (enemy-method-70 self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) + (set-focus! self (get-target-focus (-> self squad)) (the-as enemy-aware #f)) (go-virtual hostile) ) ) @@ -1528,7 +1524,7 @@ (not (logtest? (-> (the-as process-focusable a0-18) focus-status) (focus-status disable dead inactive))) ) (let* ((s5-1 this) - (s4-0 (method-of-object s5-1 enemy-method-70)) + (s4-0 (method-of-object s5-1 set-focus!)) (s3-0 (handle->process (-> this current-enemy))) ) (s4-0 @@ -1603,7 +1599,7 @@ (defmethod go-from-behavior ((this spydroid) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((6) - (set! (-> this root trans quad) (-> arg0 position quad)) + (vector-copy! (-> this root trans) (-> arg0 position)) (go (method-of-object this exit-transport)) ) (else diff --git a/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc b/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc index b5c49455377..07b54b1af38 100644 --- a/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/external-player-control_REF.gc @@ -19,7 +19,7 @@ ;; WARN: Return type mismatch int vs none. (defun set-pad-world-dir ((arg0 cpad-info) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (let ((s3-0 (matrix-transpose! (new 'stack-no-clear 'matrix) (-> *target* control cam-R-w)))) (let ((s2-0 (matrix-from-two-vectors! (new 'stack-no-clear 'matrix) @@ -203,7 +203,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self root trans) (target-pos 0)) (set-params self arg0) (go-virtual idle) ) @@ -212,7 +212,7 @@ ;; INFO: Used lq/sq (defmethod set-params ((this player-controller) (arg0 player-controller-init-params)) (mem-copy! (the-as pointer (-> this params)) (the-as pointer arg0) 40) - (set! (-> this targ-pos quad) (-> arg0 targ-pos quad)) + (vector-copy! (-> this targ-pos) (-> arg0 targ-pos)) (case (-> arg0 mode) (('active) (if (not (and (-> this next-state) (= (-> this next-state name) 'active))) @@ -305,7 +305,7 @@ ) ) ) - (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self root trans) (target-pos 0)) ) :code sleep-code ) @@ -406,24 +406,24 @@ (move-to-point! (-> *target* control) gp-0) ) ) - (set! (-> self root trans quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self root trans) (target-pos 0)) (set-virtual-cur-pos! (-> self nav state) (target-pos 0)) (let ((a0-9 (-> self nav state)) (v1-33 (-> self targ-pos)) ) (logclear! (-> a0-9 flags) (nav-state-flag directional-mode)) (logior! (-> a0-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-9 target-pos quad) (-> v1-33 quad)) + (vector-copy! (-> a0-9 target-pos) v1-33) ) 0 (let ((gp-3 *target-controller-pad*)) (let ((a1-7 (-> self nav state))) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> a1-7 velocity quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> a1-7 velocity)) ) (let ((a0-12 (-> self nav state)) (s5-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-2 quad) (-> a0-12 heading quad)) + (vector-copy! s5-2 (-> a0-12 heading)) (let ((f30-0 (vector-vector-xz-distance (-> self root trans) (-> self targ-pos)))) (let ((f28-0 1.0)) (setup-control-pad gp-3) diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc index 052e7f76b59..3773428ea10 100644 --- a/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/squad-control_REF.gc @@ -155,7 +155,7 @@ ;; INFO: Used lq/sq (defmethod probe-backgnd-collision ((this squad-control) (arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 start-pos) arg0) (vector-! (-> v1-0 move-dist) arg1 arg0) (let ((a0-4 v1-0)) (set! (-> a0-4 radius) 2048.0) @@ -188,8 +188,8 @@ ) (logior! (-> s5-1 0 flags) (squad-target-flag visible-now visible-recently visible-ever)) (set-time! (-> s5-1 0 last-seen-time)) - (set! (-> s5-1 0 position quad) (-> s4-0 1 position quad)) - (set! (-> s5-1 0 velocity quad) (-> s4-0 0 velocity quad)) + (vector-copy! (-> s5-1 0 position) (-> s4-0 1 position)) + (vector-copy! (-> s5-1 0 velocity) (-> s4-0 0 velocity)) ) (else (logclear! (-> s5-1 0 flags) (squad-target-flag visible-now)) @@ -206,8 +206,8 @@ (else (logior! (-> arg2 flags) (squad-target-flag visible-now visible-recently visible-ever)) (set-time! (-> arg2 last-seen-time)) - (set! (-> arg2 position quad) (-> (get-trans arg1 3) quad)) - (set! (-> arg2 velocity quad) (-> (get-transv arg1) quad)) + (vector-copy! (-> arg2 position) (get-trans arg1 3)) + (vector-copy! (-> arg2 velocity) (get-transv arg1)) ) ) 0 @@ -245,8 +245,8 @@ (when (logtest? (-> s4-1 0 flags) (squad-target-flag visible-recently)) (let ((s3-0 (new 'stack-no-clear 'primary-target-pos-vel))) (set-pos-vel this (the-as primary-target-pos-vel (-> s3-0 position))) - (set! (-> s4-1 0 position quad) (-> s3-0 position quad)) - (set! (-> s4-1 0 velocity quad) (-> s3-0 velocity quad)) + (vector-copy! (-> s4-1 0 position) (-> s3-0 position)) + (vector-copy! (-> s4-1 0 velocity) (-> s3-0 velocity)) ) ) (mem-copy! (the-as pointer arg2) (the-as pointer s4-1) 68) @@ -272,8 +272,8 @@ ) (when s4-0 (let ((s5-1 (new 'stack-no-clear 'primary-target-pos-vel))) - (set! (-> s5-1 position quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) - (set! (-> s5-1 velocity quad) (-> (get-transv (the-as process-focusable s4-0)) quad)) + (vector-copy! (-> s5-1 position) (get-trans (the-as process-focusable s4-0) 3)) + (vector-copy! (-> s5-1 velocity) (get-transv (the-as process-focusable s4-0))) (set! (-> s5-1 time) (the-as uint (current-time))) (if (>= (- (-> s5-1 time) (-> this primary-target-history 1 time)) (the-as uint 30)) (qmem-copy->! @@ -341,8 +341,8 @@ ) ) (when s5-0 - (set! (-> arg0 position quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) - (set! (-> arg0 velocity quad) (-> (get-transv (the-as process-focusable s5-0)) quad)) + (vector-copy! (-> arg0 position) (get-trans (the-as process-focusable s5-0) 3)) + (vector-copy! (-> arg0 velocity) (get-transv (the-as process-focusable s5-0))) ) ) arg0 @@ -484,8 +484,8 @@ #f (the-as clamp-travel-vector-to-mesh-return-info #f) ) - (set! (-> s2-0 cquery start-pos quad) (-> s5-0 quad)) - (set! (-> s2-0 cquery move-dist quad) (-> s2-0 vec0 quad)) + (vector-copy! (-> s2-0 cquery start-pos) s5-0) + (vector-copy! (-> s2-0 cquery move-dist) (-> s2-0 vec0)) (let ((v1-34 (-> s2-0 cquery))) (set! (-> v1-34 radius) 2048.0) (set! (-> v1-34 collide-with) (collide-spec backgnd)) @@ -525,7 +525,7 @@ ) ) (label cfg-19) - (set! (-> arg0 quad) (-> s5-0 quad)) + (vector-copy! arg0 s5-0) ) (none) ) @@ -542,7 +542,7 @@ ) (new 'stack-no-clear 'vector) (if a0-5 - (set! (-> arg1 quad) (-> (get-trans (the-as process-focusable a0-5) 0) quad)) + (vector-copy! arg1 (get-trans (the-as process-focusable a0-5) 0)) ) ) arg1 diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/turret-control_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/turret-control_REF.gc index 8a8cf5096ab..54ebe7055df 100644 --- a/test/decompiler/reference/jak3/levels/common/hvehicle/turret-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/turret-control_REF.gc @@ -220,7 +220,7 @@ ;; INFO: Used lq/sq (defun vehicle-los-clear? ((arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> v1-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> v1-0 start-pos) arg0) (vector-! (-> v1-0 move-dist) arg1 arg0) (let ((a0-1 v1-0)) (set! (-> a0-1 radius) 2048.0) @@ -278,7 +278,7 @@ (a1-9 arg0) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> s5-0 quad)) + (vector-copy! (-> a2-3 trans) s5-0) (t9-5 a0-8 a1-9 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -313,7 +313,7 @@ ;; WARN: Return type mismatch int vs none. (defun vehicle-draw-laser ((arg0 vector) (arg1 vector)) (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (camera-pos) arg0) 1.0) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> arg0 quad)) + (vector-copy! (new 'stack-no-clear 'vector) arg0) (let ((s5-1 (-> *part-id-table* 916))) (get-field-spec-by-id s5-1 (sp-field-id spt-timer)) (let* ((s4-3 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) @@ -351,18 +351,7 @@ (defmethod turret-control-method-9 ((this turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) (let ((gp-0 (new 'stack-no-clear 'turret-control-stack-var1))) (set! (-> gp-0 vec-12 x) (seconds-per-frame)) - (let* ((v1-1 (-> gp-0 mat-1)) - (a3-1 (-> arg0 node-list data (-> this info joint-index) bone transform)) - (a0-4 (-> a3-1 rvec quad)) - (a1-4 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-1 rvec quad) a0-4) - (set! (-> v1-1 uvec quad) a1-4) - (set! (-> v1-1 fvec quad) a2-1) - (set! (-> v1-1 trans quad) a3-2) - ) + (matrix-copy! (-> gp-0 mat-1) (-> arg0 node-list data (-> this info joint-index) bone transform)) (set! (-> this target-dist) (vector-vector-distance (-> gp-0 mat-1 trans) arg1)) (let ((f0-3 (/ (-> this target-dist) (-> this info shot-speed)))) (vector+float*! (-> gp-0 vec-1) arg1 arg2 f0-3) @@ -373,18 +362,7 @@ ) (vector-matrix*! (-> gp-0 vec-6) (-> this info local-pos) (-> gp-0 mat-1)) (vector-! (-> gp-0 vec-5) (-> gp-0 vec-1) (-> gp-0 vec-6)) - (let* ((v1-14 (-> gp-0 mat-1)) - (a3-3 (-> arg0 node-list data 0 bone transform)) - (a0-11 (-> a3-3 rvec quad)) - (a1-9 (-> a3-3 uvec quad)) - (a2-3 (-> a3-3 fvec quad)) - (a3-4 (-> a3-3 trans quad)) - ) - (set! (-> v1-14 rvec quad) a0-11) - (set! (-> v1-14 uvec quad) a1-9) - (set! (-> v1-14 fvec quad) a2-3) - (set! (-> v1-14 trans quad) a3-4) - ) + (matrix-copy! (-> gp-0 mat-1) (-> arg0 node-list data 0 bone transform)) (matrix-transpose! (the-as matrix (-> gp-0 vec-8)) (-> gp-0 mat-1)) (vector-rotate*! (-> gp-0 vec-3) (-> gp-0 vec-5) (the-as matrix (-> gp-0 vec-8))) (set! (-> gp-0 vec-4 y) (atan (-> gp-0 vec-3 x) (-> gp-0 vec-3 z))) @@ -432,21 +410,10 @@ ) (logior! (-> this flags) (turret-flag should-shoot)) (when (logtest? (-> this flags) (turret-flag targetting-laser)) - (let* ((v1-88 (-> gp-0 mat-1)) - (a3-5 (-> arg0 node-list data (-> this info joint-index) bone transform)) - (a0-29 (-> a3-5 rvec quad)) - (a1-20 (-> a3-5 uvec quad)) - (a2-5 (-> a3-5 fvec quad)) - (a3-6 (-> a3-5 trans quad)) - ) - (set! (-> v1-88 rvec quad) a0-29) - (set! (-> v1-88 uvec quad) a1-20) - (set! (-> v1-88 fvec quad) a2-5) - (set! (-> v1-88 trans quad) a3-6) - ) - (set! (-> gp-0 vec-7 quad) (-> gp-0 mat-1 fvec quad)) + (matrix-copy! (-> gp-0 mat-1) (-> arg0 node-list data (-> this info joint-index) bone transform)) + (vector-copy! (-> gp-0 vec-7) (-> gp-0 mat-1 fvec)) (let ((s3-2 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-2 start-pos quad) (-> gp-0 vec-6 quad)) + (vector-copy! (-> s3-2 start-pos) (-> gp-0 vec-6)) (vector-float*! (-> s3-2 move-dist) (-> gp-0 vec-7) (-> this info attack-range)) (let ((v1-93 s3-2)) (set! (-> v1-93 radius) 409.6) @@ -591,21 +558,10 @@ (logior! (-> s4-0 params options) (projectile-options po15)) (set! (-> s4-0 params vehicle-impulse-factor) (-> this info vehicle-impulse-factor)) (logior! (-> s4-0 params options) (projectile-options po16)) - (let* ((v1-31 (-> s4-0 mat0)) - (a3-0 (-> arg0 node-list data (-> this info joint-index) bone transform)) - (a0-24 (-> a3-0 rvec quad)) - (a1-8 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-31 rvec quad) a0-24) - (set! (-> v1-31 uvec quad) a1-8) - (set! (-> v1-31 fvec quad) a2-0) - (set! (-> v1-31 trans quad) a3-1) - ) + (matrix-copy! (-> s4-0 mat0) (-> arg0 node-list data (-> this info joint-index) bone transform)) (dotimes (s3-0 (-> this info barrel-count)) (vector-matrix*! (-> s4-0 vec2) (the-as vector (-> this info barrel-array s3-0)) (-> s4-0 mat0)) - (set! (-> s4-0 vec3 quad) (-> s4-0 mat0 fvec quad)) + (vector-copy! (-> s4-0 vec3) (-> s4-0 mat0 fvec)) (set! (-> s4-0 params pos quad) (-> s4-0 vec2 quad)) (vector-float*! (-> s4-0 params vel) (-> s4-0 vec3) (-> this info shot-speed)) (spawn-projectile (-> this info shot-type) (-> s4-0 params) arg0 *default-dead-pool*) diff --git a/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-manager_REF.gc b/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-manager_REF.gc index aa56085376d..407643da199 100644 --- a/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/hvehicle/vehicle-manager_REF.gc @@ -280,9 +280,9 @@ (stack-size-set! (-> self main-thread) 16) (logior! (-> self mask) (process-mask vehicle)) (init-collision! self) - (set! (-> self root trans quad) (-> arg1 position quad)) + (vector-copy! (-> self root trans) (-> arg1 position)) (quaternion-copy! (-> self root quat) (-> arg1 rotation)) - (set! (-> self root transv quad) (-> arg1 velocity quad)) + (vector-copy! (-> self root transv) (-> arg1 velocity)) (if (logtest? (-> arg1 flags) (traffic-spawn-flags tsf6)) (vehicle-method-149 self) ) diff --git a/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc b/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc index 704e945a9ff..13515a1c531 100644 --- a/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/race/race-manager_REF.gc @@ -13,7 +13,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 start-pos) arg1) (vector-reset! (-> s5-0 move-dist)) (set! (-> s5-0 move-dist y) -409600.0) (let ((v1-3 s5-0)) @@ -85,7 +85,7 @@ ) (when (< f0-16 (* f1-1 f1-1)) (logior! (-> s5-0 flags) (race-mesh-flag rmf0)) - (set! (-> this finish-dir quad) (-> this start-dir quad)) + (vector-copy! (-> this finish-dir) (-> this start-dir)) (set! (-> this finish-sphere quad) (-> this start-sphere quad)) ) ) @@ -293,7 +293,7 @@ ) (set! (-> this pos) (+ (-> this lap-distance) (the float (-> this lap-count)))) ) - (set! (-> this position quad) (-> s5-0 vector 0 quad)) + (vector-copy! (-> this position) (-> s5-0 vector 0)) ) (else (logior! (-> this flags) (racer-state-flags rsf2)) @@ -338,7 +338,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-racer! ((this racer-state) (arg0 process-drawable)) (set! (-> this racer) (process->handle arg0)) - (set! (-> this position quad) (-> arg0 root trans quad)) + (vector-copy! (-> this position) (-> arg0 root trans)) (set! (-> this flags) (racer-state-flags rsf7)) (set! (-> this lap-count) 0) (set! (-> this lap-distance) 0.0) @@ -584,10 +584,10 @@ (let ((a0-17 (-> this racer-array (-> this i-player)))) (let ((a3-1 (handle->process (-> a0-17 racer)))) (if a3-1 - (set! (-> v1-14 rvec quad) (-> (the-as process-drawable a3-1) root trans quad)) + (vector-copy! (-> v1-14 rvec) (-> (the-as process-drawable a3-1) root trans)) ) ) - (set! (-> v1-14 uvec quad) (-> a0-17 start-position quad)) + (vector-copy! (-> v1-14 uvec) (-> a0-17 start-position)) ) (cubic-curve-method-9 (-> this player-intro-curve) @@ -791,7 +791,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (when (= (status-of-level-and-borrows *level* 'lracelit #f) 'active) + (when (= (level-status? *level* 'lracelit #f) 'active) (let ((gp-1 (-> this info))) (handle->process (-> this manager)) (let ((s5-1 (new 'stack-no-clear 'matrix))) @@ -882,7 +882,7 @@ (set! (-> v1-8 vec1 x) (/ (-> v1-8 vec1 z) (the float (max 1 (+ (-> v1-8 word) -1))))) (set! (-> v1-8 vec1 y) -40960.0) (set! (-> v1-8 mat rvec quad) (-> arg1 start-sphere quad)) - (set! (-> v1-8 mat uvec quad) (-> arg1 start-dir quad)) + (vector-copy! (-> v1-8 mat uvec) (-> arg1 start-dir)) (set-vector! (-> v1-8 mat fvec) (-> v1-8 mat uvec z) 0.0 (- (-> v1-8 mat uvec x)) 1.0) (dotimes (a0-22 (-> arg1 racer-count)) (cond @@ -905,7 +905,7 @@ ) (let ((a1-20 (-> this racer-array a0-22))) (-> arg1 racer-array a0-22) - (set! (-> v1-8 mat trans quad) (-> v1-8 mat rvec quad)) + (vector-copy! (-> v1-8 mat trans) (-> v1-8 mat rvec)) (let ((t0-0 (-> v1-8 mat trans))) (let ((a2-9 (-> v1-8 mat trans))) (let ((a3-3 (-> v1-8 mat uvec))) @@ -936,7 +936,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> t0-1 quad) vf6) ) - (set! (-> a1-20 start-position quad) (-> v1-8 mat trans quad)) + (vector-copy! (-> a1-20 start-position) (-> v1-8 mat trans)) (set! (-> a1-20 rank) a0-22) (set! (-> a1-20 speed-factor) 1.0) (set! (-> a1-20 racer) (the-as handle #f)) @@ -1001,8 +1001,8 @@ ) (let ((v1-22 (new 'stack-no-clear 'inline-array 'vector 5))) (let ((a0-7 (-> this race-state info))) - (set! (-> v1-22 0 quad) (-> a0-7 start-sphere quad)) - (set! (-> v1-22 1 quad) (-> a0-7 start-dir quad)) + (vector-copy! (-> v1-22 0) (-> a0-7 start-sphere)) + (vector-copy! (-> v1-22 1) (-> a0-7 start-dir)) ) (set! (-> v1-22 2 y) 0.0) (set! (-> v1-22 2 x) (- (-> v1-22 1 z))) @@ -1058,8 +1058,8 @@ (logior! (-> gp-0 flags) (race-flag rf2)) ) (let ((s4-0 (new 'stack-no-clear 'race-manager-stack-var1))) - (set! (-> s4-0 vec0 quad) (-> gp-0 info start-sphere quad)) - (set! (-> s4-0 vec1 quad) (-> gp-0 info start-dir quad)) + (vector-copy! (-> s4-0 vec0) (-> gp-0 info start-sphere)) + (vector-copy! (-> s4-0 vec1) (-> gp-0 info start-dir)) (set-vector! (-> s4-0 vec2) (-> s4-0 vec1 z) 0.0 (- (-> s4-0 vec1 x)) 1.0) (set! (-> s4-0 params object-type) (traffic-type vehicle-task)) (set! (-> s4-0 params behavior) (the-as uint 10)) @@ -1083,7 +1083,7 @@ (let ((v1-23 (-> gp-0 racer-array s3-0)) (s2-0 (-> s5-0 racer-array s3-0)) ) - (set! (-> s4-0 params position quad) (-> v1-23 start-position quad)) + (vector-copy! (-> s4-0 params position) (-> v1-23 start-position)) (set! (-> s4-0 params id) (the-as uint s3-0)) (set! (-> s4-0 params user-data) (-> s2-0 rider)) (logior! (-> s4-0 params flags) (traffic-spawn-flags tsf1)) diff --git a/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc b/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc index c377f5f23e0..e977e0737ac 100644 --- a/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/race/race-mesh_REF.gc @@ -314,8 +314,8 @@ (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 4)) (a3-1 (the int arg1)) ) - (set! (-> v1-0 0 quad) (-> this samples a3-1 pos quad)) - (set! (-> v1-0 1 quad) (-> this samples (+ a3-1 1) pos quad)) + (vector-copy! (-> v1-0 0) (-> this samples a3-1 pos)) + (vector-copy! (-> v1-0 1) (-> this samples (+ a3-1 1) pos)) (let ((f0-3 (- arg1 (the float a3-1)))) (vector-lerp! arg0 (-> v1-0 0) (-> v1-0 1) f0-3) ) @@ -641,9 +641,9 @@ (v1-5 (-> this edges (-> v1-2 end-edge))) ) (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) - (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) - (set! (-> arg1 slice-corners 2 quad) (-> v1-5 right quad)) - (set! (-> arg1 slice-corners 3 quad) (-> v1-5 left quad)) + (vector-copy! (-> arg1 slice-corners 1) (-> a1-3 right)) + (vector-copy! (-> arg1 slice-corners 2) (-> v1-5 right)) + (vector-copy! (-> arg1 slice-corners 3) (-> v1-5 left)) ) (let ((v1-8 (new 'stack-no-clear 'vector)) (a0-6 (new 'stack-no-clear 'vector)) @@ -742,9 +742,9 @@ (v1-4 (-> this edges (-> v1-1 end-edge))) ) (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) - (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) - (set! (-> arg1 slice-corners 2 quad) (-> v1-4 right quad)) - (set! (-> arg1 slice-corners 3 quad) (-> v1-4 left quad)) + (vector-copy! (-> arg1 slice-corners 1) (-> a1-3 right)) + (vector-copy! (-> arg1 slice-corners 2) (-> v1-4 right)) + (vector-copy! (-> arg1 slice-corners 3) (-> v1-4 left)) ) (let ((v1-7 (new 'stack-no-clear 'vector)) (a0-6 (new 'stack-no-clear 'vector)) @@ -804,7 +804,7 @@ ) (when (or (< f30-0 0.0) (< f0-11 f30-0)) (set! f30-0 f0-11) - (set! (-> arg1 pt-on-slice quad) (-> s5-1 quad)) + (vector-copy! (-> arg1 pt-on-slice) s5-1) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/artifact-race/artifact-race_REF.gc b/test/decompiler/reference/jak3/levels/desert/artifact-race/artifact-race_REF.gc index 4bd4315a272..e0260de253c 100644 --- a/test/decompiler/reference/jak3/levels/desert/artifact-race/artifact-race_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/artifact-race/artifact-race_REF.gc @@ -97,8 +97,8 @@ (defmethod find-ground ((this was-artifact)) (let ((s4-0 #f)) (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> gp-0 vec0 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> gp-0 vec0) (-> this root trans)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec0)) (+! (-> gp-0 cquery start-pos y) 40960.0) (vector-reset! (-> gp-0 vec1)) (set! (-> gp-0 vec1 y) 1.0) @@ -116,12 +116,12 @@ (let ((f0-8 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) (when (>= f0-8 0.0) (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f0-8) - (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (vector-copy! (-> gp-0 vec1) (-> gp-0 cquery best-other-tri normal)) (set! s4-0 #t) (format #t "was-artifact::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) ) ) - (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec0)) (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) ) s4-0 @@ -136,13 +136,14 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (when v1-0 - (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (vector-copy! s5-0 (-> v1-0 control trans)) (set! (-> s5-0 w) 4096.0) (when (focus-test? v1-0 pilot) (let ((a1-4 (handle->process (-> v1-0 pilot vehicle)))) - (set! (-> s5-0 quad) - (-> (the-as collide-shape (-> (the-as process-drawable a1-4) root)) root-prim prim-core world-sphere quad) - ) + (vector-copy! + s5-0 + (-> (the-as collide-shape (-> (the-as process-drawable a1-4) root)) root-prim prim-core world-sphere) + ) ) ) (let ((f0-1 (vector-vector-xz-distance-squared (-> this root trans) s5-0)) @@ -209,8 +210,8 @@ :code (behavior () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> self root trans quad)) - (set! (-> gp-0 pos quad) (-> v1-0 quad)) + (vector-copy! v1-0 (-> self root trans)) + (vector-copy! (-> gp-0 pos) v1-0) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) @@ -241,11 +242,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 333 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 333)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 333)) ) ) @@ -297,11 +298,11 @@ (set! (-> v1-13 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 3.0 3.0 3.0 1.0) (find-ground self) - (set! (-> self pos quad) (-> self root trans quad)) + (vector-copy! (-> self pos) (-> self root trans)) (let* ((v1-23 (-> arg0 artifact-type)) (a1-6 (cond ((= v1-23 (artifact-type artifact-a)) @@ -436,7 +437,7 @@ (new 'static 'talker-speech-class :name "dax163" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :text-duration (seconds 1) :neg #x1 @@ -446,7 +447,7 @@ (new 'static 'talker-speech-class :name "dax164" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :text-duration (seconds 1) :neg #x1 @@ -456,7 +457,7 @@ (new 'static 'talker-speech-class :name "dax165" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :text-duration (seconds 1) :neg #x1 @@ -466,7 +467,7 @@ (new 'static 'talker-speech-class :name "dax166" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5 :text-duration (seconds 1) :neg #x1 @@ -476,7 +477,7 @@ (new 'static 'talker-speech-class :name "dax167" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x6 :text-duration (seconds 1) :neg #x1 @@ -486,7 +487,7 @@ (new 'static 'talker-speech-class :name "dax168" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x7 :text-duration (seconds 1) :neg #x1 @@ -496,7 +497,7 @@ (new 'static 'talker-speech-class :name "dax169" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x8 :text-duration (seconds 1) :neg #x1 @@ -506,7 +507,7 @@ (new 'static 'talker-speech-class :name "dax170" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x9 :text-duration (seconds 1) :neg #x1 @@ -516,7 +517,7 @@ (new 'static 'talker-speech-class :name "dax171" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xa :text-duration (seconds 1) :neg #x1 @@ -526,7 +527,7 @@ (new 'static 'talker-speech-class :name "dax172" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xb :text-duration (seconds 1) :neg #x1 @@ -536,7 +537,7 @@ (new 'static 'talker-speech-class :name "dax173" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xc :text-duration (seconds 1) :neg #x1 @@ -546,7 +547,7 @@ (new 'static 'talker-speech-class :name "dax174" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xd :text-duration (seconds 1) :neg #x1 @@ -556,7 +557,7 @@ (new 'static 'talker-speech-class :name "dax175" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xe :text-duration (seconds 1) :neg #x1 @@ -566,7 +567,7 @@ (new 'static 'talker-speech-class :name "dax176" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #xf :text-duration (seconds 1) :neg #x1 @@ -576,7 +577,7 @@ (new 'static 'talker-speech-class :name "dax177" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x10 :text-duration (seconds 1) :neg #x1 @@ -586,7 +587,7 @@ (new 'static 'talker-speech-class :name "dax178" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x11 :text-duration (seconds 1) :neg #x1 @@ -596,7 +597,7 @@ (new 'static 'talker-speech-class :name "dax179" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x12 :text-duration (seconds 1) :neg #x1 @@ -606,7 +607,7 @@ (new 'static 'talker-speech-class :name "dax180" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x13 :text-duration (seconds 1) :neg #x1 @@ -616,7 +617,7 @@ (new 'static 'talker-speech-class :name "dax181" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x14 :text-duration (seconds 1) :neg #x1 @@ -626,7 +627,7 @@ (new 'static 'talker-speech-class :name "dax182" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15 :text-duration (seconds 1) :neg #x1 @@ -636,7 +637,7 @@ (new 'static 'talker-speech-class :name "dax183" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16 :text-duration (seconds 1) :neg #x1 @@ -646,7 +647,7 @@ (new 'static 'talker-speech-class :name "dax184" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x17 :text-duration (seconds 1) :neg #x1 @@ -656,7 +657,7 @@ (new 'static 'talker-speech-class :name "dax185" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x18 :text-duration (seconds 1) :neg #x1 @@ -666,7 +667,7 @@ (new 'static 'talker-speech-class :name "dax186" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x19 :text-duration (seconds 1) :neg #x1 @@ -676,7 +677,7 @@ (new 'static 'talker-speech-class :name "dax187" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1a :text-duration (seconds 1) :neg #x1 @@ -686,7 +687,7 @@ (new 'static 'talker-speech-class :name "dax188" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1b :text-duration (seconds 1) :neg #x1 @@ -696,7 +697,7 @@ (new 'static 'talker-speech-class :name "dax189" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1c :text-duration (seconds 1) :neg #x1 @@ -706,7 +707,7 @@ (new 'static 'talker-speech-class :name "dax190" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1d :text-duration (seconds 1) :neg #x1 @@ -716,7 +717,7 @@ (new 'static 'talker-speech-class :name "dax191" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1e :text-duration (seconds 1) :neg #x1 @@ -726,7 +727,7 @@ (new 'static 'talker-speech-class :name "dax192" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1f :text-duration (seconds 1) :neg #x1 @@ -871,9 +872,9 @@ (format #t "artifact-race::initialize death-count ~d, suck-factor ~f~%" a2-4 (-> this suck-factor)) ) (set! (-> this extra-suck-time) (* 16.0 (-> this suck-factor))) - (set! (-> this begin-pos quad) (-> (new 'static 'vector :x 9263923.0 :y 129024.0 :z 1077248.0 :w 1.0) quad)) - (set! (-> this end-pos quad) (-> (new 'static 'vector :x 9277440.0 :y 127795.2 :z 890880.0 :w 1.0) quad)) - (set! (-> this door-plane quad) (-> (new 'static 'vector :z 1.0 :w 1.0) quad)) + (vector-copy! (-> this begin-pos) (new 'static 'vector :x 9263923.0 :y 129024.0 :z 1077248.0 :w 1.0)) + (vector-copy! (-> this end-pos) (new 'static 'vector :x 9277440.0 :y 127795.2 :z 890880.0 :w 1.0)) + (vector-copy! (-> this door-plane) (new 'static 'vector :z 1.0 :w 1.0)) (set! (-> this door-plane w) (- (vector-dot (-> this door-plane) (new 'static 'vector :x 9277440.0 :y 125747.2 :z 957235.2 :w 1.0))) ) @@ -905,7 +906,7 @@ (let ((s3-0 (-> s5-0 0 data s4-0 actor)) (s2-0 (-> this objs s4-0)) ) - (set! (-> s2-0 pos quad) (-> s3-0 extra trans quad)) + (vector-copy! (-> s2-0 pos) (-> s3-0 extra trans)) (set! (-> s2-0 time) (the-as uint (the int (* 300.0 (+ (res-lump-float s3-0 'timeout :default 60.0) (-> this extra-suck-time))))) ) @@ -958,7 +959,7 @@ (set-fog-interp self (-> self dust-begin)) (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity (-> self dust-begin)) (set-setting! 'fog-special-interp-rate #f 0.01 0) - (while (!= (status-of-level-and-borrows *level* 'desert #f) 'active) + (while (!= (level-status? *level* 'desert #f) 'active) (suspend) ) (while (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status pilot-riding)))) @@ -1042,7 +1043,7 @@ (open! (-> self node-info) 'event) (remove-setting! 'airlock) (let ((gp-3 (new 'stack-no-clear 'inline-array 'task-arrow-params 1))) - (set! (-> gp-3 0 pos quad) (-> self end-pos quad)) + (vector-copy! (-> gp-3 0 pos) (-> self end-pos)) (quaternion-identity! (-> gp-3 0 quat)) (set! (-> gp-3 0 flags) (task-arrow-flags)) (set! (-> gp-3 0 map-icon) (the-as uint 13)) @@ -1071,8 +1072,8 @@ (when (and (< 2048000.0 (-> gp-4 trans x)) (time-elapsed? (-> self speech-time) (seconds 4))) (vector-! (-> gp-4 uvec) (-> self end-pos) (-> (the-as process-drawable s5-2) root trans)) (vector-normalize! (-> gp-4 uvec) 1.0) - (set! (-> gp-4 rvec quad) (-> (the-as process-drawable s5-2) node-list data 0 bone transform fvec quad)) - (set! (-> gp-4 fvec quad) (-> (the-as process-drawable s5-2) root transv quad)) + (vector-copy! (-> gp-4 rvec) (-> (the-as process-drawable s5-2) node-list data 0 bone transform fvec)) + (vector-copy! (-> gp-4 fvec) (-> (the-as process-drawable s5-2) root transv)) (when (and (< (vector-dot (-> gp-4 uvec) (-> gp-4 rvec)) (cos 10922.667)) (< (vector-dot (-> gp-4 uvec) (-> (the-as process-drawable s5-2) root transv)) 0.0) (< 81920.0 (vector-length (-> gp-4 fvec))) @@ -1168,7 +1169,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/boss/deswalk-obs_REF.gc b/test/decompiler/reference/jak3/levels/desert/boss/deswalk-obs_REF.gc index e9576e48bcd..fa22b9d3e7c 100644 --- a/test/decompiler/reference/jak3/levels/desert/boss/deswalk-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/boss/deswalk-obs_REF.gc @@ -189,6 +189,7 @@ ;; definition for method 11 of type dm-urchin (defmethod init-from-entity! ((this dm-urchin) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) @@ -430,6 +431,7 @@ ;; definition for method 11 of type desw-eco-tank (defmethod init-from-entity! ((this desw-eco-tank) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -536,9 +538,9 @@ (deactivate self) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-0 (target-pos 0)) (if *target* - (set! (-> gp-0 quad) (-> (get-trans *target* 3) quad)) + (vector-copy! gp-0 (get-trans *target* 3)) ) (vector-! gp-0 gp-0 (-> self root trans)) (let ((f0-0 (vector-normalize-ret-len! gp-0 1.0))) @@ -572,7 +574,7 @@ (set! (-> s5-0 event-self) 'touched) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 444) self)) (go-virtual idle) ) @@ -774,13 +776,13 @@ ) (else (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this gravity quad)) + (vector-copy! s5-0 (-> this gravity)) (let ((s2-0 (-> this ragdoll-joints arg1))) (let ((f0-1 5.0)) (case (-> this mode) ((1) (set! f30-0 2.0) - (set! (-> this gravity quad) (-> arg3 uvec quad)) + (vector-copy! (-> this gravity) (-> arg3 uvec)) ) ((2) (set! f30-0 0.0) @@ -844,7 +846,7 @@ ) ) ) - (set! (-> this gravity quad) (-> s5-0 quad)) + (vector-copy! (-> this gravity) s5-0) ) ) ) @@ -927,9 +929,10 @@ :virtual #t :trans (behavior () (if (and (-> self ragdoll) (nonzero? (-> self ragdoll))) - (set! (-> self ragdoll ragdoll-joints 0 position quad) - (-> (ppointer->process (-> self parent)) root trans quad) - ) + (vector-copy! + (-> self ragdoll ragdoll-joints 0 position) + (-> (ppointer->process (-> self parent)) root trans) + ) ) (cond ((or (not (-> self ragdoll)) (zero? (-> self ragdoll))) @@ -1028,7 +1031,8 @@ ;; definition for method 20 of type dm-tentacle ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this dm-tentacle)) +(defmethod get-search-info-flag ((this dm-tentacle)) + "Get search-info-flag for this process." (the-as search-info-flag (if (and (-> this next-state) (= (-> this next-state name) 'die)) 1 16 @@ -1681,7 +1685,7 @@ (sound-play "snake-spawn" :position (-> self initial-position)) (let ((gp-1 (new 'stack-no-clear 'matrix))) (matrix-identity! gp-1) - (set! (-> gp-1 trans quad) (-> self initial-position quad)) + (vector-copy! (-> gp-1 trans) (-> self initial-position)) (if (logtest? (-> *part-group-id-table* 446 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1725,7 +1729,7 @@ (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (matrix-identity! gp-0) - (set! (-> gp-0 trans quad) (-> self initial-position quad)) + (vector-copy! (-> gp-0 trans) (-> self initial-position)) (if (logtest? (-> *part-group-id-table* 445 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1857,6 +1861,7 @@ ;; definition for method 11 of type dm-tentacle ;; INFO: Used lq/sq (defmethod init-from-entity! ((this dm-tentacle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s4-0 total-prims) (the-as uint 10)) @@ -1943,7 +1948,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-dm-tentacle" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> this initial-position quad) (-> this root trans quad)) + (vector-copy! (-> this initial-position) (-> this root trans)) (logior! (-> this mask) (process-mask enemy)) (set! (-> this hit-points) 10.0) (set! (-> this incoming-attack-id) (the-as uint 0)) @@ -2341,6 +2346,7 @@ ;; definition for method 11 of type desw-snake-stump ;; INFO: Used lq/sq (defmethod init-from-entity! ((this desw-snake-stump) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -2387,7 +2393,3 @@ (set! (-> this up-timer) 0) (go (method-of-object this moving)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/boss/terraformer-drone_REF.gc b/test/decompiler/reference/jak3/levels/desert/boss/terraformer-drone_REF.gc index a74da003b72..0eeabb7f0a0 100644 --- a/test/decompiler/reference/jak3/levels/desert/boss/terraformer-drone_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/boss/terraformer-drone_REF.gc @@ -667,34 +667,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 65536.0 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -736,6 +736,7 @@ ;; definition for method 59 of type terraformer-drone ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this terraformer-drone)) + "Common implementation of post. Runs ja-post." (with-pp (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) @@ -785,6 +786,7 @@ ;; definition for method 82 of type terraformer-drone (defmethod event-handler ((this terraformer-drone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('explode) (go (method-of-object this explode)) @@ -803,7 +805,8 @@ ) ;; definition for method 93 of type terraformer-drone -(defmethod setup-jump! ((this terraformer-drone) (arg0 enemy-jump-info)) +(defmethod setup-jump-trajectory! ((this terraformer-drone) (arg0 enemy-jump-info)) + "Compute jump trajectory." (if (< (-> this root scale x) 1.0) (setup-from-to-duration-and-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) 120.0 61440.0) (setup-from-to-duration-and-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) 120.0 40960.0) @@ -833,7 +836,7 @@ (activate! *camera-smush-control* 819.2 60 300 0.995 0.9 (-> *display* camera-clock)) (sound-play "drone-blow" :position (-> self root trans)) (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 40960.0) (set! (-> gp-1 scale) 1.0) @@ -859,9 +862,10 @@ ;; definition for method 100 of type terraformer-drone ;; WARN: Return type mismatch vector vs none. -(defmethod in-jump-handler ((this terraformer-drone) (arg0 int) (arg1 enemy-jump-info)) +(defmethod move-along-ballistic-trajectory-for-jump ((this terraformer-drone) (arg0 jump-stage) (arg1 enemy-jump-info)) + "Adjust trans, transv for the jump, if we're airborne." (case arg0 - ((2 3) + (((jump-stage takeoff) (jump-stage in-air)) (let ((f30-0 (fmin (the float (-> arg1 hang-time)) (-> arg1 traj time)))) (let ((a1-3 (compute-trans-at-time (-> arg1 traj) f30-0 (new 'stack-no-clear 'vector)))) (move-to-point! (-> this root) a1-3) @@ -877,13 +881,15 @@ ) ;; definition for method 95 of type terraformer-drone -(defmethod on-ground? ((this terraformer-drone) (arg0 enemy-jump-info)) +(defmethod landed-jump-yet? ((this terraformer-drone) (arg0 enemy-jump-info)) + "Is this on, or close to, the ground?" (>= (the float (-> arg0 hang-time)) (-> arg0 traj time)) ) ;; definition for method 94 of type terraformer-drone ;; WARN: Return type mismatch vector vs float. (defmethod move-to-gspot! ((this terraformer-drone)) + "Snap the enemy down onto the cached ground spot (gspot)." (the-as float (vector-reset! (-> this root transv))) ) @@ -977,7 +983,7 @@ (let ((gp-0 (new 'stack-no-clear 'matrix))) (format 0 "spawning impact part~%") (matrix-identity! gp-0) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 431 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1028,7 +1034,7 @@ (t9-0) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1085,7 +1091,7 @@ (let ((a0-1 (handle->process (-> self focus handle)))) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-1) 0)) (let ((s5-0 3)) (if (< (-> self root scale x) 1.0) (set! s5-0 6) @@ -1095,7 +1101,7 @@ (let ((v1-14 (-> self nav state))) (logclear! (-> v1-14 flags) (nav-state-flag directional-mode)) (logior! (-> v1-14 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-14 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-14 target-pos) gp-0) ) 0 ) @@ -1135,7 +1141,7 @@ ) (logclear! (-> a0-26 flags) (nav-state-flag directional-mode)) (logior! (-> a0-26 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-26 target-pos quad) (-> v1-48 quad)) + (vector-copy! (-> a0-26 target-pos) v1-48) ) 0 ) @@ -1173,6 +1179,7 @@ ;; definition for method 120 of type terraformer-drone ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this terraformer-drone)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1219,6 +1226,7 @@ ;; definition for method 67 of type terraformer-drone (defmethod coin-flip? ((this terraformer-drone)) + "Return #t half the time, #f the other." #f ) @@ -1248,13 +1256,14 @@ ;; definition for method 121 of type terraformer-drone ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this terraformer-drone)) + "Typical place for shared init code. Runs from entity or process style init." (with-pp (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-terraformer-drone" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *terraformer-drone-nav-enemy-info*) + (setup-enemy! this *terraformer-drone-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -1304,13 +1313,10 @@ ;; definition for method 121 of type terraformer-drone-small ;; WARN: Return type mismatch vector vs none. (defmethod init-enemy! ((this terraformer-drone-small)) + "Typical place for shared init code. Runs from entity or process style init." (let ((t9-0 (method-of-type terraformer-drone init-enemy!))) (t9-0 this) ) (set-vector! (-> this root scale) 0.95 0.95 0.95 1.0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/boss/terraformer-head_REF.gc b/test/decompiler/reference/jak3/levels/desert/boss/terraformer-head_REF.gc index 99a28b70b67..4195d2f5925 100644 --- a/test/decompiler/reference/jak3/levels/desert/boss/terraformer-head_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/boss/terraformer-head_REF.gc @@ -325,7 +325,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod set-target! ((this joint-mod-disc-look-at) (arg0 vector)) - (set! (-> this target quad) (-> arg0 quad)) + (vector-copy! (-> this target) arg0) 0 (none) ) @@ -444,7 +444,7 @@ (let ((s4-1 (matrix->trans (-> arg0 bone transform) (new 'stack-no-clear 'vector)))) (set-vector! (-> arg0 bone transform trans) 0.0 0.0 0.0 1.0) (matrix*! (-> arg0 bone transform) (-> arg0 bone transform) s5-1) - (set! (-> arg0 bone transform trans quad) (-> s4-1 quad)) + (vector-copy! (-> arg0 bone transform trans) s4-1) ) ) ) @@ -479,7 +479,8 @@ ;; definition for method 20 of type terraformer-head-target ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this terraformer-head-target)) +(defmethod get-search-info-flag ((this terraformer-head-target)) + "Get search-info-flag for this process." (the-as search-info-flag 16) ) @@ -616,8 +617,8 @@ (case message (('move) (let ((v1-1 (-> self root))) - (set! (-> self starting-pos quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self root trans quad) (-> self starting-pos quad)) + (vector-copy! (-> self starting-pos) (the-as vector (-> block param 0))) + (vector-copy! (-> self root trans) (-> self starting-pos)) (vector-! (-> self root transv) (the-as vector (-> block param 1)) (-> self starting-pos)) (let ((a0-7 (-> self root transv))) (.lvf vf1 (&-> (-> self root transv) quad)) @@ -629,7 +630,7 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a0-7 quad) vf1) ) - (set! (-> self pre-move-transv quad) (-> v1-1 transv quad)) + (vector-copy! (-> self pre-move-transv) (-> v1-1 transv)) ) (vector-normalize-copy! (-> self starting-dir) (-> self root transv) 1.0) (set! (-> self hits) 0) @@ -914,7 +915,8 @@ ;; definition for method 20 of type terraformer-head ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this terraformer-head)) +(defmethod get-search-info-flag ((this terraformer-head)) + "Get search-info-flag for this process." (the-as search-info-flag 1) ) @@ -986,8 +988,8 @@ (set! (-> a1-2 charge) 1.0) (set! (-> a1-2 options) (projectile-options)) (logclear! (-> a1-2 options) (projectile-options po14 po15 po16)) - (set! (-> a1-2 pos quad) (-> self root trans quad)) - (set! (-> a1-2 vel quad) (-> (new 'static 'vector :x 1.0) quad)) + (vector-copy! (-> a1-2 pos) (-> self root trans)) + (vector-copy! (-> a1-2 vel) (new 'static 'vector :x 1.0)) (set! (-> a1-2 notify-handle) (the-as handle #f)) (set! (-> a1-2 owner-handle) (the-as handle #f)) (set! (-> a1-2 target-handle) (the-as handle #f)) @@ -1076,7 +1078,7 @@ (set! (-> a0-29 pickup-type) (pickup-type ammo-random)) (set! (-> a0-29 pickup-amount) 10.0) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> self root trans quad)) + (vector-copy! s3-1 (-> self root trans)) (set! (-> self root trans quad) (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 s4-1)))) ) @@ -1084,7 +1086,7 @@ (set! (-> self ammo s4-1 handle) (ppointer->handle (drop-pickup a0-29 #t *entity-pool* (the-as fact-info #f) 0 #t)) ) - (set! (-> self root trans quad) (-> s3-1 quad)) + (vector-copy! (-> self root trans) s3-1) ) ) ) @@ -1199,7 +1201,7 @@ ) ) (update! (-> self position-seeker) (the-as vector #f)) - (set! (-> self root trans quad) (-> self position-seeker value quad)) + (vector-copy! (-> self root trans) (-> self position-seeker value)) (dotimes (gp-2 8) (let* ((s5-3 (-> self critter gp-2)) (s4-3 (handle->process (-> s5-3 handle))) @@ -1995,9 +1997,9 @@ ;; INFO: Used lq/sq (defbehavior terraformer-head-point-occupied? terraformer-head ((arg0 vector)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> arg0 quad)) + (vector-copy! a1-0 arg0) (set! (-> a1-0 w) 16384.0) - (add-root-sphere-to-hash! (-> self nav) a1-0 255) + (check-sphere-blocked! (-> self nav) a1-0 255) ) ) @@ -2035,7 +2037,7 @@ ) (when (terraformer-head-get-spawn-point gp-0 (-> s5-0 dest)) (set! (-> s5-0 flags) (terraformer-head-critter-tracker-flag)) - (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-0 trans) gp-0) (quaternion-copy! (-> s4-0 quat) (-> self root quat)) (set! (-> s4-0 entity) (-> self entity)) (set! (-> s4-0 directed?) #f) @@ -2135,7 +2137,7 @@ (set-vector! (-> s4-4 fvec) 0.0 1.0 0.0 0.0) (vector-cross! (-> s4-4 rvec) (-> s4-4 uvec) (-> s4-4 fvec)) (set! (-> s4-4 rvec w) 0.0) - (set! (-> s4-4 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-4 trans) gp-0) (+! (-> s4-4 trans y) 8192.0) (set! (-> s4-4 trans w) 1.0) ) @@ -2290,7 +2292,7 @@ :enter (behavior () (terraformer-head-send-group-event 0 'retract) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> self initial-position quad)) + (vector-copy! v1-0 (-> self initial-position)) (+! (-> v1-0 x) 204800.0) (+! (-> v1-0 y) -102400.0) (set! (-> self position-seeker target quad) (-> v1-0 quad)) @@ -2350,11 +2352,11 @@ (let ((gp-0 (get-trans self 3))) (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) ) ) @@ -2443,7 +2445,7 @@ (logior! (-> self skel status) (joint-control-status sync-math)) (set-time! (-> self state-time)) (let ((v1-7 (new 'stack-no-clear 'vector))) - (set! (-> v1-7 quad) (-> self initial-position quad)) + (vector-copy! v1-7 (-> self initial-position)) (+! (-> v1-7 x) 204800.0) (+! (-> v1-7 y) -223232.0) (set! (-> self position-seeker target quad) (-> v1-7 quad)) @@ -2829,6 +2831,7 @@ ;; definition for method 11 of type terraformer-head ;; INFO: Used lq/sq (defmethod init-from-entity! ((this terraformer-head) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 38) 0))) @@ -3114,7 +3117,7 @@ (set! (-> this root) s4-0) ) (process-drawable-from-entity! this arg0) - (set! (-> this initial-position quad) (-> this root trans quad)) + (vector-copy! (-> this initial-position) (-> this root trans)) (+! (-> this root trans x) 204800.0) (+! (-> this root trans y) -57344.0) (init (-> this position-seeker) (-> this root trans) 40.96 4096.0 0.3) @@ -3139,7 +3142,7 @@ (set! (-> this neck-aim-jm up) 1) (set! (-> this neck-aim-jm nose) 2) (logior! (-> this neck-aim-jm flags) (jmod-disc-lookat-flag jdl1)) - (set! (-> this target-position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this target-position) (target-pos 0)) (tracking-spline-method-10 (-> this target-spline) (-> this target-position)) (set! (-> this beam-projectile) (the-as handle #f)) (set! (-> this hit-points) 1.0) @@ -3190,7 +3193,3 @@ (set! (-> this warmup-sound-id) (new-sound-id)) (go (method-of-object this initial-state)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/boss/terraformer-setup_REF.gc b/test/decompiler/reference/jak3/levels/desert/boss/terraformer-setup_REF.gc index 21928bb495e..3e4643d0aa1 100644 --- a/test/decompiler/reference/jak3/levels/desert/boss/terraformer-setup_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/boss/terraformer-setup_REF.gc @@ -69,7 +69,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init! ((this terraformer-foot-mark-pt-array) (arg0 vector) (arg1 float)) - (set! (-> this origin quad) (-> arg0 quad)) + (vector-copy! (-> this origin) arg0) (set! (-> this radius) arg1) (set! (-> this current-point) 0) 0 @@ -144,7 +144,7 @@ ) (vector-cross! s3-1 (-> s5-0 normal) (vector-get-unique! (new 'stack-no-clear 'vector) (-> s5-0 normal))) (vector-normalize! s3-1 10240.0) - (set! (-> s4-1 0 quad) (-> s3-1 quad)) + (vector-copy! (-> s4-1 0) s3-1) (vector-cross! (-> s4-1 1) s3-1 (-> s5-0 normal)) (vector-negate! (-> s4-1 2) s3-1) (vector-cross! (-> s4-1 3) (-> s5-0 normal) s3-1) @@ -179,7 +179,7 @@ (fill-using-bounding-box *collide-cache* s3-2) ) (dotimes (s3-3 4) - (set! (-> gp-0 start-pos quad) (-> s4-1 s3-3 quad)) + (vector-copy! (-> gp-0 start-pos) (-> s4-1 s3-3)) (when (< (probe-using-line-sphere *collide-cache* gp-0) 0.0) (set! (-> s5-0 found?) #f) (return 0) @@ -209,7 +209,7 @@ ) (let ((s1-0 (-> this points (-> this current-point)))) (when (-> s1-0 found?) - (set! (-> s3-0 uvec quad) (-> s1-0 normal quad)) + (vector-copy! (-> s3-0 uvec) (-> s1-0 normal)) (vector-cross! (-> s3-0 rvec) (-> s3-0 uvec) @@ -836,7 +836,8 @@ ;; definition for method 20 of type terraformer-mine ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this terraformer-mine)) +(defmethod get-search-info-flag ((this terraformer-mine)) + "Get search-info-flag for this process." (the-as search-info-flag 24) ) @@ -878,8 +879,8 @@ (set! (-> self draw light-index) (-> (ppointer->process (-> self parent)) draw light-index)) (logior! (-> self mask) (process-mask enemy)) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self src-pos quad) (-> arg0 quad)) - (set! (-> self dest-pos quad) (-> arg1 quad)) + (vector-copy! (-> self src-pos) arg0) + (vector-copy! (-> self dest-pos) arg1) (set! (-> self which-trajectory) 0) self (set! (-> self trail-part) @@ -901,7 +902,7 @@ (defbehavior terraformer-mine-explode terraformer-mine () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) (sound-play "mine-explode" :position (-> self root trans)) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 24576.0) (set! (-> gp-0 scale) 1.0) @@ -981,7 +982,7 @@ (set! (-> self which-trajectory) 0) (set! (-> self x-rotate) (* 65536.0 (rand-vu))) (set! (-> self y-rotate) (* 65536.0 (rand-vu))) - (set! (-> self root trans quad) (-> self src-pos quad)) + (vector-copy! (-> self root trans) (-> self src-pos)) ) :trans (behavior () (rlet ((acc :class vf) @@ -1027,7 +1028,7 @@ ) (let ((gp-1 (new 'stack-no-clear 'matrix))) (matrix-identity! gp-1) - (set! (-> gp-1 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 432 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1052,7 +1053,7 @@ (vector+! gp-3 gp-3 (-> self root trans)) (let ((s5-3 (new 'stack-no-clear 'collide-query))) (set-vector! (-> s5-3 move-dist) 0.0 -122880.0 0.0 1.0) - (set! (-> s5-3 start-pos quad) (-> gp-3 quad)) + (vector-copy! (-> s5-3 start-pos) gp-3) (+! (-> s5-3 start-pos y) 61440.0) (let ((v1-69 s5-3)) (set! (-> v1-69 radius) 4096.0) @@ -1135,7 +1136,8 @@ ;; definition for method 20 of type terraformer-target ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this terraformer-target)) +(defmethod get-search-info-flag ((this terraformer-target)) + "Get search-info-flag for this process." (the-as search-info-flag 24) ) @@ -1189,7 +1191,7 @@ (('attack) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) (sound-play "blow-target" :position (-> self root trans)) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 8192.0) (set! (-> gp-0 scale) 1.0) @@ -1515,7 +1517,7 @@ ) ) (set! (-> self root event-self) 'touched) - (set! (-> self root trans quad) (-> (ppointer->process (-> self parent)) root trans quad)) + (vector-copy! (-> self root trans) (-> (ppointer->process (-> self parent)) root trans)) (set! (-> self draw light-index) (-> (ppointer->process (-> self parent)) draw light-index)) (logior! (-> self mask) (process-mask enemy)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1545,7 +1547,7 @@ (activate! *camera-smush-control* f0-4 75 600 1.1 1.07 (-> *display* camera-clock)) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self foot-lock old-position quad)) + (vector-copy! gp-1 (-> self foot-lock old-position)) (let ((s5-1 (new 'stack-no-clear 'quaternion)) (s4-1 (new 'stack-no-clear 'matrix)) (s3-1 #f) @@ -1553,7 +1555,7 @@ (+! (-> gp-1 y) 4096.0) (quaternion-from-two-vectors! s5-1 (new 'static 'vector :y 1.0) (-> self foot-lock old-normal)) (quaternion->matrix s4-1 s5-1) - (set! (-> s4-1 trans quad) (-> gp-1 quad)) + (vector-copy! (-> s4-1 trans) gp-1) (when (nonzero? (-> self splash-list)) (let ((f0-7 (ja-aframe-num 0)) (v1-12 (-> self splash-list-index)) @@ -1581,7 +1583,7 @@ (set! (-> self stepped-in-water) #t) (let ((s5-2 (new 'stack-no-clear 'matrix))) (matrix-identity! s5-2) - (set! (-> s5-2 trans quad) (-> gp-1 quad)) + (vector-copy! (-> s5-2 trans) gp-1) (set! (-> s5-2 trans y) 37273.6) (if (logtest? (-> *part-group-id-table* 437 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -1871,7 +1873,7 @@ (set! (-> self foot-lock lock target) 0.0) (let ((s5-3 (new 'stack-no-clear 'matrix))) (matrix-from-two-vectors! s5-3 (new 'static 'vector :y 1.0) (-> self foot-lock old-normal)) - (set! (-> s5-3 trans quad) (-> self foot-lock old-position quad)) + (vector-copy! (-> s5-3 trans) (-> self foot-lock old-position)) (cond ((-> self stepped-in-water) (set! (-> s5-3 trans y) 37273.6) @@ -1922,9 +1924,10 @@ (else (let ((s5-4 (new 'stack-no-clear 'collide-query))) (let ((v1-92 (new 'stack-no-clear 'vector))) - (set! (-> v1-92 quad) - (-> self node-list data (+ (-> *terraformer-ik-setup* elbow-index) 1) bone transform trans quad) - ) + (vector-copy! + v1-92 + (-> self node-list data (+ (-> *terraformer-ik-setup* elbow-index) 1) bone transform trans) + ) (let ((a2-30 (-> s5-4 bbox)) (a0-30 v1-92) (a1-26 (new 'stack-no-clear 'vector)) @@ -1952,7 +1955,7 @@ (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) ) (fill-using-bounding-box *collide-cache* s5-4) - (set! (-> s5-4 start-pos quad) (-> gp-0 quad)) + (vector-copy! (-> s5-4 start-pos) gp-0) (+! (-> s5-4 start-pos y) 163840.0) (set-vector! (-> s5-4 move-dist) 0.0 -327680.0 0.0 1.0) (let ((v1-99 s5-4)) @@ -1969,7 +1972,7 @@ (when (>= f0-27 0.0) (set! (-> self foot-lock lock target) 1.0) (vector+float*! (-> self foot-lock old-position) (-> s5-4 start-pos) (-> s5-4 move-dist) f0-27) - (set! (-> self foot-lock old-normal quad) (-> s5-4 best-other-tri normal quad)) + (vector-copy! (-> self foot-lock old-normal) (-> s5-4 best-other-tri normal)) (foot-impact) (if (nonzero? (-> self foot-marks)) (init! (-> self foot-marks) (-> self foot-lock old-position) 32768.0) @@ -2138,7 +2141,7 @@ (let* ((a0-20 (-> self nav)) (f0-0 (-> a0-20 extra-nav-sphere w)) ) - (set! (-> a0-20 extra-nav-sphere quad) (-> v1-25 quad)) + (vector-copy! (-> a0-20 extra-nav-sphere) v1-25) (set! (-> a0-20 extra-nav-sphere w) f0-0) ) 0 @@ -2155,18 +2158,7 @@ (let ((f0-2 (terraformer-leg-frames-till-down))) (when (and (< f0-2 32.0) (< 20.0 f0-2)) (let ((gp-1 (new 'stack-no-clear 'matrix))) - (let* ((v1-38 gp-1) - (a3-0 (-> self node-list data 6 bone transform)) - (a0-28 (-> a3-0 rvec quad)) - (a1-4 (-> a3-0 uvec quad)) - (a2-3 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-38 rvec quad) a0-28) - (set! (-> v1-38 uvec quad) a1-4) - (set! (-> v1-38 fvec quad) a2-3) - (set! (-> v1-38 trans quad) a3-1) - ) + (matrix-copy! gp-1 (-> self node-list data 6 bone transform)) (vector<-cspace+vector! (-> gp-1 trans) (-> self node-list data 6) (new 'static 'vector :y 122880.0 :w 1.0)) (if (-> self stepped-in-water) (spawn-from-mat (-> self water-drop-part) gp-1) @@ -2281,7 +2273,7 @@ ) (cond ((-> self launch-drones) - (set! (-> arg0 quad) (-> self target-rot fvec quad)) + (vector-copy! arg0 (-> self target-rot fvec)) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 819200.0) (vector+! arg0 arg0 (-> self old-target-pos)) @@ -2302,7 +2294,7 @@ ) (let ((s5-1 (new 'stack-no-clear 'collide-query))) (set-vector! (-> s5-1 move-dist) 0.0 -245760.0 0.0 1.0) - (set! (-> s5-1 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-1 start-pos) arg0) (+! (-> s5-1 start-pos y) 122880.0) (let ((v1-19 s5-1)) (set! (-> v1-19 radius) 4096.0) @@ -2359,13 +2351,13 @@ (cond ((-> self launch-drones) (let ((s4-0 (new 'stack-no-clear 'enemy-init-by-other-params))) - (set! (-> s4-0 trans quad) (-> s5-0 quad)) + (vector-copy! (-> s4-0 trans) s5-0) (quaternion-copy! (-> s4-0 quat) (-> self root quat)) (set! (-> s4-0 entity) (-> self entity)) (set! (-> s4-0 directed?) #t) (set! (-> s4-0 no-initial-move-to-ground?) #t) (set! (-> s4-0 art-level) #f) - (set! (-> self jump-dest quad) (-> gp-0 quad)) + (vector-copy! (-> self jump-dest) gp-0) (let ((gp-1 (get-process *default-dead-pool* terraformer-drone #x4000 1))) (set! hand (ppointer->handle (when gp-1 @@ -2456,54 +2448,21 @@ ) (when (< (-> self old-target-time) (current-time)) (set! (-> self older-target-time) (-> self old-target-time)) - (set! (-> self older-target-pos quad) (-> self old-target-pos quad)) + (vector-copy! (-> self older-target-pos) (-> self old-target-pos)) (set-time! (-> self old-target-time)) - (set! (-> self old-target-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> self old-target-pos) (target-pos 0)) (cond (*target* (quaternion->matrix (-> self target-rot) (get-quat *target* 0)) ) (*camera-combiner* - (let* ((v1-71 (-> self target-rot)) - (a3-0 (-> *camera-combiner* inv-camera-rot)) - (a0-33 (-> a3-0 rvec quad)) - (a1-13 (-> a3-0 uvec quad)) - (a2-2 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-71 rvec quad) a0-33) - (set! (-> v1-71 uvec quad) a1-13) - (set! (-> v1-71 fvec quad) a2-2) - (set! (-> v1-71 trans quad) a3-1) - ) + (matrix-copy! (-> self target-rot) (-> *camera-combiner* inv-camera-rot)) ) (*math-camera* - (let* ((v1-73 (-> self target-rot)) - (a3-2 (-> *math-camera* inv-camera-rot)) - (a0-35 (-> a3-2 rvec quad)) - (a1-14 (-> a3-2 uvec quad)) - (a2-3 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> v1-73 rvec quad) a0-35) - (set! (-> v1-73 uvec quad) a1-14) - (set! (-> v1-73 fvec quad) a2-3) - (set! (-> v1-73 trans quad) a3-3) - ) + (matrix-copy! (-> self target-rot) (-> *math-camera* inv-camera-rot)) ) (else - (let* ((v1-74 (-> self target-rot)) - (a3-4 *identity-matrix*) - (a0-36 (-> a3-4 rvec quad)) - (a1-15 (-> a3-4 uvec quad)) - (a2-4 (-> a3-4 fvec quad)) - (a3-5 (-> a3-4 trans quad)) - ) - (set! (-> v1-74 rvec quad) a0-36) - (set! (-> v1-74 uvec quad) a1-15) - (set! (-> v1-74 fvec quad) a2-4) - (set! (-> v1-74 trans quad) a3-5) - ) + (matrix-copy! (-> self target-rot) *identity-matrix*) ) ) ) @@ -2832,6 +2791,7 @@ ;; INFO: Used lq/sq ;; ERROR: Function may read a register that is not set: t1 (defmethod init-from-entity! ((this terraformer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (t1-0 int)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -2864,7 +2824,7 @@ (set! (-> this current-node) (the-as uint 0)) (set! (-> this graph) *terraformer-walk-graph*) (if (-> this graph) - (set! (-> this root trans quad) (-> this graph node (-> this current-node) position quad)) + (vector-copy! (-> this root trans) (-> this graph node (-> this current-node) position)) ) (dotimes (v1-25 6) (set! (-> this legs v1-25) (the-as handle #f)) diff --git a/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc index 900bd4ff6ba..52144551454 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/desert-chase_REF.gc @@ -190,7 +190,7 @@ (process->handle (-> (cond ((logtest? (-> *part-group-id-table* 454 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this @@ -199,7 +199,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 454) :duration (seconds 3)) ) ) @@ -351,11 +351,11 @@ (activate! *camera-smush-control* 2048.0 30 150 1.0 0.8 (-> *display* camera-clock)) (cond ((logtest? (-> *part-group-id-table* 456 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 456)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 456)) ) ) @@ -375,9 +375,10 @@ (set! (-> s2-1 charge) 1.0) (set! (-> s2-1 options) (projectile-options)) (logclear! (-> s2-1 options) (projectile-options po14 po15 po16)) - (set! (-> s2-1 pos quad) - (-> (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) quad) - ) + (vector-copy! + (-> s2-1 pos) + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :y 4096.0 :w 1.0)) + ) (set! (-> s2-1 notify-handle) (the-as handle #f)) (set! (-> s2-1 owner-handle) (the-as handle #f)) (set! (-> s2-1 target-handle) (the-as handle #f)) @@ -427,7 +428,7 @@ ;; INFO: Used lq/sq (defbehavior catapult-target-init-by-other catapult-target ((arg0 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 455) self)) (go-virtual idle) ) @@ -732,12 +733,12 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> gp-0 pos) arg0) (set! (-> gp-0 notify-handle) (process->handle this)) (set! (-> gp-0 owner-handle) (process->handle this)) (set! (-> gp-0 target-handle) (ppointer->handle (.asm.sllv.r0 (the-as handle v1-5)))) ) - (set! (-> gp-0 target-pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 target-pos) arg1) (set! (-> gp-0 ignore-handle) (process->handle this)) (let* ((v1-13 *game-info*) (a0-27 (+ (-> v1-13 attack-id) 1)) @@ -798,7 +799,7 @@ ) (when s4-0 (let ((s3-1 (-> this target-point arg0))) - (set! (-> s3-1 quad) (-> *stronghold-inside-point* quad)) + (vector-copy! s3-1 *stronghold-inside-point*) (+! (-> s3-1 x) (rand-vu-float-range -122880.0 122880.0)) (+! (-> s3-1 z) (rand-vu-float-range -122880.0 122880.0)) (send-event s4-0 'launch s3-1 this) @@ -828,7 +829,7 @@ (set! f30-0 2.0) ) (let ((s1-0 (new 'stack-no-clear 'marauder-init-by-other-params))) - (set! (-> s1-0 trans quad) (-> arg0 pos quad)) + (vector-copy! (-> s1-0 trans) (-> arg0 pos)) (quaternion-copy! (-> s1-0 quat) (-> arg0 quat)) (set! (-> s1-0 entity) (-> this marauder-entity)) (set! (-> s1-0 directed?) #f) @@ -885,8 +886,8 @@ (set! (-> s2-0 params flags) (traffic-spawn-flags tsf6)) (set! (-> s2-0 params guard-type) (the-as uint 11)) (set! (-> s2-0 params entity) #f) - (set! (-> s2-0 params velocity quad) (-> s2-0 vec quad)) - (set! (-> s2-0 params position quad) (-> s3-1 pos quad)) + (vector-copy! (-> s2-0 params velocity) (-> s2-0 vec)) + (vector-copy! (-> s2-0 params position) (-> s3-1 pos)) (quaternion-copy! (-> s2-0 params rotation) (-> s3-1 quat)) (let ((a0-12 (vehicle-spawn (vehicle-type v-catapult) (-> s2-0 params)))) (when a0-12 @@ -1000,7 +1001,7 @@ (defbehavior deschase-artifact-init-by-other deschase-artifact ((arg0 vector)) (set! (-> self level) (level-get *level* 'deschase)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self pos quad) (-> arg0 quad)) + (vector-copy! (-> self pos) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-deschase-artifact" (the-as (pointer level) #f))) @@ -1020,7 +1021,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-1 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-1 pos) arg0) (quaternion-identity! (-> s5-1 quat)) (set! (-> s5-1 flags) (task-arrow-flags taf3)) (set! (-> s5-1 map-icon) (the-as uint 13)) @@ -1053,11 +1054,11 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (when v1-0 - (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (vector-copy! s5-0 (-> v1-0 control trans)) (set! (-> s5-0 w) 4096.0) (when (focus-test? v1-0 pilot) (let ((a1-4 (the-as process-focusable (handle->process (-> v1-0 pilot vehicle))))) - (set! (-> s5-0 quad) (-> a1-4 root root-prim prim-core world-sphere quad)) + (vector-copy! s5-0 (-> a1-4 root root-prim prim-core world-sphere)) ) ) (let ((f0-1 (vector-vector-distance-squared (-> this root trans) s5-0)) @@ -1109,6 +1110,7 @@ ;; definition for method 11 of type deschase-artifact ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this deschase-artifact) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1350,7 +1352,7 @@ (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status dead))) ) (let ((s4-0 (new 'stack-no-clear 'matrix))) - (set! (-> s4-0 uvec quad) (-> (the-as process-focusable gp-0) root trans quad)) + (vector-copy! (-> s4-0 uvec) (-> (the-as process-focusable gp-0) root trans)) (vector-float*! (-> s4-0 rvec) (-> (the-as process-focusable gp-0) root transv) 0.1) (set! (-> s4-0 fvec x) 24576.0) (let ((s5-1 (the-as (array collide-shape) ((method-of-type array new) @@ -1556,7 +1558,7 @@ (set! (-> s5-0 guard-type) (the-as uint 11)) (set! (-> s5-0 entity) #f) (vector-reset! (-> s5-0 velocity)) - (set! (-> s5-0 position quad) (-> arg1 pos quad)) + (vector-copy! (-> s5-0 position) (-> arg1 pos)) (quaternion-copy! (-> s5-0 rotation) (-> arg1 quat)) (let ((s5-1 (vehicle-spawn (vehicle-type v-marauder-b) (the-as traffic-object-spawn-params (&-> s5-0 object-type)))) ) @@ -1639,7 +1641,7 @@ (let ((gp-0 (new 'stack-no-clear 'player-controller-init-params))) (set! (-> gp-0 mode) 'active) (set! (-> gp-0 flags) (player-controller-flag pc1 lock-features letterbox pc4)) - (set! (-> gp-0 targ-pos quad) (-> *stronghold-player-goto-point* quad)) + (vector-copy! (-> gp-0 targ-pos) *stronghold-player-goto-point*) (set! (-> gp-0 notify-proc) (process->handle self)) (set! (-> self h-player-controller) (ppointer->handle (process-spawn player-controller gp-0 :name "player-controller" :to *target*)) diff --git a/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc index 1640d401429..be3638ced6b 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/desert-jump_REF.gc @@ -188,7 +188,7 @@ (toggle-status gp-0 (entity-perm-status dead) #t) (toggle-status s5-0 (entity-perm-status dead) #t) (kill-by-type wascity-airlock *active-pool*) - (set! (-> self root trans quad) (-> gp-0 extra trans quad)) + (vector-copy! (-> self root trans) (-> gp-0 extra trans)) (spawn-exploder self) ) ) @@ -213,7 +213,7 @@ (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) (let ((v1-2 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) 327680.0))) (vector+! v1-2 v1-2 (-> this root trans)) - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> v1-2 quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) v1-2) ) (set! (-> gp-0 fountain-rand-transv-hi x) 81920.0) (set! (-> gp-0 fountain-rand-transv-hi y) 327680.0) @@ -239,6 +239,7 @@ ;; definition for method 11 of type wascity-airlock-debris (defmethod init-from-entity! ((this wascity-airlock-debris) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (go (method-of-object this idle)) @@ -288,7 +289,7 @@ (defbehavior beam-generator-init-by-other beam-generator ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self pos quad) (-> arg0 quad)) + (vector-copy! (-> self pos) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-beam-generator" (the-as (pointer level) #f))) @@ -308,7 +309,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-1 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-1 pos) arg0) (quaternion-identity! (-> s5-1 quat)) (set! (-> s5-1 flags) (task-arrow-flags taf3)) (set! (-> s5-1 map-icon) (the-as uint 13)) @@ -354,11 +355,11 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (when v1-0 - (set! (-> s5-0 quad) (-> v1-0 control trans quad)) + (vector-copy! s5-0 (-> v1-0 control trans)) (set! (-> s5-0 w) 4096.0) (when (focus-test? v1-0 pilot) (let ((a1-4 (the-as process-focusable (handle->process (-> v1-0 pilot vehicle))))) - (set! (-> s5-0 quad) (-> a1-4 root root-prim prim-core world-sphere quad)) + (vector-copy! s5-0 (-> a1-4 root root-prim prim-core world-sphere)) ) ) (let ((f0-1 (vector-vector-distance-squared (-> this root trans) s5-0)) @@ -411,6 +412,7 @@ ;; definition for method 11 of type beam-generator ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this beam-generator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1073,7 +1075,7 @@ ) (cond ((and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status dead)))) - (set! (-> this last-catapult-pos quad) (-> s3-0 root trans quad)) + (vector-copy! (-> this last-catapult-pos) (-> s3-0 root trans)) (let ((s1-0 (-> *desjump-vehicle-path* (-> s4-1 path-type) (-> s4-1 path-pos))) (s2-1 (= (+ (length (-> *desjump-vehicle-path* (-> s4-1 path-type))) -1) (-> s4-1 path-pos))) ) @@ -1241,7 +1243,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod spawn-beam-generator ((this desert-jump-manager) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (+! (-> s5-0 y) 8192.0) (set! (-> this generator) (ppointer->handle (process-spawn beam-generator s5-0 (-> this entity) :name "beam-generator" :to this)) @@ -1293,8 +1295,8 @@ (set! (-> s0-0 params flags) (traffic-spawn-flags)) (set! (-> s0-0 params guard-type) (the-as uint 11)) (set! (-> s0-0 params entity) #f) - (set! (-> s0-0 params velocity quad) (-> s0-0 vec quad)) - (set! (-> s0-0 params position quad) (-> s2-0 pos quad)) + (vector-copy! (-> s0-0 params velocity) (-> s0-0 vec)) + (vector-copy! (-> s0-0 params position) (-> s2-0 pos)) (quaternion-copy! (-> s0-0 params rotation) (-> s2-0 quat)) (let ((s2-1 (vehicle-spawn arg1 (-> s0-0 params)))) (when s2-1 diff --git a/test/decompiler/reference/jak3/levels/desert/chase/marauder_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/marauder_REF.gc index 20617c42674..9d30662c74d 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/marauder_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/marauder_REF.gc @@ -207,34 +207,34 @@ :jump-height-min (meters 1) :jump-height-factor 0.2 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 49152.0 - :knocked-soft-vxz-hi 73728.0 - :knocked-soft-vy-lo 32768.0 - :knocked-soft-vy-hi 49152.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 32768.0 - :knocked-medium-vy-hi 49152.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 32768.0 - :knocked-hard-vy-hi 49152.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 49152.0 - :knocked-yellow-vxz-hi 65536.0 - :knocked-yellow-vy-lo 32768.0 - :knocked-yellow-vy-hi 49152.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 32768.0 - :knocked-red-vy-hi 49152.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 + :knocked-soft-vxz-lo (meters 12) + :knocked-soft-vxz-hi (meters 18) + :knocked-soft-vy-lo (meters 8) + :knocked-soft-vy-hi (meters 12) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 8) + :knocked-medium-vy-hi (meters 12) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 8) + :knocked-hard-vy-hi (meters 12) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 12) + :knocked-yellow-vxz-hi (meters 16) + :knocked-yellow-vy-lo (meters 8) + :knocked-yellow-vy-hi (meters 12) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 8) + :knocked-red-vy-hi (meters 12) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 8) + :knocked-blue-vy-hi (meters 12) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) @@ -548,17 +548,18 @@ ;; definition for method 92 of type marauder ;; INFO: Used lq/sq (defmethod init-jump-info! ((this marauder) (arg0 enemy-jump-info)) + "Populate an enemy-jump-info for jumping to this enemy's event-param-point" (set! (-> arg0 flags) (enemy-jump-flags ejf0)) (set! (-> arg0 anim-speed) (rnd-float-range this 0.9 1.1)) (set! (-> arg0 hang-time) 0) - (set! (-> arg0 dest-pos quad) (-> this event-param-point quad)) - (set! (-> arg0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> arg0 dest-pos) (-> this event-param-point)) + (vector-copy! (-> arg0 start-pos) (-> this root trans)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (if (enemy-above-ground? this s4-0 (-> arg0 dest-pos) (-> this gnd-collide-with) 20480.0 81920.0 1024.0) (set! (-> arg0 dest-pos y) (-> s4-0 best-other-tri intersect y)) ) ) - (setup-jump! this arg0) + (setup-jump-trajectory! this arg0) (none) ) @@ -606,6 +607,7 @@ ;; definition for method 82 of type marauder ;; INFO: Used lq/sq (defmethod event-handler ((this marauder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-1 object)) (case arg2 (('nav-mesh-moved) @@ -647,7 +649,7 @@ ) (('save) (let ((a0-23 (the-as object (-> arg3 param 0)))) - (set! (-> this save-pos quad) (-> (the-as vector a0-23) quad)) + (vector-copy! (-> this save-pos) (the-as vector a0-23)) ) (set! v0-1 #t) (set! (-> this save) (the-as symbol v0-1)) @@ -671,7 +673,7 @@ (let ((s4-1 (the-as vector (-> arg3 param 0))) (s5-1 (the-as vector (-> arg3 param 1))) ) - (set! (-> this root trans quad) (-> s4-1 quad)) + (vector-copy! (-> this root trans) s4-1) (quaternion<-rotate-y-vector (-> this root quat) (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1)) (set-vector! (-> this root scale) 0.6 0.6 0.6 1.0) (setup-from-to-height! (-> this traj) s4-1 s5-1 12288.0 -4.551111) @@ -688,7 +690,8 @@ ) ;; definition for method 84 of type marauder -(defmethod send-attack-on-jump-or-knocked ((this marauder) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this marauder) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (when (!= (-> arg0 type) target) (let* ((s3-0 (-> arg1 param 0)) (s2-0 arg0) @@ -721,7 +724,7 @@ ) ) ) - (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -735,6 +738,7 @@ ;; definition for method 59 of type marauder ;; WARN: Return type mismatch int vs none. (defmethod enemy-common-post ((this marauder)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -766,22 +770,26 @@ ) ;; definition for method 123 of type marauder -(defmethod enemy-method-123 ((this marauder)) +(defmethod allow-ragdoll? ((this marauder)) + "Can this enemy ragdoll now?" (= (-> this hit-points) 0.0) ) ;; definition for method 126 of type marauder (defmethod ragdoll-spawn! ((this marauder) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." ((method-of-type nav-enemy ragdoll-spawn!) this arg0 arg1) ) ;; definition for method 125 of type marauder (defmethod ragdoll-settled? ((this marauder)) + "Has the ragdoll stopped moving?" ((method-of-type nav-enemy ragdoll-settled?) this) ) ;; definition for method 85 of type marauder (defmethod knocked-anim ((this marauder) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (cond ((not (focus-test? this dead)) @@ -838,6 +846,7 @@ ;; definition for method 86 of type marauder (defmethod knocked-land-anim ((this marauder) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((not (focus-test? this dead)) (cond @@ -893,6 +902,7 @@ ;; definition for method 98 of type marauder (defmethod jump-wind-up-anim ((this marauder) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 0.0) (set! (-> a0-1 param 1) 1.0) @@ -929,6 +939,7 @@ ;; definition for method 96 of type marauder (defmethod jump-in-air-anim ((this marauder) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (let ((v1-2 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) @@ -976,6 +987,7 @@ ;; definition for method 97 of type marauder (defmethod jump-land-anim ((this marauder) (arg0 enemy-jump-info)) + "Play the landing anim" (ja-channel-push! 1 0) (cond ((-> this jump-attack) @@ -1046,7 +1058,7 @@ (suspend) (ja :num! (loop! f30-0)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! gp-0 (ja-linear-vel 0)) (let ((v1-21 (-> self nav))) (set! (-> v1-21 target-speed) (-> gp-0 z)) ) @@ -1062,7 +1074,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-method-187 self) @@ -1146,7 +1158,7 @@ (let ((a0-0 (-> self nav state)) (v1-8 *null-vector*) ) - (set! (-> a0-0 velocity quad) (-> v1-8 quad)) + (vector-copy! (-> a0-0 velocity) v1-8) ) 0 ) @@ -1185,14 +1197,14 @@ (let* ((v1-21 (get-trans (the-as process-focusable gp-0) 0)) (f30-0 (vector-length (vector-! (new 'stack-no-clear 'vector) v1-21 (-> self root trans)))) ) - (when (enemy-method-105 self 8192.0 #t) + (when (pointing-toward-focus? self 8192.0 #t) (should-check-los? (-> self los) 0) (cond ((< f30-0 32768.0) (cond ((rand-vu-percent? 0.5) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (let ((a0-16 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (a1-10 gp-1) ) @@ -1258,7 +1270,7 @@ (suspend) (ja :num! (loop! f30-0)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! gp-0 (ja-linear-vel 0)) (let ((v1-21 (-> self nav))) (set! (-> v1-21 target-speed) (-> gp-0 z)) ) @@ -1366,7 +1378,7 @@ (let ((a0-4 (handle->process (-> self focus handle)))) (set! gp-0 (when a0-4 (set! gp-0 (-> self target-pos)) - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-4) 3) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-4) 3)) gp-0 ) ) @@ -1544,7 +1556,8 @@ ;; definition for method 147 of type marauder ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod check-victory ((this marauder)) +(defmethod clear-stale-victory ((this marauder)) + "Remove victory flag if needed." (if (or (time-elapsed? (-> this hit-focus-time) (seconds 4)) (and (handle->process (-> this focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) @@ -1588,13 +1601,15 @@ ) ;; definition for method 65 of type marauder -(defmethod penetrate->next-state ((this marauder) (arg0 process) (arg1 event-message-block) (arg2 float)) - ((method-of-type nav-enemy penetrate->next-state) this arg0 arg1 arg2) +(defmethod msg-for-incoming-attack ((this marauder) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." + ((method-of-type nav-enemy msg-for-incoming-attack) this arg0 arg1 arg2) ) ;; definition for method 62 of type marauder ;; WARN: Return type mismatch number vs float. (defmethod get-damage-from-attack ((this marauder) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let ((v0-1 (the-as number (call-parent-method this arg0 arg1)))) (if (logtest? (-> (the-as attack-info (-> arg1 param 1)) penetrate-using) (penetrate punch spin)) (set! v0-1 #x40000000) @@ -1612,14 +1627,15 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-2 quad)) + (vector-copy! (-> v1-1 target-pos) a0-2) ) 0 (none) ) ;; definition for method 102 of type marauder -(defmethod go-directed2 ((this marauder)) +(defmethod go-next-state-auto ((this marauder)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (cond ((-> this ambush?) (set! (-> this ambush?) #f) @@ -1681,7 +1697,7 @@ (suspend) (when (and (-> self skip-jump) (not (sphere-in-view-frustum? gp-0))) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (let ((a0-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (a1-1 gp-1) ) @@ -1712,7 +1728,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-2 quad) vf6) ) - (set! (-> self root trans quad) (-> gp-1 quad)) + (vector-copy! (-> self root trans) gp-1) ) (go-virtual hostile) ) @@ -1756,7 +1772,7 @@ (set! (-> v1-58 prim-core collide-with) (-> self root backup-collide-with)) ) (let ((gp-3 (new 'stack-no-clear 'vector))) - (set! (-> gp-3 quad) (-> self root trans quad)) + (vector-copy! gp-3 (-> self root trans)) (let ((a0-22 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (a1-8 gp-3) ) @@ -1890,12 +1906,12 @@ (let ((gp-0 (-> self root))) (cond ((focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) ) (else (when (!= (-> self incoming knocked-type) (knocked-type yellow-shot)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! s5-0 (ja-linear-vel 0)) (vector-orient-by-quat! s5-0 s5-0 (-> gp-0 quat)) ) ) @@ -1919,12 +1935,14 @@ ) ;; definition for method 122 of type marauder -(defmethod go-idle2 ((this marauder)) +(defmethod go-fallback-init ((this marauder)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this ambush)) ) ;; definition for method 111 of type marauder (defmethod on-attack ((this marauder) (arg0 process-focusable)) + "Handler after this enemy attacks something. By default focuses on the attacked, but could be overriden." (if (and (= (-> arg0 type) target) (-> this next-state) (let ((v1-4 (-> this next-state name))) (or (= v1-4 'attack-run) (= v1-4 'jump)) ) @@ -1937,9 +1955,9 @@ ;; definition for method 119 of type marauder ;; WARN: Return type mismatch int vs object. -(defmethod init-enemy-defaults! ((this marauder) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this marauder) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1950,6 +1968,7 @@ ;; definition for method 120 of type marauder ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this marauder)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2083,12 +2102,13 @@ ;; definition for method 121 of type marauder ;; WARN: Return type mismatch symbol vs none. (defmethod init-enemy! ((this marauder)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-marauder" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *marauder-nav-enemy-info*) + (setup-enemy! this *marauder-nav-enemy-info*) (if (logtest? (enemy-flag multi-focus) (-> this enemy-flags)) (logior! (-> this fact enemy-options) (enemy-option multi-focus)) ) diff --git a/test/decompiler/reference/jak3/levels/desert/chase/wcar-catapult_REF.gc b/test/decompiler/reference/jak3/levels/desert/chase/wcar-catapult_REF.gc index c3726fbe804..9c188d5469b 100644 --- a/test/decompiler/reference/jak3/levels/desert/chase/wcar-catapult_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/chase/wcar-catapult_REF.gc @@ -1427,7 +1427,7 @@ ) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (go-virtual active) ) @@ -1440,18 +1440,7 @@ (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) ) :trans (behavior () - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (math-camera-matrix)) - (v1-0 (-> a2-0 rvec quad)) - (a0-0 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-0) - (set! (-> gp-0 uvec quad) a0-0) - (set! (-> gp-0 fvec quad) a1-0) - (set! (-> gp-0 trans quad) a2-1) - ) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) (-> gp-0 fvec) (-> gp-0 rvec) (matrix->quat gp-0 (-> self root quat)) @@ -1564,11 +1553,11 @@ (defmethod projectile-method-26 ((this v-catapult-shot)) (cond ((logtest? (-> *part-group-id-table* 452 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 452)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 452)) ) ) @@ -1771,7 +1760,7 @@ (vector+! v1-79 (-> s5-2 transform trans) v1-79) (cond ((logtest? (-> *part-group-id-table* 448 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-79 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-79) (part-tracker-spawn part-tracker-subsampler :to this @@ -1780,7 +1769,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-79 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-79) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 448) :duration (seconds 4)) ) ) @@ -1834,11 +1823,11 @@ (set! (-> s1-0 charge) 1.0) (set! (-> s1-0 options) (projectile-options)) (logclear! (-> s1-0 options) (projectile-options po14 po15 po16)) - (set! (-> s1-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s1-0 pos) arg0) (set! (-> s1-0 notify-handle) (process->handle (handle->process (-> this notify-handle)))) (set! (-> s1-0 owner-handle) (process->handle this)) (set! (-> s1-0 target-handle) (the-as handle #f)) - (set! (-> s1-0 target-pos quad) (-> arg1 quad)) + (vector-copy! (-> s1-0 target-pos) arg1) (set! (-> s1-0 ignore-handle) (process->handle this)) (let* ((v1-29 *game-info*) (a0-22 (+ (-> v1-29 attack-id) 1)) @@ -2023,11 +2012,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 452 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 452)) ) (else - (set! (-> *launch-matrix* trans quad) (-> s5-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s5-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 452)) ) ) @@ -2065,7 +2054,7 @@ (s4-1 (< (vector-vector-angle-safe s4-0 a1-4) 5461.3335)) (a1-6 (new 'stack 'debris-tuning (the-as uint 1))) ) - (set! (-> a1-6 fountain-rand-transv-lo quad) (-> this root trans quad)) + (vector-copy! (-> a1-6 fountain-rand-transv-lo) (-> this root trans)) (set! (-> a1-6 hit-xz-reaction) 0.95) (set! (-> a1-6 hit-y-reaction) 0.6) (set! (-> a1-6 scale-rand-lo) 1.0) @@ -2281,7 +2270,7 @@ ) (when (and a0-2 v1-1) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this targ-pos quad) (-> a0-2 quad)) + (vector-copy! (-> this targ-pos) a0-2) (set! (-> this notify-handle) (process->handle v1-1)) (let ((v0-0 (the-as object #t))) (set! (-> this launch-projectile?) (the-as symbol v0-0)) diff --git a/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc index 61906b80ad5..4cfe23f0534 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc @@ -448,7 +448,7 @@ ) (when v1-10 (set! (-> this player-vehicle) (-> *target* pilot vehicle)) - (set! (-> this ground-pos quad) (-> (the-as process-focusable v1-10) root trans quad)) + (vector-copy! (-> this ground-pos) (-> (the-as process-focusable v1-10) root trans)) (set-time! (-> this ground-time)) (dotimes (s5-1 3) (send-event (handle->process (-> this player-vehicle)) 'turbo-pickup) @@ -476,7 +476,7 @@ ) (set! (-> this max-distance) (fmax (-> this max-distance) (-> this distance))) (set! (-> this max-air-time) (fmax (-> this max-air-time) (-> this air-time))) - (set! (-> this ground-pos quad) (-> v1-26 root trans quad)) + (vector-copy! (-> this ground-pos) (-> v1-26 root trans)) (set-time! (-> this ground-time)) (set! (-> this distance) 0.0) (set! (-> this air-time) 0.0) diff --git a/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc index 2df6ae4ab63..db00abe3789 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc @@ -265,18 +265,7 @@ (let ((gp-0 (get-current-task-event (-> self task))) (s5-0 #f) ) - (let ((s4-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-1 (-> self node-list data 3 bone transform)) - (v1-5 (-> a2-1 rvec quad)) - (a0-2 (-> a2-1 uvec quad)) - (a1-1 (-> a2-1 fvec quad)) - (a2-2 (-> a2-1 trans quad)) - ) - (set! (-> s4-0 rvec quad) v1-5) - (set! (-> s4-0 uvec quad) a0-2) - (set! (-> s4-0 fvec quad) a1-1) - (set! (-> s4-0 trans quad) a2-2) - ) + (let ((s4-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data 3 bone transform)))) (when (< (vector-dot (-> s4-0 fvec) (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans s4-0 (new 'stack-no-clear 'vector))) @@ -495,7 +484,7 @@ ) (vector-orient-by-quat! (-> gp-0 vec2) (new 'static 'vector :y 16384.0 :z 40960.0 :w 1.0) (-> gp-0 quat)) (vector+! (-> gp-0 vec1) (-> self root trans) (-> gp-0 vec2)) - (set! (-> *camera* slave 0 trans quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> *camera* slave 0 trans) (-> gp-0 vec1)) (let ((v1-10 (-> gp-0 vec2))) (let ((a0-9 (-> self root trans))) (let ((a1-4 *up-vector*)) @@ -518,18 +507,7 @@ (-> *camera* local-down) ) ) - (let* ((v1-17 (-> gp-0 mat)) - (a3-1 (-> self node-list data 3 bone transform)) - (a0-14 (-> a3-1 rvec quad)) - (a1-8 (-> a3-1 uvec quad)) - (a2-6 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-17 rvec quad) a0-14) - (set! (-> v1-17 uvec quad) a1-8) - (set! (-> v1-17 fvec quad) a2-6) - (set! (-> v1-17 trans quad) a3-2) - ) + (matrix-copy! (-> gp-0 mat) (-> self node-list data 3 bone transform)) (matrix->trans (-> gp-0 mat) (-> gp-0 vec2)) (vector-! (-> gp-0 vec2) (camera-pos) (-> gp-0 vec2)) (when (< (vector-dot (-> gp-0 mat fvec) (-> gp-0 vec2)) 0.0) @@ -916,7 +894,7 @@ (-> self root quat) ) ) - (set! (-> *camera* slave 0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> *camera* slave 0 trans) gp-0) (let ((t9-3 forward-down->inv-matrix) (a0-7 (-> *camera* slave 0 tracking)) (a1-1 (new 'stack-no-clear 'vector)) @@ -1177,6 +1155,7 @@ ;; definition for method 11 of type des-burning-bush (defmethod init-from-entity! ((this des-burning-bush) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (des-burning-bush-method-32 this) (process-drawable-from-entity! this arg0) (des-burning-bush-method-33 this) @@ -1461,7 +1440,7 @@ ;; definition for method 32 of type task-manager-desert-bbush-get-to ;; WARN: Return type mismatch int vs none. (defmethod task-manager-desert-bbush-get-to-method-32 ((this task-manager-desert-bbush-get-to)) - (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (if (= (level-status? *level* 'waswide #f) 'active) (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) ) @@ -1519,7 +1498,7 @@ (set! (-> t1-1 fade-time) (the-as time-frame (the int (-> *burning-bush-get-on-info* (-> self info index) time))) ) - (set! (-> a0-3 quad) (-> *burning-bush-get-on-info* (-> self info index) trans quad)) + (vector-copy! a0-3 (-> *burning-bush-get-on-info* (-> self info index) trans)) (+! (-> a0-3 y) 4096.0) (set! (-> self skill) (ppointer->handle @@ -1539,24 +1518,13 @@ (suspend) (let ((f30-0 (-> *camera* settings fov))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *camera-combiner* trans quad)) - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-7 (-> *camera-combiner* inv-camera-rot)) - (v1-46 (-> a2-7 rvec quad)) - (a0-15 (-> a2-7 uvec quad)) - (a1-15 (-> a2-7 fvec quad)) - (a2-8 (-> a2-7 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-46) - (set! (-> gp-0 uvec quad) a0-15) - (set! (-> gp-0 fvec quad) a1-15) - (set! (-> gp-0 trans quad) a2-8) - ) + (vector-copy! s5-0 (-> *camera-combiner* trans)) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (-> *camera-combiner* inv-camera-rot)))) (let ((s4-0 (new 'stack 'transformq))) (let ((v1-52 (-> *burning-bush-get-on-info* (-> self info index))) (a1-17 (new 'stack-no-clear 'matrix)) ) - (set! (-> s4-0 trans quad) (-> v1-52 camera-trans quad)) + (vector-copy! (-> s4-0 trans) (-> v1-52 camera-trans)) (set-vector! (-> s4-0 scale) 1.0 1.0 1.0 1.0) (set! (-> a1-17 rvec x) (-> v1-52 camera-rot 0)) (set! (-> a1-17 rvec y) (-> v1-52 camera-rot 1)) @@ -1583,18 +1551,8 @@ (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) ) (set! (-> self update-fov?) #f) - (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) - (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) - (v1-75 (-> gp-0 rvec quad)) - (a0-24 (-> gp-0 uvec quad)) - (a1-19 (-> gp-0 fvec quad)) - (a3-5 (-> gp-0 trans quad)) - ) - (set! (-> a2-15 rvec quad) v1-75) - (set! (-> a2-15 uvec quad) a0-24) - (set! (-> a2-15 fvec quad) a1-19) - (set! (-> a2-15 trans quad) a3-5) - ) + (vector-copy! (-> *camera-combiner* trans) s5-0) + (matrix-copy! (-> *camera-combiner* inv-camera-rot) gp-0) ) ) (set! (-> *camera* settings fov) f30-0) @@ -1658,6 +1616,7 @@ ;; definition for method 11 of type wascity-burning-bush (defmethod init-from-entity! ((this wascity-burning-bush) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (des-burning-bush-method-32 this) (process-drawable-from-entity! this arg0) (des-burning-bush-method-33 this) diff --git a/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc index 4321725855e..d9fb3086415 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc @@ -599,7 +599,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring)) (cond - ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + ((= (level-status? *level* 'waswide #f) 'active) (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) (set-setting! 'music 'wasring 0.0 0) ) @@ -662,10 +662,7 @@ (defmethod hud-timer-handler ((this task-manager-desert-bbush-ring)) (with-pp (cond - ((and *target* - (= (status-of-level-and-borrows *level* 'desert #f) 'active) - (focus-test? *target* pilot-riding) - ) + ((and *target* (= (level-status? *level* 'desert #f) 'active) (focus-test? *target* pilot-riding)) (when (nonzero? (-> this start-time)) (let ((v1-8 (handle->process (-> this hud-timer)))) (if (and *target* (not v1-8)) @@ -1176,11 +1173,11 @@ (cond ((focus-test? v1-0 pilot) (let ((a2-1 (handle->process (-> v1-0 pilot vehicle)))) - (set! (-> a1-0 quad) (-> (the-as vehicle a2-1) root root-prim prim-core world-sphere quad)) + (vector-copy! a1-0 (-> (the-as vehicle a2-1) root root-prim prim-core world-sphere)) ) ) (else - (set! (-> a1-0 quad) (-> v1-0 control trans quad)) + (vector-copy! a1-0 (-> v1-0 control trans)) (+! (-> a1-0 y) 12288.0) ) ) @@ -1292,12 +1289,13 @@ ;; definition for method 11 of type desert-chase-ring ;; INFO: Used lq/sq (defmethod init-from-entity! ((this desert-chase-ring) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set-ring-particle-texture) (alloc-trsqv! this) (process-drawable-from-entity! this arg0) (set! (-> this ring-radius) (res-lump-float arg0 'ring-radius :default 24576.0)) (quaternion->matrix (-> this mat) (-> this root quat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1547) this)) (set! (-> this part-final) (create-launch-control (-> *part-group-id-table* 1548) this)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1347,11 +1345,11 @@ :enter (behavior () (cond ((logtest? (-> *part-group-id-table* 1546 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1546)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1546)) ) ) @@ -1455,7 +1453,7 @@ (defbehavior spirit-init-by-other spirit ((arg0 vector)) (set! (-> self play-pixie?) #f) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self sound-id) (new-sound-id)) (set! (-> self sound-id-2) (new-sound-id)) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1541) self)) @@ -1899,7 +1897,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-sbanks ((this task-manager-bbush-spirit-chase)) (cond - ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + ((= (level-status? *level* 'waswide #f) 'active) (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) (set-setting! 'music 'waspirit 0.0 0) ) @@ -2696,8 +2694,8 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('trigger) - (set! (-> self src quad) (-> (the-as vector (-> block param 0)) quad)) - (set! (-> self dst quad) (-> self root trans quad)) + (vector-copy! (-> self src) (the-as vector (-> block param 0))) + (vector-copy! (-> self dst) (-> self root trans)) (setup-from-to-duration! (-> self traj) (-> self src) (-> self dst) 300.0 -4.551111) (go-virtual idle) ) @@ -2777,6 +2775,7 @@ ;; definition for method 11 of type score-drop ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this score-drop) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) diff --git a/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc index 6e4aef37016..4a0841398e9 100644 --- a/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/des-cactus_REF.gc @@ -240,7 +240,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod des-plant-method-35 ((this des-plant) (arg0 vector)) - (set! (-> this attack-vel quad) (-> arg0 quad)) + (vector-copy! (-> this attack-vel) arg0) (if (< 81920.0 (vector-length (-> this attack-vel))) (vector-normalize! (-> this attack-vel) 81920.0) ) @@ -467,6 +467,7 @@ ;; definition for method 11 of type des-cactus-a (defmethod init-from-entity! ((this des-cactus-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -592,6 +593,7 @@ ;; definition for method 11 of type des-cactus-b (defmethod init-from-entity! ((this des-cactus-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) diff --git a/test/decompiler/reference/jak3/levels/desert/desert-dust-storm_REF.gc b/test/decompiler/reference/jak3/levels/desert/desert-dust-storm_REF.gc index 3e35fe92076..113a7183a03 100644 --- a/test/decompiler/reference/jak3/levels/desert/desert-dust-storm_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/desert-dust-storm_REF.gc @@ -92,7 +92,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self level) arg0) (set! (-> self enabled-screen-filter?) #f) - (set! (-> self origin quad) (-> arg2 quad)) + (vector-copy! (-> self origin) arg2) (set-time! (-> self state-time)) (set! (-> self current-wind-angle-speed) 0.0) (set! (-> self current-wind-angle) 0.0) @@ -173,7 +173,7 @@ (go-virtual die) ) (('hold-pos) - (set! (-> self origin quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self origin) (the-as vector (-> block param 0))) (set! (-> self dest-wind-angle) (the-as float (-> block param 1))) (go-virtual hold-pos) ) @@ -182,7 +182,7 @@ :trans (behavior () (desert-dust-storm-method-20 self) (set! *duststorm-stationary?* #f) - (set! (-> self origin quad) (-> (math-camera-pos) quad)) + (vector-copy! (-> self origin) (math-camera-pos)) (desert-dust-storm-method-18 self) (desert-dust-storm-method-17 self) ) @@ -220,7 +220,7 @@ (-> self intensity) ) (('hold-pos) - (set! (-> self origin quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self origin) (the-as vector (-> block param 0))) (set! (-> self dest-wind-angle) (the-as float (-> block param 1))) (set! v0-0 (current-time)) (set! (-> self last-hold-time) (the-as time-frame v0-0)) @@ -424,7 +424,7 @@ ((>= (/ (the float (- (current-time) (-> this state-time))) (the float (-> this new-generate-time))) 1.0) (set-time! (-> this state-time)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! s5-0 (-> (math-camera-matrix) fvec)) 0.0 (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) @@ -463,7 +463,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! s5-1 (-> (math-camera-matrix) fvec)) 0.0 (let ((f28-3 1.0)) (set! (-> s5-1 y) 0.0) @@ -540,7 +540,7 @@ (s3-0 (new 'stack-no-clear 'vector)) ) (dotimes (s2-0 15) - (set! (-> s3-0 quad) (-> this origin quad)) + (vector-copy! s3-0 (-> this origin)) (let ((s1-0 s3-0) (s0-0 s3-0) ) @@ -726,7 +726,7 @@ (f30-2 (* f30-1 (+ f28-1 (* f26-0 (+ -1.0 (the-as float v1-34)))))) (s5-3 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-3 quad) (-> *duststorm-wind-vec* quad)) + (vector-copy! s5-3 *duststorm-wind-vec*) (let* ((f28-2 -0.3) (f26-1 0.6) (v1-41 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -736,7 +736,7 @@ ) (vector-float*! s5-3 s5-3 f30-2) (let ((t1-0 (new 'static 'vector))) - (set! (-> t1-0 quad) (-> s5-3 quad)) + (vector-copy! t1-0 s5-3) (set-setting! 'global-wind #f 0.0 t1-0) ) ) @@ -786,7 +786,7 @@ (let ((f0-48 (+ -1.0 (-> this intensity)))) 0.0 (let ((a2-8 (new 'stack-no-clear 'vector))) - (set! (-> a2-8 quad) (-> *time-of-day-context* current-fog fog-color quad)) + (vector-copy! a2-8 (-> *time-of-day-context* current-fog fog-color)) (set! (-> a2-8 w) (* 128.0 f0-48)) (set! (-> this enabled-screen-filter?) #t) (setup *screen-filter* a2-8 a2-8 10000.0 (bucket-id generic-sprite-1) #x20000 #x30003 #t) diff --git a/test/decompiler/reference/jak3/levels/desert/desert-part_REF.gc b/test/decompiler/reference/jak3/levels/desert/desert-part_REF.gc index 84a17fb400e..0a8f90a548d 100644 --- a/test/decompiler/reference/jak3/levels/desert/desert-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/desert-part_REF.gc @@ -1284,7 +1284,7 @@ ;; WARN: Return type mismatch vector vs none. (defun birth-func-desert-beacon-set-accel ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (math-camera-matrix) rvec quad)) + (vector-copy! s5-0 (-> (math-camera-matrix) rvec)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 6.826667) (set! (-> s5-0 y) (-> arg1 acc y)) @@ -2802,7 +2802,3 @@ (:rotate-y (degrees 0) (degrees 3600)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/desert-scenes_REF.gc b/test/decompiler/reference/jak3/levels/desert/desert-scenes_REF.gc index b58814e6124..be1cdf10f8f 100644 --- a/test/decompiler/reference/jak3/levels/desert/desert-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/desert-scenes_REF.gc @@ -6370,7 +6370,7 @@ () (when (not (-> self aborted?)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> *time-of-day-context* current-fog fog-color quad)) + (vector-copy! gp-0 (-> *time-of-day-context* current-fog fog-color)) (set! (-> gp-0 w) 128.0) (disable *screen-filter*) (setup *screen-filter* gp-0 gp-0 1.0 (bucket-id tex-hud-pris2) #x3fffff #x33001 #t) @@ -6388,8 +6388,8 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> *time-of-day-context* current-fog fog-color quad)) - (set! (-> s5-0 quad) (-> *time-of-day-context* current-fog fog-color quad)) + (vector-copy! gp-0 (-> *time-of-day-context* current-fog fog-color)) + (vector-copy! s5-0 (-> *time-of-day-context* current-fog fog-color)) (set! (-> gp-0 w) 128.0) (set! (-> s5-0 w) 0.0) (disable *screen-filter*) @@ -7971,7 +7971,3 @@ (:flags (sp-cpuinfo-flag-3)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/desertf-obs_REF.gc b/test/decompiler/reference/jak3/levels/desert/desertf-obs_REF.gc index 666e0356494..187425d1695 100644 --- a/test/decompiler/reference/jak3/levels/desert/desertf-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/desertf-obs_REF.gc @@ -91,6 +91,7 @@ ;; definition for method 11 of type des-jump-bridge (defmethod init-from-entity! ((this des-jump-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) @@ -219,8 +220,8 @@ (vector-normalize! (vector-z-quaternion! s2-0 (-> self root quat)) 102400.0) (vector-x-quaternion! s4-0 (-> self root quat)) (vector+! s2-0 s2-0 (-> self root trans)) - (set! (-> s3-0 quad) (-> s2-0 quad)) - (set! (-> gp-3 quad) (-> s2-0 quad)) + (vector-copy! s3-0 s2-0) + (vector-copy! gp-3 s2-0) (vector+! s3-0 s3-0 (vector-normalize! s4-0 143360.0)) (vector+! gp-3 gp-3 (vector-normalize! s4-0 -102400.0)) ) @@ -369,6 +370,7 @@ ;; definition for method 11 of type des-draw-bridge (defmethod init-from-entity! ((this des-draw-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -538,6 +540,7 @@ ;; definition for method 11 of type des-garage-door (defmethod init-from-entity! ((this des-garage-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) @@ -573,7 +576,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/desertg-obs_REF.gc b/test/decompiler/reference/jak3/levels/desert/desertg-obs_REF.gc index 6af13d39a0a..ea9ec5eb088 100644 --- a/test/decompiler/reference/jak3/levels/desert/desertg-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/desertg-obs_REF.gc @@ -177,6 +177,7 @@ ;; definition for method 11 of type desert-eggwall (defmethod init-from-entity! ((this desert-eggwall) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this task-node) (game-task-node nest-eggs-wall)) (cond ((task-node-closed? (-> this task-node)) @@ -310,7 +311,7 @@ (when s5-1 (setup-masks (-> self draw) 0 (the-as int (-> s5-1 prim-id))) (set! (-> s5-1 prim-core collide-as) (collide-spec)) - (set! (-> gp-1 quad) (-> s5-1 prim-core world-sphere quad)) + (vector-copy! gp-1 (-> s5-1 prim-core world-sphere)) ) ) ) @@ -320,16 +321,16 @@ (-> self root) (lambda ((arg0 collide-shape-prim)) (set! (-> arg0 prim-core collide-as) (collide-spec)) 0 (none)) ) - (set! (-> gp-1 quad) (-> self root root-prim prim-core world-sphere quad)) + (vector-copy! gp-1 (-> self root root-prim prim-core world-sphere)) ) ) (cond ((logtest? (-> *part-group-id-table* 1232 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1232)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1232)) ) ) @@ -377,6 +378,7 @@ ;; definition for method 11 of type des-cactus-obstacle (defmethod init-from-entity! ((this des-cactus-obstacle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate @@ -467,7 +469,3 @@ (logior! (-> this mask) (process-mask crate)) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc index d87cee5b1f0..18ff8e762c3 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/des-beast-2_REF.gc @@ -47,7 +47,7 @@ (set! (-> a0-4 user-int16 1) (the int (/ (-> (the-as vector v1-1) y) METER_LENGTH))) (set! (-> a0-4 user-int16 2) (the int (/ (-> (the-as vector v1-1) z) METER_LENGTH))) ) - (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + (vector-copy! (-> self root trans) (the-as vector v1-1)) ) (logclear! (-> self mask) (process-mask actor-pause)) (send-event *camera* 'change-target self) @@ -80,7 +80,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set-vector! (-> gp-0 move-dist) 0.0 -204800.0 0.0 1.0) - (set! (-> gp-0 start-pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> self root trans)) (+! (-> gp-0 start-pos y) 102400.0) (let ((v1-15 gp-0)) (set! (-> v1-15 radius) 409.6) @@ -120,7 +120,7 @@ ) (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-1 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 pos) (-> self root trans)) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags taf3 taf5)) (set! (-> gp-1 map-icon) (the-as uint 12)) @@ -184,6 +184,7 @@ ;; definition for method 11 of type quantum-reflector (defmethod init-from-entity! ((this quantum-reflector) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (the-as penetrate -1)) (let ((v1-3 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -311,7 +312,7 @@ (set! (-> self minimap) #f) ) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) (-> self blast-radius)) (set! (-> gp-0 scale) 1.0) @@ -576,7 +577,7 @@ ) :trans (behavior () (if (and (!= (-> self s-clock) 1.0) *camera*) - (set! (-> *camera* slave 0 trans quad) (-> *beast-camera-slow-motion* quad)) + (vector-copy! (-> *camera* slave 0 trans) *beast-camera-slow-motion*) ) (let ((gp-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (the int (the float (the int (-> self path-pos))))) @@ -695,8 +696,8 @@ (v1-9 (-> self root trans)) (s5-1 (new 'stack-no-clear 'inline-array 'vector 16)) ) - (set! (-> s5-1 0 quad) (-> self focus-pos quad)) - (set! (-> s5-1 1 quad) (-> self focus-vel quad)) + (vector-copy! (-> s5-1 0) (-> self focus-pos)) + (vector-copy! (-> s5-1 1) (-> self focus-vel)) (vector-! (-> s5-1 5) (-> s5-1 0) v1-9) (set! (-> s5-1 2 x) (vector-length (-> s5-1 5))) (vector-normalize! (-> s5-1 5) 1.0) @@ -756,7 +757,7 @@ (set! sv-336 (the-as float 122880.0)) (setup-from-to-height! gp-2 s5-2 s4-3 32768.0 -36864.0) ) - (set! (-> self shot-velocity quad) (-> gp-2 initial-velocity quad)) + (vector-copy! (-> self shot-velocity) (-> gp-2 initial-velocity)) ) (vector-length-max! (-> self shot-velocity) 122880.0) ) @@ -794,7 +795,7 @@ (set! sv-504 -1) (set! sv-512 (-> self des-path node)) (let ((s5-5 (new 'stack-no-clear 'vector))) - (set! (-> s5-5 quad) (-> (get-trans gp-7 0) quad)) + (vector-copy! s5-5 (get-trans gp-7 0)) (set! sv-516 s5-5) ) (vector+float*! @@ -812,7 +813,7 @@ (when (or (= sv-504 -1) (< f0-47 sv-500)) (set! sv-500 f0-47) (set! sv-504 gp-8) - (set! (-> sv-496 quad) (-> s5-8 quad)) + (vector-copy! sv-496 s5-8) ) ) ) @@ -938,9 +939,9 @@ (cond ((and (-> this next-state) (= (-> this next-state name) 'hostile)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! s4-0 (ja-linear-vel 0)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> (ja-linear-vel 1) quad)) + (vector-copy! s3-0 (ja-linear-vel 1)) (vector-lerp! arg0 s4-0 s3-0 (-> this anim-interp)) ) ) @@ -966,12 +967,12 @@ (set! (-> a1-3 charge) 1.0) (set! (-> a1-3 options) (projectile-options)) (logclear! (-> a1-3 options) (projectile-options po14 po15 po16)) - (set! (-> a1-3 pos quad) (-> a0-2 quad)) - (set! (-> a1-3 vel quad) (-> v1-1 quad)) + (vector-copy! (-> a1-3 pos) a0-2) + (vector-copy! (-> a1-3 vel) v1-1) (set! (-> a1-3 notify-handle) (the-as handle #f)) (set! (-> a1-3 owner-handle) (process->handle this)) (set! (-> a1-3 target-handle) (the-as handle #f)) - (set! (-> a1-3 target-pos quad) (-> this target-gun-pos quad)) + (vector-copy! (-> a1-3 target-pos) (-> this target-gun-pos)) (set! (-> a1-3 ignore-handle) (process->handle this)) (let* ((v1-10 *game-info*) (a0-16 (+ (-> v1-10 attack-id) 1)) @@ -989,6 +990,7 @@ ;; definition for method 106 of type des-beast-2 (defmethod find-best-focus ((this des-beast-2)) + "Search for the best thing to focus on." (if (not (-> this vehicle-handle)) (set! (-> this vehicle-handle) (-> *vehicle-info* handle-by-vehicle-type 14)) ) @@ -999,7 +1001,7 @@ ) ) (when s5-0 - (enemy-method-70 this (the-as process-focusable s5-0) (get-enemy-aware this (enemy-aware ea3))) + (set-focus! this (the-as process-focusable s5-0) (modify-awareness this (enemy-aware hostile))) s5-0 ) ) @@ -1009,14 +1011,15 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs process. (defmethod update-focus ((this des-beast-2)) + "Potentially update the focus, if there is something better to focus on." (call-parent-method this) (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s4-0) 3)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> (get-transv (the-as process-focusable s4-0)) quad)) + (vector-copy! s5-1 (get-transv (the-as process-focusable s4-0))) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> this focus-vel quad)) + (vector-copy! s4-1 (-> this focus-vel)) (let* ((f28-0 (vector-length s4-1)) (f30-0 (lerp f28-0 (vector-length s5-1) (* 0.75 (seconds-per-frame)))) ) @@ -1028,7 +1031,7 @@ (vector-float*! (-> this focus-vel) s4-1 f30-0) ) (else - (set! (-> this focus-vel quad) (-> s5-1 quad)) + (vector-copy! (-> this focus-vel) s5-1) ) ) ) @@ -1041,6 +1044,7 @@ ;; definition for method 59 of type des-beast-2 (defmethod enemy-common-post ((this des-beast-2)) + "Common implementation of post. Runs ja-post." (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this last-draw-time)) ) @@ -1051,6 +1055,7 @@ ;; definition for method 82 of type des-beast-2 (defmethod event-handler ((this des-beast-2) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('event-foot) (sound-play "desbeast-step") @@ -1077,13 +1082,15 @@ ) ;; definition for method 122 of type des-beast-2 -(defmethod go-idle2 ((this des-beast-2)) +(defmethod go-fallback-init ((this des-beast-2)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this hostile)) ) ;; definition for method 121 of type des-beast-2 ;; WARN: Return type mismatch cspace vs none. (defmethod init-enemy! ((this des-beast-2)) + "Typical place for shared init code. Runs from entity or process style init." (let ((t9-0 (method-of-type des-beast init-enemy!))) (t9-0 this) ) @@ -1114,7 +1121,7 @@ (-> (the-as des-beast-2 s4-0) angle-turret) ) (quaternion->matrix (-> arg0 bone transform) (the-as quaternion (-> gp-0 rvec))) - (set! (-> arg0 bone transform trans quad) (-> gp-0 trans quad)) + (vector-copy! (-> arg0 bone transform trans) (-> gp-0 trans)) ) 0 (none) @@ -1154,7 +1161,7 @@ (the-as quaternion (-> gp-0 uvec)) ) (quaternion->matrix (-> arg0 bone transform) (the-as quaternion (-> gp-0 uvec))) - (set! (-> arg0 bone transform trans quad) (-> gp-0 trans quad)) + (vector-copy! (-> arg0 bone transform trans) (-> gp-0 trans)) ) 0 (none) diff --git a/test/decompiler/reference/jak3/levels/desert/hover/des-beast_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/des-beast_REF.gc index f45671072a1..cd1012ea1a5 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/des-beast_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/des-beast_REF.gc @@ -110,7 +110,7 @@ (set! (-> *beast-grenade-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *beast-grenade-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *beast-grenade-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *beast-grenade-trail* use-tape-mode?) #f) @@ -1057,7 +1057,7 @@ (set! (-> v1-26 y) 8.0) (set! (-> v1-26 z) 8.0) (set! (-> v1-26 w) 1.0) - (set! (-> this root scale quad) (-> v1-26 quad)) + (vector-copy! (-> this root scale) v1-26) ) 0 (none) @@ -1131,7 +1131,7 @@ ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) (-> self blast-radius)) (set! (-> gp-0 scale) 1.0) @@ -1230,34 +1230,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -1324,34 +1324,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 10) @@ -1637,7 +1637,7 @@ ) :trans (behavior () (if (and (!= (-> self s-clock) 1.0) *camera*) - (set! (-> *camera* slave 0 trans quad) (-> *beast-camera-slow-motion* quad)) + (vector-copy! (-> *camera* slave 0 trans) *beast-camera-slow-motion*) ) (let ((gp-0 (new 'stack-no-clear 'vector))) (let* ((a1-0 (the int (the float (the int (-> self path-pos))))) @@ -1741,7 +1741,7 @@ ) (else (let ((a1-6 (new 'stack-no-clear 'vector))) - (set! (-> a1-6 quad) (-> self root trans quad)) + (vector-copy! a1-6 (-> self root trans)) (set! (-> a1-6 w) 409600.0) (if (or (des-beast-method-167 self a1-6) (and (-> self can-turn?) (time-elapsed? (-> self state-time) (seconds 6)) @@ -1950,6 +1950,7 @@ ;; definition for method 82 of type des-beast (defmethod event-handler ((this des-beast) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('touch) #f @@ -1964,7 +1965,7 @@ #f ) (('touched) - (send-attack-on-jump-or-knocked this arg0 arg3) + (enemy-touched-handler this arg0 arg3) ) (('attack) (let ((s5-0 (the-as attack-info (-> arg3 param 1)))) @@ -2056,7 +2057,8 @@ ;; definition for method 84 of type des-beast ;; INFO: Used lq/sq -(defmethod send-attack-on-jump-or-knocked ((this des-beast) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this des-beast) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (cond ((= (-> arg0 type) target) (let ((s4-0 (-> arg1 param 0))) @@ -2099,7 +2101,7 @@ (not (logtest? (-> this entity extra perm status) (entity-perm-status dead))) ) (let ((s2-1 (new 'stack-no-clear 'vector))) - (set! (-> s2-1 quad) (-> this root transv quad)) + (vector-copy! s2-1 (-> this root transv)) (if (< (vector-length s2-1) 40960.0) (vector-normalize! s2-1 40960.0) ) @@ -2143,7 +2145,7 @@ (persist-with-delay *setting-control* 'interp-time (seconds 4) 'interp-time 'abs 300.0 0) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (let ((s5-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-1 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s5-1 start-pos) (-> this root trans)) (vector-float*! (-> s5-1 move-dist) s3-4 f30-2) (let ((v1-64 s5-1)) (set! (-> v1-64 radius) 12288.0) @@ -2162,7 +2164,7 @@ ) (vector+! *beast-camera-slow-motion* (-> s5-1 start-pos) (-> s5-1 move-dist)) ) - (set! (-> *camera* slave 0 trans quad) (-> *beast-camera-slow-motion* quad)) + (vector-copy! (-> *camera* slave 0 trans) *beast-camera-slow-motion*) (set! (-> this s-clock) 0.25) ) ) @@ -2226,7 +2228,7 @@ ;; definition for method 161 of type des-beast ;; INFO: Used lq/sq (defmethod get-linear-vel! ((this des-beast) (arg0 vector)) - (set! (-> arg0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! arg0 (ja-linear-vel 0)) arg0 ) @@ -2246,7 +2248,7 @@ (let ((s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> this root gspot-normal quad)) + (vector-copy! s4-0 (-> this root gspot-normal)) (vector-cross! (new 'stack-no-clear 'vector) s5-1 s4-0) (let ((f0-2 (vector-vector-angle-safe s5-1 s4-0))) (when (< 1.8204443 f0-2) @@ -2266,7 +2268,7 @@ (let ((a1-11 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (v1-25 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-25 quad) (-> *up-vector* quad)) + (vector-copy! v1-25 *up-vector*) (seek! (-> this speed-factor) (- 1.0 (* 0.25 (vector-dot a1-11 v1-25))) (seconds-per-frame)) ) (seek! (-> this main-speed-factor) (-> this main-speed-factor-dest) (seconds-per-frame)) @@ -2281,7 +2283,7 @@ (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 21))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> this node-list data 21 bone transform fvec quad)) + (vector-copy! s5-0 (-> this node-list data 21 bone transform fvec)) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (vector-normalize! s5-0 81920.0) @@ -2290,8 +2292,8 @@ (set! (-> a1-2 charge) 1.0) (set! (-> a1-2 options) (projectile-options)) (logclear! (-> a1-2 options) (projectile-options po14 po15 po16)) - (set! (-> a1-2 pos quad) (-> s4-0 quad)) - (set! (-> a1-2 vel quad) (-> s5-0 quad)) + (vector-copy! (-> a1-2 pos) s4-0) + (vector-copy! (-> a1-2 vel) s5-0) (set! (-> a1-2 notify-handle) (the-as handle #f)) (set! (-> a1-2 owner-handle) (process->handle this)) (set! (-> a1-2 target-handle) (the-as handle #f)) @@ -2314,6 +2316,7 @@ ;; definition for method 59 of type des-beast ;; WARN: Return type mismatch float vs none. (defmethod enemy-common-post ((this des-beast)) + "Common implementation of post. Runs ja-post." (when (>= (+ (current-time) (seconds -2)) (-> this attack-id-time)) (let* ((v1-4 *game-info*) (a0-3 (+ (-> v1-4 attack-id) 1)) @@ -2399,7 +2402,7 @@ ) (quaternion-vector-angle! s4-0 *up-vector* (-> (the-as des-beast s3-0) angle-turret)) (quaternion->matrix (-> arg0 bone transform) s4-0) - (set! (-> arg0 bone transform trans quad) (-> s5-0 quad)) + (vector-copy! (-> arg0 bone transform trans) s5-0) ) ) 0 @@ -2453,7 +2456,8 @@ ) ;; definition for method 122 of type des-beast -(defmethod go-idle2 ((this des-beast)) +(defmethod go-fallback-init ((this des-beast)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this idle)) ) @@ -2488,6 +2492,7 @@ ;; definition for method 120 of type des-beast ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this des-beast)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2644,12 +2649,13 @@ ;; definition for method 121 of type des-beast ;; WARN: Return type mismatch cspace vs none. (defmethod init-enemy! ((this des-beast)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-des-beast" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *des-beast-enemy-info*) + (setup-enemy! this *des-beast-enemy-info*) (set! (-> this event-hook) enemy-event-handler) (logclear! (-> this mask) (process-mask actor-pause)) (logior! (-> this mask) (process-mask enemy)) @@ -2724,14 +2730,15 @@ ;; definition for method 11 of type des-beast ;; INFO: Used lq/sq (defmethod init-from-entity! ((this des-beast) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-enemy-collision! this) (process-drawable-from-entity! this arg0) (set! (-> this manager) (the-as handle #f)) (init-enemy! this) - (set! (-> this root trans quad) (-> this des-path node 0 position quad)) + (vector-copy! (-> this root trans) (-> this des-path node 0 position)) (set! (-> this hit-part) (create-launch-control (-> *part-group-id-table* 414) this)) (des-beast-method-166 this) - (go-idle2 this) + (go-fallback-init this) ) ;; definition for function des-beast-init-by-other @@ -2741,11 +2748,11 @@ (set! (-> self entity) arg1) (set! (-> self manager) arg4) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg2 node 0 position quad)) + (vector-copy! (-> self root trans) (-> arg2 node 0 position)) (quaternion-copy! (-> self root quat) arg3) (set! (-> self des-path) arg2) (set! (-> self hit-part) (create-launch-control (-> *part-group-id-table* 414) self)) (init-enemy! self) (des-beast-method-166 self) - (go-idle2 self) + (go-fallback-init self) ) diff --git a/test/decompiler/reference/jak3/levels/desert/hover/mh-flyer_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/mh-flyer_REF.gc index 51e7ba41714..315d30066a4 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/mh-flyer_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/mh-flyer_REF.gc @@ -134,7 +134,7 @@ (set! (-> *mh-flyer-missile-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *mh-flyer-missile-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *mh-flyer-missile-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *mh-flyer-missile-trail* use-tape-mode?) #f) @@ -217,7 +217,7 @@ (set! (-> self minimap) #f) ) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 40960.0) (set! (-> gp-0 scale) 1.0) @@ -303,21 +303,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 102 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 102)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 102)) ) ) ) ((logtest? (-> *part-group-id-table* 101 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 101)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 101)) ) ) @@ -399,7 +399,7 @@ (let ((v1-23 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-12 (-> arg0 hit-pos)) ) - (set! (-> a1-12 quad) (-> s5-0 trans quad)) + (vector-copy! a1-12 (-> s5-0 trans)) (vector+! a1-12 a1-12 v1-23) (move-to-point! (-> arg0 root) a1-12) ) @@ -493,7 +493,7 @@ (the-as pair 0) ) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 327680.0) @@ -765,34 +765,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9952 :y 0.0483 :z -0.0847 :w 19014.305) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -1077,7 +1077,7 @@ ;; INFO: Used lq/sq (defbehavior mh-flyer-fly-post mh-flyer () (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set-ground-pat! self a1-0 (collide-spec backgnd) 8192.0 163840.0 4096.0 (the-as process #f)) + (find-ground-and-set-pat! self a1-0 (collide-spec backgnd) 8192.0 163840.0 4096.0 (the-as process #f)) ) (if (!= (-> self root gspot-pos y) -40959590.0) (set! (-> self move-dest y) (+ 81920.0 (fmax (-> self move-dest y) (-> self root gspot-pos y)))) @@ -1126,7 +1126,7 @@ ) (vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) (-> self bank-angle) (-> self rotation-matrix fvec)) (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-1 1 quad) (-> self root transv quad)) + (vector-copy! (-> s5-1 1) (-> self root transv)) (vector-normalize! (-> s5-1 1) 1.0) (forward-up->quaternion (the-as quaternion (-> s5-1 0)) (-> s5-1 1) gp-0) (quaternion-slerp! @@ -1153,7 +1153,7 @@ :enter (behavior () (set! (-> self bank-angle) 0.0) (set! (-> self pitch-angle) 0.0) - (set! (-> self init-pos quad) (-> self root trans quad)) + (vector-copy! (-> self init-pos) (-> self root trans)) (vector-reset! (-> self root transv)) (let ((f0-3 (* 65536.0 (get-interp-mod-time 10.0 -0.2))) (gp-0 (new 'stack-no-clear 'vector)) @@ -1245,9 +1245,7 @@ (set! (-> gp-1 charge) (lerp-scale 0.0 1.0 (the float (-> self missiles-fired)) 0.0 3.0)) (set! (-> gp-1 options) (projectile-options)) (logclear! (-> gp-1 options) (projectile-options po14 po15 po16)) - (set! (-> gp-1 pos quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-flyer-lod0-jg jaw)) quad) - ) + (vector-copy! (-> gp-1 pos) (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-flyer-lod0-jg jaw))) (set! (-> gp-1 notify-handle) (the-as handle #f)) (set! (-> gp-1 owner-handle) (the-as handle #f)) (set! (-> gp-1 target-handle) (the-as handle #f)) @@ -1279,7 +1277,7 @@ (go empty-state) ) (let ((a1-10 (-> self des-path node (-> self path-pos)))) - (set! (-> self move-dest quad) (-> a1-10 position quad)) + (vector-copy! (-> self move-dest) (-> a1-10 position)) (if (< (vector-vector-distance (-> self root trans) (the-as vector a1-10)) 327680.0) (+! (-> self path-pos) 1) ) @@ -1308,7 +1306,7 @@ :code (behavior () (local-vars (v1-14 object)) (let ((gp-0 (-> self root transv))) - (set! (-> gp-0 quad) (-> self target-velocity quad)) + (vector-copy! gp-0 (-> self target-velocity)) (vector-length-max! gp-0 245760.0) (set! (-> gp-0 y) (fmax -163840.0 (fmin 163840.0 (-> gp-0 y)))) (vector-float*! gp-0 gp-0 0.5) @@ -1336,6 +1334,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs process. (defmethod update-focus ((this mh-flyer)) + "Potentially update the focus, if there is something better to focus on." (let ((t9-0 (method-of-type enemy update-focus))) (t9-0 this) ) @@ -1346,8 +1345,8 @@ ) ) (when s5-0 - (set! (-> this focus-bullseye-pos quad) (-> (get-trans s5-0 3) quad)) - (set! (-> this focus-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-copy! (-> this focus-bullseye-pos) (get-trans s5-0 3)) + (vector-copy! (-> this focus-pos) (get-trans s5-0 3)) (vector-! (-> this focus-xz-dir) (-> this focus-pos) (-> this root trans)) (set! (-> this focus-xz-dir y) 0.0) (vector-xz-normalize! (-> this focus-xz-dir) 1.0) @@ -1375,7 +1374,7 @@ (set! (-> gp-0 z) 0.0) (set! (-> gp-0 w) 0.0) (let ((f30-0 163840.0)) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-11 s4-0)) (set! (-> v1-11 radius) 3276.8) @@ -1433,6 +1432,7 @@ ;; definition for method 59 of type mh-flyer (defmethod enemy-common-post ((this mh-flyer)) + "Common implementation of post. Runs ja-post." (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) (mh-flyer-method-157 this) ((method-of-type enemy enemy-common-post) this) @@ -1441,6 +1441,7 @@ ;; definition for method 82 of type mh-flyer (defmethod event-handler ((this mh-flyer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (-> arg3 param 1) @@ -1454,7 +1455,8 @@ ) ;; definition for method 122 of type mh-flyer -(defmethod go-idle2 ((this mh-flyer)) +(defmethod go-fallback-init ((this mh-flyer)) + "If there's no specific settings for initial state, go to this state after spawning." (let ((v1-1 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))) (cond ((zero? v1-1) @@ -1478,6 +1480,7 @@ ;; definition for method 120 of type mh-flyer ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this mh-flyer)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1551,12 +1554,13 @@ ;; definition for method 121 of type mh-flyer ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this mh-flyer)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-flyer" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *mh-flyer-enemy-info*) + (setup-enemy! this *mh-flyer-enemy-info*) (set! (-> this root pause-adjust-distance) 368640.0) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) @@ -1581,7 +1585,7 @@ (set! (-> self entity) arg1) (set! (-> self manager) arg4) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg2 node 0 position quad)) + (vector-copy! (-> self root trans) (-> arg2 node 0 position)) (quaternion-copy! (-> self root quat) arg3) (set! (-> self des-path) arg2) (init-enemy! self) diff --git a/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc b/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc index ee3424e6111..f2fe9383598 100644 --- a/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/hover/scorpion-gun_REF.gc @@ -7,7 +7,7 @@ (new 'static 'talker-speech-class :name "sig175" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1 :neg #x1 :on-close #f @@ -16,7 +16,7 @@ (new 'static 'talker-speech-class :name "sig176" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -25,7 +25,7 @@ (new 'static 'talker-speech-class :name "sig177" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :neg #x1 :on-close #f @@ -34,7 +34,7 @@ (new 'static 'talker-speech-class :name "sig178" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :neg #x1 :on-close #f @@ -43,7 +43,7 @@ (new 'static 'talker-speech-class :name "sig197" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5 :neg #x1 :on-close #f @@ -672,7 +672,7 @@ (case message (('draw) (set! (-> self draw?) #t) - (set! (-> self screen-pos quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self screen-pos) (the-as vector (-> block param 0))) (let ((v0-0 (the-as object (-> block param 1)))) (set! (-> self color) (the-as rgba v0-0)) v0-0 @@ -780,7 +780,7 @@ ) (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) - (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (vector-copy! (-> a1-7 fvec) s2-0) (matrix->eul (the-as euler-angles s1-0) a1-7 21) (vector-negate! s3-2 s1-0) (let ((a0-14 s3-2)) @@ -802,11 +802,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 228 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 228)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 228)) ) ) @@ -908,8 +908,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this scorpion-gun-shot)) (with-pp - (set! (-> this init-pos quad) (-> this root trans quad)) - (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) + (vector-copy! (-> this init-dir) (-> this starting-dir)) (vector-normalize-copy! (-> this root transv) (-> this init-dir) @@ -1018,7 +1018,7 @@ (vector+float*! sv-32 sv-32 (-> s5-0 bone transform fvec) -24576.0) (set! (-> sv-32 y) (fmax (-> sv-32 y) (-> s5-0 bone transform trans y))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 x) 0.0) (set! (-> s3-0 y) 0.0) @@ -1199,7 +1199,7 @@ ) ) (let ((gp-1 (-> self node-list data 7 bone transform))) - (set! (-> self aim-dir quad) (-> gp-1 fvec quad)) + (vector-copy! (-> self aim-dir) (-> gp-1 fvec)) (when (-> self target-handle) (let* ((s5-1 (handle->process (-> self target-handle))) (s4-2 (if (type? s5-1 process-drawable) @@ -1235,7 +1235,7 @@ (set! sv-1304 (-> self aim-dir)) (set! sv-1308 (new 'stack-no-clear 'vector)) (set! sv-1312 (the-as rgba (new 'stack-no-clear 'array 'rgba 1))) - (set! (-> sv-1300 start-pos quad) (-> sv-1296 bone transform trans quad)) + (vector-copy! (-> sv-1300 start-pos) (-> sv-1296 bone transform trans)) (vector-float*! (-> sv-1300 move-dist) sv-1304 1024000.0) (let ((v1-73 sv-1300)) (set! (-> v1-73 radius) 819.2) @@ -1379,7 +1379,7 @@ (set! (-> s5-0 params options) (projectile-options)) (logclear! (-> s5-0 params options) (projectile-options po14 po15 po16)) (set! (-> s5-0 params pos quad) (-> gp-0 bone transform trans quad)) - (set! (-> s5-0 params vel quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 params vel) (-> s5-0 vec0)) (set! (-> s5-0 params notify-handle) (the-as handle #f)) (set! (-> s5-0 params owner-handle) (process->handle s4-0)) (set! (-> s5-0 params target-handle) (the-as handle #f)) @@ -1400,18 +1400,7 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'matrix))) - (let* ((v1-37 s5-1) - (a3-1 (-> gp-0 bone transform)) - (a0-30 (-> a3-1 rvec quad)) - (a1-6 (-> a3-1 uvec quad)) - (a2-4 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-37 rvec quad) a0-30) - (set! (-> v1-37 uvec quad) a1-6) - (set! (-> v1-37 fvec quad) a2-4) - (set! (-> v1-37 trans quad) a3-2) - ) + (matrix-copy! s5-1 (-> gp-0 bone transform)) (matrix->trans (-> gp-0 bone transform) (-> s5-1 trans)) (if (logtest? (-> *part-group-id-table* 227 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -1458,7 +1447,7 @@ (s5-0 (-> this root)) ) (when gp-0 - (set! (-> s5-0 transv quad) (-> (the-as process-drawable gp-0) root transv quad)) + (vector-copy! (-> s5-0 transv) (-> (the-as process-drawable gp-0) root transv)) (quaternion-copy! (-> this scorp-quat) (-> (the-as process-drawable gp-0) root quat)) (vector-matrix*! (-> s5-0 trans) @@ -1706,7 +1695,7 @@ ) (('trans 'player-pos) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> self trans quad)) + (vector-copy! v1-1 (-> self trans)) (+! (-> v1-1 y) -12288.0) (set! v0-0 (-> arg3 param 0)) (set! (-> (the-as vector v0-0) quad) (-> v1-1 quad)) @@ -1883,7 +1872,7 @@ (set! (-> gp-0 guard-type) (the-as uint 11)) (set! (-> gp-0 entity) #f) (vector-reset! (-> gp-0 velocity)) - (set! (-> gp-0 position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> gp-0 position) (target-pos 0)) (quaternion-copy! (-> gp-0 rotation) (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 0.0) @@ -2250,7 +2239,7 @@ (defmethod scorpion-gun-manager-method-21 ((this scorpion-gun-manager)) (let ((v1-1 (handle->process (-> this scorp)))) (when v1-1 - (set! (-> this trans quad) (-> (the-as process-drawable v1-1) root trans quad)) + (vector-copy! (-> this trans) (-> (the-as process-drawable v1-1) root trans)) (quaternion-copy! (-> this quat) (-> (the-as process-drawable v1-1) root quat)) ) ) @@ -2266,7 +2255,7 @@ (dotimes (gp-0 (-> *desbeast-battle-path-table* length)) (let ((s5-0 (-> *desbeast-battle-path-table* gp-0))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> s5-0 node 0 position quad)) + (vector-copy! s4-0 (-> s5-0 node 0 position)) (+! (-> s4-0 y) 12288.0) (let ((s3-0 add-debug-text-3d) (s2-0 #t) @@ -2320,7 +2309,8 @@ ;; definition for method 11 of type scorpion-gun-manager ;; INFO: Used lq/sq (defmethod init-from-entity! ((this scorpion-gun-manager) (arg0 entity-actor)) - (set! (-> this trans quad) (-> arg0 extra trans quad)) + "Set up a newly created process from the entity that created it." + (vector-copy! (-> this trans) (-> arg0 extra trans)) (quaternion-copy! (-> this quat) (-> arg0 quat)) (logclear! (-> this mask) (process-mask actor-pause)) (let ((v1-3 (-> this path-info))) @@ -2401,7 +2391,7 @@ :event cam-standard-event-handler :enter (behavior () (when (not (-> self enter-has-run)) - (set! (-> self saved-pt quad) (-> self trans quad)) + (vector-copy! (-> self saved-pt) (-> self trans)) (set! (-> self blend-from-type) (camera-blend-from-type unknown-1)) (set! (-> self blend-to-type) (camera-blend-to-type unknown-0)) 0 diff --git a/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-h_REF.gc b/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-h_REF.gc index 880a6789585..909412436c6 100644 --- a/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-h_REF.gc @@ -127,7 +127,7 @@ (new 'static 'talker-speech-class :name "dax208" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x10 :neg #x1 :on-close #f @@ -136,7 +136,7 @@ (new 'static 'talker-speech-class :name "dax209" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x11 :neg #x1 :on-close #f @@ -145,7 +145,7 @@ (new 'static 'talker-speech-class :name "dax210" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x12 :neg #x1 :on-close #f @@ -154,7 +154,7 @@ (new 'static 'talker-speech-class :name "dax211" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x13 :neg #x1 :on-close #f @@ -163,7 +163,7 @@ (new 'static 'talker-speech-class :name "dax212" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x14 :neg #x1 :on-close #f @@ -172,7 +172,7 @@ (new 'static 'talker-speech-class :name "dax213" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x15 :neg #x1 :on-close #f @@ -181,7 +181,7 @@ (new 'static 'talker-speech-class :name "dax214" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x16 :neg #x1 :on-close #f @@ -190,7 +190,7 @@ (new 'static 'talker-speech-class :name "dax215" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x17 :neg #x1 :on-close #f @@ -199,7 +199,7 @@ (new 'static 'talker-speech-class :name "dax216" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x18 :neg #x1 :on-close #f @@ -208,7 +208,7 @@ (new 'static 'talker-speech-class :name "dax217" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x19 :neg #x1 :on-close #f @@ -217,7 +217,7 @@ (new 'static 'talker-speech-class :name "dax218" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1a :neg #x1 :on-close #f @@ -226,7 +226,7 @@ (new 'static 'talker-speech-class :name "dax219" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1b :neg #x1 :on-close #f @@ -235,7 +235,7 @@ (new 'static 'talker-speech-class :name "dax220" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1c :neg #x1 :on-close #f @@ -244,7 +244,7 @@ (new 'static 'talker-speech-class :name "dax221" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1d :neg #x1 :on-close #f @@ -253,7 +253,7 @@ (new 'static 'talker-speech-class :name "dax222" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1e :neg #x1 :on-close #f @@ -262,7 +262,7 @@ (new 'static 'talker-speech-class :name "dax223" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x1f :neg #x1 :on-close #f @@ -271,7 +271,7 @@ (new 'static 'talker-speech-class :name "dax224" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x20 :neg #x1 :on-close #f @@ -280,7 +280,7 @@ (new 'static 'talker-speech-class :name "dax225" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x21 :neg #x1 :on-close #f @@ -289,7 +289,7 @@ (new 'static 'talker-speech-class :name "dax226" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x22 :neg #x1 :on-close #f @@ -298,7 +298,7 @@ (new 'static 'talker-speech-class :name "dax227" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x23 :neg #x1 :on-close #f @@ -307,7 +307,7 @@ (new 'static 'talker-speech-class :name "dax228" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x24 :neg #x1 :on-close #f @@ -316,7 +316,7 @@ (new 'static 'talker-speech-class :name "dax229" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x25 :neg #x1 :on-close #f @@ -325,7 +325,7 @@ (new 'static 'talker-speech-class :name "dax230" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x26 :neg #x1 :on-close #f @@ -334,7 +334,7 @@ (new 'static 'talker-speech-class :name "dax231" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x27 :neg #x1 :on-close #f @@ -351,7 +351,7 @@ (new 'static 'talker-speech-class :name "dax233" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x29 :neg #x1 :on-close #f @@ -360,7 +360,7 @@ (new 'static 'talker-speech-class :name "dax235" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2a :neg #x1 :on-close #f @@ -369,7 +369,7 @@ (new 'static 'talker-speech-class :name "dax236" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2b :neg #x1 :on-close #f @@ -378,7 +378,7 @@ (new 'static 'talker-speech-class :name "dax237" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2c :neg #x1 :on-close #f @@ -387,7 +387,7 @@ (new 'static 'talker-speech-class :name "dax238" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2d :neg #x1 :on-close #f @@ -396,7 +396,7 @@ (new 'static 'talker-speech-class :name "dax239" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2e :neg #x1 :on-close #f @@ -405,7 +405,7 @@ (new 'static 'talker-speech-class :name "dax240" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2f :neg #x1 :on-close #f @@ -414,7 +414,7 @@ (new 'static 'talker-speech-class :name "dax241" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x30 :neg #x1 :on-close #f @@ -423,7 +423,7 @@ (new 'static 'talker-speech-class :name "dax242" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x31 :neg #x1 :on-close #f @@ -434,7 +434,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-task_REF.gc b/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-task_REF.gc index bc1561a529c..d8ad09f0142 100644 --- a/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-task_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard-task_REF.gc @@ -342,7 +342,7 @@ ((and *target* (focus-test? *target* flut)) (when (not (-> self arrow-handle)) (let ((gp-4 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-4 pos quad) (-> *minimap-class-list* 121 default-position quad)) + (vector-copy! (-> gp-4 pos) (-> *minimap-class-list* 121 default-position)) (quaternion-identity! (-> gp-4 quat)) (set! (-> gp-4 flags) (task-arrow-flags taf8)) (set! (-> gp-4 map-icon) (the-as uint 12)) @@ -817,7 +817,7 @@ ) (s5-2 0) ) - (set! (-> s3-0 quad) (-> this corral-pos quad)) + (vector-copy! s3-0 (-> this corral-pos)) (set! (-> s4-3 length) (fill-actor-list-for-box *actor-hash* s3-0 (-> s4-3 data) (-> s4-3 allocated-length))) (dotimes (s3-1 (-> s4-3 length)) (if (type? (-> s4-3 s3-1 process) flut) @@ -987,6 +987,7 @@ ;; definition for method 11 of type kleever-catch-lizards (defmethod init-from-entity! ((this kleever-catch-lizards) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) diff --git a/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard_REF.gc b/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard_REF.gc index f84c260b3f4..8675547edef 100644 --- a/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/lizard/desert-lizard_REF.gc @@ -109,34 +109,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x -1.0 :w 1194.157) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -583,7 +583,7 @@ (when s4-0 (let ((gp-0 (-> self move-dest))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (get-trans s4-0 0) quad)) + (vector-copy! s5-0 (get-trans s4-0 0)) (let ((a1-3 (get-quat s4-0 0))) (when (focus-test? s4-0 pilot-riding) (let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-3)) @@ -620,12 +620,12 @@ (let ((a0-15 (-> self nav state)) (a1-8 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-8 quad) (-> a0-15 target-pos quad)) + (vector-copy! a1-8 (-> a0-15 target-pos)) (when (< 2048.0 (vector-vector-xz-distance gp-0 a1-8)) (let ((v1-38 (-> self nav state))) (logclear! (-> v1-38 flags) (nav-state-flag directional-mode)) (logior! (-> v1-38 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-38 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-38 target-pos) gp-0) ) 0 ) @@ -692,7 +692,7 @@ ) ) (set! (-> self catch-timer) (the-as uint (current-time))) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -932,7 +932,7 @@ (let ((f0-2 (vector-vector-xz-distance arg1 arg0))) (when (< f28-0 f0-2) (set! f28-0 f0-2) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) ) ) (set! f30-0 (cond @@ -948,7 +948,7 @@ (+! f24-0 f26-0) ) (when (and (!= f28-0 0.0) (< 4096.0 (vector-vector-xz-distance (-> this root trans) s3-0))) - (set! (-> arg0 quad) (-> s3-0 quad)) + (vector-copy! arg0 s3-0) arg0 ) ) @@ -962,7 +962,7 @@ (local-vars (sv-160 vector) (sv-176 int) (sv-192 vector)) (with-pp (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg1 quad)) + (vector-copy! s5-0 arg1) (cond ((-> this graph) (let ((s2-0 (-> this graph point)) @@ -983,7 +983,7 @@ (when (or (< f0-0 f30-0) (= s1-0 -1)) (set! f30-0 f0-0) (set! s1-0 sv-176) - (set! (-> s0-0 quad) (-> sv-192 quad)) + (vector-copy! s0-0 sv-192) ) ) ) @@ -992,7 +992,7 @@ (when (!= s1-0 -1) (cond ((< 24576.0 f30-0) - (set! (-> s5-0 quad) (-> s0-0 quad)) + (vector-copy! s5-0 s0-0) ) (else (let ((s0-1 (new 'stack-no-clear 'inline-array 'vector 1))) @@ -1002,7 +1002,7 @@ (-> s2-0 (-> this graph edge s1-0 index 1)) (-> s0-1 0) ) - (set! (-> s5-0 quad) (-> s0-1 0 quad)) + (vector-copy! s5-0 (-> s0-1 0)) ) ) ) @@ -1044,10 +1044,11 @@ ;; definition for method 56 of type desert-lizard ;; INFO: Used lq/sq (defmethod knocked-handler ((this desert-lizard) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (case (-> this incoming knocked-type) (((knocked-type vehicle)) - (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + (vector-copy! arg0 (-> this incoming attack-direction)) arg0 ) (else @@ -1064,16 +1065,19 @@ ;; definition for method 98 of type desert-lizard (defmethod jump-wind-up-anim ((this desert-lizard) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" #f ) ;; definition for method 97 of type desert-lizard (defmethod jump-land-anim ((this desert-lizard) (arg0 enemy-jump-info)) + "Play the landing anim" #f ) ;; definition for method 108 of type desert-lizard -(defmethod enemy-method-108 ((this desert-lizard) (arg0 process-focusable)) +(defmethod should-flee-from? ((this desert-lizard) (arg0 process-focusable)) + "Return if this enemy should flee from the process." #t ) @@ -1095,6 +1099,7 @@ ;; definition for method 82 of type desert-lizard ;; INFO: Used lq/sq (defmethod event-handler ((this desert-lizard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1106,7 +1111,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1133,7 +1138,8 @@ ) ;; definition for method 122 of type desert-lizard -(defmethod go-idle2 ((this desert-lizard)) +(defmethod go-fallback-init ((this desert-lizard)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) (go (method-of-object this disappear)) (go (method-of-object this idle)) @@ -1143,6 +1149,7 @@ ;; definition for method 120 of type desert-lizard ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod init-enemy-collision! ((this desert-lizard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1198,12 +1205,13 @@ ;; definition for method 121 of type desert-lizard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this desert-lizard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-desert-lizard" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *desert-lizard-enemy-info*) + (setup-enemy! this *desert-lizard-enemy-info*) (set! (-> this root pause-adjust-distance) 819200.0) (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) @@ -1302,7 +1310,7 @@ ) (let ((gp-3 (new 'stack-no-clear 'enemy-init-by-other-params))) (let ((s5-2 (-> self entity))) - (set! (-> gp-3 trans quad) (-> s5-2 extra trans quad)) + (vector-copy! (-> gp-3 trans) (-> s5-2 extra trans)) (quaternion-copy! (-> gp-3 quat) (-> s5-2 quat)) (set! (-> gp-3 entity) s5-2) ) @@ -1329,11 +1337,8 @@ ;; definition for method 11 of type desert-lizard-spawner (defmethod init-from-entity! ((this desert-lizard-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this suppress-spawn-time) 0) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/oasis/ash-oasis-course_REF.gc b/test/decompiler/reference/jak3/levels/desert/oasis/ash-oasis-course_REF.gc index 0f1a1f56724..1b03a82835c 100644 --- a/test/decompiler/reference/jak3/levels/desert/oasis/ash-oasis-course_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/oasis/ash-oasis-course_REF.gc @@ -36,7 +36,8 @@ ) ;; definition for method 122 of type ashelin-oasis -(defmethod go-idle2 ((this ashelin-oasis)) +(defmethod go-fallback-init ((this ashelin-oasis)) + "If there's no specific settings for initial state, go to this state after spawning." (go-idle this) ) @@ -140,12 +141,12 @@ (s3-2 (new 'stack-no-clear 'vector)) ) (if (< f30-0 122880.0) - (set! (-> s3-2 quad) (-> v1-7 quad)) - (set! (-> s3-2 quad) (-> s4-1 quad)) + (vector-copy! s3-2 v1-7) + (vector-copy! s3-2 s4-1) ) (vector+! s3-2 s3-2 (math-camera-pos)) (if arg0 - (set! (-> this last-sound-trans quad) (-> s3-2 quad)) + (vector-copy! (-> this last-sound-trans) s3-2) (vector-seek-3d-smooth! (-> this last-sound-trans) s3-2 (* 102400.0 (seconds-per-frame)) 1.0) ) ) @@ -177,6 +178,7 @@ ;; definition for method 59 of type ashelin-oasis (defmethod enemy-common-post ((this ashelin-oasis)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type ashelin enemy-common-post))) (t9-0 this) ) @@ -191,6 +193,7 @@ ;; definition for method 82 of type ashelin-oasis (defmethod event-handler ((this ashelin-oasis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('impact-impulse) (let ((v1-1 (the-as object (-> arg3 param 0)))) @@ -507,7 +510,3 @@ ;; failed to figure out what this is: (set! (-> *bot-course-table* course 0) *ash-oasis-course*) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc b/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc index 3d5a3ad99d4..a71bd1d2722 100644 --- a/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc @@ -303,7 +303,7 @@ ) (loop (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self ash-entity extra trans quad)) + (vector-copy! gp-0 (-> self ash-entity extra trans)) (let ((f30-0 (vector-vector-distance gp-0 (target-pos 0)))) (when (and *was-squad-manager* (< f30-0 3276800.0)) (set! (-> *was-squad-control* target-count) 0) @@ -378,8 +378,8 @@ (set! (-> s4-0 params flags) (traffic-spawn-flags)) (set! (-> s4-0 params guard-type) (the-as uint 11)) (set! (-> s4-0 params entity) #f) - (set! (-> s4-0 params velocity quad) (-> s4-0 vec quad)) - (set! (-> s4-0 params position quad) (-> s5-1 pos quad)) + (vector-copy! (-> s4-0 params velocity) (-> s4-0 vec)) + (vector-copy! (-> s4-0 params position) (-> s5-1 pos)) (quaternion-copy! (-> s4-0 params rotation) (-> s5-1 quat)) (let ((s5-2 (vehicle-spawn (vehicle-type v-marauder) (-> s4-0 params)))) (when s5-2 @@ -540,7 +540,7 @@ (when a1-10 (let ((v1-83 (new 'stack-no-clear 'wvehicle-ai-drop-off-params))) (set! (-> v1-83 proc) a1-10) - (set! (-> v1-83 dest quad) (-> s2-0 pos quad)) + (vector-copy! (-> v1-83 dest) (-> s2-0 pos)) (send-event s3-0 'ai-drop-off v1-83) ) (set! (-> s4-0 spawned-marauder?) #t) @@ -680,7 +680,7 @@ ) ) (let ((s0-0 (new 'stack-no-clear 'marauder-init-by-other-params))) - (set! (-> s0-0 trans quad) (-> arg0 pos quad)) + (vector-copy! (-> s0-0 trans) (-> arg0 pos)) (quaternion-copy! (-> s0-0 quat) (-> arg0 quat)) (set! (-> s0-0 entity) (-> this marauder-entity)) (set! (-> s0-0 directed?) #f) @@ -757,8 +757,8 @@ (set! (-> sv-240 params flags) (traffic-spawn-flags)) (set! (-> sv-240 params guard-type) (the-as uint 11)) (set! (-> sv-240 params entity) #f) - (set! (-> sv-240 params velocity quad) (-> sv-240 vec quad)) - (set! (-> sv-240 params position quad) (-> s0-0 pos quad)) + (vector-copy! (-> sv-240 params velocity) (-> sv-240 vec)) + (vector-copy! (-> sv-240 params position) (-> s0-0 pos)) (quaternion-copy! (-> sv-240 params rotation) (-> s0-0 quat)) ) (let ((s0-1 (vehicle-spawn (vehicle-type v-marauder) (-> sv-240 params)))) @@ -883,6 +883,7 @@ ;; definition for method 11 of type desoasis-hellcat (defmethod init-from-entity! ((this desoasis-hellcat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc b/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc index 291ce54bf70..2a15c1513b0 100644 --- a/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/race/course-race_REF.gc @@ -160,8 +160,8 @@ (s4-0 (-> s5-0 info)) (s3-0 (new 'stack-no-clear 'course-race-stack-var0)) ) - (set! (-> s3-0 vec1 quad) (-> s5-0 info start-sphere quad)) - (set! (-> s3-0 vec2 quad) (-> s5-0 info start-dir quad)) + (vector-copy! (-> s3-0 vec1) (-> s5-0 info start-sphere)) + (vector-copy! (-> s3-0 vec2) (-> s5-0 info start-dir)) (set! (-> s3-0 params object-type) (traffic-type vehicle-task)) (set! (-> s3-0 params behavior) (the-as uint 10)) (set! (-> s3-0 params id) (the-as uint 0)) @@ -179,7 +179,7 @@ (let ((v1-10 (-> s5-0 racer-array s2-0)) (s1-0 (-> s4-0 racer-array s2-0)) ) - (set! (-> s3-0 params position quad) (-> v1-10 start-position quad)) + (vector-copy! (-> s3-0 params position) (-> v1-10 start-position)) (set! (-> s3-0 params id) (the-as uint s2-0)) (set! (-> s3-0 params user-data) (-> s1-0 rider)) (logior! (-> s3-0 params flags) (traffic-spawn-flags tsf1)) @@ -187,7 +187,7 @@ (vector-reset! (-> s3-0 params velocity)) (let ((a0-16 (-> s1-0 rider))) (when (or (zero? a0-16) (= a0-16 1)) - (set! (-> this start-pos quad) (-> v1-10 start-position quad)) + (vector-copy! (-> this start-pos) (-> v1-10 start-position)) (logclear! (-> s3-0 params flags) (traffic-spawn-flags tsf1)) (logior! (-> s3-0 params flags) (traffic-spawn-flags tsf5)) ) @@ -315,8 +315,8 @@ (let ((t9-0 (method-of-type task-manager-race set-time-limit))) (t9-0 this) ) - (set! (-> this start-pos quad) (-> (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0) quad)) - (set! (-> this fail-plane quad) (-> (new 'static 'vector :x -0.9241 :z -0.3819 :w 1.0) quad)) + (vector-copy! (-> this start-pos) (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0)) + (vector-copy! (-> this fail-plane) (new 'static 'vector :x -0.9241 :z -0.3819 :w 1.0)) (set! (-> this fail-plane w) (- (vector-dot (-> this fail-plane) (new 'static 'vector :x 10571776.0 :z 1187840.0 :w 1.0))) ) @@ -506,7 +506,7 @@ ;; WARN: new jak 2 until loop case, check carefully (defbehavior task-manager-desert-course-race-pre-race-sequence task-manager-desert-course-race () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self start-pos quad)) + (vector-copy! (-> gp-0 pos) (-> self start-pos)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf3 taf5)) (set! (-> gp-0 map-icon) (the-as uint 12)) @@ -924,6 +924,7 @@ ;; definition for method 11 of type des-rally-bollard (defmethod init-from-entity! ((this des-rally-bollard) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) diff --git a/test/decompiler/reference/jak3/levels/desert/race/kleever-rider_REF.gc b/test/decompiler/reference/jak3/levels/desert/race/kleever-rider_REF.gc index d67a904dd9b..2f21ceed8c7 100644 --- a/test/decompiler/reference/jak3/levels/desert/race/kleever-rider_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/race/kleever-rider_REF.gc @@ -50,19 +50,8 @@ (let ((gp-0 (new 'stack-no-clear 'kleever-rider-stack-var0))) (let ((a0-1 (handle->process (-> self vehicle)))) (when a0-1 - (set! (-> gp-0 vec1 quad) (-> (the-as wvehicle a0-1) lin-acceleration quad)) - (let* ((v1-5 (-> gp-0 mat0)) - (a3-0 (-> (the-as wvehicle a0-1) rbody matrix)) - (a0-5 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-5 rvec quad) a0-5) - (set! (-> v1-5 uvec quad) a1-3) - (set! (-> v1-5 fvec quad) a2-0) - (set! (-> v1-5 trans quad) a3-1) - ) + (vector-copy! (-> gp-0 vec1) (-> (the-as wvehicle a0-1) lin-acceleration)) + (matrix-copy! (-> gp-0 mat0) (-> (the-as wvehicle a0-1) rbody matrix)) ) ) (set! (-> gp-0 time) (the-as uint (current-time))) @@ -186,7 +175,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (set! (-> self level) (level-get *level* 'destrack)) (initialize-skeleton @@ -271,19 +260,8 @@ (let ((gp-0 (new 'stack-no-clear 'kleever-rider-stack-var0))) (let ((a0-1 (handle->process (-> self vehicle)))) (when a0-1 - (set! (-> gp-0 vec1 quad) (-> (the-as wvehicle a0-1) lin-acceleration quad)) - (let* ((v1-5 (-> gp-0 mat0)) - (a3-0 (-> (the-as wvehicle a0-1) rbody matrix)) - (a0-5 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-5 rvec quad) a0-5) - (set! (-> v1-5 uvec quad) a1-3) - (set! (-> v1-5 fvec quad) a2-0) - (set! (-> v1-5 trans quad) a3-1) - ) + (vector-copy! (-> gp-0 vec1) (-> (the-as wvehicle a0-1) lin-acceleration)) + (matrix-copy! (-> gp-0 mat0) (-> (the-as wvehicle a0-1) rbody matrix)) ) ) (set! (-> gp-0 time) (the-as uint (current-time))) @@ -393,7 +371,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (set! (-> self level) (level-get *level* 'destrack)) (if (not (-> self level)) @@ -433,7 +411,3 @@ (the-as wland-driver gp-0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc b/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc index 3900f948272..c0649c253e2 100644 --- a/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/race/turtle-training_REF.gc @@ -47,6 +47,7 @@ ;; definition for method 11 of type des-train-bollard (defmethod init-from-entity! ((this des-train-bollard) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -118,6 +119,7 @@ ;; definition for method 11 of type des-train-barrier (defmethod init-from-entity! ((this des-train-barrier) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -188,6 +190,7 @@ ;; definition for method 11 of type des-train-stones (defmethod init-from-entity! ((this des-train-stones) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -264,8 +267,8 @@ (let ((t9-0 (method-of-type task-manager set-time-limit))) (t9-0 this) ) - (set! (-> this start-pos quad) (-> (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0) quad)) - (set! (-> this door-plane quad) (-> (new 'static 'vector :z 1.0 :w 1.0) quad)) + (vector-copy! (-> this start-pos) (new 'static 'vector :x 11540444.0 :y 91835.19 :z 956374.6 :w 1.0)) + (vector-copy! (-> this door-plane) (new 'static 'vector :z 1.0 :w 1.0)) (set! (-> this door-plane w) (- (vector-dot (-> this door-plane) (new 'static 'vector :x 9277440.0 :y 125747.2 :z 957235.2 :w 1.0))) ) @@ -279,7 +282,7 @@ (set! (-> this max-count) (-> v1-7 0 length)) (dotimes (a0-13 (-> this max-count)) (let ((a1-7 (-> v1-7 0 data a0-13 actor))) - (set! (-> this goal-array a0-13 pos quad) (-> a1-7 extra trans quad)) + (vector-copy! (-> this goal-array a0-13 pos) (-> a1-7 extra trans)) ) ) ) @@ -338,8 +341,8 @@ ) ) (when a0-3 - (set! (-> this player-pos quad) (-> (the-as process-drawable a0-3) root trans quad)) - (set! (-> this player-vel quad) (-> (the-as process-drawable a0-3) root transv quad)) + (vector-copy! (-> this player-pos) (-> (the-as process-drawable a0-3) root trans)) + (vector-copy! (-> this player-vel) (-> (the-as process-drawable a0-3) root transv)) (copy-vehicle-controls! (the-as wvehicle a0-3) (-> this player-controls)) 0 ) @@ -366,9 +369,9 @@ (suspend) (send-event (handle->process (-> self player-vehicle)) 'ignore-damage #t) (set-time! (-> self test-time)) - (set! (-> self goal-pos quad) (-> self goal-array 0 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 0 pos)) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-0 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 12)) @@ -406,9 +409,9 @@ (suspend-for (seconds 0.25) ) (set! (-> self show-message?) #f) - (set! (-> self goal-pos quad) (-> self goal-array 1 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 1 pos)) (let ((gp-5 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-5 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-5 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-5 quat)) (set! (-> gp-5 flags) (task-arrow-flags)) (set! (-> gp-5 map-icon) (the-as uint 12)) @@ -458,9 +461,9 @@ (suspend-for (seconds 0.25) ) (set! (-> self show-message?) #f) - (set! (-> self goal-pos quad) (-> self goal-array 2 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 2 pos)) (let ((gp-10 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-10 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-10 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-10 quat)) (set! (-> gp-10 flags) (task-arrow-flags)) (set! (-> gp-10 map-icon) (the-as uint 12)) @@ -506,9 +509,9 @@ (set! (-> self start-time) 0) (suspend-for (seconds 0.25) ) - (set! (-> self goal-pos quad) (-> self goal-array 3 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 3 pos)) (let ((gp-13 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-13 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-13 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-13 quat)) (set! (-> gp-13 flags) (task-arrow-flags)) (set! (-> gp-13 map-icon) (the-as uint 12)) @@ -536,9 +539,9 @@ (set! (-> self start-time) 0) (suspend-for (seconds 0.25) ) - (set! (-> self goal-pos quad) (-> self goal-array 4 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 4 pos)) (let ((gp-16 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-16 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-16 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-16 quat)) (set! (-> gp-16 flags) (task-arrow-flags)) (set! (-> gp-16 map-icon) (the-as uint 12)) @@ -570,9 +573,9 @@ (set! (-> self start-time) 0) (suspend-for (seconds 0.25) ) - (set! (-> self goal-pos quad) (-> self goal-array 5 pos quad)) + (vector-copy! (-> self goal-pos) (-> self goal-array 5 pos)) (let ((gp-19 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-19 pos quad) (-> self goal-pos quad)) + (vector-copy! (-> gp-19 pos) (-> self goal-pos)) (quaternion-identity! (-> gp-19 quat)) (set! (-> gp-19 flags) (task-arrow-flags)) (set! (-> gp-19 map-icon) (the-as uint 12)) diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue-bbush_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue-bbush_REF.gc index b755a933e05..6df10b7d894 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue-bbush_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue-bbush_REF.gc @@ -97,7 +97,7 @@ ;; failed to figure out what this is: (dotimes (v1-10 (-> *desresc-transport-path-1* length)) - (set! (-> *__bbush-transport-path__* v1-10 quad) (-> *desresc-transport-path-1* v1-10 pos quad)) + (vector-copy! (-> *__bbush-transport-path__* v1-10) (-> *desresc-transport-path-1* v1-10 pos)) ) ;; definition for method 46 of type task-manager-desert-rescue-bbush @@ -106,7 +106,7 @@ (defmethod init-transport-params! ((this task-manager-desert-rescue-bbush) (arg0 desert-rescue-transport-init-params)) (set! (-> arg0 path-pts) *__bbush-transport-path__*) (set! (-> arg0 num-pts) (-> this desresc-path allocated-length)) - (set! (-> arg0 pos quad) (-> this desresc-path 0 pos quad)) + (vector-copy! (-> arg0 pos) (-> this desresc-path 0 pos)) (set! (-> arg0 desresc-path) (-> this desresc-path)) (quaternion-identity! (-> arg0 quat)) (none) @@ -144,12 +144,11 @@ (set! (-> this passenger-pos length) (-> *passenger-pos* length)) (when (-> this actor-group) (dotimes (s5-2 (-> this actor-group 0 length)) - (set! (-> *bbush-passenger-pos* s5-2 passenger-pos quad) - (-> this actor-group 0 data s5-2 actor extra trans quad) - ) - (set! (-> *bbush-passenger-pos* s5-2 beacon-pos quad) - (-> this actor-group 1 data s5-2 actor extra trans quad) - ) + (vector-copy! + (-> *bbush-passenger-pos* s5-2 passenger-pos) + (-> this actor-group 0 data s5-2 actor extra trans) + ) + (vector-copy! (-> *bbush-passenger-pos* s5-2 beacon-pos) (-> this actor-group 1 data s5-2 actor extra trans)) (set! (-> *bbush-passenger-pos* s5-2 is-final?) #f) (let ((s4-0 (res-lump-value @@ -208,7 +207,7 @@ :trans (behavior () ((-> (method-of-type task-manager active) trans)) (task-manager-desert-rescue-method-49 self) - (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (when (= (level-status? *level* 'desert #f) 'active) (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x3e4ccccd) (when (and *target* (focus-test? *target* pilot-riding)) (set! (-> self jak-vehicle) (process->handle (the-as process (send-event *target* 'get-vehicle)))) @@ -252,7 +251,7 @@ (let ((a0-1 (entity-by-name "des-burning-bush-40"))) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> a0-1 extra trans quad)) + (vector-copy! (-> gp-0 pos) (-> a0-1 extra trans)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -315,7 +314,3 @@ (set-setting! 'music 'desresbb 0.0 0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc index 6959dddcf15..f928acb4cb2 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/desert-rescue_REF.gc @@ -1120,7 +1120,7 @@ ;; failed to figure out what this is: (dotimes (v1-20 (-> *desresc-transport-path-0* length)) - (set! (-> *__transport-path__* v1-20 quad) (-> *desresc-transport-path-0* v1-20 pos quad)) + (vector-copy! (-> *__transport-path__* v1-20) (-> *desresc-transport-path-0* v1-20 pos)) ) ;; definition for method 0 of type transport-path-control @@ -1206,7 +1206,7 @@ (set! (-> *transport-tread-settings* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *transport-tread-settings* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *transport-tread-settings* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *transport-tread-settings* use-tape-mode?) #f) @@ -1318,7 +1318,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod desert-rescue-transport-method-43 ((this desert-rescue-transport)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> this root trans quad)) + (vector-copy! s2-0 (-> this root trans)) (let ((v1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -1371,7 +1371,7 @@ ) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* gp-0) 0.0) - (set! (-> arg1 quad) (-> gp-0 best-other-tri normal quad)) + (vector-copy! arg1 (-> gp-0 best-other-tri normal)) (-> gp-0 best-other-tri intersect y) ) (else @@ -1529,7 +1529,7 @@ (ja :group! (-> self draw art-group data 3) :num! (identity 1.0)) (set! (-> self desresc-path) (-> arg0 desresc-path)) (set! (-> self path) (new 'process 'transport-path-control self (-> arg0 path-pts) (-> arg0 num-pts))) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (set! (-> self target-pitch) 0.0) (set! (-> self pitch) 0.0) @@ -1684,7 +1684,7 @@ (let ((f0-4 (vector-dot s3-1 s5-0))) (cond ((>= f0-4 0.9999) - (set! (-> s5-0 quad) (-> s3-1 quad)) + (vector-copy! s5-0 s3-1) ) (else (vector-cross! s4-0 s5-0 s3-1) @@ -1728,7 +1728,7 @@ ;; INFO: Used lq/sq (defmethod desert-rescue-transport-method-44 ((this desert-rescue-transport)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> this root trans quad)) + (vector-copy! gp-0 (-> this root trans)) (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (f30-0 43008.0) ) @@ -1743,7 +1743,7 @@ ;; INFO: Used lq/sq (defmethod desert-rescue-transport-method-45 ((this desert-rescue-transport)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> this root trans quad)) + (vector-copy! gp-0 (-> this root trans)) (let ((a1-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (f30-0 43008.0) ) @@ -1979,7 +1979,7 @@ :virtual #t :event task-manager-event-handler :code (behavior () - (while (or (not *target*) (not *spawn-actors*) (!= (status-of-level-and-borrows *level* 'desrescg #f) 'active)) + (while (or (not *target*) (not *spawn-actors*) (!= (level-status? *level* 'desrescg #f) 'active)) (suspend) ) (set-time-limit self) @@ -2033,7 +2033,7 @@ (set! (-> gp-0 guard-type) (the-as uint 11)) (set! (-> gp-0 entity) #f) (vector-reset! (-> gp-0 velocity)) - (set! (-> gp-0 position quad) (-> *snake-start-pos* quad)) + (vector-copy! (-> gp-0 position) *snake-start-pos*) (quaternion-identity! (-> gp-0 rotation)) (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *snake-start-angle*) (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-0))) @@ -2062,7 +2062,7 @@ (set! (-> gp-2 guard-type) (the-as uint 11)) (set! (-> gp-2 entity) #f) (vector-reset! (-> gp-2 velocity)) - (set! (-> gp-2 position quad) (-> *snake-start-pos* quad)) + (vector-copy! (-> gp-2 position) *snake-start-pos*) (quaternion-identity! (-> gp-2 rotation)) (quaternion-rotate-y! (-> gp-2 rotation) (-> gp-2 rotation) *snake-start-angle*) (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-2))) @@ -2079,7 +2079,7 @@ ) (else (task-manager-desert-rescue-method-49 self) - (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (when (= (level-status? *level* 'desert #f) 'active) (send-event (handle->process (-> *game-info* dust-storm)) 'set-intensity #x3e4ccccd) (when (and *target* (focus-test? *target* pilot-riding)) (set! (-> self jak-vehicle) (process->handle (the-as process (send-event *target* 'get-vehicle)))) @@ -2107,7 +2107,7 @@ (defmethod init-transport-params! ((this task-manager-desert-rescue) (arg0 desert-rescue-transport-init-params)) (set! (-> arg0 path-pts) *__transport-path__*) (set! (-> arg0 num-pts) (-> this desresc-path allocated-length)) - (set! (-> arg0 pos quad) (-> this desresc-path 0 pos quad)) + (vector-copy! (-> arg0 pos) (-> this desresc-path 0 pos)) (set! (-> arg0 desresc-path) (-> this desresc-path)) (quaternion-identity! (-> arg0 quat)) (none) @@ -2162,7 +2162,7 @@ (set-setting! 'dust-storm-sound-scalar #f 1.0 0) (remove-setting! 'vehicles) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> *home-pos* quad)) + (vector-copy! (-> gp-0 pos) *home-pos*) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 12)) @@ -2320,16 +2320,14 @@ (let ((s5-0 (-> gp-0 pos)) (s4-0 (handle->process (-> self jak-vehicle))) ) - (set! (-> s5-0 quad) (-> (get-trans - (the-as process-focusable (if (type? s4-0 process-focusable) - (the-as process-focusable s4-0) - ) - ) - 0 - ) - quad - ) - ) + (vector-copy! s5-0 (get-trans + (the-as process-focusable (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + 0 + ) + ) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) @@ -2406,7 +2404,7 @@ (set! (-> gp-0 guard-type) (the-as uint 11)) (set! (-> gp-0 entity) #f) (vector-reset! (-> gp-0 velocity)) - (set! (-> gp-0 position quad) (-> *snake-start-pos* quad)) + (vector-copy! (-> gp-0 position) *snake-start-pos*) (quaternion-identity! (-> gp-0 rotation)) (quaternion-rotate-y! (-> gp-0 rotation) (-> gp-0 rotation) *snake-start-angle*) (set! (-> self jak-vehicle) (process->handle (vehicle-spawn (vehicle-type v-snake) gp-0))) @@ -2604,7 +2602,7 @@ (task-manager-desert-rescue-method-45 self 1) (send-event (handle->process (-> self current-transport)) 'passenger-pickup) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self passenger-pos (-> self current-passenger-index) beacon-pos quad)) + (vector-copy! (-> gp-0 pos) (-> self passenger-pos (-> self current-passenger-index) beacon-pos)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -2748,10 +2746,10 @@ (let ((s5-0 (mod (-> this current-passenger-index) 3))) 0 (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s4-0 (target-pos 0)) (let ((a0-8 (the-as process-focusable (handle->process (-> this current-passenger))))) (if a0-8 - (set! (-> s4-0 quad) (-> (get-trans a0-8 3) quad)) + (vector-copy! s4-0 (get-trans a0-8 3)) ) ) (let ((s4-1 (speech-play (-> *rescue-speech-array* s5-0) arg0 *desert-rescue-speech-list* s4-0))) diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc index 549431c4423..7e518e263c0 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/neo-satellite_REF.gc @@ -1470,34 +1470,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -1579,7 +1579,7 @@ (stack-size-set! (-> self main-thread) 512) (logclear! (-> self mask) (process-mask enemy)) (init-enemy-collision! self) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) (initialize-skeleton self @@ -1594,7 +1594,7 @@ (dotimes (gp-2 3) (set! (-> self snd-whips-loop gp-2) (new-sound-id)) ) - (init-enemy-defaults! self *neo-sat-nav-enemy-info*) + (setup-enemy! self *neo-sat-nav-enemy-info*) (logior! (-> self skel status) (joint-control-status sync-math)) (ja-no-eval :group! neo-satellite-idle-ja :num! zero) (ja-post) @@ -1682,9 +1682,9 @@ ;; definition for method 119 of type neo-sat ;; WARN: Return type mismatch none vs object. -(defmethod init-enemy-defaults! ((this neo-sat) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this neo-sat) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (neo-sat-method-199 this) @@ -1752,12 +1752,13 @@ ;; definition for method 65 of type neo-sat ;; INFO: Used lq/sq -(defmethod penetrate->next-state ((this neo-sat) (arg0 process) (arg1 event-message-block) (arg2 float)) +(defmethod msg-for-incoming-attack ((this neo-sat) (arg0 process) (arg1 event-message-block) (arg2 float)) + "Given an attack message, what do we do next? Returns a message name that should be sent to self." (when (< 0.0 arg2) (let* ((a1-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this incoming attack-direction) 1.0)) (s5-0 (matrix-f-u-compose (new 'stack-no-clear 'matrix) a1-2 *up-vector*)) ) - (set! (-> s5-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) (if (logtest? (-> *part-group-id-table* 421 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 421) :mat-joint s5-0) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 421) :mat-joint s5-0) @@ -1786,6 +1787,7 @@ ;; definition for method 120 of type neo-sat ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this neo-sat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1862,6 +1864,7 @@ ;; definition for method 121 of type neo-sat ;; WARN: Return type mismatch object vs none. (defmethod init-enemy! ((this neo-sat)) + "Typical place for shared init code. Runs from entity or process style init." (let ((v1-0 (-> this nav))) (set! (-> v1-0 speed-scale) 1.0) ) @@ -1885,6 +1888,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defmethod enemy-common-post ((this neo-sat)) + "Common implementation of post. Runs ja-post." (call-parent-method this) (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) (when (-> this should-rise?) @@ -1927,7 +1931,7 @@ ) (let ((a0-19 (handle->process (-> this focus handle)))) (if a0-19 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-19) 0) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-19) 0)) ) ) (let ((f0-18 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) @@ -2083,7 +2087,7 @@ (let ((a0-1 (-> this nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a0-1 target-pos quad)) + (vector-copy! a1-1 (-> a0-1 target-pos)) (let ((f30-0 (vector-vector-xz-distance (-> this root trans) a1-1))) (-> this xz-vel) (let ((s5-0 (new-stack-vector0))) @@ -2102,7 +2106,7 @@ ) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) s3-1 (-> this root transv)))) (vector-lerp! (-> this last-thrust-vec) (-> this last-thrust-vec) s4-2 (* 2.0 (seconds-per-frame))) - (set! (-> s4-2 quad) (-> this last-thrust-vec quad)) + (vector-copy! s4-2 (-> this last-thrust-vec)) (let* ((f1-1 (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this root transv) 1.0) (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-2 1.0) @@ -2196,7 +2200,7 @@ (set-setting! 'duststorm-push-player? #f 0.0 0) (set! (-> this last-play-laser-time) 0) (set! (-> this current-height-probe-index) 0) - (set! (-> this shockwave-origin quad) (-> this root trans quad)) + (vector-copy! (-> this shockwave-origin) (-> this root trans)) (let ((v1-8 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> *neo-sat-laser-array* 0 joint))) ) @@ -2235,6 +2239,7 @@ ;; definition for method 82 of type neo-sat (defmethod event-handler ((this neo-sat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('attack) (let ((a0-3 (-> arg3 param 1)) @@ -2270,6 +2275,7 @@ ;; definition for method 67 of type neo-sat (defmethod coin-flip? ((this neo-sat)) + "Return #t half the time, #f the other." #f ) @@ -2323,7 +2329,7 @@ ) (logclear! (-> a0-12 flags) (nav-state-flag directional-mode)) (logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-12 target-pos quad) (-> v1-4 quad)) + (vector-copy! (-> a0-12 target-pos) v1-4) ) 0 (set! (-> self last-thrust-vec quad) (the-as uint128 0)) @@ -2449,14 +2455,14 @@ (a1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data gp-0))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> this node-list data gp-0 bone transform fvec quad)) + (vector-copy! s3-0 (-> this node-list data gp-0 bone transform fvec)) (let ((gp-1 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) (set! (-> gp-1 knots data 0 mass) (the-as float #x7f800000)) (if (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) - (set! (-> gp-1 gravity-dir quad) (-> s3-0 quad)) + (vector-copy! (-> gp-1 gravity-dir) s3-0) ) (set! (-> gp-1 knots data 0 pos quad) (-> a1-3 quad)) - (set! (-> gp-1 knots data 0 prev-pos quad) (-> a1-3 quad)) + (vector-copy! (-> gp-1 knots data 0 prev-pos) a1-3) (set! (-> gp-1 knot-constraints data 0 dir quad) (-> s3-0 quad)) (when (and (-> this next-state) (= (-> this next-state name) 'neo-sat-sit-and-spin)) (let ((f30-1 (- (-> a1-3 y) (neo-sat-method-218 this a1-3)))) @@ -2552,7 +2558,7 @@ (a1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s4-0))) (v1-5 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-5 quad) (-> this node-list data s4-0 bone transform fvec quad)) + (vector-copy! v1-5 (-> this node-list data s4-0 bone transform fvec)) 368640.0 (let ((a0-15 (-> this ropes (-> *neo-sat-laser-array* arg0 rope-index)))) 0.0 @@ -2784,6 +2790,7 @@ ;; definition for method 62 of type neo-sat ;; WARN: Return type mismatch number vs float. (defmethod get-damage-from-attack ((this neo-sat) (arg0 object) (arg1 event-message-block)) + "Compute hit point damage for an attack message." (let ((v0-1 (the-as number (call-parent-method this arg0 arg1)))) (if (logtest? (penetrate dark-bomb dark-smack) (-> (the-as attack-info (-> arg1 param 1)) penetrate-using)) (set! v0-1 #x41f00000) @@ -2793,7 +2800,8 @@ ) ;; definition for method 52 of type neo-sat -(defmethod damage-enemy! ((this neo-sat) (arg0 object) (arg1 event-message-block)) +(defmethod damage-enemy-from-attack! ((this neo-sat) (arg0 object) (arg1 event-message-block)) + "Given an attack message, apply damage." (let ((f30-0 (call-parent-method this arg0 arg1))) (let ((f28-0 (-> this hit-points)) (f26-0 (* 30.0 (- 3.0 (the float (+ (-> this current-stage) 1))))) @@ -2982,7 +2990,7 @@ (set! (-> *part-id-table* 1679 init-specs 3 initial-valuef) (* f26-2 (+ f24-1 (+ -1.0 (the-as float v1-42))))) ) (let ((a2-4 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s0-0 *up-vector*))) - (set! (-> a2-4 trans quad) (-> s1-0 quad)) + (vector-copy! (-> a2-4 trans) s1-0) (launch-particles (-> *part-id-table* 1679) a2-4 :origin-is-matrix #t) ) ) @@ -3001,7 +3009,7 @@ (vector+float*! s2-2 (-> this shockwave-origin) s1-1 f28-1) (set! (-> s2-2 y) (neo-sat-method-218 this s2-2)) (let ((a2-7 (matrix-f-u-compose (new 'stack-no-clear 'matrix) s1-1 *up-vector*))) - (set! (-> a2-7 trans quad) (-> s2-2 quad)) + (vector-copy! (-> a2-7 trans) s2-2) (set! (-> *part-id-table* 1680 init-specs 9 initial-valuef) (the-as float (shl (-> this global-neo-sat-index) 16)) ) @@ -3077,11 +3085,11 @@ (send-event (handle->process (-> self warp-handle)) 'turn-off) (cond ((logtest? (-> *part-group-id-table* 418 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 418)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 418)) ) ) @@ -3150,14 +3158,14 @@ (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root transv quad) (the-as uint128 0)) (set! (-> self desired-float-height) 16384.0) - (set! (-> self start-thrust-pos quad) (-> self root trans quad)) + (vector-copy! (-> self start-thrust-pos) (-> self root trans)) (set-time! (-> self state-time)) ) :trans (behavior () (neo-sat-method-220 self) (let ((f30-0 (neo-sat-probe-ground self (-> self root trans)))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> a2-0 quad) (-> self root trans quad)) + (vector-copy! a2-0 (-> self root trans)) (set! (-> a2-0 y) (+ (-> self start-thrust-pos y) (-> self desired-float-height))) (cond ((< 0.0 (-> self desired-float-height)) @@ -3169,7 +3177,7 @@ (when (>= f28-0 0.95) (set! (-> self desired-float-height) -102400.0) (set-time! (-> self state-time)) - (set! (-> self start-thrust-pos quad) (-> self root trans quad)) + (vector-copy! (-> self start-thrust-pos) (-> self root trans)) ) ) ) @@ -3232,7 +3240,7 @@ (seek! (-> self anim-speed) 3.0 (* 0.15 (seconds-per-frame))) (when (time-elapsed? (-> self wander-generate-time) (seconds 1.5)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *x-vector* quad)) + (vector-copy! s5-0 *x-vector*) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-normalize! s5-0 65536.0) (vector-rotate-y! s5-0 s5-0 (-> self offset-angle)) @@ -3249,7 +3257,7 @@ (let ((v1-26 (-> self nav state))) (logclear! (-> v1-26 flags) (nav-state-flag directional-mode)) (logior! (-> v1-26 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-26 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-26 target-pos) gp-0) ) ) ) @@ -3345,11 +3353,11 @@ (logclear! (-> self focus-status) (focus-status dangerous)) (cond ((logtest? (-> *part-group-id-table* 420 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 420)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 420)) ) ) @@ -3420,11 +3428,11 @@ (process->handle (-> (cond ((logtest? (-> *part-group-id-table* 427 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 427)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 427)) ) ) @@ -3445,11 +3453,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 426 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 426)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 426)) ) ) @@ -3478,11 +3486,11 @@ (send-event (handle->process (-> self warp-handle)) 'turn-on) (cond ((logtest? (-> *part-group-id-table* 420 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 420)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 420)) ) ) @@ -3576,7 +3584,7 @@ :trans (behavior () (sound-play "sat-hover" :id (-> self snd-hover)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *x-vector* quad)) + (vector-copy! s5-0 *x-vector*) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-normalize! s5-0 12288.0) (vector-rotate-y! s5-0 s5-0 (-> self offset-angle)) @@ -3602,7 +3610,7 @@ (let ((v1-34 (-> self nav state))) (logclear! (-> v1-34 flags) (nav-state-flag directional-mode)) (logior! (-> v1-34 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-34 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-34 target-pos) gp-0) ) ) ) @@ -3655,7 +3663,7 @@ (defmethod nav-enemy-method-161 ((this neo-sat) (arg0 nav-control)) (when (logtest? (enemy-flag ef37) (-> this enemy-flags)) (let ((a2-1 (-> arg0 state))) - (set! (-> this nav-vector quad) (-> a2-1 travel quad)) + (vector-copy! (-> this nav-vector) (-> a2-1 travel)) ) (vector-normalize! (-> this nav-vector) 1.0) ) @@ -3667,7 +3675,7 @@ ;; WARN: Return type mismatch (pointer process) vs (pointer neo-sat). (defun spawn-neo-sat ((arg0 vector) (arg1 quaternion) (arg2 process)) (let ((s5-0 (new 'stack-no-clear 'neo-sat-init-params))) - (set! (-> s5-0 pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 pos) arg0) (quaternion-copy! (-> s5-0 quat) arg1) (process-spawn neo-sat s5-0 :name "neo-sat" :to arg2 :stack-size #x14000) ) @@ -3787,7 +3795,7 @@ (a0-8 (-> s5-0 knots data (+ s4-0 1))) (s3-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s3-0 start-pos quad) (-> v1-18 pos quad)) + (vector-copy! (-> s3-0 start-pos) (-> v1-18 pos)) (vector-! (-> s3-0 move-dist) (the-as vector a0-8) (the-as vector v1-18)) (let ((v1-19 s3-0)) (set! (-> v1-19 radius) 40.96) @@ -3880,10 +3888,10 @@ ) ) ) - (set! (-> s4-1 quad) (-> this node-list data arg0 bone transform fvec quad)) + (vector-copy! s4-1 (-> this node-list data arg0 bone transform fvec)) (vector-normalize! s4-1 1.0) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> s5-1 quad)) + (vector-copy! (-> s3-1 start-pos) s5-1) (vector-float*! (-> s3-1 move-dist) s4-1 f30-0) (let ((v1-16 s3-1)) (set! (-> v1-16 radius) 4096.0) @@ -4245,7 +4253,7 @@ ) ) ) - (set! (-> this root trans quad) (-> (the-as process-focusable a0-2) root trans quad)) + (vector-copy! (-> this root trans) (-> (the-as process-focusable a0-2) root trans)) ) (quaternion-identity! (-> this root quat)) (let ((s5-1 (-> (math-camera-matrix) fvec))) @@ -4439,7 +4447,8 @@ ;; definition for method 20 of type neo-sat ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this neo-sat)) +(defmethod get-search-info-flag ((this neo-sat)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (!= (-> this hit-points) 0.0) (set! v0-0 (logior (logior v0-0 16) 8)) diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system_REF.gc index b451e98b804..ecae94f24d5 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/rope-prim-system_REF.gc @@ -59,7 +59,7 @@ (set! sv-128 (-> this alpha)) (set! sv-132 (the-as float 0.0)) (set! sv-136 (the-as float 0.0)) - (set! (-> sv-112 quad) (-> this knots data s5-0 pos quad)) + (vector-copy! sv-112 (-> this knots data s5-0 pos)) (cond ((< s5-0 (+ (-> this knots length) -1)) (vector-! sv-116 (the-as vector (-> this knots data (+ s5-0 1))) sv-112) @@ -102,7 +102,7 @@ (defmethod add-prim-vert ((this rope-prim-system) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float)) (when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts)) (let ((v1-5 (-> arg0 data (-> arg0 num-verts)))) - (set! (-> v1-5 pos quad) (-> arg1 quad)) + (vector-copy! (-> v1-5 pos) arg1) (set! (-> v1-5 col) arg2) (set! (-> v1-5 stq x) arg3) (set! (-> v1-5 stq y) arg4) @@ -218,7 +218,7 @@ ) ) (let ((v0-3 (-> this knots data 0 prev-pos))) - (set! (-> v0-3 quad) (-> this knots data 0 pos quad)) + (vector-copy! v0-3 (-> this knots data 0 pos)) v0-3 ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/rope-system_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/rope-system_REF.gc index 3b719928206..ba92499e99c 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/rope-system_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/rope-system_REF.gc @@ -77,14 +77,14 @@ (a1-3 (new 'stack-no-clear 'vector)) ) (let ((a3-0 (new 'stack-no-clear 'vector))) - (set! (-> a3-0 quad) (-> this accum-force quad)) + (vector-copy! a3-0 (-> this accum-force)) (vector+! a3-0 a3-0 (-> a2-1 force)) (vector-float*! a1-3 (-> a2-1 pos) (- 2.0 f1-1)) (vector-! a1-3 a1-3 (vector-float*! (new 'stack-no-clear 'vector) (-> a2-1 prev-pos) (- 1.0 f1-1))) (vector+float*! a1-3 a1-3 a3-0 f0-1) ) - (set! (-> a2-1 prev-pos quad) (-> a2-1 pos quad)) - (set! (-> a2-1 pos quad) (-> a1-3 quad)) + (vector-copy! (-> a2-1 prev-pos) (-> a2-1 pos)) + (vector-copy! (-> a2-1 pos) a1-3) ) ) ) @@ -216,7 +216,7 @@ (f26-0 (/ f0-7 f1-5)) ) (let ((s1-1 (new 'stack-no-clear 'vector))) - (set! (-> s1-1 quad) (-> s3-0 pos quad)) + (vector-copy! s1-1 (-> s3-0 pos)) (set! sv-368 (new 'stack-no-clear 'vector)) (let ((v1-35 (-> s2-0 pos quad))) (set! (-> sv-368 quad) v1-35) @@ -548,7 +548,3 @@ ) #f ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/rescue/wland-passenger_REF.gc b/test/decompiler/reference/jak3/levels/desert/rescue/wland-passenger_REF.gc index e69f5280d2c..1ba91084a06 100644 --- a/test/decompiler/reference/jak3/levels/desert/rescue/wland-passenger_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/rescue/wland-passenger_REF.gc @@ -235,7 +235,7 @@ (let ((f30-0 (compute-y-height arg0 (target-pos 0))) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 quad) (-> (target-pos 0) quad)) + (vector-copy! s3-1 (target-pos 0)) (set! (-> s3-1 y) f30-0) ) (vector+float*! arg1 (get-trans arg0 0) s5-0 -57344.0) @@ -245,6 +245,7 @@ ;; definition for method 151 of type wland-passenger (defmethod should-move-to-ground? ((this wland-passenger)) + "Should this enemy be moved to the ground while moving?" (not (and (-> this next-state) (= (-> this next-state name) 'entering-transport))) ) @@ -274,7 +275,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-8 quad)) + (vector-copy! (-> gp-0 target-pos) v1-8) ) 0 ) @@ -293,7 +294,7 @@ (a2-0 (-> self nav state)) (a1-3 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-3 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-3 (-> a2-0 target-pos)) (when (< (t9-2 a0-5 a1-3) 14745.6) (send-event (handle->process (-> self transport)) 'leave) (send-event (handle->process (-> self transport)) 'die-when-ready) @@ -411,7 +412,7 @@ ) (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-0 target-pos quad) (-> v1-7 quad)) + (vector-copy! (-> gp-0 target-pos) v1-7) ) 0 (nav-enemy-method-177 self) @@ -448,7 +449,7 @@ (a2-1 (-> self nav state)) (a1-3 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-3 quad) (-> a2-1 target-pos quad)) + (vector-copy! a1-3 (-> a2-1 target-pos)) (when (< (t9-2 a0-5 a1-3) 2048.0) (let ((v1-8 (-> self nav))) (set! (-> v1-8 sphere-mask) (the-as uint 65)) @@ -487,7 +488,7 @@ ) (logclear! (-> a0-12 flags) (nav-state-flag directional-mode)) (logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-12 target-pos quad) (-> v1-4 quad)) + (vector-copy! (-> a0-12 target-pos) v1-4) ) 0 (nav-enemy-method-176 self) @@ -651,7 +652,7 @@ ) (logclear! (-> a0-21 flags) (nav-state-flag directional-mode)) (logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-21 target-pos quad) (-> v1-37 quad)) + (vector-copy! (-> a0-21 target-pos) v1-37) ) 0 (if (< (vector-vector-xz-distance gp-2 (-> self root trans)) 6144.0) @@ -676,6 +677,7 @@ ;; definition for method 67 of type wland-passenger (defmethod coin-flip? ((this wland-passenger)) + "Return #t half the time, #f the other." #f ) @@ -749,7 +751,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (ja-no-eval :group! wland-passenger-vehicle-jump-to-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((s5-0 (ja-num-frames 0)) @@ -907,7 +909,7 @@ (quaternion-copy! (-> self root quat) (-> gp-2 root quat)) ) (quaternion-rotate-y! (-> self root quat) (-> self root quat) -16384.0) - (set! (-> self original-trans quad) (-> self root trans quad)) + (vector-copy! (-> self original-trans) (-> self root trans)) (quaternion-copy! (-> self original-quat) (-> self root quat)) (let ((s4-1 (the-as vehicle (handle->process (-> self vehicle)))) (s5-1 (new 'stack-no-clear 'vector)) @@ -1005,7 +1007,7 @@ (set! (-> s5-1 uvec z) (sin (-> s5-1 uvec x))) (set! (-> s5-1 uvec w) (cos (-> s5-1 uvec x))) (set! (-> s5-1 uvec y) (seconds-per-frame)) - (set! (-> s5-1 rvec quad) (-> s4-0 local-accel quad)) + (vector-copy! (-> s5-1 rvec) (-> s4-0 local-accel)) (let ((f1-6 (+ (* 0.03 (-> s5-1 uvec z)) (* -1.0 (-> s5-1 rvec x) (-> s4-0 left-right-accel-factor))))) (+! (-> this left-right-interp) (* (- f1-6 (-> this left-right-interp)) (fmin 1.0 (* 8.0 (-> s5-1 uvec y))))) ) @@ -1279,11 +1281,11 @@ ;; definition for function wland-passenger-init-by-other ;; INFO: Used lq/sq (defbehavior wland-passenger-init-by-other wland-passenger ((arg0 wland-passenger-init-by-other-params)) - (set! (-> self start-pos quad) (-> arg0 position quad)) + (vector-copy! (-> self start-pos) (-> arg0 position)) (set! (-> self transport) (the-as handle #f)) (set! (-> self is-dead?) (-> arg0 is-dead?)) (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-0 pos quad) (-> arg0 position quad)) + (vector-copy! (-> s5-0 pos) (-> arg0 position)) (quaternion-identity! (-> s5-0 quat)) (set! (-> s5-0 flags) (task-arrow-flags)) (set! (-> s5-0 map-icon) (the-as uint 13)) @@ -1414,34 +1416,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 61440.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 15) + :knocked-soft-vy-hi (meters 15) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 24) + :knocked-hard-vy-hi (meters 26) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 15) + :knocked-red-vy-hi (meters 15) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -1482,6 +1484,7 @@ ;; definition for method 120 of type wland-passenger ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this wland-passenger)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1541,12 +1544,13 @@ ;; definition for method 121 of type wland-passenger ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this wland-passenger)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wland-passenger" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *wland-passenger-nav-enemy-info*) + (setup-enemy! this *wland-passenger-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -1567,7 +1571,7 @@ ;; WARN: Return type mismatch (pointer process) vs (pointer wland-passenger). (defun spawn-wlander ((arg0 desert-passenger-info) (arg1 process)) (let ((s5-0 (new 'stack-no-clear 'wland-passenger-init-by-other-params))) - (set! (-> s5-0 position quad) (-> arg0 passenger-pos quad)) + (vector-copy! (-> s5-0 position) (-> arg0 passenger-pos)) (quaternion-identity! (-> s5-0 rotation)) (set! (-> s5-0 velocity quad) (the-as uint128 0)) (set! (-> s5-0 behavior) (the-as uint 0)) @@ -1581,6 +1585,7 @@ ;; definition for method 82 of type wland-passenger ;; WARN: disable def twice: 20. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this wland-passenger) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('impact-impulse) (when (= arg0 (send-event *target* 'get-vehicle)) @@ -1607,7 +1612,7 @@ 0 (citizen-method-195 this) (citizen-method-194 this) - (try-locate-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) + (move-to-ground this (meters 10) (meters 10) #t (-> this gnd-collide-with)) (go (method-of-object this active)) ) ) @@ -1639,6 +1644,7 @@ ;; definition for method 81 of type wland-passenger (defmethod go-die ((this wland-passenger)) + "Go to the die state." (send-event (handle->process (-> this task-man)) 'fail-delay) (call-parent-method this) ) @@ -1652,6 +1658,7 @@ ;; definition for method 66 of type wland-passenger (defmethod get-penetrated-by ((this wland-passenger)) + "Figure out the penetrated-by mask for this process." ((method-of-type enemy get-penetrated-by) this) ) @@ -1682,6 +1689,7 @@ ;; definition for method 78 of type wland-passenger (defmethod go-hostile ((this wland-passenger)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this active)) ) @@ -1691,6 +1699,7 @@ ) ;; definition for method 60 of type wland-passenger -(defmethod lerp-damage ((this wland-passenger) (arg0 float)) +(defmethod impact-velocity-to-hit-points ((this wland-passenger) (arg0 float)) + "Given an impact velocity, compute hit points." (lerp-scale 0.0 (* 0.3 (-> this enemy-info default-hit-points)) arg0 20480.0 122880.0) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc index e1c3c9b8d81..61c7fd4d816 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/w-parking-spot_REF.gc @@ -50,7 +50,7 @@ (defmethod w-parking-spot-method-24 ((this w-parking-spot)) (let ((gp-0 (new 'stack-no-clear 'cquery-with-5vec))) (set! (-> gp-0 vec 0 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec 0 quad)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec 0)) (vector-reset! (-> gp-0 vec 1)) (set! (-> gp-0 vec 1 y) 1.0) (vector-z-quaternion! (-> gp-0 vec 2) (-> this root quat)) @@ -70,19 +70,19 @@ (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) (when (>= f30-0 0.0) (vector+float*! (the-as vector (-> gp-0 vec)) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) - (set! (-> gp-0 vec 1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (vector-copy! (-> gp-0 vec 1) (-> gp-0 cquery best-other-tri normal)) (when (< (-> gp-0 vec 1 y) (cos 3640.889)) (vector-reset! (-> gp-0 vec 1)) (set! (-> gp-0 vec 1 y) 1.0) ) - (set! (-> this root trans quad) (-> gp-0 vec 0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec 0)) (format #t "w-parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec 0 y)) ) (if (< f30-0 0.0) (format #t "w-parking-spot::find-ground: could not find ground~%") ) ) - (set! (-> this root trans quad) (-> gp-0 vec 0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec 0)) (forward-up-nopitch->quaternion (-> this root quat) (-> gp-0 vec 2) (-> gp-0 vec 1)) ) 0 @@ -127,7 +127,7 @@ ) (when (not (handle->process (-> this arrow))) (let ((s5-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-1 pos quad) (-> this root trans quad)) + (vector-copy! (-> s5-1 pos) (-> this root trans)) (quaternion-identity! (-> s5-1 quat)) (set! (-> s5-1 flags) (task-arrow-flags taf8)) (set! (-> s5-1 map-icon) (the-as uint 12)) @@ -187,7 +187,7 @@ (set! (-> s4-0 guard-type) (the-as uint 11)) (set! (-> s4-0 entity) #f) (vector-reset! (-> s4-0 velocity)) - (set! (-> s4-0 position quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 position) (-> this root trans)) (quaternion-copy! (-> s4-0 rotation) (-> this root quat)) (let ((a0-22 (vehicle-spawn (the-as vehicle-type s5-0) s4-0))) (when a0-22 @@ -221,6 +221,7 @@ ;; definition for method 11 of type w-parking-spot ;; INFO: Used lq/sq (defmethod init-from-entity! ((this w-parking-spot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause movie)) @@ -233,7 +234,7 @@ (let ((v1-9 (res-lump-struct arg0 'spawn-trans vector))) (cond (v1-9 - (set! (-> this root trans quad) (-> v1-9 quad)) + (vector-copy! (-> this root trans) v1-9) (let ((a1-5 (res-lump-struct arg0 'spawn-quat structure))) (when a1-5 (quaternion-copy! (-> this root quat) (the-as quaternion a1-5)) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc index bc295e03c31..c89598a0e12 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc @@ -141,9 +141,9 @@ (a1-2 (the-as uint #xa01013fd)) (a1-3 (logand -2 a1-2)) ) - (set! (-> a0-2 vec0 quad) (-> arg0 quad)) + (vector-copy! (-> a0-2 vec0) arg0) (set! (-> a0-2 vec0 w) 20480.0) - (set! (-> v1-0 0 quad) (-> a0-2 vec0 quad)) + (vector-copy! (-> v1-0 0) (-> a0-2 vec0)) (let ((a0-3 (-> a0-2 cquery))) (set! (-> a0-3 best-dist) (the-as float v1-0)) (set! (-> a0-3 best-other-prim) (the-as collide-shape-prim 1)) @@ -173,8 +173,8 @@ (set! (-> s3-0 params flags) (traffic-spawn-flags)) (set! (-> s3-0 params guard-type) (the-as uint 11)) (set! (-> s3-0 params entity) #f) - (set! (-> s3-0 params velocity quad) (-> s3-0 vec quad)) - (set! (-> s3-0 params position quad) (-> arg0 quad)) + (vector-copy! (-> s3-0 params velocity) (-> s3-0 vec)) + (vector-copy! (-> s3-0 params position) arg0) (quaternion-copy! (-> s3-0 params rotation) arg1) (let ((s5-1 (vehicle-spawn (vehicle-type v-marauder) (-> s3-0 params)))) (when s5-1 @@ -211,27 +211,16 @@ ) (when s4-0 (let ((s5-1 (new 'stack-no-clear 'inline-array 'matrix 4))) - (let* ((s3-0 (-> s5-1 0)) - (a2-0 (camera-matrix)) - (v1-4 (-> a2-0 rvec quad)) - (a0-5 (-> a2-0 uvec quad)) - (a1-2 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> s3-0 rvec quad) v1-4) - (set! (-> s3-0 uvec quad) a0-5) - (set! (-> s3-0 fvec quad) a1-2) - (set! (-> s3-0 trans quad) a2-1) - ) - (set! (-> s5-1 1 fvec quad) (-> s5-1 0 trans quad)) - (set! (-> s5-1 1 trans quad) (-> (the-as process-focusable s4-0) root transv quad)) - (set! (-> s5-1 2 uvec quad) (-> s5-1 1 trans quad)) + (matrix-copy! (-> s5-1 0) (camera-matrix)) + (vector-copy! (-> s5-1 1 fvec) (-> s5-1 0 trans)) + (vector-copy! (-> s5-1 1 trans) (-> (the-as process-focusable s4-0) root transv)) + (vector-copy! (-> s5-1 2 uvec) (-> s5-1 1 trans)) (let* ((v1-8 (-> s5-1 1 trans)) (f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) (f1-3 4096.0) ) (if (< f0-3 (* f1-3 f1-3)) - (set! (-> s5-1 2 uvec quad) (-> (the-as process-focusable s4-0) node-list data 0 bone transform fvec quad)) + (vector-copy! (-> s5-1 2 uvec) (-> (the-as process-focusable s4-0) node-list data 0 bone transform fvec)) ) ) (set! (-> s5-1 2 uvec y) 0.0) @@ -283,7 +272,7 @@ (let ((s4-5 (new 'stack-no-clear 'cquery-with-5vec))) (set! (-> s4-5 vec 0 quad) (-> s5-1 1 uvec quad)) (set! (-> s4-5 vec 0 y) 614400.0) - (set! (-> s4-5 cquery start-pos quad) (-> s4-5 vec 0 quad)) + (vector-copy! (-> s4-5 cquery start-pos) (-> s4-5 vec 0)) (vector-reset! (-> s4-5 vec 1)) (set! (-> s4-5 vec 1 y) 1.0) (vector-! (-> s4-5 vec 2) (-> s5-1 2 trans) (the-as vector (-> s4-5 vec))) @@ -309,7 +298,7 @@ (when (or (< (* f0-31 f0-31) (vector-vector-distance-squared (-> s5-1 1 fvec) (the-as vector (-> s4-5 vec)))) (not (sphere-in-view-frustum? (the-as sphere (-> s5-1 3)))) ) - (set! (-> s4-5 vec 1 quad) (-> s4-5 cquery best-other-tri normal quad)) + (vector-copy! (-> s4-5 vec 1) (-> s4-5 cquery best-other-tri normal)) (when (< (-> s4-5 vec 1 y) (cos 3640.889)) (vector-reset! (-> s4-5 vec 1)) (set! (-> s4-5 vec 1 y) 1.0) @@ -358,8 +347,8 @@ ) ) (when v1-8 - (set! (-> s5-1 0 uvec quad) (-> (the-as process-focusable v1-8) root trans quad)) - (set! (-> s5-1 0 fvec quad) (-> (the-as process-focusable v1-8) root transv quad)) + (vector-copy! (-> s5-1 0 uvec) (-> (the-as process-focusable v1-8) root trans)) + (vector-copy! (-> s5-1 0 fvec) (-> (the-as process-focusable v1-8) root transv)) (let ((f0-0 8192.0)) (.lvf vf1 (&-> (-> s5-1 0 fvec) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -369,8 +358,8 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov a0-14 vf1) (if (< f0-0 a0-14) - (set! (-> s5-1 0 trans quad) (-> s5-1 0 fvec quad)) - (set! (-> s5-1 0 trans quad) (-> (the-as process-focusable v1-8) node-list data 0 bone transform fvec quad)) + (vector-copy! (-> s5-1 0 trans) (-> s5-1 0 fvec)) + (vector-copy! (-> s5-1 0 trans) (-> (the-as process-focusable v1-8) node-list data 0 bone transform fvec)) ) ) (set! (-> s5-1 0 trans y) 0.0) @@ -443,7 +432,7 @@ (cond (a1-20 (let ((v1-71 (new 'stack-no-clear 'matrix))) - (set! (-> v1-71 rvec quad) (-> (the-as process-focusable a1-20) root trans quad)) + (vector-copy! (-> v1-71 rvec) (-> (the-as process-focusable a1-20) root trans)) (cond ((and (< (-> this active-count) (-> this target-count)) (> (-> this reserve-count) 0) @@ -534,7 +523,7 @@ ;; definition for method 15 of type was-squad-manager ;; WARN: Return type mismatch int vs none. (defmethod was-squad-manager-method-15 ((this was-squad-manager)) - (if (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (if (= (level-status? *level* 'desert #f) 'active) (update (-> this squad)) ) 0 diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-fox_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-fox_REF.gc index 5e9873fa1ae..f1ee551fc7a 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-fox_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-fox_REF.gc @@ -80,7 +80,7 @@ (setup-masks (-> this draw) 2 0) (set! (-> this shoot-delay) (the-as uint 18)) (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) - (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0)) (set! (-> this rider-hand-joint-array 0) 8) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) @@ -131,7 +131,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc index 3d6a09becc8..d9358165c0c 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-mirage_REF.gc @@ -31,18 +31,7 @@ (set! (-> gp-1 vec10 y) 204800.0) (set! (-> gp-1 vec10 z) 409600.0) (set! (-> gp-1 vec10 w) 163840.0) - (let* ((v1-9 (-> gp-1 mat0)) - (a3-1 (-> this rbody matrix)) - (a0-4 (-> a3-1 rvec quad)) - (a1-1 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-9 rvec quad) a0-4) - (set! (-> v1-9 uvec quad) a1-1) - (set! (-> v1-9 fvec quad) a2-1) - (set! (-> v1-9 trans quad) a3-2) - ) + (matrix-copy! (-> gp-1 mat0) (-> this rbody matrix)) (let ((v1-10 (new 'static 'inline-array vector 2 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) @@ -55,7 +44,7 @@ (vector-reset! (-> gp-1 vec4)) (set! (-> gp-1 vec4 z) (-> gp-1 vec10 y)) (set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y))) - (set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad)) + (vector-copy! (-> gp-1 vec8) (-> gp-1 mat0 fvec)) (vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x))) (vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x))) (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) @@ -82,8 +71,8 @@ ) ) (when s4-2 - (set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad)) - (set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad)) + (vector-copy! (-> gp-1 vec6) (get-trans s4-2 3)) + (vector-copy! (-> gp-1 vec7) (get-transv s4-2)) (vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y)) (vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0)) (set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) @@ -108,7 +97,7 @@ (set! (-> gp-1 params options) (projectile-options)) (logclear! (-> gp-1 params options) (projectile-options po14 po15 po16)) (set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad)) - (set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad)) + (vector-copy! (-> gp-1 params vel) (-> gp-1 vec2)) (set! (-> gp-1 params notify-handle) (the-as handle #f)) (set! (-> gp-1 params owner-handle) (process->handle this)) (set! (-> gp-1 params target-handle) (the-as handle #f)) @@ -187,7 +176,7 @@ (alloc-rbody-control! this *v-mirage-constants*) (set! (-> this shoot-delay) (the-as uint 240)) (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) - (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0)) (set! (-> this rider-hand-joint-array 0) 17) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc index 11e5cb16997..a3916fd6ffa 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-projectiles_REF.gc @@ -61,7 +61,7 @@ ) (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) - (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (vector-copy! (-> a1-7 fvec) s2-0) (matrix->eul (the-as euler-angles s1-0) a1-7 21) (vector-negate! s3-2 s1-0) (let ((a0-15 s3-2)) @@ -82,11 +82,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 228 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 228)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 228)) ) ) @@ -147,7 +147,7 @@ (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) (move-by-vector! arg0 a1-1) ) - (set! (-> (the-as v-scorp-shot (-> arg0 process)) collide-normal quad) (-> arg1 best-other-tri normal quad)) + (vector-copy! (-> (the-as v-scorp-shot (-> arg0 process)) collide-normal) (-> arg1 best-other-tri normal)) (let* ((s5-1 (-> arg1 best-other-tri collide-ptr)) (v1-7 (if (type? s5-1 collide-shape-prim) s5-1 @@ -222,8 +222,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this v-scorp-shot)) (with-pp - (set! (-> this init-pos quad) (-> this root trans quad)) - (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) + (vector-copy! (-> this init-dir) (-> this starting-dir)) (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 491520.0 (-> pp clock frames-per-second))) (set! (-> this attack-mode) 'eco-blue) (set! (-> this max-speed) (* 491520.0 (-> pp clock frames-per-second))) @@ -314,7 +314,7 @@ (a1-4 (-> *part-id-table* 855)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -363,7 +363,7 @@ (f28-0 (-> *part-id-table* 982 init-specs 5 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 982 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 982 init-specs 5 initial-valuef) (* f26-0 f28-0)) (launch-particles (-> *part-id-table* 982) s4-1 :origin-is-matrix #t) @@ -384,27 +384,27 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) (v1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-1 quad) (-> s5-0 trans quad)) + (vector-copy! v1-1 (-> s5-0 trans)) (vector+! v1-1 v1-1 a0-3) (cond ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) ) ) ) ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-1 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) ) ) @@ -589,7 +589,7 @@ (set! (-> v1-13 y) 2.0) (set! (-> v1-13 z) 2.0) (set! (-> v1-13 w) 1.0) - (set! (-> this root scale quad) (-> v1-13 quad)) + (vector-copy! (-> this root scale) v1-13) ) (let ((s5-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) (set! (-> s5-1 tracked-obj) (process->handle this)) @@ -649,7 +649,7 @@ :virtual #t :code (behavior () (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) (-> self blast-radius)) (set! (-> gp-0 scale) 2.0) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc index 3ab630ade07..9b950c9d973 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-rhino_REF.gc @@ -32,18 +32,7 @@ (set! (-> this shoot-time) (the-as uint (current-time))) (set! (-> this gun-kick) 1638.4) (let ((gp-0 (new 'stack-no-clear 'wcar-rhino-proj-params))) - (let* ((v1-3 (-> gp-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-3 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-3 rvec quad) a0-3) - (set! (-> v1-3 uvec quad) a1-0) - (set! (-> v1-3 fvec quad) a2-0) - (set! (-> v1-3 trans quad) a3-1) - ) + (matrix-copy! (-> gp-0 mat) (-> this node-list data 0 bone transform)) (vector-matrix*! (-> gp-0 gun-local-pos) (-> this gun-local-pos) (-> gp-0 mat)) (vector-rotate*! (-> gp-0 gun-local-dir) (-> this gun-local-dir) (-> gp-0 mat)) (vector-float*! (-> gp-0 gun-dir) (-> gp-0 gun-local-dir) 409600.0) @@ -52,7 +41,7 @@ (set! (-> gp-0 params options) (projectile-options)) (logclear! (-> gp-0 params options) (projectile-options po14 po15 po16)) (set! (-> gp-0 params pos quad) (-> gp-0 gun-local-pos quad)) - (set! (-> gp-0 params vel quad) (-> gp-0 gun-dir quad)) + (vector-copy! (-> gp-0 params vel) (-> gp-0 gun-dir)) (set! (-> gp-0 params notify-handle) (the-as handle #f)) (set! (-> gp-0 params owner-handle) (process->handle this)) (set! (-> gp-0 params target-handle) (the-as handle #f)) @@ -173,7 +162,7 @@ 16 ) ) - (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 6553.6 :z 14745.6 :w 1.0) quad)) + (vector-copy! (-> this turret-local-pos) (new 'static 'vector :y 6553.6 :z 14745.6 :w 1.0)) ((method-of-type wcar-base vehicle-method-62) this) 0 (none) @@ -248,7 +237,7 @@ (set! (-> this rider-hand-joint-array 0) 8) (init (-> this jmod-gun-turn) this (the-as uint 9) (joint-mod-base-flags attached)) (init (-> this jmod-gun-kick) this (the-as uint 10) (joint-mod-base-flags attached trans)) - (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 10485.76 :z 12288.0 :w 1.0) quad)) + (vector-copy! (-> this turret-local-pos) (new 'static 'vector :y 10485.76 :z 12288.0 :w 1.0)) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) this diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc index a4309a56879..f1e200901e2 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-scorpion_REF.gc @@ -146,18 +146,7 @@ (set! (-> this shoot-time) (the-as uint (current-time))) (set! (-> this gun-kick) 1638.4) (let ((gp-0 (new 'stack-no-clear 'wcar-rhino-proj-params))) - (let* ((v1-3 (-> gp-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-3 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-3 rvec quad) a0-3) - (set! (-> v1-3 uvec quad) a1-0) - (set! (-> v1-3 fvec quad) a2-0) - (set! (-> v1-3 trans quad) a3-1) - ) + (matrix-copy! (-> gp-0 mat) (-> this node-list data 0 bone transform)) (vector-matrix*! (-> gp-0 gun-local-pos) (-> this gun-local-pos) (-> gp-0 mat)) (vector-rotate*! (-> gp-0 gun-local-dir) (-> this gun-local-dir) (-> gp-0 mat)) (vector-float*! (-> gp-0 gun-dir) (-> gp-0 gun-local-dir) 409600.0) @@ -166,7 +155,7 @@ (set! (-> gp-0 params options) (projectile-options)) (logclear! (-> gp-0 params options) (projectile-options po14 po15 po16)) (set! (-> gp-0 params pos quad) (-> gp-0 gun-local-pos quad)) - (set! (-> gp-0 params vel quad) (-> gp-0 gun-dir quad)) + (vector-copy! (-> gp-0 params vel) (-> gp-0 gun-dir)) (set! (-> gp-0 params notify-handle) (the-as handle #f)) (set! (-> gp-0 params owner-handle) (process->handle this)) (set! (-> gp-0 params target-handle) (the-as handle #f)) @@ -185,7 +174,7 @@ (set! (-> v1-23 initial-valuef) (+ -20480.0 (-> gp-0 gun-local-pos y))) ) ) - (set! (-> gp-0 mat fvec quad) (-> gp-0 gun-local-dir quad)) + (vector-copy! (-> gp-0 mat fvec) (-> gp-0 gun-local-dir)) (vector-cross! (the-as vector (-> gp-0 mat)) (-> gp-0 mat uvec) (-> gp-0 mat fvec)) (vector+float*! (-> gp-0 mat trans) (-> gp-0 gun-local-pos) (-> gp-0 gun-local-dir) -12288.0) (if (logtest? (-> *part-group-id-table* 227 flags) (sp-group-flag sp13)) @@ -257,33 +246,22 @@ ) ) (let ((s5-1 (new 'stack-no-clear 'wvehicle-physics-work))) - (let* ((v1-20 (-> s5-1 mat)) - (a3-4 (-> this node-list data 0 bone transform)) - (a0-15 (-> a3-4 rvec quad)) - (a1-6 (-> a3-4 uvec quad)) - (a2-6 (-> a3-4 fvec quad)) - (a3-5 (-> a3-4 trans quad)) - ) - (set! (-> v1-20 rvec quad) a0-15) - (set! (-> v1-20 uvec quad) a1-6) - (set! (-> v1-20 fvec quad) a2-6) - (set! (-> v1-20 trans quad) a3-5) - ) - (set! (-> s5-1 force quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0) quad)) - (set! (-> s5-1 velocity quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0) quad)) - (set! (-> s5-1 world-pos quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0) quad)) - (set! (-> s5-1 world-normal quad) (-> (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0) quad)) + (matrix-copy! (-> s5-1 mat) (-> this node-list data 0 bone transform)) + (vector-copy! (-> s5-1 force) (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0)) + (vector-copy! (-> s5-1 velocity) (new 'static 'vector :x 7905.28 :y 5324.8 :z 5120.0 :w 1.0)) + (vector-copy! (-> s5-1 world-pos) (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0)) + (vector-copy! (-> s5-1 world-normal) (new 'static 'vector :x 7905.28 :y 5324.8 :z -6635.52 :w 1.0)) (set-vector! (-> s5-1 local-pos) 27670.756 27670.756 28398.934 28398.934) (dotimes (s4-1 4) (let ((s3-0 (-> this wheel s4-1))) (let ((v1-29 (-> s3-0 info))) (set! (-> s5-1 ground-pos x) (+ -3276.8 (-> v1-29 susp-arm-length))) (set! (-> s5-1 tmp quad) (-> (the-as (pointer uint128) (+ (+ (* s4-1 16) 64) (the-as int s5-1))))) - (set! (-> s5-1 steering-axis quad) (-> v1-29 local-pos quad)) + (vector-copy! (-> s5-1 steering-axis) (-> v1-29 local-pos)) ) (+! (-> s5-1 steering-axis x) (* (-> s5-1 ground-pos x) (-> s3-0 cos-susp-ang))) (+! (-> s5-1 steering-axis y) (* (-> s5-1 ground-pos x) (-> s3-0 sin-susp-ang))) - (set! (-> s5-1 p-body quad) (-> s5-1 steering-axis quad)) + (vector-copy! (-> s5-1 p-body) (-> s5-1 steering-axis)) (set! (-> s5-1 p-body x) (* (-> s5-1 p-body x) (-> s3-0 x-scale))) (set! (-> s5-1 tmp x) (* (-> s5-1 tmp x) (-> s3-0 x-scale))) (vector-! (-> s5-1 axis) (-> s5-1 p-body) (-> s5-1 tmp)) @@ -334,7 +312,7 @@ (init (-> this jmod-axles 1) this (the-as uint 15) (joint-mod-base-flags attached)) (init (-> this jmod-axles 2) this (the-as uint 8) (joint-mod-base-flags attached)) (init (-> this jmod-axles 3) this (the-as uint 16) (joint-mod-base-flags attached)) - (set! (-> this turret-local-pos quad) (-> (new 'static 'vector :y 10485.76 :z -10240.0 :w 1.0) quad)) + (vector-copy! (-> this turret-local-pos) (new 'static 'vector :y 10485.76 :z -10240.0 :w 1.0)) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-shock-tops)) this diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-snake_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-snake_REF.gc index 741152ee2f8..1fad2ce38bd 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-snake_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-snake_REF.gc @@ -80,7 +80,7 @@ (alloc-rbody-control! this *v-snake-constants*) (set! (-> this shoot-delay) (the-as uint 18)) (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) - (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) quad)) + (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0)) (set! (-> this rider-hand-joint-array 0) 17) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) @@ -131,7 +131,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc index 9cdfe8831a3..535568ae32d 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-toad_REF.gc @@ -40,18 +40,7 @@ (set! (-> gp-1 vec10 y) 204800.0) (set! (-> gp-1 vec10 z) 409600.0) (set! (-> gp-1 vec10 w) 163840.0) - (let* ((v1-9 (-> gp-1 mat0)) - (a3-1 (-> this rbody matrix)) - (a0-4 (-> a3-1 rvec quad)) - (a1-1 (-> a3-1 uvec quad)) - (a2-1 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-9 rvec quad) a0-4) - (set! (-> v1-9 uvec quad) a1-1) - (set! (-> v1-9 fvec quad) a2-1) - (set! (-> v1-9 trans quad) a3-2) - ) + (matrix-copy! (-> gp-1 mat0) (-> this rbody matrix)) (let ((v1-10 (new 'static 'inline-array vector 2 (new 'static 'vector :x 2048.0 :y 7372.8 :z 6144.0 :w 1.0) (new 'static 'vector :x -2048.0 :y 7372.8 :z 6144.0 :w 1.0) @@ -64,7 +53,7 @@ (vector-reset! (-> gp-1 vec4)) (set! (-> gp-1 vec4 z) (-> gp-1 vec10 y)) (set! (-> gp-1 vec4 y) (* 0.2678 (-> gp-1 vec10 y))) - (set! (-> gp-1 vec8 quad) (-> gp-1 mat0 fvec quad)) + (vector-copy! (-> gp-1 vec8) (-> gp-1 mat0 fvec)) (vector-float*! (-> gp-1 vec9) (-> gp-1 vec8) (- (-> gp-1 vec10 z) (-> gp-1 vec10 x))) (vector+float*! (-> gp-1 vec3) (-> gp-1 vec0) (-> gp-1 vec8) (+ 32768.0 (-> gp-1 vec10 x))) (let ((s4-1 (new 'stack 'boxed-array collide-shape 128))) @@ -91,8 +80,8 @@ ) ) (when s4-2 - (set! (-> gp-1 vec6 quad) (-> (get-trans s4-2 3) quad)) - (set! (-> gp-1 vec7 quad) (-> (get-transv s4-2) quad)) + (vector-copy! (-> gp-1 vec6) (get-trans s4-2 3)) + (vector-copy! (-> gp-1 vec7) (get-transv s4-2)) (vector+float*! (-> gp-1 vec2) (-> this rbody lin-velocity) (-> gp-1 vec8) (-> gp-1 vec10 y)) (vector-! (-> gp-1 vec5) (-> gp-1 vec6) (-> gp-1 vec0)) (set! (-> gp-1 vec11 x) (vector-dot (-> gp-1 vec8) (-> gp-1 vec5))) @@ -117,7 +106,7 @@ (set! (-> gp-1 params options) (projectile-options)) (logclear! (-> gp-1 params options) (projectile-options po14 po15 po16)) (set! (-> gp-1 params pos quad) (-> gp-1 vec0 quad)) - (set! (-> gp-1 params vel quad) (-> gp-1 vec2 quad)) + (vector-copy! (-> gp-1 params vel) (-> gp-1 vec2)) (set! (-> gp-1 params notify-handle) (the-as handle #f)) (set! (-> gp-1 params owner-handle) (process->handle this)) (set! (-> gp-1 params target-handle) (the-as handle #f)) @@ -295,25 +284,14 @@ (set-vector! (-> gp-0 p-body) 1.0 0.0 0.0 1.0) (set-vector! (-> gp-0 axis) 0.0 1.0 0.0 1.0) (quaternion-copy! (the-as quaternion (-> gp-0 world-normal)) (-> this root quat)) - (let* ((v1-3 (-> gp-0 mat)) - (a3-0 (-> this rbody matrix)) - (a0-7 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-3 rvec quad) a0-7) - (set! (-> v1-3 uvec quad) a1-2) - (set! (-> v1-3 fvec quad) a2-1) - (set! (-> v1-3 trans quad) a3-1) - ) + (matrix-copy! (-> gp-0 mat) (-> this rbody matrix)) (set! (-> gp-0 wsphere y) (* (-> arg1 radius) (-> arg1 scale))) (set! (-> gp-0 wsphere z) 13590.528) (set! (-> gp-0 wsphere r) 0.0) (set! (-> gp-0 friction-coef) (+ (-> gp-0 wsphere r) (* 2.0 (asin (/ (/ (-> arg1 travel) 2) (-> gp-0 wsphere z))))) ) - (set! (-> gp-0 steering-axis quad) (-> (new 'static 'vector :x 10649.6 :y 2662.4 :z 7618.56 :w 1.0) quad)) + (vector-copy! (-> gp-0 steering-axis) (new 'static 'vector :x 10649.6 :y 2662.4 :z 7618.56 :w 1.0)) (set-vector! (-> gp-0 ground-pos) 0.0 @@ -322,7 +300,7 @@ 1.0 ) (vector-normalize! (-> gp-0 ground-pos) 1.0) - (set! (-> gp-0 tmp quad) (-> gp-0 steering-axis quad)) + (vector-copy! (-> gp-0 tmp) (-> gp-0 steering-axis)) (+! (-> gp-0 tmp z) (* (-> gp-0 wsphere z) (cos (-> gp-0 wsphere r)))) (+! (-> gp-0 tmp y) (* -1.0 (sin (-> gp-0 wsphere r)) (-> gp-0 wsphere z))) (set! (-> gp-0 tmp y) (- (-> gp-0 tmp y) (-> gp-0 wsphere y))) @@ -333,8 +311,8 @@ (-> arg0 local-axis) (* (-> arg1 steer-arm-length) (-> arg0 x-scale)) ) - (set! (-> arg0 probe-local-pos quad) (-> gp-0 tmp quad)) - (set! (-> arg0 probe-local-dir quad) (-> gp-0 ground-pos quad)) + (vector-copy! (-> arg0 probe-local-pos) (-> gp-0 tmp)) + (vector-copy! (-> arg0 probe-local-dir) (-> gp-0 ground-pos)) (vector-matrix*! (-> gp-0 side-dir) (-> gp-0 tmp) (-> gp-0 mat)) (vector-rotate*! (-> gp-0 forward-dir) (-> gp-0 ground-pos) (-> gp-0 mat)) (set! (-> gp-0 wsphere x) @@ -369,7 +347,7 @@ (the-as quaternion (-> gp-0 force)) ) ) - (set! (-> gp-0 dir quad) (-> gp-0 steering-axis quad)) + (vector-copy! (-> gp-0 dir) (-> gp-0 steering-axis)) (+! (-> gp-0 dir z) (* (-> gp-0 wsphere z) (-> arg0 cos-susp-ang))) (+! (-> gp-0 dir y) (* -1.0 (-> arg0 sin-susp-ang) (-> gp-0 wsphere z))) (set! (-> gp-0 dir x) (* (-> gp-0 dir x) (-> arg0 x-scale))) @@ -393,7 +371,7 @@ (the-as quaternion (-> gp-0 velocity)) ) (quaternion*! (-> arg0 quat) (the-as quaternion (-> gp-0 world-normal)) (the-as quaternion (-> gp-0 force))) - (set! (-> arg0 trans quad) (-> gp-0 ground-normal-sum quad)) + (vector-copy! (-> arg0 trans) (-> gp-0 ground-normal-sum)) ) 0 (none) @@ -440,31 +418,20 @@ ) ) (let ((s5-2 (new 'stack-no-clear 'wvehicle-physics-work))) - (let* ((v1-19 (-> s5-2 mat)) - (a3-3 (-> this node-list data 0 bone transform)) - (a0-12 (-> a3-3 rvec quad)) - (a1-5 (-> a3-3 uvec quad)) - (a2-4 (-> a3-3 fvec quad)) - (a3-4 (-> a3-3 trans quad)) - ) - (set! (-> v1-19 rvec quad) a0-12) - (set! (-> v1-19 uvec quad) a1-5) - (set! (-> v1-19 fvec quad) a2-4) - (set! (-> v1-19 trans quad) a3-4) - ) - (set! (-> s5-2 force quad) (-> (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0) quad)) - (set! (-> s5-2 velocity quad) (-> (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0) quad)) + (matrix-copy! (-> s5-2 mat) (-> this node-list data 0 bone transform)) + (vector-copy! (-> s5-2 force) (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0)) + (vector-copy! (-> s5-2 velocity) (new 'static 'vector :x 8806.4 :y 5324.8 :z -11878.4 :w 1.0)) (set-vector! (-> s5-2 local-pos) 32768.0 32768.0 0.0 0.0) (dotimes (s4-2 2) (let ((v1-26 (-> this wheel (+ s4-2 2)))) (let ((a0-20 (-> v1-26 info))) (set! (-> s5-2 ground-pos y) (+ -2048.0 (-> a0-20 susp-arm-length))) (set! (-> s5-2 tmp quad) (-> (the-as (pointer uint128) (+ (+ (* s4-2 16) 64) (the-as int s5-2))))) - (set! (-> s5-2 steering-axis quad) (-> a0-20 local-pos quad)) + (vector-copy! (-> s5-2 steering-axis) (-> a0-20 local-pos)) ) (+! (-> s5-2 steering-axis x) (* (-> s5-2 ground-pos y) (-> v1-26 cos-susp-ang))) (+! (-> s5-2 steering-axis y) (* (-> s5-2 ground-pos y) (-> v1-26 sin-susp-ang))) - (set! (-> s5-2 p-body quad) (-> s5-2 steering-axis quad)) + (vector-copy! (-> s5-2 p-body) (-> s5-2 steering-axis)) (set! (-> s5-2 p-body x) (* (-> s5-2 p-body x) (-> v1-26 x-scale))) (set! (-> s5-2 tmp x) (* (-> s5-2 tmp x) (-> v1-26 x-scale))) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc index df17bbc67c5..9ea7e3f4e64 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-turtle_REF.gc @@ -166,7 +166,7 @@ (vector-matrix*! (-> s5-1 mat uvec) (new 'static 'vector :y 20480.0 :z -8192.0 :w 1.0) (-> this rbody matrix)) (rigid-body-control-method-23 (-> this rbody) (-> s5-1 mat uvec) (the-as vector (-> s5-1 mat))) (vector-! (-> s5-1 mat fvec) (the-as vector (-> s5-1 mat)) (-> this ant-tip-vel)) - (set! (-> this ant-tip-vel quad) (-> s5-1 mat rvec quad)) + (vector-copy! (-> this ant-tip-vel) (-> s5-1 mat rvec)) (vector-float*! (-> s5-1 mat fvec) (-> s5-1 mat fvec) (/ 1.0 (-> s5-1 mat trans x))) (vector+float*! (-> this spring-vel) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-x-ride_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-x-ride_REF.gc index 7abf851baee..f6a5c530d53 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-x-ride_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar-x-ride_REF.gc @@ -80,7 +80,7 @@ (alloc-rbody-control! this *v-x-ride-constants*) (set! (-> this shoot-delay) (the-as uint 18)) (set! (-> this local-gun-pos 0 quad) (-> (new 'static 'vector :x 2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) - (set! (-> this local-gun-pos 1 quad) (-> (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0) quad)) + (vector-copy! (-> this local-gun-pos 1) (new 'static 'vector :x -2048.0 :y 3686.4 :z 14336.0 :w 1.0)) (set! (-> this rider-hand-joint-array 0) 8) ((method-of-type joint-mod-rotate-local init) (the-as joint-mod-rotate-local (-> this jmod-axles)) @@ -131,7 +131,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc index fde5cf13cb4..0cf8cdf5c3f 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wcar_REF.gc @@ -3862,25 +3862,14 @@ (set! (-> s5-0 vec0 7 w) 0.3419) (set! (-> s5-0 vec0 7 z) -0.1736) ) - (let* ((v1-13 (-> s5-0 mat0)) - (a3-0 (-> this rbody matrix)) - (a0-4 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-13 rvec quad) a0-4) - (set! (-> v1-13 uvec quad) a1-0) - (set! (-> v1-13 fvec quad) a2-0) - (set! (-> v1-13 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat0) (-> this rbody matrix)) (new 'static 'inline-array vector 2 (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) ) (vector-matrix*! (the-as vector (-> s5-0 vec0)) (-> this local-gun-pos (-> s5-0 barrel-idx)) (-> s5-0 mat0)) 0 - (set! (-> s5-0 vec0 2 quad) (-> (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0) quad)) + (vector-copy! (-> s5-0 vec0 2) (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0)) (vector-rotate*! (-> s5-0 vec0 3) (-> s5-0 vec0 2) (-> s5-0 mat0)) (vector-float*! (-> s5-0 vec0 4) (-> s5-0 vec0 3) (- (-> s5-0 vec0 7 y) (-> s5-0 vec0 7 x))) (vector+float*! @@ -3913,7 +3902,7 @@ ) ) (when a0-14 - (set! (-> s5-0 vec0 6 quad) (-> (get-trans a0-14 3) quad)) + (vector-copy! (-> s5-0 vec0 6) (get-trans a0-14 3)) (vector-! (-> s5-0 vec0 5) (-> s5-0 vec0 6) (the-as vector (-> s5-0 vec0))) (matrix-transpose! (-> s5-0 mat1) (-> s5-0 mat0)) (vector-matrix*! (-> s5-0 vec0 2) (-> s5-0 vec0 5) (-> s5-0 mat1)) @@ -3949,7 +3938,7 @@ (set! (-> s5-0 params options) (projectile-options)) (logclear! (-> s5-0 params options) (projectile-options po14 po15 po16)) (set! (-> s5-0 params pos quad) (-> s5-0 vec0 0 quad)) - (set! (-> s5-0 params vel quad) (-> s5-0 vec0 4 quad)) + (vector-copy! (-> s5-0 params vel) (-> s5-0 vec0 4)) (set! (-> s5-0 params notify-handle) (the-as handle #f)) (set! (-> s5-0 params owner-handle) (process->handle this)) (set! (-> s5-0 params target-handle) (the-as handle #f)) @@ -4115,21 +4104,21 @@ (set! (-> v1-16 2 quad) a2-3) (set! (-> v1-16 3 quad) a3-3) ) - (set! (-> s5-1 vec0 4 quad) (-> (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0) quad)) - (set! (-> s5-1 vec0 5 quad) (-> (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0) quad)) - (set! (-> s5-1 vec0 6 quad) (-> (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0) quad)) - (set! (-> s5-1 vec0 7 quad) (-> (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0) quad)) + (vector-copy! (-> s5-1 vec0 4) (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0)) + (vector-copy! (-> s5-1 vec0 5) (new 'static 'vector :x 3768.32 :y 3686.4 :z 6758.4 :w 1.0)) + (vector-copy! (-> s5-1 vec0 6) (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0)) + (vector-copy! (-> s5-1 vec0 7) (new 'static 'vector :x 5816.32 :y 5242.88 :z -11960.32 :w 1.0)) (set-vector! (-> s5-1 vec0 8) 25486.223 25486.223 29127.111 29127.111) (dotimes (s4-1 4) (let ((s3-1 (-> this wheel s4-1))) (let ((v1-25 (-> s3-1 info))) (set! (-> s5-1 float0) (+ -2048.0 (-> v1-25 susp-arm-length))) (set! (-> s5-1 vec1 0 quad) (-> (the-as (pointer uint128) (+ (+ (* s4-1 16) 64) (the-as int s5-1))))) - (set! (-> s5-1 vec0 9 quad) (-> v1-25 local-pos quad)) + (vector-copy! (-> s5-1 vec0 9) (-> v1-25 local-pos)) ) (+! (-> s5-1 vec0 9 x) (* (-> s5-1 float0) (-> s3-1 cos-susp-ang))) (+! (-> s5-1 vec0 9 y) (* (-> s5-1 float0) (-> s3-1 sin-susp-ang))) - (set! (-> s5-1 vec1 1 quad) (-> s5-1 vec0 9 quad)) + (vector-copy! (-> s5-1 vec1 1) (-> s5-1 vec0 9)) (set! (-> s5-1 vec1 1 x) (* (-> s5-1 vec1 1 x) (-> s3-1 x-scale))) (set! (-> s5-1 vec1 0 x) (* (-> s5-1 vec1 0 x) (-> s3-1 x-scale))) (vector-! (-> s5-1 vec1 2) (-> s5-1 vec1 1) (the-as vector (-> s5-1 vec1))) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-ai_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-ai_REF.gc index 8dda8e7074f..d1c4821a786 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-ai_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-ai_REF.gc @@ -17,8 +17,8 @@ ) ) (when s5-2 - (set! (-> this target-status position quad) (-> (get-trans (the-as process-focusable s5-2) 3) quad)) - (set! (-> this target-status velocity quad) (-> (get-transv (the-as process-focusable s5-2)) quad)) + (vector-copy! (-> this target-status position) (get-trans (the-as process-focusable s5-2) 3)) + (vector-copy! (-> this target-status velocity) (get-transv (the-as process-focusable s5-2))) ) ) ((-> this control-hook) this) @@ -78,9 +78,9 @@ (set! (-> gp-0 friction-coef) (the-as float (current-time))) (vehicle-method-140 this) (set! (-> gp-0 mat rvec quad) (-> this rbody position quad)) - (set! (-> gp-0 mat uvec quad) (-> this rbody lin-velocity quad)) - (set! (-> gp-0 probe-dir quad) (-> this rbody matrix fvec quad)) - (set! (-> gp-0 steering-axis quad) (-> this rbody matrix rvec quad)) + (vector-copy! (-> gp-0 mat uvec) (-> this rbody lin-velocity)) + (vector-copy! (-> gp-0 probe-dir) (-> this rbody matrix fvec)) + (vector-copy! (-> gp-0 steering-axis) (-> this rbody matrix rvec)) (set! (-> gp-0 steering-axis y) 0.0) (set! (-> gp-0 side-dir z) (vector-length (-> gp-0 mat uvec))) (set! (-> gp-0 wheel-axis z) (vector-dot (-> gp-0 mat uvec) (-> gp-0 probe-dir))) @@ -119,10 +119,10 @@ (set! (-> gp-0 side-dir x) 1.0) (b! #t cfg-64 :delay (nop!)) (label cfg-39) - (set! (-> gp-0 force quad) (-> (the-as process-focusable a0-32) node-list data 0 bone transform fvec quad)) + (vector-copy! (-> gp-0 force) (-> (the-as process-focusable a0-32) node-list data 0 bone transform fvec)) ) - (set! (-> gp-0 mat fvec quad) (-> this target-status position quad)) - (set! (-> gp-0 mat trans quad) (-> this target-status velocity quad)) + (vector-copy! (-> gp-0 mat fvec) (-> this target-status position)) + (vector-copy! (-> gp-0 mat trans) (-> this target-status velocity)) (let* ((f0-11 40960.0) (f0-13 (* f0-11 f0-11)) ) @@ -134,7 +134,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-50 vf1) (if (< f0-13 v1-50) - (set! (-> gp-0 force quad) (-> gp-0 mat trans quad)) + (vector-copy! (-> gp-0 force) (-> gp-0 mat trans)) ) ) (set! (-> gp-0 wheel-axis x) @@ -144,10 +144,10 @@ (vector+float*! (-> gp-0 velocity) (-> gp-0 mat fvec) (-> gp-0 force) 81920.0) (vector+float*! (-> gp-0 velocity) (-> gp-0 velocity) (-> gp-0 mat trans) 0.5) (when (logtest? (vehicle-flag vf54) (-> this v-flags)) - (set! (-> gp-0 axis quad) (-> gp-0 mat rvec quad)) - (set! (-> gp-0 dir quad) (-> gp-0 mat uvec quad)) - (set! (-> gp-0 ground-normal-sum quad) (-> gp-0 mat fvec quad)) - (set! (-> gp-0 ground-pos quad) (-> gp-0 mat trans quad)) + (vector-copy! (-> gp-0 axis) (-> gp-0 mat rvec)) + (vector-copy! (-> gp-0 dir) (-> gp-0 mat uvec)) + (vector-copy! (-> gp-0 ground-normal-sum) (-> gp-0 mat fvec)) + (vector-copy! (-> gp-0 ground-pos) (-> gp-0 mat trans)) (set! (-> gp-0 axis y) 0.0) (set! (-> gp-0 dir y) 0.0) (set! (-> gp-0 ground-normal-sum y) 0.0) @@ -178,7 +178,7 @@ (label cfg-45) (cond ((= v1-38 2) - (set! (-> gp-0 velocity quad) (-> this ai-target-point quad)) + (vector-copy! (-> gp-0 velocity) (-> this ai-target-point)) (set! (-> gp-0 wheel-axis x) (-> this ai-max-speed)) ) ((zero? v1-38) @@ -203,7 +203,7 @@ ) (logclear! (-> a0-69 flags) (nav-state-flag directional-mode)) (logior! (-> a0-69 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-69 target-pos quad) (-> v1-92 quad)) + (vector-copy! (-> a0-69 target-pos) v1-92) ) 0 (let ((v1-95 (-> this nav))) @@ -211,7 +211,7 @@ ) 0 (let ((a1-22 (-> this nav state))) - (set! (-> gp-0 mat trans quad) (-> a1-22 velocity quad)) + (vector-copy! (-> gp-0 mat trans) (-> a1-22 velocity)) ) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-obs_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-obs_REF.gc index b932f6f183c..1db6276455b 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-obs_REF.gc @@ -338,8 +338,8 @@ (defmethod find-ground ((this turbo-pickup)) (let ((s4-0 #f)) (let ((gp-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> gp-0 vec0 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> gp-0 vec0) (-> this root trans)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec0)) (vector-reset! (-> gp-0 vec1)) (set! (-> gp-0 vec1 y) 1.0) (set-vector! (-> gp-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) @@ -356,13 +356,13 @@ (let ((f0-6 (fill-and-probe-using-line-sphere *collide-cache* (-> gp-0 cquery)))) (when (>= f0-6 0.0) (vector+float*! (-> gp-0 vec0) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f0-6) - (set! (-> gp-0 vec1 quad) (-> gp-0 cquery best-other-tri normal quad)) + (vector-copy! (-> gp-0 vec1) (-> gp-0 cquery best-other-tri normal)) (+! (-> gp-0 vec0 y) 4915.2) (set! s4-0 #t) (format #t "turbo-pickup::find-ground: ground y ~M~%" (-> gp-0 vec0 y)) ) ) - (set! (-> this root trans quad) (-> gp-0 vec0 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec0)) (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec1)) ) s4-0 @@ -463,7 +463,7 @@ (set! (-> s4-0 event-self) 'touched) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (update-transforms (-> self root)) (set! (-> self available) #t) @@ -500,7 +500,3 @@ (the-as turbo-pickup gp-0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-part_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-part_REF.gc index 0173be8c84d..712beeb3d41 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-part_REF.gc @@ -1057,7 +1057,7 @@ (set! (-> *toad-grenade-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *toad-grenade-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *toad-grenade-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *toad-grenade-trail* use-tape-mode?) #f) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc index 389f8dd9fa3..0f31cbf9690 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc @@ -241,7 +241,7 @@ (vector-! (-> arg1 velocity) (-> arg1 velocity) (-> this surface-velocity)) ) (let ((s0-0 (the-as object (+ (+ (* 144 s3-1) 416) (the-as int arg1))))) - (set! (-> arg1 probe-work-array 0 local-normal quad) (-> (the-as wvehicle-physics-work s0-0) force quad)) + (vector-copy! (-> arg1 probe-work-array 0 local-normal) (-> (the-as wvehicle-physics-work s0-0) force)) (vector+float*! (-> (the-as wvehicle-physics-work s0-0) velocity) (-> arg1 probe-work-array 0 local-normal) @@ -255,15 +255,18 @@ (-> s2-1 ground-normal) ) (vector-normalize! (-> (the-as wvehicle-physics-work s0-0) world-pos) 1.0) - (set! (-> (the-as wvehicle-physics-work arg1) forward-dir quad) - (-> (the-as wvehicle-physics-work s0-0) world-pos quad) - ) - (set! (-> (the-as wvehicle-physics-work arg1) side-dir quad) - (-> (the-as wvehicle-physics-work s0-0) velocity quad) - ) - (set! (-> (the-as wvehicle-physics-work s0-0) world-normal quad) - (-> (the-as wvehicle-physics-work arg1) velocity quad) - ) + (vector-copy! + (-> (the-as wvehicle-physics-work arg1) forward-dir) + (-> (the-as wvehicle-physics-work s0-0) world-pos) + ) + (vector-copy! + (-> (the-as wvehicle-physics-work arg1) side-dir) + (-> (the-as wvehicle-physics-work s0-0) velocity) + ) + (vector-copy! + (-> (the-as wvehicle-physics-work s0-0) world-normal) + (-> (the-as wvehicle-physics-work arg1) velocity) + ) ) (set! (-> s2-1 side-vel) (vector-dot @@ -413,11 +416,11 @@ (when (< 0.0 (-> s1-2 up-force)) (set! (-> arg1 probe-work-array 0 world-normal y) (* (-> s2-2 scale) (-> s2-2 radius))) (let ((v1-138 (-> (the-as wvehicle-physics-work arg1) probe-work-array s3-2))) - (set! (-> (the-as wvehicle-physics-work arg1) forward-dir quad) (-> v1-138 forward-dir quad)) - (set! (-> (the-as wvehicle-physics-work arg1) side-dir quad) (-> v1-138 side-dir quad)) - (set! (-> (the-as wvehicle-physics-work arg1) velocity quad) (-> v1-138 velocity quad)) + (vector-copy! (-> (the-as wvehicle-physics-work arg1) forward-dir) (-> v1-138 forward-dir)) + (vector-copy! (-> (the-as wvehicle-physics-work arg1) side-dir) (-> v1-138 side-dir)) + (vector-copy! (-> (the-as wvehicle-physics-work arg1) velocity) (-> v1-138 velocity)) ) - (set! (-> (the-as wvehicle-physics-work arg1) ground-pos quad) (-> s1-2 ground-pos quad)) + (vector-copy! (-> (the-as wvehicle-physics-work arg1) ground-pos) (-> s1-2 ground-pos)) (vector-! (-> (the-as wvehicle-physics-work arg1) p-body) (-> (the-as wvehicle-physics-work arg1) ground-pos) @@ -544,7 +547,7 @@ ) (cond ((< f0-13 (* f1-10 f1-10)) - (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (vector-copy! (-> gp-0 local-pos) (-> s4-0 info cm-offset-joint)) (+! (-> gp-0 local-pos z) 4096.0) (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) (vector-reset! (-> gp-0 force)) @@ -554,7 +557,7 @@ (rigid-body-control-method-22 s5-0 (-> gp-0 world-pos) (-> gp-0 force)) ) (else - (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (vector-copy! (-> gp-0 local-pos) (-> s4-0 info cm-offset-joint)) (+! (-> gp-0 local-pos y) 4096.0) (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) (vector-reset! (-> gp-0 force)) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-race_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-race_REF.gc index 19bb906892c..deb71c587c8 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-race_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-race_REF.gc @@ -152,22 +152,11 @@ (vector-reset! (-> s4-0 ang-momentum)) (rigid-body-control-method-26 s4-0) (init-velocities! s4-0) - (set! (-> this root transv quad) (-> s4-0 lin-velocity quad)) + (vector-copy! (-> this root transv) (-> s4-0 lin-velocity)) (quaternion-copy! (-> this root quat) (the-as quaternion (-> s4-0 rot))) (rigid-body-control-method-25 s4-0 (-> this root trans)) - (let* ((v1-54 (-> this node-list data 0 bone transform)) - (a3-1 (-> s4-0 matrix)) - (a0-21 (-> a3-1 rvec quad)) - (a1-16 (-> a3-1 uvec quad)) - (a2-5 (-> a3-1 fvec quad)) - (a3-2 (-> a3-1 trans quad)) - ) - (set! (-> v1-54 rvec quad) a0-21) - (set! (-> v1-54 uvec quad) a1-16) - (set! (-> v1-54 fvec quad) a2-5) - (set! (-> v1-54 trans quad) a3-2) - ) - (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (matrix-copy! (-> this node-list data 0 bone transform) (-> s4-0 matrix)) + (vector-copy! (-> this node-list data 0 bone transform trans) (-> this root trans)) (race-control-method-11 s5-0 (* f30-0 f28-0)) ) ) @@ -207,13 +196,13 @@ ) (mem-set32! (the-as pointer (-> gp-0 vec11)) 6 0) (set! (-> gp-0 time) (the-as uint (current-time))) - (set! (-> gp-0 vec0 quad) (-> this rbody position quad)) - (set! (-> gp-0 vec1 quad) (-> this rbody lin-velocity quad)) + (vector-copy! (-> gp-0 vec0) (-> this rbody position)) + (vector-copy! (-> gp-0 vec1) (-> this rbody lin-velocity)) (set! (-> gp-0 float5) 0.0) - (set! (-> gp-0 vec8 quad) (-> this rbody matrix rvec quad)) + (vector-copy! (-> gp-0 vec8) (-> this rbody matrix rvec)) (set! (-> gp-0 vec8 y) 0.0) (vector-normalize! (-> gp-0 vec8) 1.0) - (set! (-> gp-0 vec9 quad) (-> this rbody matrix fvec quad)) + (vector-copy! (-> gp-0 vec9) (-> this rbody matrix fvec)) (set! (-> gp-0 vec13 x) (* (-> this rbody ang-velocity y) (vector-length (-> this rbody lin-velocity)))) (set! (-> gp-0 float1) (seconds-per-frame)) (set! (-> gp-0 float8) (vector-dot (-> gp-0 vec1) (-> gp-0 vec9))) @@ -257,9 +246,9 @@ (let ((v1-60 (handle->process (-> s3-0 racer-array s2-0 racer)))) (when v1-60 (when (!= v1-60 this) - (set! (-> gp-0 vec2 quad) (-> (the-as process-drawable v1-60) root trans quad)) - (set! (-> gp-0 vec3 quad) (-> (the-as process-drawable v1-60) root transv quad)) - (set! (-> gp-0 vec4 quad) (-> (the-as process-drawable v1-60) rbody matrix fvec quad)) + (vector-copy! (-> gp-0 vec2) (-> (the-as process-drawable v1-60) root trans)) + (vector-copy! (-> gp-0 vec3) (-> (the-as process-drawable v1-60) root transv)) + (vector-copy! (-> gp-0 vec4) (-> (the-as process-drawable v1-60) rbody matrix fvec)) (set! (-> gp-0 float6) (nearest-dist2-between-moving-points (-> gp-0 vec0) (-> gp-0 vec1) (-> gp-0 vec2) (-> gp-0 vec3) 0.5) ) @@ -435,7 +424,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod wvehicle-method-182 ((this wvehicle)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) - (set! (-> s5-0 0 quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 0) (-> this rbody position)) (set! (-> this camera-dist2) (vector-vector-distance-squared (-> s5-0 0) (camera-pos))) (let ((s4-1 vector-vector-distance-squared) (s5-1 (-> s5-0 0)) @@ -461,7 +450,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod wvehicle-method-185 ((this wvehicle)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) - (set! (-> s5-0 0 quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 0) (-> this rbody position)) (set! (-> this camera-dist2) (vector-vector-distance-squared (-> s5-0 0) (camera-pos))) (let ((s4-1 vector-vector-distance-squared) (s5-1 (-> s5-0 0)) @@ -510,7 +499,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc index ee1769c0e5b..d39cc69ebec 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-states_REF.gc @@ -110,7 +110,7 @@ (init-velocities! gp-1) ) (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) @@ -168,7 +168,7 @@ (set-time! (-> self state-time)) (set! (-> self v-flags) (the-as vehicle-flag (logclear (-> self v-flags) (vehicle-flag rammed-target)))) (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 4096.0) (set! (-> gp-0 scale) (/ (-> self draw bounds w) 11264)) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-util_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-util_REF.gc index 33c6149cba2..1087478e79d 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-util_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-util_REF.gc @@ -593,7 +593,7 @@ (defmethod spawn-wheels! ((this wvehicle) (arg0 skeleton-group) (arg1 skeleton-group) (arg2 skeleton-group) (arg3 skeleton-group)) (local-vars (sv-96 vehicle-wheel-state)) (let ((s1-0 (new 'stack-no-clear 'vehicle-wheel-init-params))) - (set! (-> s1-0 position quad) (-> this root trans quad)) + (vector-copy! (-> s1-0 position) (-> this root trans)) (quaternion-identity! (-> s1-0 rotation)) (vector-identity! (-> s1-0 scale)) (set! (-> s1-0 skel) arg0) @@ -685,7 +685,8 @@ ;; definition for method 20 of type wvehicle ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this wvehicle)) +(defmethod get-search-info-flag ((this wvehicle)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (logtest? (vehicle-flag ai-driving) (-> this v-flags)) (set! v0-0 (logior v0-0 40)) @@ -704,10 +705,10 @@ (let ((gp-0 (new 'stack-no-clear 'wvehicle-stack-type2))) (set! (-> gp-0 float0) 4096.0) (quaternion->matrix (-> gp-0 mat0) (-> this root quat)) - (set! (-> gp-0 mat0 trans quad) (-> this root trans quad)) - (set! (-> gp-0 vec3 quad) (-> gp-0 mat0 fvec quad)) - (set! (-> gp-0 vec1 quad) (-> this root trans quad)) - (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> gp-0 mat0 trans) (-> this root trans)) + (vector-copy! (-> gp-0 vec3) (-> gp-0 mat0 fvec)) + (vector-copy! (-> gp-0 vec1) (-> this root trans)) + (vector-copy! (-> gp-0 cquery start-pos) (-> gp-0 vec1)) (+! (-> gp-0 cquery start-pos y) 4096.0) (vector-reset! (-> gp-0 vec2)) (set! (-> gp-0 vec2 y) 1.0) @@ -753,19 +754,19 @@ ) (set! (-> gp-0 vec1 y) (- (-> gp-0 vec1 y) (-> v1-21 depth))) ) - (set! (-> gp-0 vec2 quad) (-> gp-0 cquery best-other-tri normal quad)) + (vector-copy! (-> gp-0 vec2) (-> gp-0 cquery best-other-tri normal)) (when (< (-> gp-0 vec2 y) (cos 3640.889)) (vector-reset! (-> gp-0 vec2)) (set! (-> gp-0 vec2 y) 1.0) ) - (set! (-> this root trans quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec1)) 0 ) (if (< f30-0 0.0) 0 ) ) - (set! (-> this root trans quad) (-> gp-0 vec1 quad)) + (vector-copy! (-> this root trans) (-> gp-0 vec1)) (forward-up-nopitch->quaternion (-> this root quat) (-> gp-0 vec3) (-> gp-0 vec2)) ) 0 @@ -781,19 +782,8 @@ (let ((v1-2 (-> this info setup))) (set! (-> gp-0 ground-pos y) (fmax (fmin (-> this gun-aim-yaw) (-> v1-2 gun-yaw-max)) (-> v1-2 gun-yaw-min))) ) - (let* ((v1-4 (-> gp-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-3 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-4 rvec quad) a0-3) - (set! (-> v1-4 uvec quad) a1-0) - (set! (-> v1-4 fvec quad) a2-0) - (set! (-> v1-4 trans quad) a3-1) - ) - (set! (-> gp-0 tmp quad) (-> this turret-local-pos quad)) + (matrix-copy! (-> gp-0 mat) (-> this node-list data 0 bone transform)) + (vector-copy! (-> gp-0 tmp) (-> this turret-local-pos)) (set-vector! (-> gp-0 probe-dir) (sin (-> gp-0 ground-pos y)) 0.0 (cos (-> gp-0 ground-pos y)) 1.0) (vector+float*! (-> gp-0 steering-axis) (-> gp-0 tmp) (-> gp-0 probe-dir) 204800.0) (vector-matrix*! (-> gp-0 local-pos) (-> gp-0 tmp) (-> gp-0 mat)) @@ -867,8 +857,8 @@ ) (vector+float*! (-> gp-0 steering-axis) (-> gp-0 tmp) (-> gp-0 probe-dir) (-> s4-4 gun-z-offset)) ) - (set! (-> this gun-local-dir quad) (-> gp-0 probe-dir quad)) - (set! (-> this gun-local-pos quad) (-> gp-0 steering-axis quad)) + (vector-copy! (-> this gun-local-dir) (-> gp-0 probe-dir)) + (vector-copy! (-> this gun-local-pos) (-> gp-0 steering-axis)) ) 0 (none) @@ -896,7 +886,7 @@ (else (matrix-transpose! (-> s5-0 mat0) (-> this rbody matrix)) (matrix*! (-> s5-0 mat0) (camera-matrix) (-> s5-0 mat0)) - (set! (-> s5-0 vec0 quad) (-> s5-0 mat0 fvec quad)) + (vector-copy! (-> s5-0 vec0) (-> s5-0 mat0 fvec)) (set! (-> this gun-aim-yaw) (atan (-> s5-0 vec0 x) (-> s5-0 vec0 z))) ) ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc index 031f01dd504..0613fbb208e 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-wheel_REF.gc @@ -241,7 +241,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod rbody-post ((this vehicle-wheel)) (let ((v1-0 (new 'stack-no-clear 'rigid-body-move-work))) - (set! (-> v1-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> v1-0 cquery start-pos) (-> this rbody position)) (vector-float*! (-> v1-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) (let ((a0-4 (-> v1-0 cquery))) (set! (-> a0-4 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) @@ -294,7 +294,7 @@ (let ((a0-4 (-> self draw color-mult))) (vector-float*! (the-as vector a0-4) (the-as vector a0-4) 0.25) ) - (set! (-> self rbody position quad) (-> self root trans quad)) + (vector-copy! (-> self rbody position) (-> self root trans)) (quaternion-copy! (the-as quaternion (-> self rbody rot)) (-> self root quat)) (let ((v1-10 (-> block param 0))) (when v1-10 @@ -446,9 +446,9 @@ (defbehavior vehicle-wheel-init-by-other vehicle-wheel ((arg0 vehicle-wheel-init-params)) (logior! (-> self mask) (process-mask vehicle)) (init-collision! self arg0) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 rotation)) - (set! (-> self root scale quad) (-> arg0 scale quad)) + (vector-copy! (-> self root scale) (-> arg0 scale)) (set! (-> self level) (the-as level (-> arg0 level))) (initialize-skeleton self (-> arg0 skel) (the-as pair 0)) (setup-lods! (-> self normal-look) (-> arg0 skel) (-> self draw art-group) (-> self entity)) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc index c6169efd3c0..ec12ca33a52 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle_REF.gc @@ -32,19 +32,8 @@ (set-vector! (-> gp-0 vec0) 1.0 0.0 0.0 1.0) (set-vector! (-> gp-0 vec1) 0.0 1.0 0.0 1.0) (quaternion-copy! (-> gp-0 quat3) (-> this root quat)) - (let* ((v1-3 (-> gp-0 mat0)) - (a3-0 (-> this rbody matrix)) - (a0-7 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-1 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-3 rvec quad) a0-7) - (set! (-> v1-3 uvec quad) a1-2) - (set! (-> v1-3 fvec quad) a2-1) - (set! (-> v1-3 trans quad) a3-1) - ) - (set! (-> gp-0 vec2 quad) (-> arg1 local-pos quad)) + (matrix-copy! (-> gp-0 mat0) (-> this rbody matrix)) + (vector-copy! (-> gp-0 vec2) (-> arg1 local-pos)) (+! (-> gp-0 vec2 x) (-> arg1 susp-arm-length)) (set! (-> gp-0 vec2 x) (* (-> gp-0 vec2 x) (-> arg0 x-scale))) (+! (-> gp-0 vec2 y) (-> arg1 probe-y-offset)) @@ -77,7 +66,7 @@ (quaternion-normalize! (-> gp-0 quat0)) (quaternion*! (-> gp-0 quat4) (-> gp-0 quat4) (-> gp-0 quat0)) ) - (set! (-> gp-0 vec2 quad) (-> arg1 local-pos quad)) + (vector-copy! (-> gp-0 vec2) (-> arg1 local-pos)) (+! (-> gp-0 vec2 x) (* (-> arg1 susp-arm-length) (-> arg0 cos-susp-ang))) (set! (-> gp-0 vec2 x) (* (-> gp-0 vec2 x) (-> arg0 x-scale))) (+! (-> gp-0 vec2 y) (-> gp-0 float0)) @@ -93,7 +82,7 @@ (quaternion*! (-> gp-0 quat0) (-> gp-0 quat2) (-> gp-0 quat4)) (quaternion*! (-> gp-0 quat0) (-> gp-0 quat0) (-> gp-0 quat1)) (quaternion*! (-> arg0 quat) (-> gp-0 quat3) (-> gp-0 quat0)) - (set! (-> arg0 trans quad) (-> gp-0 vec3 quad)) + (vector-copy! (-> arg0 trans) (-> gp-0 vec3)) ) 0 (none) @@ -147,10 +136,10 @@ (vector-normalize! (-> s5-1 uvec) 1.0) (mem-copy! (the-as pointer s1-0) (the-as pointer (-> this draw shadow-ctrl settings)) 80) (set! (-> s5-1 uvec w) (-> s1-0 shadow-dir w)) - (set! (-> s1-0 shadow-dir quad) (-> s5-1 uvec quad)) + (vector-copy! (-> s1-0 shadow-dir) (-> s5-1 uvec)) ) (let ((v1-39 (-> (the-as process-focusable s2-0) root))) - (set! (-> v1-39 trans quad) (-> s3-0 trans quad)) + (vector-copy! (-> v1-39 trans) (-> s3-0 trans)) (quaternion-copy! (-> v1-39 quat) (-> s3-0 quat)) ) (logand! (-> s3-0 flags) -9) @@ -335,7 +324,7 @@ ) (let ((v1-8 (new 'stack-no-clear 'matrix))) (set! (-> v1-8 fvec x) (seconds-per-frame)) - (set! (-> v1-8 uvec quad) (-> this draw color-emissive quad)) + (vector-copy! (-> v1-8 uvec) (-> this draw color-emissive)) (set! (-> v1-8 uvec x) (fmax 0.0 (+ (-> v1-8 uvec x) (* -2.0 (-> v1-8 fvec x))))) (set! (-> this draw color-emissive quad) (-> v1-8 uvec quad)) ) @@ -962,8 +951,8 @@ (set! (-> a1-11 tread-tracker) (the-as handle #f)) (set! (-> a1-11 inertia) (-> a2-2 inertia)) ) - (set! (-> a1-11 probe-local-dir quad) (-> (new 'static 'vector :y -1.0 :w 1.0) quad)) - (set! (-> a1-11 local-axis quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + (vector-copy! (-> a1-11 probe-local-dir) (new 'static 'vector :y -1.0 :w 1.0)) + (vector-copy! (-> a1-11 local-axis) (new 'static 'vector :x 1.0 :w 1.0)) ) ) (set! (-> (the-as rigid-body-vehicle-constants arg0) physics-model drive-wheel-count) (-> v1-19 byte0)) @@ -1230,7 +1219,7 @@ ) (('ai-drop-off) (let ((v1-140 (the-as object (-> arg3 param 0)))) - (set! (-> this other-pos quad) (-> (the-as wvehicle-ai-drop-off-params v1-140) dest quad)) + (vector-copy! (-> this other-pos) (-> (the-as wvehicle-ai-drop-off-params v1-140) dest)) (set! (-> this other-proc) (process->handle (-> (the-as wvehicle-ai-drop-off-params v1-140) proc))) ) (set! v0-0 (logior (vehicle-flag vf53) (-> this v-flags))) diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-effects_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-effects_REF.gc index b828d5fc6a7..9a1a5678db7 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-effects_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-effects_REF.gc @@ -11,18 +11,7 @@ (when (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (when (< 0.0 (-> this info particles thruster-flame-length)) (let ((s5-0 (new 'stack-no-clear 'hvehicle-effects-stack-var0))) - (let* ((v1-7 (-> s5-0 mat)) - (a3-0 (-> this node-list data 0 bone transform)) - (a0-4 (-> a3-0 rvec quad)) - (a1-0 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-4) - (set! (-> v1-7 uvec quad) a1-0) - (set! (-> v1-7 fvec quad) a2-0) - (set! (-> v1-7 trans quad) a3-1) - ) + (matrix-copy! (-> s5-0 mat) (-> this node-list data 0 bone transform)) (set! (-> s5-0 work vec0 y) (-> this info particles thruster-flame-width)) (set! (-> s5-0 work vec0 z) (-> this info particles thruster-flame-length)) (set! (-> s5-0 work vec0 x) @@ -152,7 +141,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-physics_REF.gc index 6589e7e0f43..16e360893d6 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-physics_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-physics_REF.gc @@ -79,8 +79,8 @@ (s0-0 (-> arg1 probe-work-array s1-0)) ) (vector-reset! (-> s0-0 tire-force)) - (set! (-> s0-0 local-pos quad) (-> v1-29 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-29 rot quad)) + (vector-copy! (-> s0-0 local-pos) (-> v1-29 local-pos)) + (vector-copy! (-> s0-0 local-normal) (-> v1-29 rot)) (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) (let ((a1-9 (-> s0-0 probe-pos))) (let ((v1-32 (-> s0-0 world-pos))) @@ -98,27 +98,25 @@ (.svf (&-> a1-9 quad) vf6) ) (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) - (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) - (-> arg1 steering-axis) - (the-as vector (-> arg1 mat)) - ) - ) - quad - ) - ) - (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s0-0 wheel-axis) (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) + (-> arg1 steering-axis) + (the-as vector (-> arg1 mat)) + ) + ) + ) + (vector-copy! (-> s0-0 ground-pos) (-> s0-0 probe-pos)) (set! (-> s0-0 ground-pos y) 0.0) (vector-reset! (-> s0-0 ground-normal)) (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos)) (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) (cond ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) (logclear! (-> this v-flags) (vehicle-flag in-air)) (logior! (-> this v-flags) (vehicle-flag on-ground)) (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) - (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) + (vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal)) + (vector-copy! (-> arg1 ground-normal) (-> s0-0 ground-normal)) ) (else (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 position y))) @@ -139,8 +137,8 @@ (when (>= 1 (-> this force-level)) (dotimes (s2-1 (-> this info physics-model lift-thruster-count)) (let ((s1-1 (-> arg1 probe-work-array s2-1))) - (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) - (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s1-1 world-pos)) + (vector-copy! (-> arg1 velocity) (-> s1-1 velocity)) (let ((f28-1 (-> s1-1 probe-pos y))) (when (> (-> this flight-level-index) 0) (set! f28-1 (- f28-1 (+ 6144.0 (-> this flight-level)))) @@ -278,8 +276,8 @@ (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) ) (vector-normalize! (-> arg1 normal) 1.0) - (set! (-> arg1 world-pos quad) (-> s3-0 position quad)) - (set! (-> arg1 velocity quad) (-> s3-0 lin-velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s3-0 position)) + (vector-copy! (-> arg1 velocity) (-> s3-0 lin-velocity)) (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 position)) (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 inv-i-world)) @@ -339,7 +337,7 @@ (when (>= 1 (-> this force-level)) (set! sv-944 (* (-> s4-0 info mass) (-> s4-0 extra gravity))) (when (!= (-> s4-0 handling pitch-control-factor) 0.0) - (set! (-> gp-0 axis quad) (-> gp-0 mat rvec quad)) + (vector-copy! (-> gp-0 axis) (-> gp-0 mat rvec)) (set! (-> gp-0 axis y) 0.0) (let ((f30-0 (vector-dot (-> gp-0 axis) (-> s5-0 ang-velocity)))) (dotimes (s1-0 (-> s4-0 physics-model lift-thruster-count)) @@ -378,7 +376,7 @@ (quaternion-vector-angle! (the-as quaternion (-> s1-1 0)) (-> gp-0 mat fvec) f0-12) ) (quaternion->matrix (the-as matrix (-> s1-1 1)) (the-as quaternion (-> s1-1 0))) - (set! (-> gp-0 dir quad) (-> s1-1 2 quad)) + (vector-copy! (-> gp-0 dir) (-> s1-1 2)) ) (let ((f0-14 (vector-dot (the-as vector (-> gp-0 mat)) (-> gp-0 dir)))) (set! sv-1040 (* (-> s4-0 info mass) (-> s4-0 extra gravity))) @@ -427,7 +425,7 @@ (if (< (-> this controls throttle) 0.0) (set! f0-30 (* -1.0 f0-30)) ) - (set! (-> gp-0 axis quad) (-> gp-0 mat uvec quad)) + (vector-copy! (-> gp-0 axis) (-> gp-0 mat uvec)) (let* ((f0-34 (* (-> this power-level) (- (* f0-30 f2-12 (-> s4-0 handling steering-thruster-max-gain)) (vector-dot (-> gp-0 axis) (-> s5-0 ang-velocity)) ) @@ -447,7 +445,7 @@ (seek! (-> this jump-thrust) 0.0 (* 6.0 arg0)) (when (logtest? (vehicle-flag ignition) (-> this v-flags)) (vector-matrix*! (-> gp-0 world-pos) (-> s4-0 physics-model engine-thrust-local-pos) (-> gp-0 mat)) - (set! (-> gp-0 dir quad) (-> gp-0 mat fvec quad)) + (vector-copy! (-> gp-0 dir) (-> gp-0 mat fvec)) (let ((f0-45 (* (-> this engine-thrust) (-> s4-0 handling max-engine-thrust) (-> s4-0 info mass) @@ -557,7 +555,7 @@ ) (when (not (logtest? (vehicle-flag gun-dark-2-zero-g) (-> this v-flags))) (when (logtest? (-> this v-flags) (vehicle-flag riding)) - (set! (-> gp-0 local-pos quad) (-> s4-0 info cm-offset-joint quad)) + (vector-copy! (-> gp-0 local-pos) (-> s4-0 info cm-offset-joint)) (+! (-> gp-0 local-pos x) (* (-> this controls steering) (-> s4-0 handling player-shift-x))) (+! (-> gp-0 local-pos z) (* (-> this controls lean-z) (-> s4-0 handling player-shift-z))) (vector-matrix*! (-> gp-0 world-pos) (-> gp-0 local-pos) (-> gp-0 mat)) @@ -570,7 +568,7 @@ ) (vehicle-method-96 this arg0) (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) - (set! (-> gp-0 world-normal quad) (-> s5-0 lin-momentum quad)) + (vector-copy! (-> gp-0 world-normal) (-> s5-0 lin-momentum)) (set! (-> gp-0 world-normal y) 0.0) (vector-normalize! (-> gp-0 world-normal) 1.0) (let* ((v1-161 (-> s5-0 lin-velocity)) diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-util_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-util_REF.gc index 63abc5041c7..4c97620c910 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle-util_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle-util_REF.gc @@ -44,7 +44,7 @@ (set! sv-24 (-> arg2 info info inv-mass)) (let ((gp-0 (new 'stack-no-clear 'vehicle-physics-work))) (set! (-> gp-0 dir x) (+ (-> this target-speed) (-> this target-speed-offset))) - (set! (-> gp-0 mat uvec quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 mat uvec) arg1) (set! (-> gp-0 mat rvec quad) (-> arg2 root trans quad)) (vector-z-quaternion! (-> gp-0 mat trans) (-> arg2 root quat)) (vector-reset! (-> gp-0 mat fvec)) @@ -53,7 +53,7 @@ (vector-! (-> gp-0 world-pos) (-> this turn-enter-point) (the-as vector (-> gp-0 mat))) (let ((f0-5 (vector-dot (-> gp-0 world-pos) (-> this turn-enter-dir)))) (vector+float*! (-> gp-0 force) (-> this turn-enter-point) (-> this turn-enter-dir) (- f0-5)) - (set! (-> gp-0 velocity quad) (-> this turn-enter-dir quad)) + (vector-copy! (-> gp-0 velocity) (-> this turn-enter-dir)) (if (>= 0.0 f0-5) (logclear! (-> this flags) (vehicle-controller-flag on-straightaway)) ) @@ -132,8 +132,8 @@ ) ) (when (and v1-70 (not (logtest? (-> v1-70 v-flags) (vehicle-flag dead))) (nonzero? (-> v1-70 flight-level-index))) - (set! (-> gp-0 lift-dir quad) (-> v1-70 root trans quad)) - (set! (-> gp-0 normal quad) (-> v1-70 root transv quad)) + (vector-copy! (-> gp-0 lift-dir) (-> v1-70 root trans)) + (vector-copy! (-> gp-0 normal) (-> v1-70 root transv)) (vector-! (-> gp-0 tmp) (the-as vector (-> gp-0 mat)) (-> gp-0 lift-dir)) (.lvf vf1 (&-> (-> gp-0 tmp) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -256,7 +256,7 @@ ) ) (else - (set! (-> gp-0 world-normal quad) (-> this turn-exit-dir quad)) + (vector-copy! (-> gp-0 world-normal) (-> this turn-exit-dir)) ) ) (let ((f0-60 (vector-length (-> gp-0 world-normal)))) @@ -269,7 +269,7 @@ ) ) (vector+! (-> gp-0 mat fvec) (-> gp-0 mat fvec) (-> gp-0 world-pos)) - (set! (-> sv-16 quad) (-> gp-0 mat fvec quad)) + (vector-copy! sv-16 (-> gp-0 mat fvec)) ) (let ((v1-144 (-> *perf-stats* data 21))) (b! (zero? (-> v1-144 ctrl)) cfg-76 :delay (nop!)) @@ -330,8 +330,8 @@ (defmethod hvehicle-method-158 ((this hvehicle)) (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others direct-mode)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-0 0 quad) (-> this root trans quad)) - (set! (-> s5-0 1 quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 0) (-> this root trans)) + (vector-copy! (-> s5-0 1) (-> this root transv)) (set! (-> s5-0 0 w) 40960.0) (let ((s4-0 0)) (label cfg-1) diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc index afda55cf4c1..9fab0dbed66 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc @@ -210,9 +210,9 @@ (logclear! (-> s4-0 status) (collide-status on-ground)) (cond ((above-ground? s4-0 s3-0 (-> s4-0 trans) (collide-spec backgnd) 0.0 102400.0 1024.0) - (set! (-> s4-0 gspot-pos quad) (-> s4-0 trans quad)) + (vector-copy! (-> s4-0 gspot-pos) (-> s4-0 trans)) (set! (-> s4-0 gspot-pos y) (-> s3-0 best-other-tri intersect y)) - (set! (-> s4-0 gspot-normal quad) (-> s3-0 best-other-tri normal quad)) + (vector-copy! (-> s4-0 gspot-normal) (-> s3-0 best-other-tri normal)) (set! (-> s4-0 ground-pat) (-> s3-0 best-other-tri pat)) (when (logtest? (-> gp-0 settings flags) (shadow-flags disable-draw)) (set! (-> gp-0 settings top-plane w) (- (-> this root trans y) (-> this root gspot-pos y))) @@ -305,7 +305,7 @@ (logclear! (-> this v-flags) (vehicle-flag impact)) (let ((s5-0 (new 'stack-no-clear 'rigid-body-move-work))) (set! (-> s5-0 mat trans w) -4096000.0) - (set! (-> s5-0 cquery start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> s5-0 cquery start-pos) (-> this rbody position)) (vector-float*! (-> s5-0 cquery move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) (let ((v1-6 (-> s5-0 cquery))) (set! (-> v1-6 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) @@ -618,7 +618,7 @@ (let ((v1-31 (math-camera-matrix)) (a0-17 (new 'stack-no-clear 'matrix)) ) - (set! (-> a0-17 uvec quad) (-> *target* alt-cam-pos quad)) + (vector-copy! (-> a0-17 uvec) (-> *target* alt-cam-pos)) (vector-! (-> a0-17 rvec) (-> a0-17 uvec) (-> v1-31 trans)) (let ((f0-7 (/ (vector-dot (-> a0-17 rvec) (-> v1-31 uvec)) (vector-dot (-> a0-17 rvec) (-> v1-31 fvec))))) (cond @@ -762,8 +762,8 @@ (defmethod control-hook-ai ((this hvehicle) (arg0 vehicle-controls)) (let ((s5-0 (new 'stack-no-clear 'vehicle-physics-work))) (mem-set32! (the-as pointer (-> s5-0 mat)) 6 0) - (set! (-> s5-0 mat trans quad) (-> this rbody matrix rvec quad)) - (set! (-> s5-0 force quad) (-> this rbody matrix fvec quad)) + (vector-copy! (-> s5-0 mat trans) (-> this rbody matrix rvec)) + (vector-copy! (-> s5-0 force) (-> this rbody matrix fvec)) (let ((f28-0 (* (-> this rbody ang-velocity y) (vector-length (-> this rbody lin-velocity)))) (f30-0 (seconds-per-frame)) ) @@ -949,7 +949,7 @@ ) (when (logtest? (-> this draw status) (draw-control-status on-screen)) (when #t - (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vector-copy! (-> this node-list data 0 bone transform trans) (-> this root trans)) (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag particles) (-> this v-flags)))) (vehicle-method-78 this) ) @@ -986,7 +986,7 @@ 0 (rigid-body-object-method-30 this) (update-transforms (-> this root)) - (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vector-copy! (-> this node-list data 0 bone transform trans) (-> this root trans)) (vehicle-method-115 this) (let ((v1-98 (-> *perf-stats* data 20))) (b! (zero? (-> v1-98 ctrl)) cfg-25 :delay (nop!)) @@ -1061,10 +1061,10 @@ (init-rbody-impact-from-tshape! this (the-as rigid-body-impact (-> s5-0 mat)) arg1) (if (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (rigid-body-control-method-23 (-> this rbody) (the-as vector (-> s5-0 mat)) (-> s5-0 mat fvec)) - (set! (-> s5-0 mat fvec quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 mat fvec) (-> this root transv)) ) (let ((v1-17 (-> arg0 root))) - (set! (-> s5-0 force quad) (-> v1-17 transv quad)) + (vector-copy! (-> s5-0 force) (-> v1-17 transv)) (vector-! (-> s5-0 mat fvec) (-> v1-17 transv) (-> s5-0 mat fvec)) ) (let ((f0-2 (vector-dot (-> s5-0 mat fvec) (-> s5-0 mat uvec)))) @@ -1167,9 +1167,9 @@ (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) (logior! (-> this v-flags) (vehicle-flag traffic-managed)) (let ((s5-0 (the-as traffic-object-spawn-params (-> arg3 param 0)))) - (set! (-> this root trans quad) (-> s5-0 position quad)) + (vector-copy! (-> this root trans) (-> s5-0 position)) (quaternion-copy! (-> this root quat) (-> s5-0 rotation)) - (set! (-> this root transv quad) (-> s5-0 velocity quad)) + (vector-copy! (-> this root transv) (-> s5-0 velocity)) (hvehicle-method-161 this s5-0) ) ) @@ -1285,7 +1285,7 @@ (vector-float*! (the-as vector a0-8) (the-as vector a0-8) 0.25) ) (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) (set! (-> gp-2 scale) (/ (-> self draw bounds w) 11264)) diff --git a/test/decompiler/reference/jak3/levels/factory/car/wcar-faccar_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/wcar-faccar_REF.gc index 0187ad5aab1..db9021ff687 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/wcar-faccar_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/wcar-faccar_REF.gc @@ -397,7 +397,8 @@ ;; definition for method 20 of type v-faccar ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this v-faccar)) +(defmethod get-search-info-flag ((this v-faccar)) + "Get search-info-flag for this process." (the-as search-info-flag 0) ) diff --git a/test/decompiler/reference/jak3/levels/factory/conveyor_REF.gc b/test/decompiler/reference/jak3/levels/factory/conveyor_REF.gc index c878d419da8..1799d13389d 100644 --- a/test/decompiler/reference/jak3/levels/factory/conveyor_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/conveyor_REF.gc @@ -161,7 +161,7 @@ ;; INFO: Used lq/sq (defmethod push-focus ((this conveyor) (arg0 process-focusable)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (get-trans arg0 0) quad)) + (vector-copy! s4-0 (get-trans arg0 0)) (set! (-> s4-0 w) 1.0) (when (>= (vector4-dot s4-0 (the-as vector (-> this leading))) 0.0) (let* ((a1-2 (-> this sections)) @@ -360,7 +360,7 @@ (set! sv-32 (the-as conveyor-section #f)) (dotimes (s0-0 s1-0) (set! sv-48 (-> s2-0 data s0-0)) - (set! (-> sv-48 start quad) (-> s3-0 quad)) + (vector-copy! (-> sv-48 start) s3-0) (get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'exact) (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start)) @@ -430,6 +430,7 @@ ;; definition for method 11 of type conveyor (defmethod init-from-entity! ((this conveyor) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (alloc-trsqv! this) (process-drawable-from-entity! this arg0) (init-skel! this) diff --git a/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc index f2dc03c2551..b4ed2344a7e 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc @@ -434,34 +434,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -484,7 +484,7 @@ ((and arg0 (-> this los-clear)) (let ((a0-2 (the-as process-focusable (handle->process (-> this focus handle))))) (when a0-2 - (set! (-> this aim-pos quad) (-> (get-trans a0-2 3) quad)) + (vector-copy! (-> this aim-pos) (get-trans a0-2 3)) (vector+! (-> this aim-pos) (-> this aim-pos) (-> this aim-offset)) ) ) @@ -551,7 +551,7 @@ (defmethod check-los ((this fac-gunturret)) (let ((a0-2 (the-as process-focusable (handle->process (-> this focus handle))))) (if a0-2 - (set! (-> this aim-pos quad) (-> (get-trans a0-2 3) quad)) + (vector-copy! (-> this aim-pos) (get-trans a0-2 3)) ) ) (let* ((s4-0 @@ -563,8 +563,8 @@ (cos 364.0889) ) (let ((a1-5 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-5 start-pos quad) (-> s4-0 quad)) - (set! (-> a1-5 move-dist quad) (-> s5-3 quad)) + (vector-copy! (-> a1-5 start-pos) s4-0) + (vector-copy! (-> a1-5 move-dist) s5-3) (let ((v1-17 a1-5)) (set! (-> v1-17 radius) 409.6) (set! (-> v1-17 collide-with) @@ -617,7 +617,7 @@ (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) - (set! (-> s4-0 pos quad) (-> s0-0 quad)) + (vector-copy! (-> s4-0 pos) s0-0) (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) (set! (-> s4-0 target-handle) (the-as handle #f)) @@ -643,7 +643,7 @@ (vector+! (-> s4-0 vel) (-> s4-0 vel) s2-0) ) (if (-> this use-alt-barrel) - (set! (-> s4-0 pos quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 pos) s3-0) ) (set! (-> this use-alt-barrel) (not (-> this use-alt-barrel))) (spawn-projectile fturret-shot s4-0 this *default-dead-pool*) @@ -706,7 +706,7 @@ ) (suspend-for (seconds 0.75) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> self aim-pos quad)) + (vector-copy! s5-2 (-> self aim-pos)) (track-target self #t) (vector-! s5-2 (-> self aim-pos) s5-2) (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.12)) @@ -773,6 +773,7 @@ ;; definition for method 82 of type fac-gunturret (defmethod event-handler ((this fac-gunturret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) (set-time! (-> this last-hit-time)) ) @@ -907,7 +908,7 @@ (cleanup-for-death self) (ja-channel-set! 0) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (+! (-> gp-1 y) 12288.0) (suspend-for (seconds 2) (spawn (-> self part) gp-1) @@ -928,6 +929,7 @@ ;; definition for method 120 of type fac-gunturret ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this fac-gunturret)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -994,7 +996,8 @@ ) ;; definition for method 107 of type fac-gunturret -(defmethod is-pfoc-in-mesh? ((this fac-gunturret) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this fac-gunturret) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (= (-> this activate-distance) 0.0) (return #t) (return (< (fabs (vector-dot @@ -1028,6 +1031,7 @@ ;; definition for method 67 of type fac-gunturret (defmethod coin-flip? ((this fac-gunturret)) + "Return #t half the time, #f the other." #f ) @@ -1083,9 +1087,10 @@ ;; definition for method 121 of type fac-gunturret ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this fac-gunturret)) + "Typical place for shared init code. Runs from entity or process style init." (init-turret-params! this) (initialize-skeleton this (-> this params normal-sg) (the-as pair 0)) - (init-enemy-defaults! this (-> this params enemy-info)) + (setup-enemy! this (-> this params enemy-info)) (set! (-> this draw light-index) (the-as uint 10)) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) @@ -1118,7 +1123,8 @@ ) ;; definition for method 122 of type fac-gunturret -(defmethod go-idle2 ((this fac-gunturret)) +(defmethod go-fallback-init ((this fac-gunturret)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this idle)) ) diff --git a/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc index 1da12a0ef55..12e53f4816e 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc @@ -210,7 +210,7 @@ (vector-normalize-copy! (new 'stack-no-clear 'vector) (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0) 1.0) ) ) - (set! (-> self root trans quad) (-> s5-0 quad)) + (vector-copy! (-> self root trans) s5-0) (forward-up->quaternion (-> self root quat) a1-3 *up-vector*) ) (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0))) @@ -473,7 +473,7 @@ (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) - (set! (-> s4-0 pos quad) (-> s5-0 quad)) + (vector-copy! (-> s4-0 pos) s5-0) (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) (set! (-> s4-0 target-handle) (the-as handle #f)) @@ -524,7 +524,7 @@ (s0-0 sv-144 sv-160 a2-1) ) ) - (set! (-> s5-0 0 quad) (-> s3-0 0 quad)) + (vector-copy! (-> s5-0 0) (-> s3-0 0)) (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) (set! (-> this shot-range) (fmin 204800.0 f28-0)) ) @@ -532,7 +532,7 @@ (let ((f28-1 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 1))))))) (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-r s2-0) bone transform fvec) 1.0) (vector-rotate-y! s4-0 s4-0 (- (- 16384.0 (acos (/ f30-0 f28-1))))) - (set! (-> s5-0 0 quad) (-> s3-0 1 quad)) + (vector-copy! (-> s5-0 0) (-> s3-0 1)) (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) (set! (-> this shot-range) (fmin 204800.0 f28-1)) ) @@ -549,7 +549,7 @@ (let ((s5-0 (new 'stack-no-clear 'collide-query)) (f30-0 307200.0) ) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-float*! (-> s5-0 move-dist) arg1 f30-0) (let ((v1-4 s5-0)) (set! (-> v1-4 radius) 4096.0) @@ -579,7 +579,7 @@ ) (s5-2 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-2 quad) (-> s4-1 quad)) + (vector-copy! s5-2 s4-1) (vector+float*! s5-2 s5-2 (-> (math-camera-matrix) fvec) -2048.0) (if (and s3-0 (logtest? (process-mask target enemy) (-> (the-as collide-shape-prim s3-0) cshape process mask)) @@ -624,7 +624,7 @@ (look-at! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) 'attacking self) ) (set! (-> self aim-pos 0 quad) (-> self aim-pos 1 quad)) - (set! (-> self aim-pos 1 quad) (-> (get-trans gp-0 0) quad)) + (vector-copy! (-> self aim-pos 1) (get-trans gp-0 0)) (let ((s5-2 (-> self aim-pos 2)) (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self gun-joint-l 0)))) ) @@ -645,8 +645,8 @@ (vector-normalize! gp-2 1.0) (vector-normalize! s3-1 1.0) (if (logtest? (-> self flags) (fac-robotank-turret-flag frt3)) - (set! (-> s5-3 quad) (-> s3-1 quad)) - (set! (-> s5-3 quad) (-> gp-2 quad)) + (vector-copy! s5-3 s3-1) + (vector-copy! s5-3 gp-2) ) (when (logtest? (-> self flags) (fac-robotank-turret-flag frt7)) (let ((f0-6 (lerp-scale 1.0 0.2 f30-0 8192.0 327680.0))) @@ -837,7 +837,7 @@ (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> s4-1 quad)) + (vector-copy! s5-0 s4-1) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (set! (-> s5-0 y) 0.0) @@ -896,8 +896,8 @@ ) (when a0-1 (set! (-> self aim-pos 0 quad) (-> (get-trans a0-1 0) quad)) - (set! (-> self aim-pos 1 quad) (-> self aim-pos 0 quad)) - (set! (-> self aim-pos 2 quad) (-> self aim-pos 0 quad)) + (vector-copy! (-> self aim-pos 1) (-> self aim-pos 0)) + (vector-copy! (-> self aim-pos 2) (-> self aim-pos 0)) ) ) ) @@ -929,7 +929,7 @@ ) ) (logior! (-> self flags) (fac-robotank-turret-flag frt3)) - (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) + (vector-copy! (-> self firing-sight-pos) (-> self sight-pos)) (suspend-for (seconds 0.5) ) (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) @@ -1073,9 +1073,9 @@ ) (set! (-> self root) s2-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) - (set! (-> self offset quad) (-> arg2 quad)) + (vector-copy! (-> self offset) arg2) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-robotank-turret" (the-as (pointer level) #f))) @@ -1094,8 +1094,8 @@ (set! (-> self rotate-rate) 0.0) (set! (-> self rotate-mult) arg3) (set! (-> self aim-pos 0 quad) (-> self root trans quad)) - (set! (-> self aim-pos 1 quad) (-> self root trans quad)) - (set! (-> self aim-pos 2 quad) (-> self root trans quad)) + (vector-copy! (-> self aim-pos 1) (-> self root trans)) + (vector-copy! (-> self aim-pos 2) (-> self root trans)) (set-time! (-> self gun-timer)) (set! (-> self flags) (fac-robotank-turret-flag)) (set! (-> self fov-mult) 1.0) @@ -1106,7 +1106,7 @@ (set! (-> self gun-joint-r 1) 6) (set! (-> self gun-index) 0) (let ((v1-51 (new 'stack-no-clear 'vector))) - (set! (-> v1-51 quad) (-> self root trans quad)) + (vector-copy! v1-51 (-> self root trans)) (+! (-> v1-51 z) 40960.0) (+! (-> v1-51 y) 32768.0) ) diff --git a/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc index f6aa3c7d5dd..414d9f4b491 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc @@ -376,7 +376,7 @@ (set! (-> s1-0 random-rangef) (lerp-scale 0.0 1.0 f30-0 0.0 f28-0)) ) (let ((a1-8 (forward-up-nopitch->inv-matrix (new 'stack-no-clear 'matrix) s2-0 *up-vector*))) - (set! (-> a1-8 trans quad) (-> s4-0 quad)) + (vector-copy! (-> a1-8 trans) s4-0) (+! (-> a1-8 trans y) -2498.56) (spawn-from-mat (-> self part) a1-8) ) @@ -390,7 +390,7 @@ ) ) ) - (set! (-> s5-0 pos quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 pos) s4-0) ) ) (let ((v1-48 (-> self path-info data (-> self path-index)))) @@ -691,11 +691,11 @@ (sound-play "tank-explode") (cond ((logtest? (-> *part-group-id-table* 732 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 732)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 732)) ) ) diff --git a/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc index 14922c9a08e..bbc0b66dd56 100644 --- a/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc @@ -141,7 +141,7 @@ ) ) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (vector-identity! (-> self root scale)) (go-virtual idle) @@ -241,7 +241,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gun-tower-break" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (quaternion-copy! (-> self root quat) arg2) (vector-identity! (-> self root scale)) (if s4-2 @@ -348,6 +348,7 @@ ;; definition for method 11 of type fac-gun-tower-base ;; INFO: Used lq/sq (defmethod init-from-entity! ((this fac-gun-tower-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -388,7 +389,7 @@ (set! (-> this draw lod-set lod 2 dist) 14336000.0) (logior! (-> this draw status) (draw-control-status no-draw)) (quaternion-copy! (-> this root quat) (-> arg0 quat)) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (go (method-of-object this idle)) ) @@ -410,10 +411,10 @@ (when (and (type? proc projectile) (not (type? proc warf-projectile))) (let ((s4-0 (the-as projectile proc))) (when (not (vector= *fac-tower-impact-pos* (-> s4-0 root trans))) - (set! (-> *fac-tower-impact-pos* quad) (-> s4-0 root trans quad)) + (vector-copy! *fac-tower-impact-pos* (-> s4-0 root trans)) (cond ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-0 root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s4-0 root trans)) (let ((s4-1 (the-as projectile (get-process *default-dead-pool* part-tracker-subsampler #x4000 0)))) (when s4-1 (let ((t9-4 (method-of-type part-tracker-subsampler activate))) @@ -442,7 +443,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-0 root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> s4-0 root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) ) ) @@ -503,6 +504,7 @@ ;; definition for method 11 of type fac-gun-tower (defmethod init-from-entity! ((this fac-gun-tower) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) @@ -601,7 +603,8 @@ ;; definition for method 20 of type fac-gun-tower ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this fac-gun-tower)) +(defmethod get-search-info-flag ((this fac-gun-tower)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (and (-> this next-state) (= (-> this next-state name) 'open)) (set! v0-0 (logior v0-0 40)) @@ -648,7 +651,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> (get-trans *target* 3) quad)) + (vector-copy! s4-0 (get-trans *target* 3)) (let ((s2-0 (-> this node-list data 10 bone transform)) (s3-0 (new 'stack-no-clear 'quaternion)) ) @@ -727,7 +730,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod fac-gun-tower-method-36 ((this fac-gun-tower)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) 409600.0) (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-0 s4-0 384)) @@ -839,11 +842,11 @@ (start-destroyed-fac-gun-tower (-> self root trans) (-> self root quat) (the-as process *entity-pool*)) (cond ((logtest? (-> *part-group-id-table* 731 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 731)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 731)) ) ) @@ -919,7 +922,7 @@ (let ((s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8))) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 quad) (-> (get-trans *target* 3) quad)) + (vector-copy! s2-0 (get-trans *target* 3)) (vector-! s4-0 s3-0 s2-0) ) (vector-negate! s4-0 s4-0) @@ -971,14 +974,14 @@ (('attack) (when (and (type? proc projectile) (not (type? proc warf-projectile))) (when (not (vector= *fac-tower-impact-pos* (-> (the-as projectile proc) root trans))) - (set! (-> *fac-tower-impact-pos* quad) (-> (the-as projectile proc) root trans quad)) + (vector-copy! *fac-tower-impact-pos* (-> (the-as projectile proc) root trans)) (cond ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (the-as projectile proc) root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as projectile proc) root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (the-as projectile proc) root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as projectile proc) root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) ) ) diff --git a/test/decompiler/reference/jak3/levels/factory/factory-boss-setup_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-boss-setup_REF.gc index ea6b141bba1..6d19fa41dda 100644 --- a/test/decompiler/reference/jak3/levels/factory/factory-boss-setup_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factory-boss-setup_REF.gc @@ -369,7 +369,7 @@ (f30-0 0.0) ) (matrix-identity! s5-0) - (set! (-> s5-0 trans quad) (-> sv-160 quad)) + (vector-copy! (-> s5-0 trans) sv-160) (let ((v1-8 s1-0)) (cond ((zero? v1-8) @@ -419,23 +419,12 @@ (let* ((f0-2 (lerp-scale 1.0 0.1 (the float (mod s2-0 90)) 90.0 0.0)) (f30-1 (* 3686.4 f0-2)) ) - (let* ((a2-2 s1-1) - (a3-2 s5-0) - (v1-64 (-> a3-2 rvec quad)) - (a0-9 (-> a3-2 uvec quad)) - (a1-3 (-> a3-2 fvec quad)) - (a3-3 (-> a3-2 trans quad)) - ) - (set! (-> a2-2 rvec quad) v1-64) - (set! (-> a2-2 uvec quad) a0-9) - (set! (-> a2-2 fvec quad) a1-3) - (set! (-> a2-2 trans quad) a3-3) - ) + (matrix-copy! s1-1 s5-0) (vector+float*! (-> s1-1 trans) (-> s5-0 trans) (-> s5-0 rvec) (- f30-1)) (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 fvec) (- f30-1)) (spawn-from-mat (-> this reticle-corner-0) s1-1) (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 rvec) (* 2.0 f30-1)) - (set! (-> s1-1 rvec quad) (-> s5-0 fvec quad)) + (vector-copy! (-> s1-1 rvec) (-> s5-0 fvec)) (vector-negate! (-> s1-1 fvec) (-> s5-0 rvec)) (spawn-from-mat (-> this reticle-corner-1) s1-1) (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 fvec) (* 2.0 f30-1)) @@ -445,7 +434,7 @@ (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 rvec) (* -2.0 f30-1)) ) (vector-negate! (-> s1-1 rvec) (-> s5-0 fvec)) - (set! (-> s1-1 fvec quad) (-> s5-0 rvec quad)) + (vector-copy! (-> s1-1 fvec) (-> s5-0 rvec)) (spawn-from-mat (-> this reticle-corner-3) s1-1) ) ) @@ -690,7 +679,7 @@ (let ((t9-1 (method-of-type projectile init-proj-settings!))) (t9-1 this) ) - (set! (-> this shot-dest quad) (-> this root transv quad)) + (vector-copy! (-> this shot-dest) (-> this root transv)) (set-time! (-> this traj-time)) (cond ((type? this factory-boss-shockwave-bomb) @@ -715,10 +704,10 @@ ) ) (compute-transv-at-time (-> this traj) 0.0 (-> this root transv)) - (set! (-> this pre-move-transv quad) (-> this root transv quad)) + (vector-copy! (-> this pre-move-transv) (-> this root transv)) (vector-normalize-copy! (-> this starting-dir) (-> this root transv) 1.0) (vector+float*! (-> this base-target-pos) (-> this root trans) (-> this starting-dir) 2048000.0) - (set! (-> this target-pos quad) (-> this base-target-pos quad)) + (vector-copy! (-> this target-pos) (-> this base-target-pos)) (set! (-> this impact-played) #f) (set! (-> this reticle-sound) (new-sound-id)) (sound-play "reticle-lock" :id (-> this reticle-sound) :position (-> this shot-dest)) @@ -782,7 +771,7 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> v1-22 quad) vf1) ) - (set! (-> self root transv quad) (-> self pre-move-transv quad)) + (vector-copy! (-> self root transv) (-> self pre-move-transv)) (if (< 2191360.0 (-> gp-1 y)) (integrate-and-collide! (-> self root) (-> self root transv)) (projectile-move-fill-line-sphere self) @@ -838,7 +827,7 @@ ) 0 (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -914,7 +903,7 @@ ) 0 (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -932,13 +921,13 @@ (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) (set-time! (-> self state-time)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> self root trans quad)) + (vector-copy! s5-1 (-> self root trans)) (let ((gp-2 (new 'stack-no-clear 'quaternion))) (let ((s4-0 (new 'stack-no-clear 'matrix))) (+! (-> s5-1 y) 409.6) (quaternion-set! gp-2 0.0 0.0 0.0 1.0) (matrix-identity! s4-0) - (set! (-> s4-0 trans quad) (-> s5-1 quad)) + (vector-copy! (-> s4-0 trans) s5-1) ) (let* ((s3-0 (get-process *default-dead-pool* manipy #x20000 1)) (s4-1 (when s3-0 @@ -1046,7 +1035,7 @@ (f28-1 (* 2048.0 (pow (the float (+ (- (seconds -0.05) (-> self state-time)) (current-time))) 0.85))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self root trans quad)) + (vector-copy! s5-0 (-> self root trans)) (+! (-> s5-0 y) 409.6) (when *target* (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) s5-0)) @@ -1114,7 +1103,7 @@ ) 0 (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -1401,6 +1390,7 @@ ;; definition for method 11 of type fac-drop-plat ;; INFO: Used lq/sq (defmethod init-from-entity! ((this fac-drop-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (with-pp (stack-size-set! (-> this main-thread) 32) @@ -1563,11 +1553,11 @@ (let ((v1-0 (new 'stack-no-clear 'vector)) (a0-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-0 quad) (-> this center quad)) + (vector-copy! v1-0 (-> this center)) (+! (-> v1-0 x) (-> this x-off)) (+! (-> v1-0 z) (-> this z-off)) (+! (-> v1-0 y) 9175.04) - (set! (-> a0-2 quad) (-> this center quad)) + (vector-copy! a0-2 (-> this center)) (set! (-> a0-2 x) (- (-> a0-2 x) (-> this x-off))) (set! (-> a0-2 z) (- (-> a0-2 z) (-> this z-off))) (+! (-> a0-2 y) 9011.2) @@ -1582,7 +1572,7 @@ (let ((a3-5 (-> this lightning a1-5)) (a2-15 a0-2) ) - (set! (-> a3-5 state meet data (+ (-> a3-5 state points-to-draw) -1) quad) (-> a2-15 quad)) + (vector-copy! (-> a3-5 state meet data (+ (-> a3-5 state points-to-draw) -1)) a2-15) ) (let ((a2-19 (-> this lightning a1-5)) (a3-8 1) @@ -1609,10 +1599,10 @@ ) ) (let ((s4-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) - (set! (-> s4-0 0 quad) (-> this center quad)) + (vector-copy! (-> s4-0 0) (-> this center)) (+! (-> s4-0 0 x) (-> this x-off)) (+! (-> s4-0 0 z) (-> this z-off)) - (set! (-> s4-0 1 quad) (-> s4-0 0 quad)) + (vector-copy! (-> s4-0 1) (-> s4-0 0)) (set! (-> s4-0 1 x) (- (-> s4-0 1 x) (* 2.0 (-> this x-off)))) (set! (-> s4-0 1 z) (- (-> s4-0 1 z) (* 2.0 (-> this z-off)))) (when (not (handle->process (-> this blocking-plane))) @@ -1675,7 +1665,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod factory-boss-lightning-gate-method-11 ((this factory-boss-lightning-gate) (arg0 vector) (arg1 float) (arg2 float) (arg3 process)) (set-factoryd-light! 0.0) - (set! (-> this center quad) (-> arg0 quad)) + (vector-copy! (-> this center) arg0) (set! (-> this x-off) arg1) (set! (-> this z-off) arg2) (set! (-> this blocking-plane) (the-as handle #f)) @@ -1843,9 +1833,9 @@ ;; INFO: Used lq/sq (defmethod factory-boss-method-27 ((this factory-boss) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> arg0 quad)) + (vector-copy! v1-0 arg0) (set! (-> v1-0 w) 16384.0) - (add-root-sphere-to-hash! (-> this nav) v1-0 255) + (check-sphere-blocked! (-> this nav) v1-0 255) ) ) @@ -1988,6 +1978,7 @@ ;; definition for method 11 of type factory-boss ;; INFO: Used lq/sq (defmethod init-from-entity! ((this factory-boss) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -2015,7 +2006,7 @@ (logior! (-> this skel status) (joint-control-status eye-anim)) (logior! (-> this mask) (process-mask enemy)) (set-vector! (-> this root scale) 1.6 1.6 1.6 1.0) - (set! (-> this center quad) (-> this root trans quad)) + (vector-copy! (-> this center) (-> this root trans)) (+! (-> this center z) 83992.98) (+! (-> this center y) -65536.0) (+! (-> this center x) -83992.98) @@ -2218,10 +2209,10 @@ (set! (-> this reticle-sound) (new-sound-id)) (set! (-> this reticle-sound-playing) #f) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> this center quad)) + (vector-copy! s5-2 (-> this center)) (+! (-> s5-2 z) 141312.0) (factory-boss-lightning-gate-method-11 (-> this warp-blocker) s5-2 28672.0 0.0 this) - (set! (-> s5-2 quad) (-> this center quad)) + (vector-copy! s5-2 (-> this center)) (+! (-> s5-2 z) -141312.0) (factory-boss-lightning-gate-method-11 (-> this entry-blocker) s5-2 28672.0 0.0 this) ) @@ -2475,6 +2466,7 @@ ;; definition for method 11 of type fac-warp-effect (defmethod init-from-entity! ((this fac-warp-effect) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2484,7 +2476,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc index 2389d1d7dd7..6d8425fa047 100644 --- a/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc @@ -25,7 +25,7 @@ ;; definition for function factory-boss-target-pos ;; INFO: Used lq/sq (defbehavior factory-boss-target-pos factory-boss ((arg0 vector) (arg1 int) (arg2 int)) - (set! (-> arg0 quad) (-> (target-pos 0) quad)) + (vector-copy! arg0 (target-pos 0)) (set! (-> arg0 y) (-> self center y)) (when (= arg1 1) (let ((a0-3 (- (the-as int (- (current-time) (-> self shot-timer))))) @@ -302,8 +302,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s3-0 quad)) - (set! (-> gp-0 vel quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 pos) s3-0) + (vector-copy! (-> gp-0 vel) s4-0) ) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) @@ -464,7 +464,7 @@ (let ((v1-0 (new 'stack-no-clear 'vector))) (vector+float*! v1-0 arg1 (-> arg0 uvec) 14336.0) (vector+float*! v1-0 v1-0 (-> arg0 fvec) 7168.0) - (set! (-> arg0 trans quad) (-> v1-0 quad)) + (vector-copy! (-> arg0 trans) v1-0) ) (spawn-from-mat (-> arg2 ring-part) arg0) (none) @@ -593,11 +593,11 @@ (vector+float*! s1-0 s1-0 (-> s2-0 uvec) f1-5) ) (vector+float*! s1-0 s1-0 (-> s2-0 fvec) -4096.0) - (set! (-> s2-0 trans quad) (-> s1-0 quad)) + (vector-copy! (-> s2-0 trans) s1-0) (vector+float*! s3-0 s1-0 (-> s2-0 rvec) (* -2.0 f0-6)) ) ) - (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s2-0 trans) s3-0) (if (logtest? (-> s5-0 flags) (facboss-machine-state-flag fms1)) (factory-boss-spawn-ring s2-0 s4-0 s5-0) ) @@ -627,7 +627,7 @@ ) (set! (-> s5-0 lightning state meet data 0 quad) (-> s1-0 quad)) (let ((v1-51 (-> s5-0 lightning))) - (set! (-> v1-51 state meet data (+ (-> v1-51 state points-to-draw) -1) quad) (-> s3-0 quad)) + (vector-copy! (-> v1-51 state meet data (+ (-> v1-51 state points-to-draw) -1)) s3-0) ) ) (else @@ -657,9 +657,9 @@ ) ) ) - (set! (-> s2-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s2-0 trans) s4-0) (spawn-from-mat (-> s5-0 damaged-low-smoke-part) s2-0) - (set! (-> s2-0 trans quad) (-> s0-0 quad)) + (vector-copy! (-> s2-0 trans) s0-0) (spawn-from-mat (-> s5-0 damaged-high-smoke-part) s2-0) (cond ((< (- (current-time) (-> s5-0 ring-timer)) 0) @@ -703,7 +703,7 @@ ) (cond ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms2)) - (set! (-> s2-0 trans quad) (-> s1-0 quad)) + (vector-copy! (-> s2-0 trans) s1-0) (spawn-from-mat (-> s5-0 damaged-left-spark-part) s2-0) (when (>= (- (current-time) (-> s5-0 left-spark-timer)) 0) (let ((s1-1 (current-time)) @@ -745,7 +745,7 @@ ) (cond ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms3)) - (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s2-0 trans) s3-0) (spawn-from-mat (-> s5-0 damaged-right-spark-part) s2-0) (when (>= (- (current-time) (-> s5-0 right-spark-timer)) 0) (let* ((s3-1 (current-time)) @@ -813,7 +813,7 @@ (dotimes (s3-3 10) (when (not (handle->process (-> self ammo s3-3))) (let ((s2-3 (new 'static 'fact-info))) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> (the-as process-drawable s4-1) root trans quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s4-1) root trans)) (set-vector! (new 'stack-no-clear 'vector) 0.0 57001.605 0.0 1.0) (set! (-> s2-3 options) (actor-option fade-out fall no-distance-check-fadeout)) (set! (-> s2-3 fade-time) (seconds 10)) @@ -1155,7 +1155,7 @@ (gp-0 (new 'stack-no-clear 'matrix)) ) (factory-boss-get-particle-spawn-points (-> self chosen-machine) a1-8 s5-0 gp-0) - (set! (-> gp-0 trans quad) (-> s5-0 quad)) + (vector-copy! (-> gp-0 trans) s5-0) (if (logtest? (-> *part-group-id-table* 1367 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1317,7 +1317,7 @@ (the-as symbol (-> self launching-group)) ) (set! (-> s5-0 flags) (facboss-critter-tracker-flag)) - (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-0 trans) gp-0) (quaternion-copy! (-> s4-0 quat) (-> self root quat)) (set! (-> s4-0 entity) (-> self entity)) (set! (-> s4-0 directed?) #t) @@ -1445,7 +1445,7 @@ (set-vector! (-> s4-2 fvec) 0.0 1.0 0.0 0.0) (vector-cross! (-> s4-2 rvec) (-> s4-2 uvec) (-> s4-2 fvec)) (set! (-> s4-2 rvec w) 0.0) - (set! (-> s4-2 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-2 trans) gp-0) (+! (-> s4-2 trans y) 8192.0) (set! (-> s4-2 trans w) 1.0) (if (logtest? (-> *part-group-id-table* 1377 flags) (sp-group-flag sp13)) diff --git a/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc index 490309f1021..a139257cb85 100644 --- a/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc @@ -148,7 +148,7 @@ (set! (-> *factory-fighter-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *factory-fighter-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *factory-fighter-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *factory-fighter-trail* use-tape-mode?) #f) @@ -463,6 +463,7 @@ ;; definition for method 11 of type factory-fighter-path ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this factory-fighter-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (cleanup-for-death this) ) @@ -487,6 +488,7 @@ ;; definition for method 11 of type factory-tanks-path ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this factory-tanks-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (cleanup-for-death this) ) @@ -594,7 +596,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) 0.0 0.0 - (set! (-> s5-0 quad) (-> *target* control trans quad)) + (vector-copy! s5-0 (-> *target* control trans)) (dotimes (s4-0 (-> arg0 fpath npath)) (when (logtest? (-> arg0 fpath inout s4-0 flags) (factory-inout-flag fi1)) (get-point-at-percent-along-path! (-> arg0 fpath path s4-0) s5-0 0.0 'interp) @@ -694,7 +696,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> (get-trans *target* 3) quad)) + (vector-copy! s4-0 (get-trans *target* 3)) (let ((v1-4 s5-0)) (let ((a0-3 (-> this root trans))) (let ((a1-1 (-> this forw))) @@ -809,7 +811,7 @@ ) ) ) - (set! (-> this ppos quad) (-> this root trans quad)) + (vector-copy! (-> this ppos) (-> this root trans)) (get-point-at-percent-along-path! (-> s5-0 fpath path (-> this path-idx)) (-> this root trans) @@ -823,10 +825,10 @@ ) (vector-! s2-0 (-> this root trans) (-> this ppos)) (vector-float*! s2-0 s2-0 f28-0) - (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-copy! s4-0 s2-0) (vector-normalize! s4-0 1.0) (vector-! s3-0 s2-0 (-> this pvel)) - (set! (-> this pvel quad) (-> s2-0 quad)) + (vector-copy! (-> this pvel) s2-0) (vector-float*! s3-0 s3-0 (/ f28-0 (meters 15))) (cond ((< 0.0 (-> this blendpath)) @@ -838,10 +840,10 @@ (set! (-> this blendpath) (fmax 0.0 (- (-> this blendpath) (* 4.0 f30-0)))) ) ((zero? (-> this newpath)) - (set! (-> this pacc quad) (-> s3-0 quad)) + (vector-copy! (-> this pacc) s3-0) ) (else - (set! (-> s3-0 quad) (-> this pacc quad)) + (vector-copy! s3-0 (-> this pacc)) (+! (-> this newpath) -1) (if (zero? (-> this newpath)) (set! (-> this blendpath) 1.0) @@ -863,8 +865,8 @@ (vector+! s5-1 *up-vector* s3-0) (vector-normalize! s5-1 1.0) (forward-up->quaternion (-> this root quat) s4-0 s5-1) - (set! (-> this forw quad) (-> s4-0 quad)) - (set! (-> this upvc quad) (-> s5-1 quad)) + (vector-copy! (-> this forw) s4-0) + (vector-copy! (-> this upvc) s5-1) ) ) ) @@ -887,7 +889,7 @@ (let ((s5-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s4-0 (new 'stack-no-clear 'vector))) (if (-> self disappear) (go-virtual die) @@ -1005,11 +1007,11 @@ 0 (cond ((logtest? (-> *part-group-id-table* 730 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 730)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 730)) ) ) @@ -1068,11 +1070,11 @@ (set! (-> self root root-prim local-sphere w) 491520.0) (cond ((logtest? (-> *part-group-id-table* 730 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 730)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 730)) ) ) @@ -1359,6 +1361,7 @@ ;; definition for method 11 of type fac-target (defmethod init-from-entity! ((this fac-target) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -1606,11 +1609,11 @@ (set! (-> gp-0 rot-speed) 16.0) (cond ((logtest? (-> *part-group-id-table* 733 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 733)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 733)) ) ) @@ -1699,7 +1702,8 @@ ;; definition for method 20 of type fac-target ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this fac-target)) +(defmethod get-search-info-flag ((this fac-target)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (set! v0-0 (logior v0-0 40)) diff --git a/test/decompiler/reference/jak3/levels/factory/factoryb-init_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryb-init_REF.gc index 01b62c65c3e..356497f1036 100644 --- a/test/decompiler/reference/jak3/levels/factory/factoryb-init_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factoryb-init_REF.gc @@ -5,7 +5,7 @@ ;; WARN: Return type mismatch int vs none. (defun factoryb-activate ((arg0 level)) (cond - ((= (status-of-level-and-borrows *level* 'lfactory #f) 'active) + ((= (level-status? *level* 'lfactory #f) 'active) (format 0 "factoryb-activate~%") (factory-manager-start arg0) ) @@ -16,7 +16,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc index a414a62b065..a4a4254e91c 100644 --- a/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc @@ -117,11 +117,11 @@ () (cond ((logtest? (-> *part-group-id-table* 750 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 750)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 750)) ) ) @@ -133,7 +133,7 @@ ) ) (when a0-14 - (set! (-> gp-2 fountain-rand-transv-lo quad) (-> (get-trans a0-14 0) quad)) + (vector-copy! (-> gp-2 fountain-rand-transv-lo) (get-trans a0-14 0)) (+! (-> gp-2 fountain-rand-transv-lo y) 16384.0) ) ) @@ -166,6 +166,7 @@ ;; definition for method 11 of type fac-break-floor (defmethod init-from-entity! ((this fac-break-floor) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -380,11 +381,11 @@ (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) (cond ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) ) ) @@ -407,6 +408,7 @@ ;; definition for method 11 of type fac-break-fence-a (defmethod init-from-entity! ((this fac-break-fence-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -551,11 +553,11 @@ (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) (cond ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) ) ) @@ -578,6 +580,7 @@ ;; definition for method 11 of type fac-break-fence-b (defmethod init-from-entity! ((this fac-break-fence-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -670,6 +673,7 @@ ;; definition for method 11 of type fac-break-fence-c (defmethod init-from-entity! ((this fac-break-fence-c) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -770,11 +774,11 @@ (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) (cond ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-1) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) ) ) @@ -988,6 +992,7 @@ ;; definition for method 11 of type fac-switch ;; INFO: Used lq/sq (defmethod init-from-entity! ((this fac-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -1655,6 +1660,7 @@ ;; definition for method 11 of type fac-rotfan (defmethod init-from-entity! ((this fac-rotfan) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1876,6 +1882,7 @@ ;; definition for method 11 of type fac-robot-ass-manager (defmethod init-from-entity! ((this fac-robot-ass-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-set! this arg0) (go (method-of-object this idle)) ) @@ -2072,6 +2079,7 @@ ;; definition for method 11 of type fac-punch-wall (defmethod init-from-entity! ((this fac-punch-wall) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) diff --git a/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc index 0bccf52e9bb..ff5ab09bfc9 100644 --- a/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc @@ -107,7 +107,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. (defmethod set-jmod-inner-scale! ((this generic-spot-shadow-effect) (arg0 vector)) - (set! (-> this jmod-inner transform scale quad) (-> arg0 quad)) + (vector-copy! (-> this jmod-inner transform scale) arg0) (none) ) @@ -115,7 +115,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. (defmethod set-jmod-outer-scale! ((this generic-spot-shadow-effect) (arg0 vector)) - (set! (-> this jmod-outer transform scale quad) (-> arg0 quad)) + (vector-copy! (-> this jmod-outer transform scale) arg0) (none) ) @@ -123,9 +123,9 @@ ;; INFO: Used lq/sq (defbehavior generic-spot-shadow-effect-init-by-other generic-spot-shadow-effect ((arg0 vector) (arg1 quaternion)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) - (set! (-> self pre-flicker-pos quad) (-> self root trans quad)) + (vector-copy! (-> self pre-flicker-pos) (-> self root trans)) (set! (-> self level) (-> *level* level-default)) (initialize-skeleton self @@ -338,7 +338,7 @@ (let ((a0-5 (-> self lightning)) (v1-4 s5-0) ) - (set! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1) quad) (-> v1-4 quad)) + (vector-copy! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1)) v1-4) ) (until #f (let ((v1-9 (mod (+ (current-time) (-> self phase-offset)) (+ (-> self on-duration) (-> self off-duration))))) @@ -421,6 +421,7 @@ ;; definition for method 11 of type fac-zapper (defmethod init-from-entity! ((this fac-zapper) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this entity) arg0) (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) (set! (-> this lightning) (new 'process 'lightning-control (-> *lightning-spec-id-table* 33) this 0.0)) @@ -571,31 +572,10 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'matrix))) - (let* ((v1-9 gp-1) - (a3-0 (-> self node-list data 4 bone transform)) - (a0-5 (-> a3-0 rvec quad)) - (a1-2 (-> a3-0 uvec quad)) - (a2-2 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-9 rvec quad) a0-5) - (set! (-> v1-9 uvec quad) a1-2) - (set! (-> v1-9 fvec quad) a2-2) - (set! (-> v1-9 trans quad) a3-1) - ) + (matrix-copy! gp-1 (-> self node-list data 4 bone transform)) (vector-negate-in-place! (-> gp-1 uvec)) (vector-negate-in-place! (-> gp-1 fvec)) - (let ((a2-3 (-> self particle-hack)) - (v1-10 (-> gp-1 rvec quad)) - (a0-8 (-> gp-1 uvec quad)) - (a1-3 (-> gp-1 fvec quad)) - (a3-2 (-> gp-1 trans quad)) - ) - (set! (-> a2-3 rvec quad) v1-10) - (set! (-> a2-3 uvec quad) a0-8) - (set! (-> a2-3 fvec quad) a1-3) - (set! (-> a2-3 trans quad) a3-2) - ) + (matrix-copy! (-> self particle-hack) gp-1) ) (add-debug-rot-matrix #t (bucket-id debug-no-zbuf1) (-> self particle-hack) (-> self root trans)) (spawn-from-mat (-> self part) (-> self particle-hack)) @@ -625,6 +605,7 @@ ;; definition for method 11 of type fac-fire-torch (defmethod init-from-entity! ((this fac-fire-torch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -785,7 +766,7 @@ (s5-0 (new 'stack-no-clear 'enemy-init-by-other-params)) ) (vector+! v1-5 (-> arg0 root trans) (new 'static 'vector :w 1.0)) - (set! (-> s5-0 trans quad) (-> v1-5 quad)) + (vector-copy! (-> s5-0 trans) v1-5) (quaternion-copy! (-> s5-0 quat) (-> arg0 root quat)) (set! (-> s5-0 entity) (-> arg0 entity)) (set! (-> s5-0 directed?) #f) @@ -989,11 +970,11 @@ (sound-play "fac-hatch-explo") (cond ((logtest? (-> *part-group-id-table* 752 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 752)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 752)) ) ) @@ -1015,11 +996,11 @@ (set! (-> self root root-prim prim-core action) (collide-action)) (cond ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 218)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 218)) ) ) @@ -1059,6 +1040,7 @@ ;; definition for method 11 of type fac-robopod (defmethod init-from-entity! ((this fac-robopod) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1160,7 +1142,7 @@ ) (set! (-> self beams gp-0 state meet data 0 quad) (-> s4-0 quad)) (let ((a0-9 (-> self beams gp-0))) - (set! (-> a0-9 state meet data (+ (-> a0-9 state points-to-draw) -1) quad) (-> v1-2 quad)) + (vector-copy! (-> a0-9 state meet data (+ (-> a0-9 state points-to-draw) -1)) v1-2) ) ) (set! (-> self beams-on gp-0) #t) @@ -1319,6 +1301,7 @@ ;; definition for method 11 of type factory-elec-gate ;; INFO: Used lq/sq (defmethod init-from-entity! ((this factory-elec-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (when (task-node-closed? (game-task-node factory-assault-get-vehicle)) (process-entity-status! this (entity-perm-status dead) #t) diff --git a/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc index e7c0c7a1aa0..6ad338420f1 100644 --- a/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc @@ -345,7 +345,7 @@ (a1-4 (-> *part-id-table* 2856)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -398,7 +398,7 @@ ) (-> *part-id-table* 2854 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 2854 init-specs 3 initial-valuef) (* f28-1 f30-1)) (launch-particles (-> *part-id-table* 2854) s4-1 :origin-is-matrix #t) (set! (-> *part-id-table* 2854 init-specs 3 initial-valuef) f30-1) @@ -631,7 +631,7 @@ ;; INFO: Used lq/sq (defmethod init-proj-settings! ((this ffight-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'ffight-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) ffight-shot-move) @@ -666,7 +666,7 @@ (set! (-> gp-0 attack-id) a2-12) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) (the-as projectile (spawn-projectile ffight-shot gp-0 arg0 *default-dead-pool*)) diff --git a/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc index 44578309558..242728146c3 100644 --- a/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc @@ -272,7 +272,7 @@ (a1-4 (-> *part-id-table* 2871)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -325,7 +325,7 @@ ) (-> *part-id-table* 2869 init-specs 4 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 2869 init-specs 3 initial-valuef) (* f28-1 f30-1)) (launch-particles (-> *part-id-table* 2869) s4-1 :origin-is-matrix #t) (set! (-> *part-id-table* 2869 init-specs 3 initial-valuef) f30-1) @@ -415,7 +415,7 @@ (let ((v1-5 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> v1-5 sphere quad) (-> self root trans quad)) (set! (-> v1-5 sphere r) 40960.0) - (set! (-> v1-5 velocity quad) (-> self root transv quad)) + (vector-copy! (-> v1-5 velocity) (-> self root transv)) (set! (-> v1-5 notify-radius) 122880.0) (set! (-> v1-5 danger-level) 1.0) (set! (-> v1-5 decay-rate) 0.0) @@ -532,7 +532,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this ftank-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'fac-robotank-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) ftank-shot-move) @@ -569,8 +569,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) diff --git a/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc index e459db8428b..c9548450175 100644 --- a/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc @@ -383,7 +383,7 @@ (a1-4 (-> *part-id-table* 2883)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -436,7 +436,7 @@ (f28-1 (-> *part-id-table* 2881 init-specs 4 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 2881 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 2881 init-specs 4 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 2881) s4-1 :origin-is-matrix #t) @@ -619,7 +619,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this fturret-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'fac-robotank-shot) (set! (-> this max-speed) 819200.0) (set! (-> this move) fturret-shot-move) @@ -656,8 +656,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) diff --git a/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc b/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc index ea524b12a2b..66af01496b2 100644 --- a/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc @@ -673,7 +673,7 @@ (set! (-> s5-1 charge) 1.0) (set! (-> s5-1 options) (projectile-options po13)) (logclear! (-> s5-1 options) (projectile-options po14 po15 po16)) - (set! (-> s5-1 pos quad) (-> s4-0 quad)) + (vector-copy! (-> s5-1 pos) s4-0) (set! (-> s5-1 notify-handle) (the-as handle #f)) (set! (-> s5-1 owner-handle) (process->handle *target*)) (set! (-> s5-1 target-handle) (the-as handle #f)) @@ -750,7 +750,7 @@ (set! (-> s5-2 charge) 1.0) (set! (-> s5-2 options) (projectile-options)) (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) - (set! (-> s5-2 pos quad) (-> s2-1 quad)) + (vector-copy! (-> s5-2 pos) s2-1) (set! (-> s5-2 notify-handle) (the-as handle #f)) (set! (-> s5-2 owner-handle) (the-as handle #f)) (set! (-> s5-2 target-handle) (the-as handle #f)) @@ -848,7 +848,7 @@ ) 0.0 (let ((v1-11 (new 'stack-no-clear 'vector))) - (set! (-> v1-11 quad) (-> this rbody ang-velocity quad)) + (vector-copy! v1-11 (-> this rbody ang-velocity)) (let ((f0-10 (* 0.25 (fabs (-> v1-11 y))))) (set! (-> v1-11 y) 0.0) (let* ((f0-11 (+ f0-10 (vector-length v1-11))) @@ -1074,8 +1074,8 @@ (s0-0 (-> arg1 probe-work-array s1-0)) ) (vector-reset! (-> s0-0 tire-force)) - (set! (-> s0-0 local-pos quad) (-> v1-29 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-29 rot quad)) + (vector-copy! (-> s0-0 local-pos) (-> v1-29 local-pos)) + (vector-copy! (-> s0-0 local-normal) (-> v1-29 rot)) (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) (let ((a1-9 (-> s0-0 probe-pos))) (let ((v1-32 (-> s0-0 world-pos))) @@ -1093,27 +1093,25 @@ (.svf (&-> a1-9 quad) vf6) ) (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) - (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) - (-> arg1 steering-axis) - (the-as vector (-> arg1 mat)) - ) - ) - quad - ) - ) - (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s0-0 wheel-axis) (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) + (-> arg1 steering-axis) + (the-as vector (-> arg1 mat)) + ) + ) + ) + (vector-copy! (-> s0-0 ground-pos) (-> s0-0 probe-pos)) (set! (-> s0-0 ground-pos y) 0.0) (vector-reset! (-> s0-0 ground-normal)) (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos)) (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) (cond ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) (logclear! (-> this v-flags) (vehicle-flag in-air)) (logior! (-> this v-flags) (vehicle-flag on-ground)) (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) - (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) + (vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal)) + (vector-copy! (-> arg1 ground-normal) (-> s0-0 ground-normal)) ) (else (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 position y))) @@ -1134,8 +1132,8 @@ (when (>= 1 (-> this force-level)) (dotimes (s2-1 (-> this info physics-model lift-thruster-count)) (let ((s1-1 (-> arg1 probe-work-array s2-1))) - (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) - (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s1-1 world-pos)) + (vector-copy! (-> arg1 velocity) (-> s1-1 velocity)) (let* ((f1-12 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) (f28-1 (- 1.0 (/ (+ -4096.0 f1-12) (+ -4096.0 f30-1)))) ) @@ -1202,8 +1200,8 @@ (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) ) (vector-normalize! (-> arg1 normal) 1.0) - (set! (-> arg1 world-pos quad) (-> s3-0 position quad)) - (set! (-> arg1 velocity quad) (-> s3-0 lin-velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s3-0 position)) + (vector-copy! (-> arg1 velocity) (-> s3-0 lin-velocity)) (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 position)) (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 inv-i-world)) @@ -1259,7 +1257,7 @@ 0.0 (forward-up->inv-matrix s1-0 arg0 *up-vector*) (matrix-transpose! s1-0 s1-0) - (set! (-> s2-0 quad) (-> this rbody matrix fvec quad)) + (vector-copy! s2-0 (-> this rbody matrix fvec)) (set! (-> s2-0 y) 0.0) (vector-normalize! s2-0 1.0) (vector-rotate*! s2-0 s2-0 s1-0) @@ -1318,7 +1316,7 @@ (disable-physics! this) ) (when (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) (not (time-elapsed? (-> this birth) (seconds 1)))) - (set! (-> this rbody lin-momentum quad) (-> this rbody matrix fvec quad)) + (vector-copy! (-> this rbody lin-momentum) (-> this rbody matrix fvec)) (vector-normalize! (-> this rbody lin-momentum) 204800.0) (vector-float*! (-> this rbody lin-momentum) (-> this rbody lin-momentum) (-> this rbody info mass)) ) @@ -1349,7 +1347,7 @@ (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) (+! (-> s3-0 z) 4096.0) - (set! (-> s2-2 velocity quad) (-> *x-vector* quad)) + (vector-copy! (-> s2-2 velocity) *x-vector*) (let ((f0-19 (* 0.00024414062 (vector-length (-> this rbody lin-velocity))))) (set! (-> s2-2 world-pos z) (/ 1.0 f0-19)) ) @@ -1362,7 +1360,7 @@ (let ((s0-0 (new 'stack-no-clear 'vector)) (s1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s0-0 quad) (-> this rbody matrix rvec quad)) + (vector-copy! s0-0 (-> this rbody matrix rvec)) (set! (-> s0-0 y) 0.0000000001) (vector-normalize! s0-0 1.0) (set! (-> s2-2 world-pos x) (* 0.00024414062 (vector-dot (-> this rbody lin-velocity) s0-0))) @@ -1541,7 +1539,7 @@ (let ((s3-1 (new 'stack-no-clear 'vector))) 0.0 (let ((f30-3 (impact-reduction (the-as int (-> this impact-time))))) - (set! (-> s3-1 quad) (-> this rbody matrix rvec quad)) + (vector-copy! s3-1 (-> this rbody matrix rvec)) (set! (-> s3-1 y) 0.0000000001) (vector-normalize! s3-1 1.0) (vector-float*! @@ -1588,7 +1586,7 @@ ) 0.0 (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) - (set! (-> s3-2 quad) (-> this rbody lin-velocity quad)) + (vector-copy! s3-2 (-> this rbody lin-velocity)) (vector-normalize! s3-2 1.0) (let ((f0-156 (vector-dot s3-2 s4-0))) (vector-float*! s2-3 s3-2 f0-156) @@ -1649,10 +1647,10 @@ (init-rbody-impact-from-tshape! this s5-0 arg1) (if (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (rigid-body-control-method-23 (-> this rbody) (-> s5-0 point) (-> s5-0 velocity)) - (set! (-> s5-0 velocity quad) (-> this root transv quad)) + (vector-copy! (-> s5-0 velocity) (-> this root transv)) ) (let ((v1-17 (-> arg0 root))) - (set! (-> s2-0 quad) (-> v1-17 transv quad)) + (vector-copy! s2-0 (-> v1-17 transv)) (vector-! (-> s5-0 velocity) (-> v1-17 transv) (-> s5-0 velocity)) ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) @@ -1742,7 +1740,7 @@ (init-vf0-vector) (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> arg2 quad)) + (vector-copy! s5-0 arg2) (let ((s4-0 (new 'stack-no-clear 'matrix))) (quaternion->matrix s4-0 (-> this root quat)) (let ((a2-1 (matrix-transpose! (new 'stack-no-clear 'matrix) s4-0))) @@ -1760,10 +1758,10 @@ ) ) (else - (set! (-> s5-0 quad) (-> arg2 quad)) + (vector-copy! s5-0 arg2) ) ) - (set! (-> s4-0 trans quad) (-> arg1 quad)) + (vector-copy! (-> s4-0 trans) arg1) (dotimes (s3-1 15) (let* ((f28-0 (* 0.06666667 (- 15.0 (the float s3-1)))) (f26-0 (* f28-0 (rand-vu-float-range 8192.0 9011.2))) @@ -1832,7 +1830,7 @@ (when (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) (let ((s5-0 (new 'stack-no-clear 'h-warf-stack-var0))) (quaternion->matrix (-> s5-0 mat) (-> this root quat)) - (set! (-> s5-0 mat trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 mat trans) (-> this root trans)) (set-vector! (-> s5-0 vec1) 0.0 0.0 -1.0 1.0) (vector-rotate*! (-> s5-0 vec1) (-> s5-0 vec1) (-> s5-0 mat)) (when (< 0.0 (-> this info particles thruster-flame-length)) @@ -1874,19 +1872,8 @@ (let ((a0-3 (the-as process-focusable (handle->process (-> this track-obj))))) (when a0-3 (let ((s5-0 (new 'stack-no-clear 'vehicle-physics-work))) - (let* ((v1-7 (-> s5-0 mat)) - (a3-0 (-> a0-3 node-list data (-> this track-joint) bone transform)) - (a0-9 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-7 rvec quad) a0-9) - (set! (-> v1-7 uvec quad) a1-3) - (set! (-> v1-7 fvec quad) a2-0) - (set! (-> v1-7 trans quad) a3-1) - ) - (set! (-> s5-0 velocity quad) (-> s5-0 mat trans quad)) + (matrix-copy! (-> s5-0 mat) (-> a0-3 node-list data (-> this track-joint) bone transform)) + (vector-copy! (-> s5-0 velocity) (-> s5-0 mat trans)) (matrix->quaternion (the-as quaternion (-> s5-0 force)) (-> s5-0 mat)) (rigid-body-control-method-28 (-> this rbody) (-> s5-0 velocity) (the-as quaternion (-> s5-0 force))) ) diff --git a/test/decompiler/reference/jak3/levels/factory/lfaccity-mood_REF.gc b/test/decompiler/reference/jak3/levels/factory/lfaccity-mood_REF.gc index 9f4132dfa19..79f5007b7ef 100644 --- a/test/decompiler/reference/jak3/levels/factory/lfaccity-mood_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/lfaccity-mood_REF.gc @@ -173,6 +173,7 @@ ;; definition for method 11 of type lfaccity-pparticle-mover ;; INFO: Used lq/sq (defmethod init-from-entity! ((this lfaccity-pparticle-mover) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -246,7 +247,7 @@ (when a1-4 (let ((a1-5 (-> a1-4 extra process))) (when a1-5 - (set! (-> (the-as process-drawable a1-5) root trans quad) (-> v1-6 quad)) + (vector-copy! (-> (the-as process-drawable a1-5) root trans) v1-6) (vector+! (-> (the-as process-drawable a1-5) root trans) (-> (the-as process-drawable a1-5) root trans) @@ -282,7 +283,3 @@ ) (call-parent-method this offset) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/lfacrm1-mood_REF.gc b/test/decompiler/reference/jak3/levels/factory/lfacrm1-mood_REF.gc index 53eef8ea89a..ac524d40473 100644 --- a/test/decompiler/reference/jak3/levels/factory/lfacrm1-mood_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/lfacrm1-mood_REF.gc @@ -173,6 +173,7 @@ ;; definition for method 11 of type lfac-hanger-door (defmethod init-from-entity! ((this lfac-hanger-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -188,7 +189,7 @@ (defbehavior lfac-hanger-door-init-by-other lfac-hanger-door ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-lfac-hanger-door" (the-as (pointer level) #f))) @@ -196,7 +197,3 @@ ) (go-virtual idle) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc b/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc index 3c1b71eed09..c1df0d8d122 100644 --- a/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc @@ -213,34 +213,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 20480.0 - :knocked-soft-vxz-hi 28672.0 - :knocked-soft-vy-lo 36864.0 - :knocked-soft-vy-hi 45056.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 49152.0 - :knocked-hard-vxz-hi 57344.0 - :knocked-hard-vy-lo 49152.0 - :knocked-hard-vy-hi 57344.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 28672.0 - :knocked-yellow-vy-lo 36864.0 - :knocked-yellow-vy-hi 4096.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 114688.0 - :knocked-red-vy-lo 53248.0 - :knocked-red-vy-hi 69632.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 20480.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 5) + :knocked-soft-vxz-hi (meters 7) + :knocked-soft-vy-lo (meters 9) + :knocked-soft-vy-hi (meters 11) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 12) + :knocked-hard-vxz-hi (meters 14) + :knocked-hard-vy-lo (meters 12) + :knocked-hard-vy-hi (meters 14) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 7) + :knocked-yellow-vy-lo (meters 9) + :knocked-yellow-vy-hi (meters 1) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 28) + :knocked-red-vy-lo (meters 13) + :knocked-red-vy-hi (meters 17) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 5) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -289,6 +289,7 @@ ;; definition for method 82 of type missile-bot (defmethod event-handler ((this missile-bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('lift-off) (go (method-of-object this lift-off)) @@ -300,7 +301,10 @@ ) ;; definition for method 63 of type missile-bot -(defmethod enemy-method-63 ((this missile-bot) (arg0 float)) +(defmethod apply-incoming-hitpoint-mods ((this missile-bot) (arg0 float)) + "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (fmax 0.0 (fmin arg0 (-> this hit-points))) ) @@ -348,7 +352,7 @@ ) (init-vf0-vector) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node missile-bot-lod0-jg main)))) - (set! (-> arg0 quad) (-> s4-0 quad)) + (vector-copy! arg0 s4-0) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (target-pos 0))) (s2-0 (ppointer->process (-> self parent))) (s3-1 (if (type? s2-0 factory-boss) @@ -495,7 +499,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -519,7 +523,7 @@ ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) (go-stare self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -616,7 +620,7 @@ (set! (-> self root penetrate-using) (the-as penetrate (logclear (-> self root penetrate-using) (penetrate knocked))) ) - (enemy-method-50 self 2) + (update-collision-action self 2) (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -764,17 +768,17 @@ (f30-0 (rand-vu-float-range 1228.8 2048.0)) (f28-0 (rand-vu-float-range 30.0 120.0)) ) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (+! (-> gp-0 y) (rand-vu-float-range 6144.0 10240.0)) (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-0 f28-0 f30-0) ) (cond ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) ) ) @@ -834,11 +838,11 @@ (set! (-> self root root-prim local-sphere w) 491520.0) (cond ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) ) ) @@ -860,6 +864,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. (defmethod enemy-common-post ((this missile-bot)) + "Common implementation of post. Runs ja-post." (local-vars (sv-272 vector) (sv-288 vector) (sv-304 vector)) (with-pp (cond @@ -896,7 +901,7 @@ (update-with-delay! (-> this main-wobble-rand)) (when (not (stunned?)) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> this main-wobble-rand value quad)) + (vector-copy! a1-4 (-> this main-wobble-rand value)) (vector+! a1-4 a1-4 (new 'static 'vector :y 1.0)) (update! (-> this main-wobble) a1-4) ) @@ -1034,7 +1039,7 @@ (let ((a0-67 (-> this lightning s0-0)) (v1-116 s4-0) ) - (set! (-> a0-67 state meet data (+ (-> a0-67 state points-to-draw) -1) quad) (-> v1-116 quad)) + (vector-copy! (-> a0-67 state meet data (+ (-> a0-67 state points-to-draw) -1)) v1-116) ) (cond ((or (= (-> this lightning-mode) 2) (and (= (-> this lightning-mode) 1) (< s0-0 2))) @@ -1151,6 +1156,7 @@ ;; definition for method 67 of type missile-bot (defmethod coin-flip? ((this missile-bot)) + "Return #t half the time, #f the other." #f ) @@ -1200,7 +1206,8 @@ ;; definition for method 50 of type missile-bot ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this missile-bot) (arg0 int)) +(defmethod update-collision-action ((this missile-bot) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0)) (a0-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1)) ) @@ -1232,6 +1239,7 @@ ;; definition for method 120 of type missile-bot ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this missile-bot)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1283,6 +1291,7 @@ ;; definition for method 121 of type missile-bot ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this missile-bot)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-missile-bot" (the-as (pointer level) #f))) @@ -1291,7 +1300,7 @@ (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) ) - (init-enemy-defaults! this *missile-bot-nav-enemy-info*) + (setup-enemy! this *missile-bot-nav-enemy-info*) (set! (-> this top-angle) 0.0) (set! (-> this top-spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) (set! (-> this top-spin-jm track-mode) (track-mode no-trans no-scale)) diff --git a/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc index a6cd648644a..5e9c5a732d9 100644 --- a/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc @@ -250,7 +250,7 @@ ) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-identity! (-> self root quat)) (set! (-> self draw lod-set lod 0 dist) 14336000.0) (set! (-> self expanding?) #t) @@ -277,18 +277,7 @@ (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) ) :trans (behavior () - (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (math-camera-matrix)) - (v1-0 (-> a2-0 rvec quad)) - (a0-0 (-> a2-0 uvec quad)) - (a1-0 (-> a2-0 fvec quad)) - (a2-1 (-> a2-0 trans quad)) - ) - (set! (-> gp-0 rvec quad) v1-0) - (set! (-> gp-0 uvec quad) a0-0) - (set! (-> gp-0 fvec quad) a1-0) - (set! (-> gp-0 trans quad) a2-1) - ) + (let ((gp-0 (matrix-copy! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) (let ((a1-1 (-> gp-0 fvec)) (v1-1 (-> gp-0 rvec)) ) @@ -396,7 +385,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (set! (-> gp-0 notify-handle) (process->handle arg0)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -432,7 +421,7 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (set! (-> gp-0 notify-handle) (process->handle arg0)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -488,7 +477,7 @@ (fmin 1.0 (/ f30-0 (meters 40))) (-> *part-id-table* 2895 init-specs 3 initial-valuef) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) ) ) 0 @@ -555,7 +544,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod warf-projectile-method-45 ((this warf-projectile)) (when (time-elapsed? (-> this spawn-time) (seconds 0.5)) - (set! (-> this hit-pos quad) (-> this root trans quad)) + (vector-copy! (-> this hit-pos) (-> this root trans)) (go (method-of-object this impact)) ) 0 @@ -587,7 +576,7 @@ (let ((v1-19 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-6 (-> arg0 hit-pos)) ) - (set! (-> a1-6 quad) (-> s5-0 trans quad)) + (vector-copy! a1-6 (-> s5-0 trans)) (vector+! a1-6 a1-6 v1-19) (move-to-point! (-> arg0 root) a1-6) ) @@ -705,7 +694,7 @@ (set! (-> self hit-pos w) 0.0) (kill-particles (-> self part)) (let ((gp-0 (new 'stack-no-clear 'warf-explosion-sphere-init-params))) - (set! (-> gp-0 pos quad) (-> self hit-pos quad)) + (vector-copy! (-> gp-0 pos) (-> self hit-pos)) (let ((s5-0 sound-play-by-name) (sname (static-sound-name "impact-trigger2")) (s3-0 (new-sound-id)) @@ -850,7 +839,7 @@ (defmethod init-proj-settings! ((this warf-projectile)) (set! (-> this hit-actor?) #f) (set! (-> this hit-pos quad) (the-as uint128 0)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'guard-shot) (set! (-> this max-speed) 327680.0) (set! (-> this move) warf-projectile-move) @@ -1154,7 +1143,7 @@ (f28-0 (-> *part-id-table* 2895 init-specs 3 initial-valuef)) ) (forward-up->inv-matrix s3-1 s4-1 *up-vector*) - (set! (-> s3-1 trans quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 trans) s5-0) (gun-warf-shot-method-42 this f30-1 f28-0 s3-1) ) ) @@ -1412,7 +1401,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this fac-gun-tower-projectile)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) #t) (set! (-> this max-speed) 327680.0) (set! (-> this move) fac-gun-tower-projectile-move) @@ -1440,21 +1429,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) ) ) ) ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) ) ) @@ -1533,7 +1522,7 @@ (let ((v1-14 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-5 (-> arg0 hit-pos)) ) - (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector-copy! a1-5 (-> s5-0 trans)) (vector+! a1-5 a1-5 v1-14) (move-to-point! (-> arg0 root) a1-5) ) @@ -1602,7 +1591,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this gun-warf-shot)) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (set! (-> this attack-mode) 'eco-yellow) (set! (-> this max-speed) 1638400.0) diff --git a/test/decompiler/reference/jak3/levels/forest/eco-green-collider_REF.gc b/test/decompiler/reference/jak3/levels/forest/eco-green-collider_REF.gc index 992848b87ba..b3541b4eaac 100644 --- a/test/decompiler/reference/jak3/levels/forest/eco-green-collider_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/eco-green-collider_REF.gc @@ -76,11 +76,7 @@ (defbehavior eco-green-collider-init-by-other eco-green-collider ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (init-collision! self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 125) self)) (go-virtual idle) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/forest/for-turret-shot_REF.gc b/test/decompiler/reference/jak3/levels/forest/for-turret-shot_REF.gc index 4b4a031b636..194975f91f0 100644 --- a/test/decompiler/reference/jak3/levels/forest/for-turret-shot_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/for-turret-shot_REF.gc @@ -360,7 +360,7 @@ (a1-4 (-> *part-id-table* 1069)) (a2-2 *launch-matrix*) ) - (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (vector-copy! (-> a2-2 trans) v1-2) (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) 0 @@ -412,7 +412,7 @@ (f28-1 (-> *part-id-table* 1067 init-specs 5 initial-valuef)) ) (forward-up->inv-matrix s4-1 s5-1 *up-vector*) - (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-1 trans) gp-0) (set! (-> *part-id-table* 1067 init-specs 3 initial-valuef) (* f26-0 f30-1)) (set! (-> *part-id-table* 1067 init-specs 5 initial-valuef) (* f26-0 f28-1)) (launch-particles (-> *part-id-table* 1067) s4-1 :origin-is-matrix #t) @@ -433,15 +433,15 @@ (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) (v1-2 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector-copy! v1-2 (-> gp-0 trans)) (vector+! v1-2 v1-2 a0-3) (cond ((logtest? (-> *part-group-id-table* 239 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 239)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-2) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 239)) ) ) @@ -596,7 +596,7 @@ ;; definition for method 31 of type for-turret-shot ;; INFO: Used lq/sq (defmethod init-proj-settings! ((this for-turret-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'for-turret-shot) (set! (-> this max-speed) 737280.0) (set! (-> this move) for-turret-shot-move) @@ -626,7 +626,7 @@ (set! (-> gp-0 attack-id) a0-11) ) (set! (-> gp-0 timeout) (seconds 4)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg1) (vector-normalize-copy! (-> gp-0 vel) arg2 arg3) (the-as (pointer for-turret-shot) (spawn-projectile for-turret-shot gp-0 arg0 *default-dead-pool*)) ) diff --git a/test/decompiler/reference/jak3/levels/forest/for-turret_REF.gc b/test/decompiler/reference/jak3/levels/forest/for-turret_REF.gc index 1321ab5e78e..d097cacbcdd 100644 --- a/test/decompiler/reference/jak3/levels/forest/for-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/for-turret_REF.gc @@ -345,8 +345,8 @@ (set! (-> this values 1 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) ) (('set-aim-vector) - (set! (-> this aim-vector-source quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> this aim-vector quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! (-> this aim-vector-source) (the-as vector (-> arg3 param 0))) + (vector-copy! (-> this aim-vector) (the-as vector (-> arg3 param 1))) ) (('set-hud-pos) (set-hud-piece-position! @@ -559,7 +559,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (ja-post) (update-transforms (-> self root)) (go-virtual idle) @@ -930,11 +930,11 @@ ) (when gp-0 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) + (vector-copy! s5-1 (get-trans (the-as process-focusable gp-0) 0)) (+! (-> s5-1 y) 6144.0) (when (>= 327680.0 (vector-vector-xz-distance s5-1 (-> self root trans))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (get-transv (the-as process-focusable gp-0)) quad)) + (vector-copy! s4-0 (get-transv (the-as process-focusable gp-0))) (vector+float*! (-> self aim-pos) s5-1 s4-0 -0.3) ) (when (and (time-elapsed? (-> self fire-timer) (-> self params fire-interval)) @@ -945,7 +945,7 @@ (f30-1 (vector-length s5-3)) (gp-1 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-1 quad) (-> self node-list data 7 bone transform fvec quad)) + (vector-copy! gp-1 (-> self node-list data 7 bone transform fvec)) (vector-normalize! s5-3 1.0) (vector-normalize! gp-1 1.0) (if (and (< (acos (vector-dot s5-3 gp-1)) 1820.4445) @@ -1115,9 +1115,9 @@ (vector+float*! sv-120 (-> this root trans) s4-1 (* 4096.0 (rand-vu-float-range 1.5 2.5))) ) (let ((s4-2 (new 'stack-no-clear 'vector))) - (set! (-> s4-2 quad) (-> *y-vector* quad)) + (vector-copy! s4-2 *y-vector*) (let ((s3-2 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-2 start-pos quad) (-> sv-120 quad)) + (vector-copy! (-> s3-2 start-pos) sv-120) (+! (-> s3-2 start-pos y) 12288.0) (set-vector! (-> s3-2 move-dist) 0.0 -12288.0 0.0 0.0) (let ((v1-13 s3-2)) @@ -1141,7 +1141,7 @@ (matrix-u-f-compose sv-112 s4-2 sv-116) ) (+! (-> sv-120 y) 819.2) - (set! (-> sv-112 trans quad) (-> sv-120 quad)) + (vector-copy! (-> sv-112 trans) sv-120) (let ((v1-32 (if (logtest? (-> *part-group-id-table* 241 flags) (sp-group-flag sp13)) (part-tracker-spawn @@ -1269,7 +1269,7 @@ (f0-3 6144.0) (s3-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s3-0 start-pos quad) (-> s1-1 quad)) + (vector-copy! (-> s3-0 start-pos) s1-1) (+! (-> s3-0 start-pos y) 12288.0) (set-vector! (-> s3-0 move-dist) 0.0 -12288.0 0.0 0.0) (let ((v1-10 s3-0)) @@ -1294,7 +1294,7 @@ (set! (-> v1-10 action-mask) (collide-action solid)) ) (when (< (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) - (set! (-> arg0 quad) (-> s1-1 quad)) + (vector-copy! arg0 s1-1) (let ((v1-15 s3-0)) (set! (-> v1-15 radius) 819.2) (set! (-> v1-15 collide-with) (collide-spec backgnd)) @@ -1338,9 +1338,9 @@ (s3-0 (-> this node-list data (-> v1-3 (-> this current-barrel)))) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) s3-0)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> s5-0 quad)) + (vector-copy! (new 'stack-no-clear 'vector) s5-0) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> s3-0 bone transform fvec quad)) + (vector-copy! s4-0 (-> s3-0 bone transform fvec)) (new 'stack-no-clear 'vector) (vector-normalize! s4-0 1.0) (vector+float*! s5-0 s5-0 s4-0 10240.0) @@ -1450,7 +1450,7 @@ (gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) s3-0)) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> s3-0 bone transform fvec quad)) + (vector-copy! s4-1 (-> s3-0 bone transform fvec)) (vector-normalize! s4-1 1.0) (vector+float*! gp-1 gp-1 s4-1 10240.0) ) diff --git a/test/decompiler/reference/jak3/levels/forest/forest-bridges_REF.gc b/test/decompiler/reference/jak3/levels/forest/forest-bridges_REF.gc index b3816d77211..4ee44265151 100644 --- a/test/decompiler/reference/jak3/levels/forest/forest-bridges_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/forest-bridges_REF.gc @@ -146,14 +146,14 @@ (process-entity-status! self (entity-perm-status subtask-complete) #t) (sound-play "bridge-break") (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> gp-1 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 fountain-rand-transv-lo) (-> self root trans)) (set! (-> gp-1 fountain-rand-transv-hi x) 4096.0) (set! (-> gp-1 fountain-rand-transv-hi y) 40960.0) (set! (-> gp-1 fountain-rand-transv-hi z) 4096.0) (set! (-> gp-1 fountain-rand-transv-hi w) 102400.0) (cond ((logtest? (-> *part-group-id-table* 577 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -162,7 +162,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -195,6 +195,7 @@ ;; definition for method 11 of type for-break-bridge-board (defmethod init-from-entity! ((this for-break-bridge-board) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 64) (when (task-node-closed? (game-task-node forest-kill-plants-resolution)) (cleanup-for-death this) @@ -325,7 +326,3 @@ (defmethod get-skel ((this for-break-bridge-board-d)) (art-group-get-by-name *level* "skel-for-break-bridge-board-d" (the-as (pointer level) #f)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/forest/forest-kill-plants_REF.gc b/test/decompiler/reference/jak3/levels/forest/forest-kill-plants_REF.gc index de3575f3e51..d68a245e262 100644 --- a/test/decompiler/reference/jak3/levels/forest/forest-kill-plants_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/forest-kill-plants_REF.gc @@ -266,7 +266,7 @@ (set! (-> *eco-green-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *eco-green-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *eco-green-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *eco-green-trail* use-tape-mode?) #f) diff --git a/test/decompiler/reference/jak3/levels/forest/forest-part_REF.gc b/test/decompiler/reference/jak3/levels/forest/forest-part_REF.gc index c472666dc66..3130a129008 100644 --- a/test/decompiler/reference/jak3/levels/forest/forest-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/forest-part_REF.gc @@ -736,7 +736,7 @@ (set! (-> a0-9 y) (-> arg2 launchrot y)) (set! (-> a0-9 z) (-> arg2 launchrot z)) (set! (-> a0-9 w) 1.0) - (set! (-> v1-18 quad) (-> a0-9 quad)) + (vector-copy! v1-18 a0-9) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 570)) ) @@ -748,7 +748,7 @@ (set! (-> a0-14 y) (-> arg2 launchrot y)) (set! (-> a0-14 z) (-> arg2 launchrot z)) (set! (-> a0-14 w) 1.0) - (set! (-> v1-33 quad) (-> a0-14 quad)) + (vector-copy! v1-33 a0-14) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 570)) ) @@ -1065,7 +1065,7 @@ (set! (-> a0-1 y) (-> arg2 launchrot y)) (set! (-> a0-1 z) (-> arg2 launchrot z)) (set! (-> a0-1 w) 1.0) - (set! (-> v1-6 quad) (-> a0-1 quad)) + (vector-copy! v1-6 a0-1) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 573)) ) @@ -1077,7 +1077,7 @@ (set! (-> a0-6 y) (-> arg2 launchrot y)) (set! (-> a0-6 z) (-> arg2 launchrot z)) (set! (-> a0-6 w) 1.0) - (set! (-> v1-19 quad) (-> a0-6 quad)) + (vector-copy! v1-19 a0-6) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 573)) ) @@ -2861,7 +2861,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/forest/forest-ring-chase_REF.gc b/test/decompiler/reference/jak3/levels/forest/forest-ring-chase_REF.gc index 12457ce49af..61be0e9d769 100644 --- a/test/decompiler/reference/jak3/levels/forest/forest-ring-chase_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/forest-ring-chase_REF.gc @@ -472,11 +472,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 579 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 579)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 579)) ) ) @@ -498,7 +498,7 @@ (let ((f0-18 (vector-dot s3-0 s4-3))) (cond ((< 0.9999 f0-18) - (set! (-> s4-3 quad) (-> s3-0 quad)) + (vector-copy! s4-3 s3-0) ) (else (let ((s5-2 (new 'stack-no-clear 'vector)) @@ -516,7 +516,7 @@ ) (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this root trans) s4-3 (meters 1) *color-yellow*) (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this root trans) s3-0 (meters 1) *color-dark-yellow*) - (set! (-> this root transv quad) (-> s4-3 quad)) + (vector-copy! (-> this root transv) s4-3) ) (vector-normalize! (-> this root transv) f30-1) ) @@ -585,6 +585,7 @@ ;; definition for method 11 of type for-race-ring-finder ;; WARN: Return type mismatch float vs object. (defmethod init-from-entity! ((this for-race-ring-finder) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) (set! (-> this ring-finder-speed) 163840.0) ) @@ -594,7 +595,7 @@ (defbehavior for-race-ring-finder-init-by-other for-race-ring-finder ((arg0 vector) (arg1 entity)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self path-pos) 0.0) (set! (-> self ring-finder-speed) 163840.0) @@ -740,13 +741,14 @@ (cond ((focus-test? v1-3 pilot) (let ((a2-1 (handle->process (-> v1-3 pilot vehicle)))) - (set! (-> a1-1 quad) - (-> (the-as collide-shape (-> (the-as process-drawable a2-1) root)) root-prim prim-core world-sphere quad) - ) + (vector-copy! + a1-1 + (-> (the-as collide-shape (-> (the-as process-drawable a2-1) root)) root-prim prim-core world-sphere) + ) ) ) (else - (set! (-> a1-1 quad) (-> v1-3 control trans quad)) + (vector-copy! a1-1 (-> v1-3 control trans)) (+! (-> a1-1 y) 8192.0) ) ) @@ -858,10 +860,11 @@ ;; definition for method 11 of type for-race-ring ;; INFO: Used lq/sq (defmethod init-from-entity! ((this for-race-ring) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (for-race-ring-method-23 this) (process-drawable-from-entity! this arg0) (quaternion->matrix (-> this mat) (-> this root quat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 589) this)) (set! (-> this part-final) (create-launch-control (-> *part-group-id-table* 590) this)) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1121,7 +1124,7 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 584 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to self @@ -1130,7 +1133,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 584) :duration (seconds 1)) ) ) @@ -1144,7 +1147,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 585 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -1153,7 +1156,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1279,6 +1282,7 @@ ;; definition for method 11 of type for-statue (defmethod init-from-entity! ((this for-statue) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (with-pp (for-statue-method-27 this) (process-drawable-from-entity! this arg0) @@ -2405,11 +2409,10 @@ (not (logtest? (-> s5-1 extra perm status) (entity-perm-status subtask-complete))) ) (let ((s2-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s2-0 pos quad) - (-> (vector+! (new 'stack-no-clear 'vector) (-> s5-1 extra trans) (new 'static 'vector :y -4096.0 :w 1.0)) - quad - ) - ) + (vector-copy! + (-> s2-0 pos) + (vector+! (new 'stack-no-clear 'vector) (-> s5-1 extra trans) (new 'static 'vector :y -4096.0 :w 1.0)) + ) (quaternion-identity! (-> s2-0 quat)) (set! (-> s2-0 flags) (task-arrow-flags taf8)) (set! (-> s2-0 map-icon) (the-as uint 13)) @@ -2676,7 +2679,7 @@ ) (set-setting! 'airlock #f 0.0 0) (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-0 pos quad) (-> (new 'static 'vector :x -2937746.8 :y 249443.12 :z 4155934.0 :w 1.0) quad)) + (vector-copy! (-> s5-0 pos) (new 'static 'vector :x -2937746.8 :y 249443.12 :z 4155934.0 :w 1.0)) (quaternion-identity! (-> s5-0 quat)) (set! (-> s5-0 flags) (task-arrow-flags)) (set! (-> s5-0 map-icon) (the-as uint 12)) diff --git a/test/decompiler/reference/jak3/levels/forest/forest-tasks_REF.gc b/test/decompiler/reference/jak3/levels/forest/forest-tasks_REF.gc index e05b12a8040..a2a8b2aac28 100644 --- a/test/decompiler/reference/jak3/levels/forest/forest-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/forest-tasks_REF.gc @@ -379,7 +379,7 @@ ) ) (let ((gp-4 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-4 pos quad) (-> (new 'static 'vector :x -2937746.8 :y 249443.12 :z 4155934.0 :w 1.0) quad)) + (vector-copy! (-> gp-4 pos) (new 'static 'vector :x -2937746.8 :y 249443.12 :z 4155934.0 :w 1.0)) (quaternion-identity! (-> gp-4 quat)) (set! (-> gp-4 flags) (task-arrow-flags)) (set! (-> gp-4 map-icon) (the-as uint 12)) diff --git a/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc b/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc index aee12b580b7..4bdca3724a6 100644 --- a/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/foresta-obs_REF.gc @@ -312,7 +312,7 @@ (set! (-> a0-21 param2) (the-as basic 0)) ) (let ((v1-18 (-> this shakers 1))) - (set! (-> v1-18 axis quad) (-> s5-0 quad)) + (vector-copy! (-> v1-18 axis) s5-0) (set! (-> v1-18 start-time) (+ (current-time) (seconds -0.06))) (set! (-> v1-18 decay-time) 600.0) (set! (-> v1-18 freq) 150.0) @@ -328,7 +328,7 @@ (set! (-> v1-20 param2) (the-as basic 1)) ) (let ((v1-21 (-> this shakers 2))) - (set! (-> v1-21 axis quad) (-> s5-0 quad)) + (vector-copy! (-> v1-21 axis) s5-0) (set! (-> v1-21 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-21 decay-time) 600.0) (set! (-> v1-21 freq) 150.0) @@ -343,7 +343,7 @@ (set! (-> v1-23 param2) (the-as basic 2)) ) (let ((v1-24 (-> this shakers 3))) - (set! (-> v1-24 axis quad) (-> s5-0 quad)) + (vector-copy! (-> v1-24 axis) s5-0) (set! (-> v1-24 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-24 decay-time) 600.0) (set! (-> v1-24 freq) 150.0) @@ -422,6 +422,7 @@ ;; definition for method 11 of type for-log (defmethod init-from-entity! ((this for-log) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -654,7 +655,7 @@ ) ) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self entity extra trans quad)) + (vector-copy! a1-1 (-> self entity extra trans)) (set! (-> a1-1 y) 90112.0) (spawn (-> self part) a1-1) ) @@ -737,6 +738,7 @@ ;; definition for method 11 of type for-pillar (defmethod init-from-entity! ((this for-pillar) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 64) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -976,6 +978,7 @@ ;; definition for method 11 of type for-telescope ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this for-telescope) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -984,7 +987,7 @@ (defbehavior for-telescope-init-by-other for-telescope ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (for-telescope-method-21 self) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) 11832.889) (initialize-skeleton self @@ -1089,6 +1092,7 @@ ;; definition for method 11 of type for-tower ;; INFO: Used lq/sq (defmethod init-from-entity! ((this for-tower) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 64) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1112,7 +1116,7 @@ (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> this root trans quad)) + (vector-copy! s4-1 (-> this root trans)) (set! (-> s4-1 y) (+ 65536.0 (-> this extend-height) (-> s4-1 y))) (set! (-> this telescope) (ppointer->handle (process-spawn for-telescope s4-1 arg0 :name "for-telescope" :to this)) @@ -1158,7 +1162,7 @@ (set! (-> self level) arg2) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-shoulder-plates" (the-as (pointer level) #f))) @@ -1180,5 +1184,6 @@ ;; definition for method 11 of type shoulder-plates ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this shoulder-plates) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) diff --git a/test/decompiler/reference/jak3/levels/forest/mh-plant_REF.gc b/test/decompiler/reference/jak3/levels/forest/mh-plant_REF.gc index 70f8857c235..36633c90ebc 100644 --- a/test/decompiler/reference/jak3/levels/forest/mh-plant_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/mh-plant_REF.gc @@ -174,11 +174,11 @@ (sound-play "plant-sprout") (cond ((logtest? (-> *part-group-id-table* 571 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 571)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 571)) ) ) @@ -262,11 +262,11 @@ (sound-play "plant-pop") (cond ((logtest? (-> *part-group-id-table* 576 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 576)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 576)) ) ) @@ -295,11 +295,11 @@ ((time-elapsed? (-> self sub-state-time) (seconds 4)) (cond ((logtest? (-> *part-group-id-table* 575 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 575)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 575)) ) ) @@ -352,11 +352,11 @@ :enter (behavior () (cond ((logtest? (-> *part-group-id-table* 574 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 574)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 574)) ) ) @@ -551,6 +551,7 @@ ;; definition for method 11 of type mh-plant (defmethod init-from-entity! ((this mh-plant) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 16) (init! this arg0) (cond @@ -563,7 +564,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/forest/neo-spawner_REF.gc b/test/decompiler/reference/jak3/levels/forest/neo-spawner_REF.gc index 785169ba8c8..eae04a3c5ae 100644 --- a/test/decompiler/reference/jak3/levels/forest/neo-spawner_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/neo-spawner_REF.gc @@ -207,6 +207,7 @@ ;; definition for method 11 of type neo-spawner-manager ;; INFO: Used lq/sq (defmethod init-from-entity! ((this neo-spawner-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this total-spawned) 0) (set! (-> this max-spawned) 0) @@ -437,7 +438,7 @@ (gp-0 (new 'stack-no-clear 'vector4w)) ) (set! (-> gp-0 quad) (the-as uint128 0)) - (set! (-> s5-0 quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! s5-0 (-> self node-list data 3 bone transform trans)) (+! (-> s5-0 y) -6144.0) (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (camera-pos) s5-0))) (vector-normalize! s4-1 9420.8) @@ -621,7 +622,7 @@ ) ) (when s4-0 - (set! (-> s5-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) (quaternion-copy! (-> s5-0 quat) (-> this root quat)) (set! (-> s5-0 entity) (-> this entity)) (set! (-> s5-0 directed?) #f) @@ -711,7 +712,7 @@ (let ((a1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) (matrix-f-compose gp-0 a1-5) ) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 566 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 566) :mat-joint gp-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 566) :mat-joint gp-0) @@ -787,7 +788,7 @@ (new 'stack-no-clear 'vector) (set! (-> a1-7 hit-xz-reaction) 0.95) (set! (-> a1-7 hit-y-reaction) 0.6) - (set! (-> a1-7 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> a1-7 fountain-rand-transv-lo) (-> self root trans)) (set! (-> a1-7 fountain-rand-transv-hi x) 24576.0) (set! (-> a1-7 fountain-rand-transv-hi y) 163840.0) (set! (-> a1-7 fountain-rand-transv-hi z) 24576.0) @@ -797,11 +798,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 565 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 565)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 565)) ) ) @@ -826,18 +827,7 @@ :code sleep-code :post (behavior () (let ((a1-0 (new 'stack-no-clear 'matrix))) - (let* ((v1-0 a1-0) - (t0-0 (-> self node-list data 3 bone transform)) - (a0-2 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-0 rvec quad) a0-2) - (set! (-> v1-0 uvec quad) a2-0) - (set! (-> v1-0 fvec quad) a3-0) - (set! (-> v1-0 trans quad) t0-1) - ) + (matrix-copy! a1-0 (-> self node-list data 3 bone transform)) (vector+float*! (-> a1-0 trans) (-> a1-0 trans) (-> a1-0 fvec) 8192.0) (spawn-from-mat (-> self dead-part) a1-0) ) @@ -846,7 +836,8 @@ ;; definition for method 20 of type neo-spawner ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this neo-spawner)) +(defmethod get-search-info-flag ((this neo-spawner)) + "Get search-info-flag for this process." (the-as search-info-flag 1) ) @@ -872,6 +863,7 @@ ;; definition for method 11 of type neo-spawner ;; INFO: Used lq/sq (defmethod init-from-entity! ((this neo-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/test/decompiler/reference/jak3/levels/glider/glider-manager_REF.gc b/test/decompiler/reference/jak3/levels/glider/glider-manager_REF.gc index 7bb11f87b75..06dc06befe0 100644 --- a/test/decompiler/reference/jak3/levels/glider/glider-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/glider/glider-manager_REF.gc @@ -78,7 +78,7 @@ (defun pre-populate-clouds ((arg0 vector) (arg1 process)) (let ((s4-0 (new 'stack-no-clear 'vector))) (dotimes (s3-0 57) - (set! (-> s4-0 quad) (-> arg0 quad)) + (vector-copy! s4-0 arg0) (let* ((f30-0 -1228800.0) (f28-0 2457600.0) (v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -965,7 +965,7 @@ (if (= (-> this max-count) -1) (set! (-> this max-count) (-> s4-0 length)) ) - (set! (-> s5-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s5-0 (target-pos 0)) (while (< (-> this count) (-> this max-count)) (let ((s3-1 (-> s4-0 (-> this count)))) (let ((f0-0 8192000.0)) @@ -1067,8 +1067,8 @@ ) ) (b! (not s4-0) cfg-86 :delay (nop!)) - (set! (-> s5-0 pos quad) (-> s4-0 rbody matrix trans quad)) - (set! (-> s5-0 forw quad) (-> s4-0 rbody matrix fvec quad)) + (vector-copy! (-> s5-0 pos) (-> s4-0 rbody matrix trans)) + (vector-copy! (-> s5-0 forw) (-> s4-0 rbody matrix fvec)) (set! (-> s5-0 shootable) #f) (set! (-> s5-0 speedmod) 1.0) (cond @@ -1110,7 +1110,7 @@ ) ) (b! (not v1-85) cfg-86 :delay (nop!)) - (set! (-> s5-1 pos quad) (-> v1-85 rbody matrix trans quad)) + (vector-copy! (-> s5-1 pos) (-> v1-85 rbody matrix trans)) (set! (-> s5-1 pos w) 40960.0) (set! (-> s5-1 thermal-time) 0) (let ((a0-42 (new 'stack-no-clear 'vector))) @@ -1130,7 +1130,7 @@ (.svf (&-> a2-2 quad) vf6) ) (set! (-> a0-42 w) (-> s5-1 pos w)) - (set! (-> s5-1 pos quad) (-> a0-42 quad)) + (vector-copy! (-> s5-1 pos) a0-42) ) ) (set! (-> s5-1 hheight) 409600.0) @@ -1492,7 +1492,7 @@ ) (let ((s5-2 (new 'stack-no-clear 'vector))) (let ((s4-4 (camera-matrix))) - (set! (-> s5-2 quad) (-> (camera-pos) quad)) + (vector-copy! s5-2 (camera-pos)) (let ((a0-29 s5-2)) (let ((v1-73 s5-2)) (let ((a1-15 (-> s4-4 fvec))) @@ -1509,7 +1509,7 @@ (.svf (&-> a0-29 quad) vf6) ) ) - (set! (-> *cloud-cube* quad) (-> s5-2 quad)) + (vector-copy! *cloud-cube* s5-2) ) (set! (-> *cloud-cube* w) 2457600.0) (task-manager-desert-glide-method-34 this) @@ -1683,6 +1683,7 @@ ;; definition for method 11 of type tpl-glider (defmethod init-from-entity! ((this tpl-glider) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/test/decompiler/reference/jak3/levels/glider/glider-ring-part_REF.gc b/test/decompiler/reference/jak3/levels/glider/glider-ring-part_REF.gc index 83df2192750..e4ee0469a39 100644 --- a/test/decompiler/reference/jak3/levels/glider/glider-ring-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/glider/glider-ring-part_REF.gc @@ -837,7 +837,7 @@ (let ((s3-0 (new 'stack-no-clear 'collide-query)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s3-0 start-pos) arg0) (set! (-> s3-0 move-dist quad) (the-as uint128 0)) (set! (-> s3-0 move-dist y) -2048000.0) (let ((v1-3 s3-0)) @@ -852,18 +852,18 @@ ) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* s3-0) 0.0) - (set! (-> s4-0 quad) (-> s3-0 best-other-tri normal quad)) + (vector-copy! s4-0 (-> s3-0 best-other-tri normal)) (set! (-> arg0 y) (-> s3-0 best-other-tri intersect y)) ) (else - (set! (-> s4-0 quad) (-> *up-vector* quad)) + (vector-copy! s4-0 *up-vector*) (set! (-> arg0 y) (get-base-height *ocean-map*)) ) ) (matrix-u-compose arg1 s4-0 arg2 arg3) ) (+! (-> arg0 y) 8192.0) - (set! (-> arg1 trans quad) (-> arg0 quad)) + (vector-copy! (-> arg1 trans) arg0) (set! (-> arg1 rvec w) 0.0) (set! (-> arg1 uvec w) 0.0) (set! (-> arg1 fvec w) 0.0) diff --git a/test/decompiler/reference/jak3/levels/glider/glider-ring_REF.gc b/test/decompiler/reference/jak3/levels/glider/glider-ring_REF.gc index 1e6b2fbb27f..143ec4cc0de 100644 --- a/test/decompiler/reference/jak3/levels/glider/glider-ring_REF.gc +++ b/test/decompiler/reference/jak3/levels/glider/glider-ring_REF.gc @@ -110,7 +110,7 @@ (set! (-> *glider-ring-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *glider-ring-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *glider-ring-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *glider-ring-trail* use-tape-mode?) #f) @@ -391,8 +391,8 @@ ) (when gp-2 (let ((s4-1 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s4-1 0 quad) (-> gp-2 trans quad)) - (set! (-> s4-1 1 quad) (-> gp-2 trans-old-old quad)) + (vector-copy! (-> s4-1 0) (-> gp-2 trans)) + (vector-copy! (-> s4-1 1) (-> gp-2 trans-old-old)) (set! (-> s4-1 0 w) 1.0) (set! (-> s4-1 1 w) 1.0) (let ((f30-0 (vector4-dot (-> self plane) (-> s4-1 0))) @@ -501,7 +501,7 @@ (set-far self #f) (set-far self #t) ) - (set! (-> self root trans quad) (-> self save-pos quad)) + (vector-copy! (-> self root trans) (-> self save-pos)) (when (< 0.0 (-> self speedmod)) (when (!= (-> self xdist) 0.0) (let ((gp-1 (-> self root trans))) @@ -541,7 +541,7 @@ (if (and (-> self shootable) (not (-> self shot))) (quaternion-rotate-local-z! (-> self root quat) (-> self root quat) (* 32768.0 (seconds-per-frame))) ) - (set! (-> self mat trans quad) (-> self root trans quad)) + (vector-copy! (-> self mat trans) (-> self root trans)) (when (and (nonzero? (-> self distant-part)) (not (-> self shootable))) ) (when (logtest? (-> self draw status) (draw-control-status on-screen)) @@ -612,7 +612,7 @@ ) (let ((v1-151 (the-as glider-prim (handle->process (-> self ring-prim))))) (when v1-151 - (set! (-> v1-151 root trans quad) (-> self root trans quad)) + (vector-copy! (-> v1-151 root trans) (-> self root trans)) (quaternion-copy! (-> v1-151 root quat) (-> self root quat)) ) ) @@ -705,9 +705,9 @@ (vector-normalize! (-> this right) 1.0) (vector-cross! (-> this up) (-> this right) (-> s5-0 fvec)) (vector-normalize! (-> this up) 1.0) - (set! (-> s5-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 trans) (-> this root trans)) (matrix->quaternion (-> this root quat) s5-0) - (set! (-> this plane quad) (-> s5-0 fvec quad)) + (vector-copy! (-> this plane) (-> s5-0 fvec)) ) (set! (-> this plane w) (- (vector-dot (-> this plane) (-> this root trans)))) (update-transforms (-> this root)) @@ -775,7 +775,7 @@ ) ) ) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-from-two-vectors! (-> self root quat) *z-vector* (-> arg0 forw)) (let ((v1-37 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) (a0-17 (-> self root trans)) @@ -792,7 +792,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a0-17 quad) vf6) ) - (set! (-> self save-pos quad) (-> self root trans quad)) + (vector-copy! (-> self save-pos) (-> self root trans)) (set! (-> self boost) (-> arg0 boost)) (set! (-> self id) arg1) (set! (-> self persistent) arg2) @@ -893,7 +893,7 @@ (defmethod init-part-and-mat! ((this glider-thermal)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 656) this)) (matrix-identity! (-> this mat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) 0 (none) ) @@ -902,7 +902,7 @@ ;; INFO: Used lq/sq (defbehavior glider-thermal-init-by-other glider-thermal ((arg0 glider-thermal-info) (arg1 int)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (set! (-> self id) arg1) (init-part-and-mat! self) (go-virtual idle) @@ -965,11 +965,11 @@ (defun glider-launch-mist-particle ((arg0 vector) (arg1 process)) (cond ((logtest? (-> *part-group-id-table* 657 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> arg0 quad)) + (vector-copy! (-> *launch-matrix* trans) arg0) (part-tracker-spawn part-tracker-subsampler :to arg1 :group (-> *part-group-id-table* 657) :duration -1) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg0 quad)) + (vector-copy! (-> *launch-matrix* trans) arg0) (part-tracker-spawn part-tracker :to arg1 :group (-> *part-group-id-table* 657) :duration -1) ) ) diff --git a/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc b/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc index de010fd2f5e..e5a7ebdd886 100644 --- a/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc +++ b/test/decompiler/reference/jak3/levels/glider/h-glider_REF.gc @@ -468,10 +468,10 @@ ) (('ring-pos) (let ((v1-1 (new 'stack-no-clear 'vector))) - (set! (-> v1-1 quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! v1-1 (the-as vector (-> arg3 param 1))) (when (< 0.0 (vector-dot v1-1 (-> this rbody matrix fvec))) - (set! (-> this last-ring-pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> this progression-plane quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (vector-copy! (-> this last-ring-pos) (the-as vector (-> arg3 param 0))) + (vector-copy! (-> this progression-plane) (the-as vector (-> arg3 param 1))) (set! (-> this progression-plane w) (vector-dot (-> this root trans) (-> this progression-plane))) ) ) @@ -712,8 +712,8 @@ (s0-0 (-> arg1 probe-work-array s1-0)) ) (vector-reset! (-> s0-0 tire-force)) - (set! (-> s0-0 local-pos quad) (-> v1-29 local-pos quad)) - (set! (-> s0-0 local-normal quad) (-> v1-29 rot quad)) + (vector-copy! (-> s0-0 local-pos) (-> v1-29 local-pos)) + (vector-copy! (-> s0-0 local-normal) (-> v1-29 rot)) (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) (let ((a1-9 (-> s0-0 probe-pos))) (let ((v1-32 (-> s0-0 world-pos))) @@ -731,27 +731,25 @@ (.svf (&-> a1-9 quad) vf6) ) (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) - (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) - (-> arg1 steering-axis) - (the-as vector (-> arg1 mat)) - ) - ) - quad - ) - ) - (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s0-0 wheel-axis) (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) + (-> arg1 steering-axis) + (the-as vector (-> arg1 mat)) + ) + ) + ) + (vector-copy! (-> s0-0 ground-pos) (-> s0-0 probe-pos)) (set! (-> s0-0 ground-pos y) 0.0) (vector-reset! (-> s0-0 ground-normal)) (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) - (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (vector-copy! (-> s2-0 start-pos) (-> s0-0 probe-pos)) (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) (cond ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) (logclear! (-> this v-flags) (vehicle-flag in-air)) (logior! (-> this v-flags) (vehicle-flag on-ground)) (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) - (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) - (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) + (vector-copy! (-> s0-0 ground-normal) (-> s2-0 best-other-tri normal)) + (vector-copy! (-> arg1 ground-normal) (-> s0-0 ground-normal)) ) (else (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 position y))) @@ -772,8 +770,8 @@ (when (>= 1 (-> this force-level)) (dotimes (s2-1 (-> this info physics-model lift-thruster-count)) (let ((s1-1 (-> arg1 probe-work-array s2-1))) - (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) - (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s1-1 world-pos)) + (vector-copy! (-> arg1 velocity) (-> s1-1 velocity)) (let* ((f1-12 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) (f28-1 (- 1.0 (/ (+ -4096.0 f1-12) (+ -4096.0 f30-1)))) ) @@ -840,8 +838,8 @@ (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) ) (vector-normalize! (-> arg1 normal) 1.0) - (set! (-> arg1 world-pos quad) (-> s3-0 position quad)) - (set! (-> arg1 velocity quad) (-> s3-0 lin-velocity quad)) + (vector-copy! (-> arg1 world-pos) (-> s3-0 position)) + (vector-copy! (-> arg1 velocity) (-> s3-0 lin-velocity)) (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 position)) (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 inv-i-world)) @@ -942,7 +940,7 @@ (= v1-15 0.0) ) ) - (set! (-> this rbody lin-momentum quad) (-> this rbody matrix fvec quad)) + (vector-copy! (-> this rbody lin-momentum) (-> this rbody matrix fvec)) (vector-normalize! (-> this rbody lin-momentum) (if (task-node-closed? (game-task-node desert-glide-templetop)) @@ -971,7 +969,7 @@ (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) (+! (-> s3-0 z) 4096.0) - (set! (-> s2-3 force quad) (-> *x-vector* quad)) + (vector-copy! (-> s2-3 force) *x-vector*) (let ((f0-20 (* 0.00024414062 (vector-length (-> this rbody lin-velocity))))) (set! (-> s2-3 velocity z) (/ 1.0 f0-20)) ) @@ -1155,7 +1153,7 @@ (let ((s3-1 (new 'stack-no-clear 'vector))) 0.0 (let ((f30-4 (glider-impact-reduction (the-as time-frame (-> this impact-time))))) - (set! (-> s3-1 quad) (-> this rbody matrix rvec quad)) + (vector-copy! s3-1 (-> this rbody matrix rvec)) (set! (-> s3-1 y) 0.0000000001) (vector-normalize! s3-1 1.0) (vector-float*! @@ -1270,21 +1268,21 @@ ) ) (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) - (set! (-> s3-5 quad) (-> this rbody lin-velocity quad)) + (vector-copy! s3-5 (-> this rbody lin-velocity)) (vector-normalize! s3-5 1.0) (let ((f0-152 (vector-dot s3-5 s4-0))) (vector-float*! s2-6 s3-5 f0-152) ) (vector-! s4-0 s4-0 s2-6) (add-force! (-> this rbody) s4-0) - (set! (-> s3-5 quad) (-> this rbody matrix fvec quad)) + (vector-copy! s3-5 (-> this rbody matrix fvec)) (vector-normalize! s3-5 1.0) (vector-float*! s4-0 *up-vector* (* -1.0 (-> this info info mass) f30-7)) (let ((f0-157 (vector-dot s3-5 s4-0))) (vector-float*! s4-0 s3-5 f0-157) ) (add-force! (-> this rbody) s4-0) - (set! (-> s3-5 quad) (-> this rbody matrix uvec quad)) + (vector-copy! s3-5 (-> this rbody matrix uvec)) (vector-normalize! s3-5 1.0) (vector-float*! s4-0 *up-vector* (* -0.12 (-> this info info mass) f30-7)) (let ((f0-162 (vector-dot s3-5 s4-0))) diff --git a/test/decompiler/reference/jak3/levels/gungame/gun-dummy_REF.gc b/test/decompiler/reference/jak3/levels/gungame/gun-dummy_REF.gc index 75821f27c42..920fdafde48 100644 --- a/test/decompiler/reference/jak3/levels/gungame/gun-dummy_REF.gc +++ b/test/decompiler/reference/jak3/levels/gungame/gun-dummy_REF.gc @@ -210,7 +210,7 @@ (return 0) ) (let ((s5-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> s5-0 fountain-rand-transv-lo quad) (-> this impact quad)) + (vector-copy! (-> s5-0 fountain-rand-transv-lo) (-> this impact)) (set! (-> s5-0 fountain-rand-transv-hi x) 4096.0) (set! (-> s5-0 fountain-rand-transv-hi y) 122880.0) (if (-> this explode-part-group) @@ -410,7 +410,7 @@ (forward-up-nopitch->quaternion (-> this quat-ground) s4-6 *up-vector*) ) (quaternion-normalize! (-> this quat-ground)) - (set! (-> this root trans quad) (-> s3-3 quad)) + (vector-copy! (-> this root trans) s3-3) ) (set! (-> this inout-percent) (lerp-scale 0.0 1.0 f30-0 0.0 (-> s5-0 0 time))) (set! (-> this first-time-command) #f) @@ -448,7 +448,7 @@ (get-point-in-path! s4-0 s2-4 (-> this path-pos) 'interp) (get-point-in-path! s4-0 s3-4 (* 0.007843138 (the float (-> s5-0 0 path-pos))) 'interp) (let ((v1-102 (new 'stack-no-clear 'vector))) - (set! (-> v1-102 quad) (-> this root trans quad)) + (vector-copy! v1-102 (-> this root trans)) (vector-float*! (-> this root trans) s2-4 (- 1.0 f28-2)) (let ((a0-63 (-> this root trans))) (let ((a1-23 (-> this root trans))) @@ -536,7 +536,7 @@ (case arg0 ((3 2) (let ((v0-0 (new 'static 'vector :w 1.0))) - (set! (-> v0-0 quad) (-> v1-0 trans quad)) + (vector-copy! v0-0 (-> v1-0 trans)) (+! (-> v0-0 y) 8192.0) v0-0 ) @@ -606,13 +606,13 @@ (let ((s5-3 (new 'stack-no-clear 'matrix))) (let ((s4-3 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self root trans)))) (let ((a0-40 s4-3)) - (set! (-> a0-40 quad) (-> s4-3 quad)) + (vector-copy! a0-40 s4-3) (set! (-> a0-40 y) 0.0) (vector-normalize! a0-40 1.0) ) (matrix-fu-compose s5-3 s4-3 *up-vector*) ) - (set! (-> s5-3 trans quad) (-> self root trans quad)) + (vector-copy! (-> s5-3 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 1425 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -756,6 +756,7 @@ ;; definition for method 11 of type gun-dummy (defmethod init-from-entity! ((this gun-dummy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -777,16 +778,17 @@ (quaternion-copy! (-> arg1 quat) (-> s4-0 gun-info quat)) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> arg0 bone transform trans quad)) + (vector-copy! s4-1 (-> arg0 bone transform trans)) (matrix<-no-trans-transformq! (-> arg0 bone transform) arg1) - (set! (-> arg0 bone transform trans quad) (-> s4-1 quad)) + (vector-copy! (-> arg0 bone transform trans) s4-1) ) (none) ) ;; definition for method 20 of type gun-dummy ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this gun-dummy)) +(defmethod get-search-info-flag ((this gun-dummy)) + "Get search-info-flag for this process." (let ((v1-1 (-> this current 0 command))) (the-as search-info-flag (if (or (= v1-1 (tpath-cmd cmd1)) (= v1-1 (tpath-cmd cmd5))) 0 @@ -1221,7 +1223,7 @@ (set-time! (-> this arm-start-time)) (sound-play "gtarget-explode") (let ((s5-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-1 spawn-point quad) (-> this root trans quad)) + (vector-copy! (-> s5-1 spawn-point) (-> this root trans)) (quaternion-identity! (-> s5-1 spawn-quat)) (set! (-> s5-1 radius) 24576.0) (set! (-> s5-1 scale) 1.0) @@ -1410,8 +1412,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) ) @@ -1467,7 +1469,7 @@ ((3) (let ((s5-0 (new 'stack-no-clear 'primary-target-pos-vel))) (send-event (ppointer->process (-> this parent)) 'get-player-pos-vel s5-0) - (set! (-> this gun-info last-known-player-pos quad) (-> s5-0 position quad)) + (vector-copy! (-> this gun-info last-known-player-pos) (-> s5-0 position)) ) (if (not (and *target* (not (logtest? (-> *target* focus-status) (focus-status disable dead ignore grabbed))))) (set! (-> this gun-info next-fire-time) (generate-next-fire-time (-> this gun-info fire-speed-scalar))) diff --git a/test/decompiler/reference/jak3/levels/gungame/gungame-manager_REF.gc b/test/decompiler/reference/jak3/levels/gungame/gungame-manager_REF.gc index 6618eb9aafb..7783abe2f51 100644 --- a/test/decompiler/reference/jak3/levels/gungame/gungame-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/gungame/gungame-manager_REF.gc @@ -255,8 +255,8 @@ ) (when s4-0 (let ((s5-1 (new 'stack-no-clear 'primary-target-pos-vel))) - (set! (-> s5-1 position quad) (-> (get-trans s4-0 3) quad)) - (set! (-> s5-1 velocity quad) (-> (get-transv s4-0) quad)) + (vector-copy! (-> s5-1 position) (get-trans s4-0 3)) + (vector-copy! (-> s5-1 velocity) (get-transv s4-0)) (set! (-> s5-1 time) (the-as uint (current-time))) (if (>= (- (-> s5-1 time) (-> this primary-target-history 1 time)) (the-as uint 30)) (qmem-copy->! @@ -982,6 +982,7 @@ ;; definition for method 11 of type training-path (defmethod init-from-entity! ((this training-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (length "training-path-")) (a0-3 (length (-> this name))) (v1-2 0) @@ -1121,7 +1122,7 @@ ) (dotimes (s3-0 (-> this actor-group 2 length)) (when (not (handle->process (-> this course-crates s3-0))) - (set! (-> s5-0 quad) (-> this actor-group 2 data s3-0 actor trans quad)) + (vector-copy! s5-0 (-> this actor-group 2 data s3-0 actor trans)) (set! (-> s5-0 w) 1.0) (gungame-manager-method-28 this s5-0) (format 0 "Name is ~s~%" (-> this actor-group 2 data s3-0 actor)) @@ -1157,7 +1158,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (set-vector! (-> s5-0 move-dist) 0.0 -8192.0 0.0 1.0) (let ((v1-2 s5-0)) (set! (-> v1-2 radius) 40.96) @@ -1438,7 +1439,7 @@ (defstate wait-load (gungame-mgr-rnc) :virtual #t :code (behavior () - (until (= (status-of-level-and-borrows *level* 'lgunrnc #f) 'active) + (until (= (level-status? *level* 'lgunrnc #f) 'active) (suspend) ) (go-virtual wait-start) @@ -1598,7 +1599,7 @@ (defstate wait-load (gungame-mgr-1) :virtual #t :code (behavior () - (until (= (status-of-level-and-borrows *level* 'lgunnorm #f) 'active) + (until (= (level-status? *level* 'lgunnorm #f) 'active) (suspend) ) (go-virtual wait-start) @@ -1609,7 +1610,7 @@ (defstate wait-load (gungame-mgr-2) :virtual #t :code (behavior () - (until (= (status-of-level-and-borrows *level* 'lgunnorm #f) 'active) + (until (= (level-status? *level* 'lgunnorm #f) 'active) (suspend) ) (go-virtual wait-start) @@ -1644,7 +1645,7 @@ (defstate wait-load (gungame-mgr-4) :virtual #t :code (behavior () - (until (= (status-of-level-and-borrows *level* 'lgunrnc #f) 'active) + (until (= (level-status? *level* 'lgunrnc #f) 'active) (suspend) ) (go-virtual wait-start) diff --git a/test/decompiler/reference/jak3/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak3/levels/gungame/gungame-obs_REF.gc index db629001b8c..daa07329fcd 100644 --- a/test/decompiler/reference/jak3/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/gungame/gungame-obs_REF.gc @@ -281,6 +281,7 @@ ;; definition for method 11 of type gungame-door (defmethod init-from-entity! ((this gungame-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/test/decompiler/reference/jak3/levels/hiphog/hiphog-scenes_REF.gc b/test/decompiler/reference/jak3/levels/hiphog/hiphog-scenes_REF.gc index 4a5330ddb3c..6b5118338b8 100644 --- a/test/decompiler/reference/jak3/levels/hiphog/hiphog-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/hiphog/hiphog-scenes_REF.gc @@ -49,6 +49,7 @@ ;; definition for method 11 of type hip-door-b (defmethod init-from-entity! ((this hip-door-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -134,6 +135,7 @@ ;; definition for method 11 of type hip-mirror (defmethod init-from-entity! ((this hip-mirror) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -150,7 +152,7 @@ (defun hiphog-activate () (let ((a0-1 (entity-by-name "hip-mirror-2"))) (when a0-1 - (set! (-> *math-camera* mirror-trans quad) (-> a0-1 extra trans quad)) + (vector-copy! (-> *math-camera* mirror-trans) (-> a0-1 extra trans)) (vector-rotate-y! (-> *math-camera* mirror-normal) (new 'static 'vector :x 1.0 :w 1.0) -10297.162) ) ) @@ -1269,7 +1271,3 @@ (:userdata 4096.0) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/intro/intro-obs_REF.gc b/test/decompiler/reference/jak3/levels/intro/intro-obs_REF.gc index 8d5e6159960..7994044df69 100644 --- a/test/decompiler/reference/jak3/levels/intro/intro-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/intro/intro-obs_REF.gc @@ -46,6 +46,7 @@ ;; definition for method 11 of type ctypal-ctyfarma (defmethod init-from-entity! ((this ctypal-ctyfarma) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -56,7 +57,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc index 12548fea1db..f997d9be68c 100644 --- a/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc +++ b/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc @@ -358,7 +358,7 @@ ) 0 (let ((gp-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) - (set! (-> gp-1 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 325 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -416,7 +416,7 @@ (set! sv-688 (new 'stack-no-clear 'collide-query)) (set! sv-704 (the-as symbol #f)) (set! sv-768 (new 'stack-no-clear 'vector)) - (set! (-> sv-688 start-pos quad) (-> arg1 quad)) + (vector-copy! (-> sv-688 start-pos) arg1) (set! sv-720 (-> sv-688 move-dist)) (set! (-> sv-720 x) (rand-vu-float-range 0.0 65536.0)) (set! (-> sv-720 y) (rand-vu-float-range 0.0 65536.0)) @@ -440,7 +440,7 @@ ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) (set-time! (-> s5-0 last-valid-time)) - (set! (-> sv-768 quad) (-> sv-688 best-other-tri intersect quad)) + (vector-copy! sv-768 (-> sv-688 best-other-tri intersect)) (when (< 16384.0 (vector-vector-distance sv-768 (-> sv-688 start-pos))) (set! sv-704 #t) (goto cfg-7) @@ -474,7 +474,7 @@ (a0-26 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (vector-copy! (-> a2-5 trans) (-> s5-0 end-pos)) (t9-12 a0-26 arg4 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -626,7 +626,7 @@ ) (sound-play "de-tower-zap" :id (-> self plasma-sound) :position (-> self root trans)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> self root trans quad)) + (vector-copy! s3-0 (-> self root trans)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-2 (new 'stack-no-clear 'vector)) (gp-2 (new 'stack-no-clear 'vector)) @@ -637,10 +637,10 @@ ) (set! (-> s3-0 y) (+ f0-6 (- f1-3 (* (the float (the int (/ f1-3 f2-3))) f2-3)))) ) - (set! (-> gp-2 quad) (-> s3-0 quad)) + (vector-copy! gp-2 s3-0) (sound-play "tree-shocker" :id (-> self shock-sound) :position gp-2) (+! (-> s3-0 x) 28672.0) - (set! (-> s4-0 start-pos quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 start-pos) s3-0) (vector-float*! (-> s4-0 move-dist) *x-vector* -40960.0) (let ((v1-39 s4-0)) (set! (-> v1-39 radius) 2048.0) @@ -656,7 +656,7 @@ (s3-1 (-> self discs)) ) (when (>= f0-12 0.0) - (set! (-> s5-2 quad) (-> s4-0 best-other-tri intersect quad)) + (vector-copy! s5-2 (-> s4-0 best-other-tri intersect)) (let ((s4-1 *x-vector*) (f30-0 9362.286) (s2-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> s3-1 0 orient))) @@ -690,7 +690,7 @@ (set! (-> gp-3 spans data a0-37 random-offset-size-start) 4096.0) (set! (-> gp-3 spans-internal data a0-37 num-inner-points) 2) (set! (-> gp-3 spans data a0-37 inner-random-offset-size) 4096.0) - (set! (-> gp-3 span-pts-start data a0-37 quad) (-> v1-55 pts a0-37 quad)) + (vector-copy! (-> gp-3 span-pts-start data a0-37) (-> v1-55 pts a0-37)) ) (set! (-> gp-3 spans data 0 random-offset-size-start) 0.0) (set! (-> gp-3 spans data 7 random-offset-size-start) 0.0) @@ -798,9 +798,9 @@ (set! (-> self shock-sound) (new-sound-id)) (set! (-> self plasma-sound) (new-sound-id)) (set! (-> self entity) arg0) - (set! (-> self root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> self root trans) (-> arg0 extra trans)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) - (set! (-> self root scale quad) (-> (res-lump-struct arg0 'scale vector) quad)) + (vector-copy! (-> self root scale) (res-lump-struct arg0 'scale vector)) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-orb" (the-as (pointer level) #f))) @@ -869,7 +869,7 @@ (set! (-> self root) s4-0) ) (quaternion-identity! (-> self root quat)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set-vector! (-> self root scale) arg1 arg1 arg1 1.0) (set! (-> self shock-sound) (new-sound-id)) (set! (-> self plasma-sound) (new-sound-id)) @@ -1007,6 +1007,7 @@ ;; definition for method 11 of type dark-eco-tower (defmethod init-from-entity! ((this dark-eco-tower) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1061,9 +1062,9 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> self root trans) (-> arg0 extra trans)) (quaternion-copy! (-> self root quat) (-> arg0 quat)) - (set! (-> self root scale quad) (-> (res-lump-struct arg0 'scale vector) quad)) + (vector-copy! (-> self root scale) (res-lump-struct arg0 'scale vector)) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-tower" (the-as (pointer level) #f))) @@ -1488,8 +1489,8 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self root trans quad)) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! s5-0 (-> self root trans)) + (vector-copy! gp-0 (-> self root trans)) (let ((s2-0 s5-0)) (let ((s4-0 s5-0)) (let ((s3-0 *x-vector*)) @@ -1608,7 +1609,7 @@ (a1-10 sv-52) (a2-3 *launch-matrix*) ) - (set! (-> a2-3 trans quad) (-> s5-0 quad)) + (vector-copy! (-> a2-3 trans) s5-0) (t9-10 a0-20 a1-10 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) (let ((t9-11 sp-launch-particles-var) @@ -1616,7 +1617,7 @@ (a1-11 sv-52) (a2-4 *launch-matrix*) ) - (set! (-> a2-4 trans quad) (-> gp-0 quad)) + (vector-copy! (-> a2-4 trans) gp-0) (t9-11 a0-21 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -1629,6 +1630,7 @@ ;; definition for method 11 of type grind-electricity (defmethod init-from-entity! ((this grind-electricity) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (go (method-of-object this idle)) diff --git a/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs2_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs2_REF.gc index 3f5a1e64141..d75daaf13bf 100644 --- a/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs2_REF.gc @@ -77,6 +77,7 @@ ;; definition for method 11 of type mhcity-puffer (defmethod init-from-entity! ((this mhcity-puffer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this 1.0) (process-drawable-from-entity! this arg0) (process-drawable-scale-from-entity! this arg0) @@ -157,7 +158,7 @@ (defbehavior puffer-init-by-other mhcity-puffer ((arg0 puffer-init-by-other-params)) (set! (-> self level) (level-get *level* 'lctydest)) (init-collision! self (-> arg0 scale)) - (set! (-> self root trans quad) (-> arg0 pos quad)) + (vector-copy! (-> self root trans) (-> arg0 pos)) (quaternion-copy! (-> self root quat) (-> arg0 orient)) (initialize-skeleton self @@ -265,7 +266,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('move-to) - (set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! (-> self root trans) (the-as vector (-> block param 0))) (quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 1))) ) ) diff --git a/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs_REF.gc index 8e63eb59453..5c31aede036 100644 --- a/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/mhcity/mhcity-obs_REF.gc @@ -772,6 +772,7 @@ ;; definition for method 11 of type mhcity-dark-eco-door (defmethod init-from-entity! ((this mhcity-dark-eco-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -858,7 +859,7 @@ (defbehavior mhcity-dark-eco-door-broken-init-by-other mhcity-dark-eco-door-broken ((arg0 process-drawable)) (set! (-> self level) (level-get *level* 'mhcitya)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (initialize-skeleton self @@ -905,15 +906,15 @@ :virtual #t :code (behavior () (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> self root trans quad)) + (vector-copy! v1-0 (-> self root trans)) (+! (-> v1-0 y) 40960.0) (cond ((logtest? (-> *part-group-id-table* 327 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-0 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 327)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-0 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 327)) ) ) @@ -1241,6 +1242,7 @@ ;; definition for method 11 of type mhcity-dark-eco-nodule (defmethod init-from-entity! ((this mhcity-dark-eco-nodule) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (initialize-skeleton this @@ -1304,11 +1306,11 @@ (sound-play "egg-explode") (cond ((logtest? (-> *part-group-id-table* 326 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 326)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 326)) ) ) @@ -1395,11 +1397,11 @@ (sound-play "egg-explode") (cond ((logtest? (-> *part-group-id-table* 325 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 325)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 325)) ) ) @@ -1424,7 +1426,8 @@ ;; definition for method 20 of type mhcity-ambient-killable ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this mhcity-ambient-killable)) +(defmethod get-search-info-flag ((this mhcity-ambient-killable)) + "Get search-info-flag for this process." (the-as search-info-flag 2) ) @@ -1499,6 +1502,7 @@ ;; definition for method 11 of type mhcity-vein-writhing-large (defmethod init-from-entity! ((this mhcity-vein-writhing-large) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (initialize-skeleton @@ -1561,6 +1565,7 @@ ;; definition for method 11 of type mhcity-vein-writhing-small (defmethod init-from-entity! ((this mhcity-vein-writhing-small) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (initialize-skeleton @@ -1633,6 +1638,7 @@ ;; definition for method 11 of type mhcity-claw-finger-small (defmethod init-from-entity! ((this mhcity-claw-finger-small) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this sphere-size) 12288.0) (set! (-> this hit-points) 1.0) (set! (-> this drop-type) 7) @@ -1797,6 +1803,7 @@ ;; definition for method 11 of type mhcity-twitch-blade (defmethod init-from-entity! ((this mhcity-twitch-blade) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1853,6 +1860,7 @@ ;; definition for method 11 of type mhcity-vine-wriggler (defmethod init-from-entity! ((this mhcity-vine-wriggler) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1914,6 +1922,7 @@ ;; definition for method 11 of type mhcity-vine-wriggler-big (defmethod init-from-entity! ((this mhcity-vine-wriggler-big) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -1975,6 +1984,7 @@ ;; definition for method 11 of type mhcity-de-tower-undervines (defmethod init-from-entity! ((this mhcity-de-tower-undervines) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -2036,6 +2046,7 @@ ;; definition for method 11 of type mhcity-grunt-egg-c (defmethod init-from-entity! ((this mhcity-grunt-egg-c) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -2094,6 +2105,7 @@ ;; definition for method 11 of type mhcity-grunt-egg-b (defmethod init-from-entity! ((this mhcity-grunt-egg-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -2152,6 +2164,7 @@ ;; definition for method 11 of type mhcity-grunt-egg-d (defmethod init-from-entity! ((this mhcity-grunt-egg-d) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -2210,6 +2223,7 @@ ;; definition for method 11 of type mhcity-grunt-egg-a (defmethod init-from-entity! ((this mhcity-grunt-egg-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-fields! this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -2413,6 +2427,7 @@ ;; definition for method 11 of type mhcity-tower-door (defmethod init-from-entity! ((this mhcity-tower-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/test/decompiler/reference/jak3/levels/mhcity/mhcity-part_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/mhcity-part_REF.gc index 6c3139e5c1e..28d5aa995b4 100644 --- a/test/decompiler/reference/jak3/levels/mhcity/mhcity-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/mhcity/mhcity-part_REF.gc @@ -919,6 +919,7 @@ ;; definition for method 11 of type bubbles-path (defmethod init-from-entity! ((this bubbles-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -984,12 +985,12 @@ (s2-2 (vector-! (new 'stack-no-clear 'vector) s4-2 (-> self path curve cverts s5-1))) ) (let ((a0-16 s3-3)) - (set! (-> a0-16 quad) (-> s3-3 quad)) + (vector-copy! a0-16 s3-3) (set! (-> a0-16 y) 0.0) (vector-normalize! a0-16 1.0) ) (let ((a0-17 s2-2)) - (set! (-> a0-17 quad) (-> s2-2 quad)) + (vector-copy! a0-17 s2-2) (set! (-> a0-17 y) 0.0) (vector-normalize! a0-17 1.0) ) @@ -998,7 +999,7 @@ ) ) ) - (set! (-> gp-0 trans quad) (-> s4-2 quad)) + (vector-copy! (-> gp-0 trans) s4-2) (launch-particles (-> *part-id-table* 1371) gp-0 :origin-is-matrix #t) (+! f28-2 (rand-vu)) ) @@ -1149,7 +1150,3 @@ (:rotate-y (degrees 0)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc b/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc index ada9d697e07..30345033af3 100644 --- a/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/gekko_REF.gc @@ -328,34 +328,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp -1.0 - :knocked-soft-vxz-lo 113049.6 - :knocked-soft-vxz-hi 149094.4 - :knocked-soft-vy-lo 122880.0 - :knocked-soft-vy-hi 163840.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 27.6) + :knocked-soft-vxz-hi (meters 36.4) + :knocked-soft-vy-lo (meters 30) + :knocked-soft-vy-hi (meters 40) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x -0.9169 :y -0.314 :z 0.2441 :w 2358.841) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -813,6 +813,7 @@ ;; definition for method 120 of type gekko ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this gekko)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1144,7 +1145,7 @@ (ja-channel-push! 1 (seconds 0.017)) (ja-no-eval :group! (-> self draw art-group data gp-3) :num! (loop!) :frame-num 0.0) ) - (until (enemy-method-104 self (-> self turn-face-point) 910.2222) + (until (pointing-toward? self (-> self turn-face-point) 910.2222) (suspend) (ja :num! (loop!)) ) @@ -1208,7 +1209,7 @@ (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node gekko-lod0-jg head))) (s4-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-1 quad) (-> self focus-pos quad)) + (vector-copy! s4-1 (-> self focus-pos)) (set! (-> s4-1 y) (- (-> s4-1 y) (* 4096.0 (rnd-float-range self 0.0 10.0)))) (sound-play "gekko-shot") (spawn-metalhead-projectile (the-as metalhead-shot self) s5-1 s4-1 532480.0) @@ -1316,15 +1317,15 @@ ) (when (not (logtest? (-> self root root-prim prim-core action) (collide-action no-normal-reset))) (let ((v1-20 (-> self root dynam gravity-normal))) - (set! (-> self root local-normal quad) (-> v1-20 quad)) - (set! (-> self root surface-normal quad) (-> v1-20 quad)) - (set! (-> self root poly-normal quad) (-> v1-20 quad)) + (vector-copy! (-> self root local-normal) v1-20) + (vector-copy! (-> self root surface-normal) v1-20) + (vector-copy! (-> self root poly-normal) v1-20) ) (set! (-> self root coverage) 0.0) (set! (-> self root touch-angle) 0.0) ) (logior! (-> self focus-status) (focus-status dangerous)) - (enemy-method-50 self 3) + (update-collision-action self 3) (dotimes (gp-0 4) (enable-set! (-> self foot gp-0 leg-ik) #f) ) @@ -1421,7 +1422,7 @@ ) :exit (behavior () (local-vars (v1-9 enemy-flag) (v1-11 enemy-flag) (v1-13 enemy-flag)) - (enemy-method-50 self 0) + (update-collision-action self 0) (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -1454,7 +1455,7 @@ (logior! (-> self flags) (gekko-flag follow-terrain update-tilt)) ) :trans (behavior () - (if (and (time-elapsed? (-> self state-time) (seconds 0.2)) (within-gspot-range? self)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.2)) (invalid-height? self)) (go-die self) ) ) @@ -1473,9 +1474,9 @@ (ja :num! (seek!)) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) - (go-best-state self) + (go-state-for-focused self) ) ) :post (behavior () @@ -1505,12 +1506,12 @@ 24 ) ) - (s4-0 (set-reaction-time! self (seconds 0.007) (seconds 0.017))) + (s4-0 (rnd-time-frame self (seconds 0.007) (seconds 0.017))) (gp-0 (new 'stack-no-clear 'vector)) ) (nav-enemy-method-164 self) (let ((a1-2 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-2 target-pos quad)) + (vector-copy! gp-0 (-> a1-2 target-pos)) ) (let ((v1-13 self)) (set! (-> v1-13 enemy-flags) (the-as enemy-flag (logclear (-> v1-13 enemy-flags) (enemy-flag ef37)))) @@ -1528,7 +1529,7 @@ (ja :num! (seek! max f30-1)) ) ) - (when (not (enemy-method-104 self gp-0 8192.0)) + (when (not (pointing-toward? self gp-0 8192.0)) (let ((v1-48 self)) (set! (-> v1-48 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-48 enemy-flags)))) ) @@ -1549,7 +1550,7 @@ (set! f28-0 (* -1.0 f28-0)) ) ) - (until (enemy-method-104 self gp-0 6371.5557) + (until (pointing-toward? self gp-0 6371.5557) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (* -81920.0 (seconds-per-frame) f28-0)) (suspend) (ja :num! (loop! f30-2)) @@ -1569,7 +1570,7 @@ 14 ) ) - (s4-1 (set-reaction-time! self (seconds 0.017) (seconds 0.027))) + (s4-1 (rnd-time-frame self (seconds 0.017) (seconds 0.027))) ) (let ((v1-95 self)) (if (not (logtest? (enemy-flag ef37) (-> v1-95 enemy-flags))) @@ -1614,7 +1615,7 @@ ) (until #f (cond - ((enemy-method-104 self (-> self focus-pos) 8192.0) + ((pointing-toward? self (-> self focus-pos) 8192.0) (let ((v1-10 self)) (set! (-> v1-10 enemy-flags) (the-as enemy-flag (logclear (-> v1-10 enemy-flags) (enemy-flag ef38)))) ) @@ -1633,7 +1634,7 @@ (ja :num! (seek! max f30-1)) ) ) - ((or (enemy-method-104 self (-> self focus-pos) 30947.555) (rnd-chance? self 0.3)) + ((or (pointing-toward? self (-> self focus-pos) 30947.555) (rnd-chance? self 0.3)) (let ((v1-50 self)) (set! (-> v1-50 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-50 enemy-flags)))) ) @@ -1648,7 +1649,7 @@ (ja-no-eval :group! gekko-turn-left0-ja :num! (loop! f28-0) :frame-num 0.0) (ja-no-eval :group! gekko-turn-right0-ja :num! (loop! f28-0) :frame-num 0.0) ) - (until (enemy-method-104 self (-> self focus-pos) 6371.5557) + (until (pointing-toward? self (-> self focus-pos) 6371.5557) (suspend) (ja :num! (loop! f28-0)) ) @@ -1753,14 +1754,14 @@ (set! (-> s4-1 y) 0.0) (vector-xz-normalize! s4-1 24576.0) (vector+! gp-0 (-> self focus-pos) s4-1) - (set! (-> s5-0 quad) (-> gp-0 quad)) + (vector-copy! s5-0 gp-0) (closest-point-on-mesh (-> self nav) s5-0 gp-0 (the-as nav-poly #f)) - (set! (-> self move-dest quad) (-> s5-0 quad)) + (vector-copy! (-> self move-dest) s5-0) ) (let ((v1-8 (-> self nav state))) (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-8 target-pos) gp-0) ) ) 0 @@ -1781,7 +1782,7 @@ (when (time-elapsed? (-> self state-time) (seconds 0.3)) (cond ((and (get-focus! self) - (enemy-method-104 self (-> self focus-pos) 8192.0) + (pointing-toward? self (-> self focus-pos) 8192.0) (let ((f0-0 (vector-vector-distance (-> self root trans) (-> self focus-pos)))) (< f0-0 40960.0) (and (< 4096.0 f0-0) (gekko-method-204 self)) @@ -1791,7 +1792,7 @@ ) (else (set! (-> self scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 0.8 2.1))))) - (go-best-state self) + (go-state-for-focused self) ) ) ) @@ -1898,7 +1899,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-chase-post ) @@ -1920,8 +1921,8 @@ (logclear! (-> self flags) (gekko-flag follow-terrain)) ) :trans (behavior () - (if (enemy-method-104 self (-> self focus-pos) 2730.6667) - (go-best-state self) + (if (pointing-toward? self (-> self focus-pos) 2730.6667) + (go-state-for-focused self) ) ) :code (behavior () @@ -1981,7 +1982,7 @@ (if (nav-enemy-method-174 self) (go-stare2 self) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -2057,7 +2058,7 @@ (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) (suspend-for (seconds 0.4) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -2122,7 +2123,7 @@ (let ((v1-2 1) (a0-2 (new 'stack-no-clear 'inline-array 'vector 1)) ) - (set! (-> a0-2 0 quad) (-> s3-0 trans quad)) + (vector-copy! (-> a0-2 0) (-> s3-0 trans)) (set! (-> a0-2 0 w) (+ 409.6 sv-560 (sqrtf (+ (* 25600.0 (-> gp-0 scale) (-> gp-0 scale)) (* (/ f30-0 4) f30-0)))) ) @@ -2180,14 +2181,14 @@ (vector-normalize! sv-696 1.0) ) (else - (set! (-> sv-692 quad) (-> sv-1008 quad)) + (vector-copy! sv-692 sv-1008) (set! (-> sv-692 y) (-> gp-0 root gspot-pos y)) - (set! (-> sv-696 quad) (-> gp-0 rot-matrix uvec quad)) + (vector-copy! sv-696 (-> gp-0 rot-matrix uvec)) ) ) (if (logtest? (-> gp-0 flags) (gekko-flag on-wall?)) - (set! (-> s0-0 ground-normal quad) (-> sv-696 quad)) - (set! (-> s0-0 ground-normal quad) (-> *y-vector* quad)) + (vector-copy! (-> s0-0 ground-normal) sv-696) + (vector-copy! (-> s0-0 ground-normal) *y-vector*) ) (when (logtest? (-> gp-0 flags) (gekko-flag update-foot-position?)) (set! sv-992 intersect-ray-plane) @@ -2283,7 +2284,7 @@ (vector-normalize-copy! (-> gp-0 gspot-normal) s1-1 1.0) ) (when (logtest? (-> gp-0 flags) (gekko-flag follow-terrain)) - (set! (-> gp-0 root gspot-pos quad) (-> s2-1 quad)) + (vector-copy! (-> gp-0 root gspot-pos) s2-1) (let ((a2-15 (vector-! (new 'stack-no-clear 'vector) s2-1 (-> s3-0 trans)))) (vector+float*! (-> s3-0 trans) @@ -2356,15 +2357,15 @@ (f30-0 (sqrtf (+ (* (-> v1-6 x) (-> v1-6 x)) (* (-> v1-6 z) (-> v1-6 z))))) ) (cond - ((and (get-focus! this) (and (and (< f30-0 32768.0) (< 16384.0 f30-0)) (enemy-method-104 this s5-0 6371.5557))) + ((and (get-focus! this) (and (and (< f30-0 32768.0) (< 16384.0 f30-0)) (pointing-toward? this s5-0 6371.5557))) (go (method-of-object this pre-attack)) ) ((< 32768.0 f30-0) (cond - ((not (enemy-method-104 this s5-0 29127.111)) + ((not (pointing-toward? this s5-0 29127.111)) (go (method-of-object this turn-quick)) ) - ((not (enemy-method-104 this s5-0 6371.5557)) + ((not (pointing-toward? this s5-0 6371.5557)) (go (method-of-object this turn)) ) ) @@ -2372,7 +2373,7 @@ ) ) (set! (-> this scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 1.3 2.25))))) - (go-best-state this) + (go-state-for-focused this) ) 0 (none) @@ -2383,7 +2384,7 @@ ;; WARN: Return type mismatch symbol vs none. (defmethod gekko-method-204 ((this gekko)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this root trans)) (let* ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (closest-point-on-mesh (-> this nav) s5-0 s3-0 (the-as nav-poly #f))) ) @@ -2403,7 +2404,8 @@ ) ;; definition for method 107 of type gekko -(defmethod is-pfoc-in-mesh? ((this gekko) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this gekko) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (and arg0 (not arg1)) (set! arg1 (get-trans arg0 1)) ) @@ -2432,7 +2434,9 @@ ;; definition for method 109 of type gekko ;; INFO: Used lq/sq -(defmethod enemy-method-109 ((this gekko)) +(defmethod out-of-bounds? ((this gekko)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (let ((gp-0 (-> this root)) (s3-0 (-> this nav state)) ) @@ -2440,7 +2444,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (cond ((logtest? (-> s3-0 flags) (nav-state-flag in-mesh)) - (set! (-> s5-0 quad) (-> gp-0 trans quad)) + (vector-copy! s5-0 (-> gp-0 trans)) ) (else (if (or (not (closest-point-on-mesh (-> this nav) s5-0 (-> gp-0 trans) (-> s3-0 current-poly))) @@ -2476,7 +2480,7 @@ ;; WARN: Return type mismatch object vs none. (defmethod gekko-method-207 ((this gekko)) (set-look-at-mode! this 1) - (set! (-> this turn-face-point quad) (-> this focus-pos quad)) + (vector-copy! (-> this turn-face-point) (-> this focus-pos)) (set! (-> this turn-next-state) (method-of-type gekko attack-wall)) (go (method-of-object this turn-wall)) (none) @@ -2484,6 +2488,7 @@ ;; definition for method 113 of type gekko (defmethod get-focus! ((this gekko)) + "If we're focusing on something alive, return it." (let* ((t9-0 (method-of-type nav-enemy get-focus!)) (v0-0 (t9-0 this)) ) @@ -2525,8 +2530,8 @@ (set! s2-0 (mod (+ s2-0 1) s5-0)) ) (label cfg-11) - (set! (-> this move-dest quad) (-> s4-0 quad)) - (set! (-> this turn-face-point quad) (-> s4-0 quad)) + (vector-copy! (-> this move-dest) s4-0) + (vector-copy! (-> this turn-face-point) s4-0) ) ) (vector-! (-> this dest-to-me-dir) (-> this root trans) (-> this move-dest)) @@ -2538,7 +2543,8 @@ ;; definition for method 108 of type gekko ;; WARN: disable def twice: 33. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod enemy-method-108 ((this gekko) (arg0 process-focusable)) +(defmethod should-flee-from? ((this gekko) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (< (current-time) (-> this scared-timer)) (let ((v1-4 (handle->process (-> this focus handle)))) (if v1-4 @@ -2557,6 +2563,7 @@ ;; definition for method 85 of type gekko (defmethod knocked-anim ((this gekko) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 0) (cond ((logtest? (-> this flags) (gekko-flag falling-off-wall?)) @@ -2587,6 +2594,7 @@ ;; definition for method 86 of type gekko (defmethod knocked-land-anim ((this gekko) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-2 (if (> (-> this skel active-channels) 0) (-> this skel root-channel 0 frame-group) ) @@ -2633,6 +2641,7 @@ ;; definition for method 78 of type gekko (defmethod go-hostile ((this gekko)) + "Go to the hostile state, actively trying to attack the target." (if (logtest? (-> this flags) (gekko-flag on-wall?)) (gekko-method-206 this) (go (method-of-object this hostile)) @@ -2642,6 +2651,7 @@ ;; definition for method 54 of type gekko ;; INFO: Used lq/sq (defmethod get-knockback-dir! ((this gekko) (arg0 vector)) + "Compute the knockback direction for an incoming attack." (local-vars (v1-2 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2649,7 +2659,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + (vector-copy! arg0 (-> this incoming attack-direction)) (.lvf vf1 (&-> arg0 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -2670,6 +2680,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs object. (defmethod knocked-handler ((this gekko) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (let ((s4-0 (-> this enemy-info)) (f28-0 0.0) @@ -2744,7 +2755,7 @@ ) ) ((= v1-2 (knocked-type vehicle)) - (set! (-> arg0 quad) (-> this incoming attack-direction quad)) + (vector-copy! arg0 (-> this incoming attack-direction)) f30-0 ) (else @@ -2764,11 +2775,12 @@ ;; definition for method 103 of type gekko ;; INFO: Used lq/sq -(defmethod enemy-method-103 ((this gekko) (arg0 vector) (arg1 float)) +(defmethod heading-matches-direction? ((this gekko) (arg0 vector) (arg1 float)) + "Does this enemy's heading match the given heading? Threshold in degrees." (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (vector-flatten! s4-0 s4-0 (-> this rot-matrix uvec)) (vector-normalize! s4-0 1.0) (vector-flatten! s5-0 s5-0 (-> this rot-matrix uvec)) @@ -2780,6 +2792,7 @@ ;; definition for method 125 of type gekko ;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this gekko)) + "Has the ragdoll stopped moving?" (local-vars (v1-18 gekko-shadow-spot)) (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (or (not s5-0) @@ -2807,7 +2820,7 @@ (let ((s4-0 (-> this foot s5-0)) (s3-0 (-> *gekko-ik-setup* s5-0)) ) - (set! (-> s4-0 ground-normal quad) (-> this rot-matrix uvec quad)) + (vector-copy! (-> s4-0 ground-normal) (-> this rot-matrix uvec)) (vector<-cspace! (-> s4-0 ground-pos) (-> this node-list data (-> s3-0 hand-index))) (vector+float*! (-> s4-0 ground-pos) (-> s4-0 ground-pos) (-> s4-0 ground-normal) (-> s3-0 hand-dist)) ) @@ -2817,17 +2830,19 @@ ) ;; definition for method 110 of type gekko -(defmethod send-attack ((this gekko) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this gekko) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (sound-play "gekko-impact") - ((method-of-type nav-enemy send-attack) this arg0 arg1 arg2) + ((method-of-type nav-enemy send-attack-from-tshape) this arg0 arg1 arg2) ) ;; definition for method 59 of type gekko ;; INFO: Used lq/sq (defmethod enemy-common-post ((this gekko)) + "Common implementation of post. Runs ja-post." (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-2) 3)) ) ) (if (and (nonzero? (-> this path-wall)) (not (logtest? (-> this path-wall flags) (path-control-flag not-found)))) @@ -2853,7 +2868,7 @@ (s5-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this rot-matrix uvec))) (f30-0 81920.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) s5-0 f30-0) (let ((v1-10 s4-0)) (set! (-> v1-10 radius) 3276.8) @@ -2919,7 +2934,8 @@ ;; definition for method 50 of type gekko ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this gekko) (arg0 int)) +(defmethod update-collision-action ((this gekko) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((or (zero? v1-0) (= v1-0 2)) @@ -2956,6 +2972,7 @@ ;; definition for method 82 of type gekko (defmethod event-handler ((this gekko) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -2967,7 +2984,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -2986,6 +3003,7 @@ ;; definition for method 67 of type gekko (defmethod coin-flip? ((this gekko)) + "Return #t half the time, #f the other." #f ) @@ -3006,12 +3024,13 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this gekko)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-gekko" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *gekko-nav-enemy-info*) + (setup-enemy! this *gekko-nav-enemy-info*) (set! (-> this scale) (rnd-float-range this 1.15 1.35)) (let ((f0-1 (-> this scale))) (set-vector! (-> this root scale) f0-1 f0-1 f0-1 1.0) @@ -3042,7 +3061,7 @@ (set! (-> a0-18 param1) this) (set! (-> a0-18 param2) (the-as basic s4-1)) ) - (set! (-> s4-1 foot-transform scale quad) (-> *identity-vector* quad)) + (vector-copy! (-> s4-1 foot-transform scale) *identity-vector*) ) ) (logior! (-> this foot 2 leg-ik flags) (joint-mod-ik-flags elbow-trans-neg)) @@ -3077,7 +3096,8 @@ ) ;; definition for method 89 of type gekko -(defmethod within-gspot-range? ((this gekko)) +(defmethod invalid-height? ((this gekko)) + "Return #t if the enemy is too high in the air, or below the ground." (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) diff --git a/test/decompiler/reference/jak3/levels/mine/manta_REF.gc b/test/decompiler/reference/jak3/levels/mine/manta_REF.gc index a106591baf8..158ea0b6afe 100644 --- a/test/decompiler/reference/jak3/levels/mine/manta_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/manta_REF.gc @@ -191,34 +191,34 @@ :ragdoll-rotate-velocity-mult 1.0 :jump-height-min (meters 3) :jump-height-factor 0.5 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 57344.0 - :knocked-red-vxz-hi 57344.0 - :knocked-red-vy-lo 81920.0 - :knocked-red-vy-hi 81920.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 14) + :knocked-red-vxz-hi (meters 14) + :knocked-red-vy-lo (meters 20) + :knocked-red-vy-hi (meters 20) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -260,6 +260,7 @@ ;; definition for method 120 of type manta ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this manta)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -351,7 +352,7 @@ (vector-rotate-y! gp-1 gp-1 (* (-> self orbit-speed) (seconds-per-frame))) (vector-xz-normalize! gp-1 81920.0) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> s4-0 trans quad)) + (vector-copy! s2-0 (-> s4-0 trans)) (let ((s5-0 (-> self dest-pos))) (closest-point-on-mesh (-> self nav) s2-0 (-> s4-0 trans) (the-as nav-poly #f)) (cond @@ -370,7 +371,7 @@ (let ((v1-15 (-> self nav state))) (logclear! (-> v1-15 flags) (nav-state-flag directional-mode)) (logior! (-> v1-15 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-15 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-15 target-pos) s5-0) ) ) ) @@ -387,7 +388,7 @@ (set! (-> self offset-difference) (- (-> self dest-pos y) (-> self root trans y))) (vector-! (-> self forward-dir) (-> self focus-pos) (-> self root trans)) (vector-normalize! (-> self forward-dir) 1.0) - (set! (-> self up-dir quad) (-> *y-vector* quad)) + (vector-copy! (-> self up-dir) *y-vector*) (manta-method-200 self) (do-impact self) (manta-method-203 self -4096.0) @@ -537,8 +538,8 @@ (logior! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) - (set! (-> self landed-pos quad) (-> self root trans quad)) + (move-to-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (vector-copy! (-> self landed-pos) (-> self root trans)) (logior! (-> self draw status) (draw-control-status no-draw)) ) :exit (behavior () @@ -555,9 +556,9 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.1)) (until #f - (let ((s5-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (let ((s5-0 (rnd-time-frame self (seconds 0.007) (seconds 0.015))) (f28-0 (rnd-float-range self 0.5 0.3)) - (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.01))) (f30-0 (rnd-float-range self 0.5 0.3)) ) (dotimes (s4-0 s5-0) @@ -595,14 +596,14 @@ (logclear! (-> self flags) (manta-flags mf0)) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag ef43)))) (logclear! (-> self nav flags) (nav-control-flag limit-rotation-rate update-heading-from-facing)) - (set! (-> self dest-pos quad) (-> self landed-pos quad)) + (vector-copy! (-> self dest-pos) (-> self landed-pos)) (set! (-> self dest-pos y) (+ 8192.0 (-> self default-y-offset) (-> self landed-pos y))) (let ((a0-7 (-> self nav state)) (v1-9 (-> self dest-pos)) ) (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-7 target-pos quad) (-> v1-9 quad)) + (vector-copy! (-> a0-7 target-pos) v1-9) ) 0 (set! (-> self go-enable) #t) @@ -646,7 +647,7 @@ :event enemy-event-handler :enter (behavior () (logclear! (-> self flags) (manta-flags mf0)) - (set! (-> self dest-pos quad) (-> self landed-pos quad)) + (vector-copy! (-> self dest-pos) (-> self landed-pos)) (set! (-> self dest-pos y) (+ (-> self landed-pos y) (-> self default-y-offset))) (set! (-> self restart-fly-anims) #t) ) @@ -748,8 +749,8 @@ (t9-0) ) ) - (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) - (set! (-> self landed-pos quad) (-> self root trans quad)) + (move-to-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (vector-copy! (-> self landed-pos) (-> self root trans)) (manta-method-206 self) (logclear! (-> self draw status) (draw-control-status no-draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -804,7 +805,7 @@ 0 (set! (-> self fly-anim-speed) 1.5) (set! (-> self y-offset) (-> self default-y-offset)) - (set! (-> self dest-pos quad) (-> self root trans quad)) + (vector-copy! (-> self dest-pos) (-> self root trans)) (set! (-> self dest-pos y) (+ (-> self root gspot-pos y) (-> self y-offset))) ) :exit (behavior () @@ -968,7 +969,7 @@ (set! (-> self move-u) 0.0) (set! (-> self move-du) (* 0.94 f30-0)) ) - (set! (-> self attack-pos quad) (-> self focus-pos quad)) + (vector-copy! (-> self attack-pos) (-> self focus-pos)) (set! (-> self y-offset) (+ 24576.0 (-> self default-y-offset))) (set! (-> self move-matrix rvec quad) (-> self root trans quad)) (manta-method-195 self) @@ -1169,7 +1170,7 @@ ) ) (let ((a1-9 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-9 start-pos quad) (-> self rbody position quad)) + (vector-copy! (-> a1-9 start-pos) (-> self rbody position)) (vector-float*! (-> a1-9 move-dist) (-> self rbody lin-velocity) (seconds-per-frame)) (let ((v1-21 a1-9)) (set! (-> v1-21 radius) (+ 4096.0 (-> self root root-prim local-sphere w))) @@ -1206,14 +1207,14 @@ (ja :num! (seek! max 1.5)) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) ) :post (behavior () (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> self rbody position quad)) + (vector-copy! (-> a1-0 start-pos) (-> self rbody position)) (vector-float*! (-> a1-0 move-dist) (-> self rbody lin-velocity) (seconds-per-frame)) (let ((v1-3 a1-0)) (set! (-> v1-3 radius) (+ 4096.0 (-> self root root-prim local-sphere w))) @@ -1231,10 +1232,11 @@ ) ;; definition for method 80 of type manta -(defmethod go-best-state ((this manta)) +(defmethod go-state-for-focused ((this manta)) + "Go to the appropriate state for the current awareness of the focused process." (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware ea3)) (get-focus! this)) + ((and (= s5-0 (enemy-aware hostile)) (get-focus! this)) (go-hostile this) ) ((<= (the-as int s5-0) 0) @@ -1243,7 +1245,7 @@ ((>= 1 (the-as int s5-0)) (go (method-of-object this land-approach)) ) - ((= s5-0 (enemy-aware ea4)) + ((= s5-0 (enemy-aware flee)) (go-flee this) ) (else @@ -1260,7 +1262,7 @@ (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) (the-as vector (-> this move-matrix))))) (set! (-> s5-1 y) (-> this attack-y-offset)) (vector-normalize! s5-1 (-> this move-force)) - (set! (-> this move-matrix fvec quad) (-> s5-1 quad)) + (vector-copy! (-> this move-matrix fvec) s5-1) (vector+! (-> this move-matrix uvec) (the-as vector (-> this move-matrix)) s5-1) ) (vector-! (-> this move-matrix trans) (-> this focus-pos) (-> this move-matrix uvec)) @@ -1275,7 +1277,7 @@ ;; INFO: Used lq/sq (defmethod manta-method-196 ((this manta)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this root trans quad)) + (vector-copy! s3-0 (-> this root trans)) (let* ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (closest-point-on-mesh (-> this nav) s5-0 s3-0 (the-as nav-poly #f))) ) @@ -1298,6 +1300,7 @@ ;; definition for method 113 of type manta (defmethod get-focus! ((this manta)) + "If we're focusing on something alive, return it." (let* ((t9-0 (method-of-type nav-enemy get-focus!)) (v0-0 (t9-0 this)) ) @@ -1331,12 +1334,14 @@ ) ;; definition for method 89 of type manta -(defmethod within-gspot-range? ((this manta)) +(defmethod invalid-height? ((this manta)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) ;; definition for method 88 of type manta -(defmethod enemy-method-88 ((this manta) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this manta) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" (let ((v1-0 (-> this root))) (or (>= (-> arg0 on-surface-count) 3) (>= (-> this hit-ground-count) (the-as uint 1)) @@ -1378,7 +1383,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s5-0 (-> this root root-prim prim-core)) ) - (set! (-> s3-0 quad) (-> s5-0 world-sphere quad)) + (vector-copy! s3-0 (-> s5-0 world-sphere)) (set! (-> s3-0 w) (-> s5-0 world-sphere w)) (let ((s4-0 544)) (set! *actor-list-length* 0) @@ -1510,7 +1515,7 @@ (set! (-> v1-2 rvec w) 1.0) ) (set-vector! (-> gp-0 1 uvec) 0.0 16384.0 0.0 1.0) - (set! (-> gp-0 0 uvec quad) (-> gp-0 0 rvec quad)) + (vector-copy! (-> gp-0 0 uvec) (-> gp-0 0 rvec)) (set! (-> gp-0 0 uvec y) 0.0) (let* ((v1-5 (-> gp-0 0)) (f30-0 (sqrtf (+ (* (-> v1-5 rvec x) (-> v1-5 rvec x)) (* (-> v1-5 rvec z) (-> v1-5 rvec z))))) @@ -1645,7 +1650,7 @@ ;; INFO: Used lq/sq (defmethod nav-enemy-method-161 ((this manta) (arg0 nav-control)) (let ((a2-0 (-> arg0 state))) - (set! (-> this move-vel quad) (-> a2-0 velocity quad)) + (vector-copy! (-> this move-vel) (-> a2-0 velocity)) ) (manta-method-201 this 201326600.0) (none) @@ -1673,7 +1678,7 @@ (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 81920.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-12 s4-0)) (set! (-> v1-12 radius) 3276.8) @@ -1731,11 +1736,12 @@ ;; definition for method 59 of type manta ;; INFO: Used lq/sq (defmethod enemy-common-post ((this manta)) - (set! (-> this root gspot-pos quad) (-> this root trans quad)) + "Common implementation of post. Runs ja-post." + (vector-copy! (-> this root gspot-pos) (-> this root trans)) (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set-ground-pat! + (find-ground-and-set-pat! this a1-0 (-> this enemy-info recover-gnd-collide-with) @@ -1774,6 +1780,7 @@ ;; WARN: disable def twice: 150. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. ;; WARN: disable def twice: 100. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this manta) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-4 object)) (case arg2 (('hit 'hit-flinch 'hit-knocked) @@ -1786,7 +1793,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1837,14 +1844,14 @@ (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-2) 3)) (if (not (manta-method-196 this)) (set-time! (-> this attack-path-blocked-time)) ) ) (else - (set! (-> this focus-pos quad) (-> (target-pos 0) quad)) - (set! (-> this dest-pos quad) (-> this root trans quad)) + (vector-copy! (-> this focus-pos) (target-pos 0)) + (vector-copy! (-> this dest-pos) (-> this root trans)) ) ) ) @@ -1853,7 +1860,8 @@ ;; definition for method 50 of type manta ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this manta) (arg0 int)) +(defmethod update-collision-action ((this manta) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -1890,6 +1898,7 @@ ;; definition for method 87 of type manta (defmethod knocked-anim-handler ((this manta) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (let ((s5-0 (ja-done? 0))) @@ -1920,6 +1929,7 @@ ;; definition for method 85 of type manta (defmethod knocked-anim ((this manta) (arg0 enemy-knocked-info)) + "start the knocked animation." (cond ((= (-> this hit-points) 0.0) (ja-channel-push! 1 (seconds 0.1)) @@ -1968,6 +1978,7 @@ ;; definition for method 86 of type manta (defmethod knocked-land-anim ((this manta) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (set! (-> arg0 anim-speed) 0.5) (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) @@ -2021,13 +2032,14 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this manta)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag)) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-manta" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *manta-nav-enemy-info*) + (setup-enemy! this *manta-nav-enemy-info*) (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) ) @@ -2062,8 +2074,8 @@ (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef44)))) (set! (-> this go-enable) #t) - (set! (-> this up-dir quad) (-> *y-vector* quad)) - (set! (-> this forward-dir quad) (-> *z-vector* quad)) + (vector-copy! (-> this up-dir) *y-vector*) + (vector-copy! (-> this forward-dir) *z-vector*) (set! (-> this last-attack-time) 0) (set! (-> this attack-path-blocked-time) 0) (set! (-> this track-timer) 0) diff --git a/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc index 71aaa657dab..650b43c9260 100644 --- a/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mine-obs_REF.gc @@ -163,6 +163,7 @@ ;; definition for method 11 of type rat-light-manager ;; INFO: Used lq/sq (defmethod init-from-entity! ((this rat-light-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -422,7 +423,7 @@ ) ) :enter (behavior () - (set! (-> self force-pos quad) (-> self root trans quad)) + (vector-copy! (-> self force-pos) (-> self root trans)) ) :trans (behavior () (if (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 204800.0) @@ -443,7 +444,7 @@ :virtual #t :event (-> (method-of-type min-rat-engine inactive) event) :trans (behavior () - (set! (-> self force-pos quad) (-> self root trans quad)) + (vector-copy! (-> self force-pos) (-> self root trans)) (rider-trans) (if (< 245760.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans))) (go-virtual inactive) @@ -667,7 +668,7 @@ (when (= arg0 this) (let ((a2-1 (handle->process (-> arg1 handle)))) (if a2-1 - (set! (-> this force-pos quad) (-> (the-as process-focusable a2-1) root trans quad)) + (vector-copy! (-> this force-pos) (-> (the-as process-focusable a2-1) root trans)) ) ) ) @@ -749,6 +750,7 @@ ;; definition for method 11 of type min-rat-engine ;; INFO: Used lq/sq (defmethod init-from-entity! ((this min-rat-engine) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (min-rat-engine-method-24 this) (process-drawable-from-entity! this arg0) @@ -925,6 +927,7 @@ ;; definition for method 11 of type min-crane (defmethod init-from-entity! ((this min-crane) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (min-crane-method-21 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1294,7 +1297,8 @@ ;; definition for method 20 of type min-target-sign ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this min-target-sign)) +(defmethod get-search-info-flag ((this min-target-sign)) + "Get search-info-flag for this process." (let ((v0-0 0)) (if (and (-> this next-state) (= (-> this next-state name) 'idle)) (set! v0-0 (logior v0-0 40)) @@ -1305,6 +1309,7 @@ ;; definition for method 11 of type min-target-sign (defmethod init-from-entity! ((this min-target-sign) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) (t9-0 this arg0) ) @@ -1776,6 +1781,7 @@ ;; definition for method 11 of type min-elev-doors (defmethod init-from-entity! ((this min-elev-doors) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (min-elev-doors-method-23 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1862,7 +1868,7 @@ (= (-> self rog) #f) ) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 pos) (-> self root trans)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf8)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -2110,6 +2116,7 @@ ;; definition for method 11 of type min-door (defmethod init-from-entity! ((this min-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (cond ((or (task-node-closed? (game-task-node mine-blow-resolution)) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) @@ -2333,6 +2340,7 @@ ;; definition for method 11 of type min-airlock-door (defmethod init-from-entity! ((this min-airlock-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc index 4dfbd2be4f2..5dc728cac11 100644 --- a/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mine-platforms_REF.gc @@ -47,6 +47,7 @@ ;; definition for method 11 of type mine-platform-base ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this mine-platform-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -101,7 +102,7 @@ (stack-size-set! (-> self main-thread) 32) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self spool-sound) (new-sound-id)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (queue-drill-sound self) (go-virtual active) ) @@ -295,6 +296,7 @@ ;; definition for method 11 of type min-moving-plat (defmethod init-from-entity! ((this min-moving-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) (t9-0 this arg0) ) @@ -528,8 +530,8 @@ (vector+float*! (-> s3-1 trans) (-> s3-1 trans) gp-1 (* 106496.0 (-> self root scale x))) (vector+float*! (-> s3-1 trans) (-> s3-1 trans) s5-0 (* -8192.0 (-> self root scale x))) (vector-float*! (-> s3-1 fvec) gp-1 1.0) - (set! (-> s3-1 uvec quad) (-> *up-vector* quad)) - (set! (-> s3-1 rvec quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 uvec) *up-vector*) + (vector-copy! (-> s3-1 rvec) s5-0) (launch-particles (-> *part-id-table* 2316) s3-1 :origin-is-matrix #t) (launch-particles (-> *part-id-table* 2315) s3-1 :origin-is-matrix #t) ) @@ -634,6 +636,7 @@ ;; definition for method 11 of type min-rotating-plat (defmethod init-from-entity! ((this min-rotating-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) (t9-0 this arg0) ) @@ -1054,7 +1057,8 @@ ;; definition for method 20 of type min-falling-step ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this min-falling-step)) +(defmethod get-search-info-flag ((this min-falling-step)) + "Get search-info-flag for this process." (let ((v0-0 0)) (cond ((and (-> this next-state) (= (-> this next-state name) 'idle)) @@ -1227,6 +1231,7 @@ ;; definition for method 11 of type min-falling-step ;; INFO: Used lq/sq (defmethod init-from-entity! ((this min-falling-step) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((t9-0 (method-of-type mine-platform-base init-from-entity!))) (t9-0 this arg0) @@ -1461,6 +1466,7 @@ ;; definition for method 11 of type min-folding-plat (defmethod init-from-entity! ((this min-folding-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1680,6 +1686,7 @@ ;; definition for method 11 of type min-ramp (defmethod init-from-entity! ((this min-ramp) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (s5-3 symbol)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -1914,6 +1921,7 @@ ;; definition for method 11 of type min-bridge (defmethod init-from-entity! ((this min-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2010,6 +2018,7 @@ ;; definition for method 11 of type min-plat-updown ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this min-plat-updown) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) diff --git a/test/decompiler/reference/jak3/levels/mine/mine-scenes_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-scenes_REF.gc index 836d771c117..1cd2ab084f9 100644 --- a/test/decompiler/reference/jak3/levels/mine/mine-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mine-scenes_REF.gc @@ -1544,6 +1544,7 @@ ;; definition for method 11 of type leggings (defmethod init-from-entity! ((this leggings) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (when (task-node-closed? (game-task-node mine-explore-resolution)) (cleanup-for-death this) (return #f) @@ -1562,7 +1563,3 @@ (go (method-of-object this idle)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc b/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc index 8bbdb04575a..1c1cfa21b72 100644 --- a/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mine-train_REF.gc @@ -543,11 +543,11 @@ (explode-sound self) (cond ((logtest? (-> *part-group-id-table* 604 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 604)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 604)) ) ) @@ -584,11 +584,11 @@ (explode-sound self) (cond ((logtest? (-> *part-group-id-table* 604 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 604)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 604)) ) ) @@ -787,7 +787,7 @@ (a1-7 (new 'stack-no-clear 'matrix)) ) (let ((a0-7 (new 'stack-no-clear 'vector))) - (set! (-> a0-7 quad) (-> *up-vector* quad)) + (vector-copy! a0-7 *up-vector*) (vector-! v1-11 a2-6 s4-0) (let ((a2-7 v1-11)) (let ((f0-4 1.0)) @@ -809,14 +809,14 @@ (.svf (&-> a2-7 quad) vf1) ) (let ((a2-8 a1-7)) - (set! (-> a2-8 fvec quad) (-> v1-11 quad)) - (set! (-> a2-8 uvec quad) (-> a0-7 quad)) + (vector-copy! (-> a2-8 fvec) v1-11) + (vector-copy! (-> a2-8 uvec) a0-7) (vector-cross! (-> a2-8 rvec) (-> a2-8 uvec) v1-11) ) ) (matrix->quaternion (-> this root quat) a1-7) ) - (set! (-> this root trans quad) (-> s5-1 quad)) + (vector-copy! (-> this root trans) s5-1) ) f30-0 ) @@ -870,6 +870,7 @@ ;; definition for method 11 of type min-bomb-train ;; INFO: Used lq/sq (defmethod init-from-entity! ((this min-bomb-train) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (when (task-node-closed? (game-task-node mine-blow-resolution)) (cleanup-for-death this) diff --git a/test/decompiler/reference/jak3/levels/mine/mined-mood_REF.gc b/test/decompiler/reference/jak3/levels/mine/mined-mood_REF.gc index 7b290b0259a..8f09924a019 100644 --- a/test/decompiler/reference/jak3/levels/mine/mined-mood_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mined-mood_REF.gc @@ -68,8 +68,8 @@ (set! (-> s5-0 light 1) (set-mined-filter-light! "light-3803" s4-1 (-> s5-0 filter 1) (-> s5-0 light 1))) ) (set! (-> arg0 times 0 w) 1.0) - (set! (-> arg0 times 1 quad) (-> s5-0 filter 0 quad)) - (set! (-> arg0 times 2 quad) (-> s5-0 filter 1 quad)) + (vector-copy! (-> arg0 times 1) (-> s5-0 filter 0)) + (vector-copy! (-> arg0 times 2) (-> s5-0 filter 1)) ) ) ) @@ -84,13 +84,9 @@ (let ((v1-1 (level-get *level* 'mined))) (when v1-1 (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) - (set! (-> (the-as mined-states v1-2) filter arg1 quad) (-> arg0 quad)) + (vector-copy! (-> (the-as mined-states v1-2) filter arg1) arg0) ) ) ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/mined-scenes_REF.gc b/test/decompiler/reference/jak3/levels/mine/mined-scenes_REF.gc index 23922149edd..a74459e261c 100644 --- a/test/decompiler/reference/jak3/levels/mine/mined-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/mined-scenes_REF.gc @@ -49,6 +49,7 @@ ;; definition for method 11 of type cav-airlock-door (defmethod init-from-entity! ((this cav-airlock-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) @@ -1211,7 +1212,7 @@ ,(lambda :behavior scene-player ((arg0 process-drawable) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-0 spawn-point quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 spawn-point) arg1) (quaternion-identity! (-> s5-0 spawn-quat)) (set! (-> s5-0 radius) 8192.0) (set! (-> s5-0 scale) 1.0) @@ -1616,7 +1617,7 @@ ,(lambda :behavior scene-player ((arg0 process-drawable) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-0 spawn-point quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 spawn-point) arg1) (quaternion-identity! (-> s5-0 spawn-quat)) (set! (-> s5-0 radius) 8192.0) (set! (-> s5-0 scale) 1.0) @@ -2538,7 +2539,3 @@ (:rotate-y (degrees 0)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/minee-scenes_REF.gc b/test/decompiler/reference/jak3/levels/mine/minee-scenes_REF.gc index 338ce35dca1..4ff6befb930 100644 --- a/test/decompiler/reference/jak3/levels/mine/minee-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/minee-scenes_REF.gc @@ -130,6 +130,7 @@ ;; definition for method 11 of type minee-elevator (defmethod init-from-entity! ((this minee-elevator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) @@ -162,7 +163,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/monster-frog_REF.gc b/test/decompiler/reference/jak3/levels/mine/monster-frog_REF.gc index 3fc7fc68fb5..7553b6c1a7a 100644 --- a/test/decompiler/reference/jak3/levels/mine/monster-frog_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/monster-frog_REF.gc @@ -131,34 +131,34 @@ :jump-height-min (meters 2.87) :jump-height-factor 0.1 :knocked-seek-ry-clamp 4551.1113 - :knocked-soft-vxz-lo 75776.0 - :knocked-soft-vxz-hi 75776.0 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 81920.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 79872.0 - :knocked-hard-vxz-hi 79872.0 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 75776.0 - :knocked-yellow-vxz-hi 75776.0 - :knocked-yellow-vy-lo 81920.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 73728.0 - :knocked-red-vxz-hi 73728.0 - :knocked-red-vy-lo 96256.0 - :knocked-red-vy-hi 96256.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 18.5) + :knocked-soft-vxz-hi (meters 18.5) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 20) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.5) + :knocked-hard-vxz-hi (meters 19.5) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 18.5) + :knocked-yellow-vxz-hi (meters 18.5) + :knocked-yellow-vy-lo (meters 20) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 18) + :knocked-red-vxz-hi (meters 18) + :knocked-red-vy-lo (meters 23.5) + :knocked-red-vy-hi (meters 23.5) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -206,7 +206,7 @@ (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) ) 0 - (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (dotimes (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.01))) (cond ((zero? (rnd-int self 4)) (let ((v1-7 (ja-group))) @@ -337,7 +337,7 @@ (set! (-> v1-37 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-37 prim-core collide-with) (-> self root backup-collide-with)) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -375,7 +375,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -398,7 +398,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (when (enemy-method-134 self 0.2) + (when (rnd-chance-for-idle? self 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.6)) (let ((v1-57 self)) @@ -416,7 +416,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -516,7 +516,7 @@ ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) (go-stare self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -545,7 +545,7 @@ (gp-1 (-> self enemy-info)) ) (let ((a1-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-4 1.0))) - (if (not (enemy-method-103 self a1-5 6371.5557)) + (if (not (heading-matches-direction? self a1-5 6371.5557)) (go-virtual turn) ) ) @@ -635,7 +635,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 self)) @@ -692,7 +692,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-17 quad)) + (vector-copy! (-> a0-3 target-pos) v1-17) ) ) 0 @@ -768,13 +768,14 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) ;; definition for method 85 of type monster-frog (defmethod knocked-anim ((this monster-frog) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 0) @@ -836,6 +837,7 @@ ;; definition for method 86 of type monster-frog (defmethod knocked-land-anim ((this monster-frog) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.17)) @@ -897,6 +899,7 @@ ;; definition for method 59 of type monster-frog (defmethod enemy-common-post ((this monster-frog)) + "Common implementation of post. Runs ja-post." (water-control-method-10 (-> this water)) ((method-of-type nav-enemy enemy-common-post) this) (none) @@ -905,6 +908,7 @@ ;; definition for method 120 of type monster-frog ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this monster-frog)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -969,12 +973,13 @@ ;; definition for method 121 of type monster-frog ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this monster-frog)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-monster-frog" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *monster-frog-nav-enemy-info*) + (setup-enemy! this *monster-frog-nav-enemy-info*) (set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0)) (set! (-> this water flags) (water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) @@ -985,7 +990,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc index 4d8ea1c3e4e..40e18129b5d 100644 --- a/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/prebot-extras_REF.gc @@ -33,6 +33,7 @@ ;; definition for method 11 of type cav-break-bridge (defmethod init-from-entity! ((this cav-break-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -79,7 +80,8 @@ ;; definition for method 20 of type cav-railblocker ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this cav-railblocker)) +(defmethod get-search-info-flag ((this cav-railblocker)) + "Get search-info-flag for this process." (the-as search-info-flag (if (-> this trackable) 24 1 @@ -220,7 +222,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -291,6 +293,7 @@ ;; definition for method 11 of type cav-railblocker ;; INFO: Used lq/sq (defmethod init-from-entity! ((this cav-railblocker) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -364,6 +367,7 @@ ;; definition for method 11 of type cav-minecar (defmethod init-from-entity! ((this cav-minecar) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -464,7 +468,7 @@ 0.5 ) (vector-! s5-0 gp-0 (-> self prev-position)) - (set! (-> self prev-position quad) (-> gp-0 quad)) + (vector-copy! (-> self prev-position) gp-0) (let ((v1-13 s5-0)) (.lvf vf1 (&-> s5-0 quad)) (let ((f0-7 (-> self clock frames-per-second))) @@ -634,8 +638,8 @@ ) ) (vector<-cspace! (-> s4-0 min) (-> self node-list data (-> s5-0 (+ (-> s5-0 length) -1) joint-index))) - (set! (-> s4-0 max quad) (-> s4-0 min quad)) - (set! (-> s5-0 (+ (-> s5-0 length) -1) position quad) (-> s4-0 min quad)) + (vector-copy! (-> s4-0 max) (-> s4-0 min)) + (vector-copy! (-> s5-0 (+ (-> s5-0 length) -1) position) (-> s4-0 min)) (dotimes (s3-0 (+ (-> s5-0 length) -1)) (let ((s2-0 (new 'stack-no-clear 'vector))) (vector<-cspace! (-> s5-0 s3-0 position) (-> self node-list data (-> s5-0 s3-0 joint-index))) @@ -659,7 +663,7 @@ (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer s4-0) 32) (fill-using-bounding-box *collide-cache* gp-0) (dotimes (s4-1 (+ (-> s5-0 length) -1)) - (set! (-> gp-0 start-pos quad) (-> s5-0 s4-1 position quad)) + (vector-copy! (-> gp-0 start-pos) (-> s5-0 s4-1 position)) (vector-! (-> gp-0 move-dist) (-> s5-0 (+ s4-1 1) position) (-> gp-0 start-pos)) (let ((v1-52 gp-0)) (set! (-> v1-52 radius) 2048.0) @@ -850,7 +854,7 @@ ) 0 (let ((gp-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-0 spawn-quat)) (set! (-> gp-0 radius) 8192.0) (set! (-> gp-0 scale) 1.0) @@ -886,17 +890,16 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-gun-lod0-jg gunTip)) quad) - ) - (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! - (new 'stack-no-clear 'vector) - (-> self node-list data 7 bone transform uvec) - (* 4096.0 (-> self clock frames-per-second)) - ) - quad - ) - ) + (vector-copy! + (-> gp-0 pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-gun-lod0-jg gunTip)) + ) + (vector-copy! (-> gp-0 vel) (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> self node-list data 7 bone transform uvec) + (* 4096.0 (-> self clock frames-per-second)) + ) + ) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1101,7 +1104,7 @@ (let ((a1-12 (new 'stack 'debris-tuning (the-as uint 1)))) (set! (-> a1-12 hit-xz-reaction) 0.95) (set! (-> a1-12 hit-y-reaction) 0.6) - (set! (-> a1-12 fountain-rand-transv-lo quad) (-> self root trans quad)) + (vector-copy! (-> a1-12 fountain-rand-transv-lo) (-> self root trans)) (+! (-> a1-12 fountain-rand-transv-lo z) 4096.0) (debris-spawn (the-as process-drawable (ppointer->process (-> self parent))) @@ -1113,11 +1116,11 @@ (sound-play "columns-break" :position (-> self root trans)) (cond ((logtest? (-> *part-group-id-table* 1344 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1344)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1344)) ) ) @@ -1174,7 +1177,7 @@ (set-vector! (-> self draw color-mult) f30-0 f30-0 f30-0 1.0) ) (let ((a1-2 (new 'stack-no-clear 'vector))) - (set! (-> a1-2 quad) (-> self root trans quad)) + (vector-copy! a1-2 (-> self root trans)) (set! (-> a1-2 y) (-> self start-y)) (spawn (-> self cool-part) a1-2) ) @@ -1200,7 +1203,7 @@ ) :trans (behavior () (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 y) (-> self start-y)) (spawn (-> self part) a1-0) ) @@ -1239,7 +1242,7 @@ (go-virtual wait-to-cool) ) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> self root trans quad)) + (vector-copy! a1-1 (-> self root trans)) (set! (-> a1-1 y) (-> self start-y)) (spawn (-> self part) a1-1) ) @@ -1272,7 +1275,7 @@ (go-virtual grow) ) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self root trans quad)) + (vector-copy! a1-0 (-> self root trans)) (set! (-> a1-0 y) (-> self start-y)) (spawn (-> self heat-part) a1-0) ) @@ -1357,6 +1360,7 @@ ;; definition for method 11 of type cav-exit-door (defmethod init-from-entity! ((this cav-exit-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-setup_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-setup_REF.gc index 54c52166976..2b33c2974e3 100644 --- a/test/decompiler/reference/jak3/levels/mine/prebot-setup_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/prebot-setup_REF.gc @@ -672,7 +672,7 @@ ) (quaternion-set! (-> self root quat) 0.0 (-> s4-8 x) 0.0 (-> s4-8 y)) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self start-y) (-> self root trans y)) (set! (-> self end-y) (+ (-> arg0 y) (-> arg1 height))) (set! (-> self vulnerable) #f) @@ -848,7 +848,7 @@ (set! (-> *prebot-sword-color-array* zbuffer?) #t) ;; failed to figure out what this is: -(set! (-> *prebot-sword-color-array* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *prebot-sword-color-array* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *prebot-sword-color-array* use-tape-mode?) #t) @@ -886,8 +886,8 @@ (set! (-> self root) s2-0) ) (set! (-> self root pause-adjust-distance) 409600.0) - (set! (-> self root trans quad) (-> arg1 quad)) - (set! (-> self prev-position quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) + (vector-copy! (-> self prev-position) arg1) (set! (-> self old-target-dist) 204800.0) (set! (-> self prefix) arg0) (initialize-skeleton @@ -984,7 +984,7 @@ (set! (-> self root) s4-0) ) (set! (-> self root pause-adjust-distance) 409600.0) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) arg1) (initialize-skeleton self @@ -1029,7 +1029,7 @@ (set! (-> self root) s4-0) ) (set! (-> self root pause-adjust-distance) 409600.0) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (set! (-> self prefix) arg0) (initialize-skeleton self @@ -1090,7 +1090,7 @@ (set! (-> self root) s3-0) ) (set! (-> self root pause-adjust-distance) 409600.0) - (set! (-> self root trans quad) (-> arg1 quad)) + (vector-copy! (-> self root trans) arg1) (set! (-> self prefix) arg0) (initialize-skeleton self @@ -1132,6 +1132,7 @@ ;; definition for method 11 of type prebot ;; INFO: Used lq/sq (defmethod init-from-entity! ((this prebot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1289,7 +1290,7 @@ (the-as pair 0) ) (logior! (-> this mask) (process-mask enemy)) - (set! (-> this original-position quad) (-> this root trans quad)) + (vector-copy! (-> this original-position) (-> this root trans)) (init (-> this position) (-> this original-position) 0.004096 2048.0 0.125) (set! (-> this draw light-index) (the-as uint 10)) (dotimes (v1-64 28) diff --git a/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc b/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc index 1d6973a3ab6..f8564122d1e 100644 --- a/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/prebot-states_REF.gc @@ -37,10 +37,10 @@ (let ((a1-9 (matrix-axis-angle! (new 'stack-no-clear 'matrix) s5-0 (* 8192.0 (-> s4-1 neck-angle value)))) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> arg0 bone transform trans quad)) + (vector-copy! s5-1 (-> arg0 bone transform trans)) (vector-reset! (-> arg0 bone transform trans)) (matrix*! (-> arg0 bone transform) a1-9 (-> arg0 bone transform)) - (set! (-> arg0 bone transform trans quad) (-> s5-1 quad)) + (vector-copy! (-> arg0 bone transform trans) s5-1) ) ) ) @@ -148,7 +148,7 @@ (set! (-> a0-16 pickup-type) (pickup-type ammo-random)) (set! (-> a0-16 pickup-amount) 10.0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self root trans quad)) + (vector-copy! s5-0 (-> self root trans)) (set! (-> self root trans quad) (-> (the-as (pointer uint128) (+ (the-as uint (-> self ammo 0 where)) (* 48 gp-0)))) ) @@ -156,7 +156,7 @@ (set! (-> self ammo gp-0 handle) (ppointer->handle (drop-pickup a0-16 #t *entity-pool* (the-as fact-info #f) 0 #t)) ) - (set! (-> self root trans quad) (-> s5-0 quad)) + (vector-copy! (-> self root trans) s5-0) ) ) ) @@ -178,7 +178,7 @@ (set! (-> *game-info* counter) (the float (-> self stage))) (prebot-prespool) (update! (-> self position) (the-as vector #f)) - (set! (-> self root trans quad) (-> self position value quad)) + (vector-copy! (-> self root trans) (-> self position value)) (let* ((f0-17 (* 54.613335 (the float (current-time)))) (f0-18 (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0))) ) @@ -190,7 +190,7 @@ ) (else (let ((t0-1 (new 'static 'vector))) - (set! (-> t0-1 quad) (-> self root trans quad)) + (vector-copy! t0-1 (-> self root trans)) (+! (-> t0-1 y) 16384.0) (set-setting! 'point-of-interest 'abs t0-1 0) ) @@ -254,11 +254,11 @@ (remove-setting! 'entity-name) (when (and (< (-> self stage) 4) (not (handle->process (-> self blocker)))) (let ((gp-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) - (set! (-> gp-0 0 quad) (-> self entity extra trans quad)) + (vector-copy! (-> gp-0 0) (-> self entity extra trans)) (+! (-> gp-0 0 x) 163840.0) (+! (-> gp-0 0 y) -81920.0) (+! (-> gp-0 0 z) 4096.0) - (set! (-> gp-0 1 quad) (-> self entity extra trans quad)) + (vector-copy! (-> gp-0 1) (-> self entity extra trans)) (+! (-> gp-0 1 x) -163840.0) (+! (-> gp-0 1 y) -81920.0) (+! (-> gp-0 1 z) 4096.0) @@ -293,7 +293,8 @@ ;; definition for method 20 of type prebot ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this prebot)) +(defmethod get-search-info-flag ((this prebot)) + "Get search-info-flag for this process." (the-as search-info-flag 0) ) @@ -469,7 +470,7 @@ (process-grab? *target* #f) (ja :num! (seek!)) (when (ja-done? 0) - (set! (-> self root trans quad) (-> self entity extra trans quad)) + (vector-copy! (-> self root trans) (-> self entity extra trans)) (process-release? *target*) (go-virtual play-fma) ) @@ -478,7 +479,7 @@ (let ((gp-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) (let ((v1-19 (the-as entity-actor (entity-by-name "scene-stage-133")))) (when v1-19 - (set! (-> self root trans quad) (-> v1-19 extra trans quad)) + (vector-copy! (-> self root trans) (-> v1-19 extra trans)) (quaternion-copy! gp-0 (-> v1-19 quat)) ) ) @@ -629,7 +630,7 @@ (when gp-3 (blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f) (let ((a1-10 (new 'stack-no-clear 'vector))) - (set! (-> a1-10 quad) (-> (the-as process-drawable gp-3) root trans quad)) + (vector-copy! a1-10 (-> (the-as process-drawable gp-3) root trans)) (+! (-> a1-10 y) -14336.0) (set-target! (-> self shoulder-aim-jm) a1-10) ) @@ -828,7 +829,7 @@ (else (blend-on! (-> self shoulder-aim-jm) (seconds 0.25) 1.0 #f) (let ((gp-10 (new 'stack-no-clear 'vector))) - (set! (-> gp-10 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-10 (target-pos 0)) (let ((s5-6 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node prebot-lod0-jg shoulderL)))) (+! (-> gp-10 y) (-> self shot-extra-y)) (set! (-> s5-6 y) (-> s5-6 x)) @@ -883,7 +884,7 @@ ;; WARN: Return type mismatch none vs object. (defbehavior prebot-fire-tentacle prebot ((arg0 handle) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> self root trans quad)) + (vector-copy! s5-0 (-> self root trans)) (let ((v1-2 (handle->process arg0))) (if v1-2 (vector<-cspace! s5-0 (-> (the-as prebot-tentacle v1-2) node-list data 14)) @@ -1012,7 +1013,7 @@ (set! (-> self num-attacks) (the-as uint 0)) (dotimes (s3-0 (min 5 (-> gp-0 length))) (vector+! s5-0 (-> gp-0 s3-0 offset) (-> self original-position)) - (set! (-> s4-0 quad) (-> s5-0 quad)) + (vector-copy! s4-0 s5-0) (+! (-> s4-0 x) (* 4096.0 (cos (* 1747.6267 (the float (+ (* 30 s3-0) (- (current-time) (-> self state-time))))))) ) @@ -1244,7 +1245,7 @@ ) ) ) - (set! (-> s5-0 quad) (-> self nav state mesh bounds quad)) + (vector-copy! s5-0 (-> self nav state mesh bounds)) (case (-> self stage) ((1) (+! (-> s5-0 x) 61440.0) @@ -1255,7 +1256,7 @@ (set! (-> s5-0 x) (- (-> s5-0 x) (* 28672.0 (the float (-> self critters-to-launch))))) ) ) - (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (vector-copy! (-> s4-0 trans) gp-0) (quaternion-copy! (-> s4-0 quat) (-> self root quat)) (set! (-> s4-0 entity) (-> self entity)) (set! (-> s4-0 directed?) #f) @@ -1963,7 +1964,7 @@ ;; WARN: Return type mismatch int vs object. (defbehavior prebot-spawn-shockwave prebot () (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-identity! (new 'stack-no-clear 'quaternion)))) L162 (let* ((v1-6 (ja-group)) @@ -2389,8 +2390,8 @@ (else (let ((gp-0 (new 'stack-no-clear 'enemy-init-by-other-params))) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> self nav state mesh bounds quad)) - (set! (-> gp-0 trans quad) (-> v1-4 quad)) + (vector-copy! v1-4 (-> self nav state mesh bounds)) + (vector-copy! (-> gp-0 trans) v1-4) ) (quaternion-copy! (-> gp-0 quat) (-> self root quat)) (set! (-> gp-0 entity) (-> self entity)) diff --git a/test/decompiler/reference/jak3/levels/mine/rat_REF.gc b/test/decompiler/reference/jak3/levels/mine/rat_REF.gc index 86b72ada171..5a40a85b11a 100644 --- a/test/decompiler/reference/jak3/levels/mine/rat_REF.gc +++ b/test/decompiler/reference/jak3/levels/mine/rat_REF.gc @@ -212,34 +212,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 49152.0 - :knocked-soft-vxz-hi 77824.0 - :knocked-soft-vy-lo 65536.0 - :knocked-soft-vy-hi 102400.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 12) + :knocked-soft-vxz-hi (meters 19) + :knocked-soft-vy-lo (meters 16) + :knocked-soft-vy-hi (meters 25) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9898 :y 0.0756 :z 0.1191 :w 16871.352) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -649,6 +649,7 @@ ;; definition for method 120 of type rat ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this rat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -760,7 +761,7 @@ (defstate idle (rat) :virtual #t :enter (behavior () - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-virtual die) ) (call-parent-state-handler enter) @@ -798,7 +799,7 @@ (if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y)) ) - (set! (-> self root gspot-pos quad) (-> gp-0 quad)) + (vector-copy! (-> self root gspot-pos) gp-0) ) (sound-play "rat-spawner") ) @@ -888,7 +889,7 @@ ) (logclear! (-> a0-22 flags) (nav-state-flag directional-mode)) (logior! (-> a0-22 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-22 target-pos quad) (-> v1-18 quad)) + (vector-copy! (-> a0-22 target-pos) v1-18) ) 0 ) @@ -960,7 +961,7 @@ ) ) ) - (if (enemy-method-103 self (-> self face-dir) 1820.4445) + (if (heading-matches-direction? self (-> self face-dir) 1820.4445) (go-virtual active) ) ) @@ -1029,7 +1030,7 @@ (ja :num! (seek!)) ) (set-look-at-mode! self 1) - (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015))) + (dotimes (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.015))) (ja-no-eval :group! rat-sit-alert-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1041,7 +1042,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1093,7 +1094,7 @@ a1-0 ) ) - (set! (-> gp-0 quad) (-> self wheel-actor extra trans quad)) + (vector-copy! gp-0 (-> self wheel-actor extra trans)) ) ) ) @@ -1104,7 +1105,7 @@ ) (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-7 target-pos quad) (-> v1-11 quad)) + (vector-copy! (-> a0-7 target-pos) v1-11) ) 0 (nav-enemy-method-187 self) @@ -1131,7 +1132,7 @@ ) :code (behavior () (until #f - (when (not (enemy-method-105 self 4551.1113 #t)) + (when (not (pointing-toward-focus? self 4551.1113 #t)) (let ((v1-3 self)) (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) ) @@ -1139,7 +1140,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! rat-turn-left-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop!)) @@ -1206,7 +1207,7 @@ (suspend) (ja :num! (seek! max 1.5)) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-chase-post ) @@ -1236,7 +1237,7 @@ ) 0 (set-look-at-mode! self 1) - (set! (-> self flee-focus-pos quad) (-> self focus-pos quad)) + (vector-copy! (-> self flee-focus-pos) (-> self focus-pos)) ) :trans (behavior () (when (time-elapsed? (-> self state-time) (seconds 1)) @@ -1249,7 +1250,7 @@ ) :code (behavior () (until #f - (when (not (enemy-method-105 self 4551.1113 #t)) + (when (not (pointing-toward-focus? self 4551.1113 #t)) (let ((v1-3 self)) (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) ) @@ -1257,7 +1258,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! rat-turn-left-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop!)) @@ -1296,7 +1297,7 @@ ) :code (behavior () (until #f - (when (not (enemy-method-105 self 4551.1113 #t)) + (when (not (pointing-toward-focus? self 4551.1113 #t)) (let ((v1-3 self)) (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags)))) ) @@ -1304,7 +1305,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! rat-turn-left-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 1820.4445 #t) + (until (pointing-toward-focus? self 1820.4445 #t) (ja-blend-eval) (suspend) (ja :num! (loop!)) @@ -1363,7 +1364,7 @@ (cond ((handle->process (-> self ragdoll-proc)) (vector-reset! (-> self root transv)) - (try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) + (move-to-ground self (meters 10) (meters 10) #t (collide-spec backgnd)) (ja-channel-push! 1 0) (ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0) (let ((gp-0 (-> (the-as ragdoll-proc (-> self ragdoll-proc process 0)) ragdoll))) @@ -1432,7 +1433,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-virtual flee) ) @@ -1633,12 +1634,15 @@ ) ;; definition for method 108 of type rat -(defmethod enemy-method-108 ((this rat) (arg0 process-focusable)) +(defmethod should-flee-from? ((this rat) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (not (time-elapsed? (-> this scared-timer) (-> this scared-interval))) (-> this permanently-scared)) ) ;; definition for method 109 of type rat -(defmethod enemy-method-109 ((this rat)) +(defmethod out-of-bounds? ((this rat)) + "Has the enemy gone somewhere it shouldn't? + Used to kill some enemies that can be knocked of regions." (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -1671,7 +1675,8 @@ ) ;; definition for method 89 of type rat -(defmethod within-gspot-range? ((this rat)) +(defmethod invalid-height? ((this rat)) + "Return #t if the enemy is too high in the air, or below the ground." (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -1687,7 +1692,7 @@ a1-0 ) ) - ((method-of-type nav-enemy within-gspot-range?) this) + ((method-of-type nav-enemy invalid-height?) this) ) ) ) @@ -1696,6 +1701,7 @@ ;; definition for method 125 of type rat (defmethod ragdoll-settled? ((this rat)) + "Has the ragdoll stopped moving?" (with-pp (and (or (time-elapsed? (-> this state-time) (seconds 3)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -1721,6 +1727,7 @@ ;; definition for method 56 of type rat ;; WARN: Return type mismatch float vs object. (defmethod knocked-handler ((this rat) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (let ((f30-0 (rnd-float-range this 0.9 1.0))) (let ((f0-0 0.0) @@ -1733,7 +1740,10 @@ ) ;; definition for method 63 of type rat -(defmethod enemy-method-63 ((this rat) (arg0 float)) +(defmethod apply-incoming-hitpoint-mods ((this rat) (arg0 float)) + "Modify the hitpoints from an incoming attack. + Keeps enemy alive for a bit while being shot with a blue gun. + This looks cool because you can shoot them many times." (if (= (-> this hit-points) (-> this enemy-info default-hit-points)) 1.0 0.0 @@ -1743,6 +1753,7 @@ ;; definition for method 142 of type rat ;; WARN: Return type mismatch int vs knocked-type. (defmethod penetrate->knocked-type ((this rat) (arg0 penetrate)) + "Based on the penetrate of an attacker, pick the knocked-type." (the-as knocked-type (cond ((logtest? arg0 (penetrate vehicle)) 7 @@ -1765,6 +1776,7 @@ ;; definition for method 78 of type rat (defmethod go-hostile ((this rat)) + "Go to the hostile state, actively trying to attack the target." (if (logtest? (-> this fact enemy-options) (enemy-option user8)) (go (method-of-object this wait-by-wheel-seek)) (go (method-of-object this hostile)) @@ -1773,20 +1785,22 @@ ;; definition for method 67 of type rat (defmethod coin-flip? ((this rat)) + "Return #t half the time, #f the other." #f ) ;; definition for method 59 of type rat ;; INFO: Used lq/sq (defmethod enemy-common-post ((this rat)) + "Common implementation of post. Runs ja-post." (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-2) 3)) ) ) (when (-> this return-to-nav-mesh?) (format *stdebug* "~s ~d off nav-mesh~%" (-> this name) (-> this pid)) - (when (enemy-method-109 this) + (when (out-of-bounds? this) (set! (-> this return-to-nav-mesh?) #f) (go-die this) ) @@ -1807,7 +1821,8 @@ ;; definition for method 50 of type rat ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this rat) (arg0 int)) +(defmethod update-collision-action ((this rat) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -1832,13 +1847,15 @@ ;; definition for method 20 of type rat ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this rat)) +(defmethod get-search-info-flag ((this rat)) + "Get search-info-flag for this process." (the-as search-info-flag 8) ) ;; definition for method 82 of type rat ;; INFO: Used lq/sq (defmethod event-handler ((this rat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-5 object)) (case arg2 (('hit 'hit-knocked 'hit-flinch) @@ -1851,7 +1868,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1891,6 +1908,7 @@ ;; definition for method 121 of type rat ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this rat)) + "Typical place for shared init code. Runs from entity or process style init." (with-pp (rlet ((vf0 :class vf)) (init-vf0-vector) @@ -1899,7 +1917,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-rat" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *rat-nav-enemy-info*) + (setup-enemy! this *rat-nav-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -2050,7 +2068,7 @@ (let ((s5-2 (-> self entity)) (gp-2 (new 'stack-no-clear 'enemy-init-by-other-params)) ) - (set! (-> gp-2 trans quad) (-> s5-2 extra trans quad)) + (vector-copy! (-> gp-2 trans) (-> s5-2 extra trans)) (quaternion-copy! (-> gp-2 quat) (-> s5-2 quat)) (set! (-> gp-2 entity) s5-2) (set! (-> gp-2 directed?) #f) @@ -2094,6 +2112,7 @@ ;; definition for method 11 of type rat-spawner ;; INFO: Used lq/sq (defmethod init-from-entity! ((this rat-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this wheel-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (set! (-> this rats-spawned) (the-as uint 0)) diff --git a/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc b/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc index a50bfe56d2b..643be26644a 100644 --- a/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/egg-spider_REF.gc @@ -655,34 +655,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 275251.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 67.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -735,6 +735,7 @@ ;; ERROR: Stack slot load at 16 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 (defmethod event-handler ((this egg-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (sv-16 float) (sv-32 float)) (case arg2 (('attack) @@ -776,9 +777,10 @@ ;; definition for method 20 of type egg-spider ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this egg-spider)) +(defmethod get-search-info-flag ((this egg-spider)) + "Get search-info-flag for this process." (the-as search-info-flag (if (or *egg-spider-always-trackable?* (-> this trackable?)) - (the-as int ((method-of-type nav-enemy process-mask->search-info-flag) this)) + (the-as int ((method-of-type nav-enemy get-search-info-flag) this)) 0 ) ) @@ -793,7 +795,7 @@ (a3-0 (-> arg0 state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (vector-copy! a2-0 (-> a3-0 heading)) (t9-0 this v1-1 a2-0) ) 0 @@ -830,7 +832,7 @@ (cond ((logtest? (enemy-flag ef39) (-> this enemy-flags)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) - (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (vector-copy! (-> this root gspot-pos) (-> this root trans)) ) (else (normalize-heading! this (-> this nav)) @@ -911,11 +913,11 @@ ) (cond ((< f30-0 (-> this enemy-info notice-nav-radius)) - (set! (-> this target-pos quad) (-> s5-2 quad)) + (vector-copy! (-> this target-pos) s5-2) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s4-2 quad)) + (vector-copy! s3-1 s4-2) (let ((s5-3 (new 'stack-no-clear 'vector))) - (set! (-> s5-3 quad) (-> this root transv quad)) + (vector-copy! s5-3 (-> this root transv)) (vector-normalize! s5-3 f30-0) (if (>= (vector-dot s3-1 s5-3) 0.98) (go (method-of-object this attack)) @@ -945,7 +947,7 @@ ) (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-1 s5-2 s3-2) - (set! (-> this target-pos quad) (-> s2-1 quad)) + (vector-copy! (-> this target-pos) s2-1) ) ) ) @@ -1002,6 +1004,7 @@ ;; definition for method 59 of type egg-spider ;; WARN: Return type mismatch object vs none. (defmethod enemy-common-post ((this egg-spider)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -1019,7 +1022,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-2 quad)) + (vector-copy! (-> v1-1 target-pos) a0-2) ) 0 (none) @@ -1066,7 +1069,7 @@ ) (logclear! (-> gp-1 flags) (nav-state-flag directional-mode)) (logior! (-> gp-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> gp-1 target-pos quad) (-> v1-10 quad)) + (vector-copy! (-> gp-1 target-pos) v1-10) ) 0 ) @@ -1096,7 +1099,7 @@ (ja :num! (seek!)) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-travel-post ) @@ -1107,7 +1110,7 @@ :enter (behavior () (set-time! (-> self state-time)) (nav-enemy-method-182 self) - (set! (-> self init-pos quad) (-> self root trans quad)) + (vector-copy! (-> self init-pos) (-> self root trans)) (set! (-> self jump-pos) 0.0) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (collide-spec)) @@ -1175,7 +1178,7 @@ (set! (-> self attack-id) a0-2) ) (sound-play "spider-land-veh") - (set! (-> self init-pos quad) (-> self root trans quad)) + (vector-copy! (-> self init-pos) (-> self root trans)) ) :exit (behavior () (let ((a0-1 (handle->process (-> self wvehicle)))) @@ -1241,7 +1244,7 @@ (.svf (&-> a1-7 quad) vf6) ) (vector-normalize! (-> self vec-up) 1.0) - (set! (-> self root trans quad) (-> s1-0 quad)) + (vector-copy! (-> self root trans) s1-0) (quaternion-from-two-vectors! s3-0 (-> self vec-up) s2-0) (quaternion*! (-> self root quat) (the-as quaternion s4-0) s3-0) (send-event @@ -1353,7 +1356,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -1371,11 +1374,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 638 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 638)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 638)) ) ) @@ -1424,11 +1427,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 639 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 639)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 639)) ) ) @@ -1479,6 +1482,7 @@ ;; definition for method 11 of type egg-spider ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this egg-spider) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1490,9 +1494,9 @@ ;; definition for method 119 of type egg-spider ;; WARN: Return type mismatch int vs object. -(defmethod init-enemy-defaults! ((this egg-spider) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this egg-spider) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1522,6 +1526,7 @@ ;; definition for method 120 of type egg-spider ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this egg-spider)) + "Typical place to construct collision shapes" (let ((f30-0 (* 3276.8 (-> this size))) (s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))) ) @@ -1564,12 +1569,13 @@ ;; definition for method 121 of type egg-spider ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this egg-spider)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-egg-spider" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *egg-spider-nav-enemy-info*) + (setup-enemy! this *egg-spider-nav-enemy-info*) (set! (-> this move-angle) 10922.667) (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) #t @@ -1694,10 +1700,10 @@ ;; WARN: Return type mismatch int vs none. (defmethod spider-manager-method-24 ((this spider-manager) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> s5-0 vec0 quad) (-> arg0 quad)) - (set! (-> s5-0 cquery start-pos quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec0) arg0) + (vector-copy! (-> s5-0 cquery start-pos) (-> s5-0 vec0)) (set-vector! (-> s5-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) - (when (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (when (= (level-status? *level* 'desert #f) 'active) (set-vector! (-> s5-0 cquery move-dist) 0.0 -409600.0 0.0 1.0) (+! (-> s5-0 cquery start-pos y) 204800.0) ) @@ -1714,8 +1720,8 @@ (let ((f0-11 (fill-and-probe-using-line-sphere *collide-cache* (-> s5-0 cquery)))) (when (>= f0-11 0.0) (vector+float*! (-> s5-0 vec0) (-> s5-0 cquery start-pos) (-> s5-0 cquery move-dist) f0-11) - (set! (-> s5-0 vec1 quad) (-> s5-0 cquery best-other-tri normal quad)) - (set! (-> arg0 quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 cquery best-other-tri normal)) + (vector-copy! arg0 (-> s5-0 vec0)) ) ) ) @@ -1732,12 +1738,12 @@ (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (let ((a1-2 (new 'stack-no-clear 'nav-poly))) (set! (-> a1-2 vertex1 x) 122880.0) (set! (-> a1-2 data 20) (the-as uint 2)) (vector-! (the-as vector (-> a1-2 vertex)) s3-0 (the-as vector (-> s4-0 bounds))) - (set! (-> s3-0 quad) (-> a1-2 vertex 0 quad)) + (vector-copy! s3-0 (-> a1-2 vertex 0)) (let ((a1-3 (nav-mesh-method-45 s4-0 a1-2))) (when a1-3 (let ((s2-1 (new 'stack-no-clear 'vector))) @@ -1810,7 +1816,7 @@ (check-can-rid self) (when (< (-> self next-spot-time) (current-time)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (camera-pos) quad)) + (vector-copy! s5-0 (camera-pos)) (let ((f28-0 (camera-angle)) (s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) @@ -1833,7 +1839,7 @@ ) ) (when (spider-manager-method-25 self (the-as sphere gp-0)) - (set! (-> self spawn-pos quad) (-> gp-0 quad)) + (vector-copy! (-> self spawn-pos) gp-0) (set! (-> self next-spot-time) (+ (current-time) (rand-vu-int-range (-> self min-spot-delay) (-> self max-spot-delay))) ) @@ -1859,7 +1865,7 @@ (set! (-> gp-3 r) 4096.0) (when (and (sphere-in-view-frustum? gp-3) (spider-manager-method-25 self gp-3)) (let ((s5-1 (new 'stack-no-clear 'enemy-init-by-other-params))) - (set! (-> s5-1 trans quad) (-> gp-3 quad)) + (vector-copy! (-> s5-1 trans) gp-3) (quaternion-copy! (-> s5-1 quat) *unity-quaternion*) (set! (-> s5-1 entity) (-> self actor-group 0 data 0 actor)) (set! (-> s5-1 directed?) #f) @@ -1922,11 +1928,12 @@ ;; definition for method 11 of type spider-manager ;; INFO: Used lq/sq (defmethod init-from-entity! ((this spider-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag) (sv-32 res-tag)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'trsqv))) (set! (-> this root) s4-0) - (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> s4-0 trans) (-> arg0 extra trans)) (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) (vector-identity! (-> s4-0 scale)) ) diff --git a/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc b/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc index 93314b1d800..cfdb761723b 100644 --- a/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc @@ -624,34 +624,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) :bg-collide-with (collide-spec backgnd) @@ -1043,6 +1043,7 @@ ;; definition for method 120 of type mh-bat ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this mh-bat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1239,7 +1240,7 @@ :enter (behavior () (call-parent-state-handler enter) (set-time! (-> self state-time)) - (set! (-> self start-pos quad) (-> self root trans quad)) + (vector-copy! (-> self start-pos) (-> self root trans)) (set-vector! (-> self root transv) 0.0 -81920.0 0.0 0.0) (set! (-> self orbit-angle) (vector-vector-angle-safe @@ -1288,7 +1289,7 @@ :event enemy-event-handler :enter (behavior () (set-time! (-> self state-time)) - (set! (-> self event-param-point quad) (-> self start-pos quad)) + (vector-copy! (-> self event-param-point) (-> self start-pos)) (vector-reset! (-> self target-velocity)) ) :code (behavior () @@ -1329,10 +1330,10 @@ ((>= 1 (the-as int gp-0)) (go-virtual retreat) ) - ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + ((and (= gp-0 (enemy-aware hostile)) (get-focus! self)) (go-hostile self) ) - ((= gp-0 (enemy-aware ea4)) + ((= gp-0 (enemy-aware flee)) (go-flee self) ) ) @@ -1512,7 +1513,7 @@ (logior! (-> gp-0 options) (projectile-options po14)) (set! (-> gp-0 vehicle-impulse-factor) 1.5) (logior! (-> gp-0 options) (projectile-options po16)) - (set! (-> gp-0 pos quad) (-> a2-2 quad)) + (vector-copy! (-> gp-0 pos) a2-2) (vector-normalize-copy! (-> gp-0 vel) (vector-! (new 'stack-no-clear 'vector) v1-23 a2-2) 532480.0) ) (spawn-projectile metalhead-shot gp-0 self *default-dead-pool*) @@ -1570,7 +1571,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1690,7 +1691,7 @@ (s5-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 81920.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) s5-0 f30-0) (let ((v1-17 s4-0)) (set! (-> v1-17 radius) 3276.8) @@ -1747,13 +1748,15 @@ ) ;; definition for method 89 of type mh-bat -(defmethod within-gspot-range? ((this mh-bat)) +(defmethod invalid-height? ((this mh-bat)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) ;; definition for method 50 of type mh-bat ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this mh-bat) (arg0 int)) +(defmethod update-collision-action ((this mh-bat) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((or (zero? v1-0) (= v1-0 2)) @@ -1778,6 +1781,7 @@ ;; definition for method 126 of type mh-bat ;; WARN: Return type mismatch ragdoll-flag vs vector. (defmethod ragdoll-spawn! ((this mh-bat) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." (let ((t9-0 (method-of-type enemy ragdoll-spawn!))) (t9-0 this arg0 arg1) ) @@ -1799,6 +1803,7 @@ ;; definition for method 59 of type mh-bat ;; INFO: Used lq/sq (defmethod enemy-common-post ((this mh-bat)) + "Common implementation of post. Runs ja-post." (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) (set-time! (-> this last-off-screen-time)) ) @@ -1806,8 +1811,8 @@ (when (< 1 (the-as int (-> this focus aware))) (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) (when s5-0 - (set! (-> this focus-pos quad) (-> (get-trans s5-0 0) quad)) - (set! (-> this focus-bullseye-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans s5-0 0)) + (vector-copy! (-> this focus-bullseye-pos) (get-trans s5-0 3)) (vector-! (-> this focus-xz-dir) (-> this focus-pos) (-> this root trans)) (set! (-> this focus-xz-dir y) 0.0) (vector-xz-normalize! (-> this focus-xz-dir) 1.0) @@ -1821,6 +1826,7 @@ ;; definition for method 82 of type mh-bat (defmethod event-handler ((this mh-bat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1832,7 +1838,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1863,18 +1869,20 @@ ;; definition for method 67 of type mh-bat (defmethod coin-flip? ((this mh-bat)) + "Return #t half the time, #f the other." #f ) ;; definition for method 121 of type mh-bat ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this mh-bat)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-bat" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *mh-bat-enemy-info*) + (setup-enemy! this *mh-bat-enemy-info*) (set-scale! this 1.0) (set! (-> this root pause-adjust-distance) 368640.0) (let ((v1-9 (-> this neck))) diff --git a/test/decompiler/reference/jak3/levels/nest/mh-centipede-part_REF.gc b/test/decompiler/reference/jak3/levels/nest/mh-centipede-part_REF.gc index d558711dac3..387626d96ad 100644 --- a/test/decompiler/reference/jak3/levels/nest/mh-centipede-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/mh-centipede-part_REF.gc @@ -1101,11 +1101,11 @@ (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) (cond ((logtest? (-> *part-group-id-table* 648 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 648)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 648)) ) ) @@ -1623,7 +1623,3 @@ (:flags (sp-cpuinfo-flag-3)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc b/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc index 78e2e1110b2..393b586347f 100644 --- a/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc @@ -691,7 +691,7 @@ (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set-vector! (-> gp-0 move-dist) 0.0 -204800.0 0.0 1.0) - (set! (-> gp-0 start-pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 start-pos) (-> self root trans)) (+! (-> gp-0 start-pos y) 102400.0) (let ((v1-17 gp-0)) (set! (-> v1-17 radius) 409.6) @@ -730,7 +730,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-1 pos quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 pos) (-> self root trans)) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags taf3 taf5)) (set! (-> gp-1 map-icon) (the-as uint 12)) @@ -816,6 +816,7 @@ ;; definition for method 11 of type rod-spawner (defmethod init-from-entity! ((this rod-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -998,7 +999,7 @@ ) 0 (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 8192.0) (set! (-> gp-1 scale) 1.0) @@ -1082,7 +1083,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init! ((this mh-centipede-crater-pt-array) (arg0 vector) (arg1 float)) - (set! (-> this origin quad) (-> arg0 quad)) + (vector-copy! (-> this origin) arg0) (set! (-> this radius) arg1) (set! (-> this current-point) 0) 0 @@ -1159,7 +1160,7 @@ ) (vector-cross! s3-1 (-> s5-0 normal) (vector-get-unique! (new 'stack-no-clear 'vector) (-> s5-0 normal))) (vector-normalize! s3-1 10240.0) - (set! (-> s4-1 0 quad) (-> s3-1 quad)) + (vector-copy! (-> s4-1 0) s3-1) (vector-cross! (-> s4-1 1) s3-1 (-> s5-0 normal)) (vector-negate! (-> s4-1 2) s3-1) (vector-cross! (-> s4-1 3) (-> s5-0 normal) s3-1) @@ -1194,7 +1195,7 @@ (fill-using-bounding-box *collide-cache* s3-2) ) (dotimes (s3-3 4) - (set! (-> gp-0 start-pos quad) (-> s4-1 s3-3 quad)) + (vector-copy! (-> gp-0 start-pos) (-> s4-1 s3-3)) (when (< (probe-using-line-sphere *collide-cache* gp-0) 0.0) (set! (-> s5-0 found?) #f) (return 0) @@ -1227,7 +1228,7 @@ ) (let ((s1-0 (-> this points (-> this current-point)))) (when (-> s1-0 found?) - (set! (-> s3-0 uvec quad) (-> s1-0 normal quad)) + (vector-copy! (-> s3-0 uvec) (-> s1-0 normal)) (vector-cross! (-> s3-0 rvec) (-> s3-0 uvec) @@ -1478,7 +1479,8 @@ ;; definition for method 20 of type mh-centipede ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this mh-centipede)) +(defmethod get-search-info-flag ((this mh-centipede)) + "Get search-info-flag for this process." (the-as search-info-flag 120) ) @@ -1491,7 +1493,7 @@ (let ((gp-0 (new 'static 'vector))) (cond ((logtest? (-> this flags) (mh-centipede-flag mc5)) - (set! (-> gp-0 quad) (-> this landing-position quad)) + (vector-copy! gp-0 (-> this landing-position)) (+! (-> gp-0 y) 8192.0) ) (else @@ -1514,8 +1516,8 @@ (set! (-> this effect-sphere) (nest-hunt-find-sphere (-> this root trans))) (when (!= (-> this prev-time) (current-time)) (set-time! (-> this prev-time)) - (set! (-> this prev-target-position quad) (-> this current-target-position quad)) - (set! (-> this current-target-position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this prev-target-position) (-> this current-target-position)) + (vector-copy! (-> this current-target-position) (target-pos 0)) ) (nest-hunt-play-speech 1 (-> this effect-sphere)) 0 @@ -1535,7 +1537,7 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (+! (-> s5-0 start-pos y) 20480.0) (let ((v1-3 s5-0)) (set! (-> v1-3 radius) 409.6) @@ -1597,13 +1599,13 @@ (set! (-> this current-anim) (-> this breach-anims (rand-vu-int-count (-> this breach-anims length)))) ) (set! (-> this pre-breach-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) - (set! (-> s4-0 rvec quad) (-> (camera-matrix) fvec quad)) + (vector-copy! (-> s4-0 rvec) (-> (camera-matrix) fvec)) (set! (-> s4-0 rvec y) 0.0) (vector-normalize! (-> s4-0 rvec) 1.0) - (set! (-> s4-0 uvec quad) (-> (camera-matrix) rvec quad)) + (vector-copy! (-> s4-0 uvec) (-> (camera-matrix) rvec)) (set! (-> s4-0 uvec y) 0.0) (vector-normalize! (-> s4-0 uvec) 1.0) - (set! (-> s4-0 fvec quad) (-> s4-0 rvec quad)) + (vector-copy! (-> s4-0 fvec) (-> s4-0 rvec)) (vector-normalize! (-> s4-0 fvec) 327680.0) (vector+! (-> s4-0 fvec) (-> s4-0 fvec) (target-pos 0)) (let ((s3-3 (closest-point-on-mesh (-> this nav) (-> this landing-position) (-> s4-0 fvec) (the-as nav-poly #f))) @@ -1683,7 +1685,7 @@ (when (probe-ground this (-> this launch-position)) (when arg0 (logior! (-> this flags) (mh-centipede-flag mc8)) - (set! (-> this landing-position quad) (-> this launch-position quad)) + (vector-copy! (-> this landing-position) (-> this launch-position)) ) (return #t) ) @@ -1707,10 +1709,10 @@ (let ((s5-0 (new 'stack-no-clear 'matrix))) (set! (-> this current-anim) (-> this breach-anims (rand-vu-int-count (-> this breach-anims length)))) (set! (-> this pre-breach-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) - (set! (-> s5-0 rvec quad) (-> (camera-matrix) fvec quad)) + (vector-copy! (-> s5-0 rvec) (-> (camera-matrix) fvec)) (set! (-> s5-0 rvec y) 0.0) (vector-normalize! (-> s5-0 rvec) 1.0) - (set! (-> s5-0 uvec quad) (-> (camera-matrix) rvec quad)) + (vector-copy! (-> s5-0 uvec) (-> (camera-matrix) rvec)) (set! (-> s5-0 uvec y) 0.0) (vector-normalize! (-> s5-0 uvec) 1.0) (let* ((s4-2 (-> s5-0 fvec)) @@ -1834,23 +1836,12 @@ (let ((s4-0 (get-field-spec-by-id (-> *part-id-table* 2512) (sp-field-id spt-omega))) (s5-0 (new 'stack-no-clear 'matrix)) ) - (let* ((v1-2 s5-0) - (a3-0 (-> this node-list data arg0 bone transform)) - (a0-5 (-> a3-0 rvec quad)) - (a1-3 (-> a3-0 uvec quad)) - (a2-0 (-> a3-0 fvec quad)) - (a3-1 (-> a3-0 trans quad)) - ) - (set! (-> v1-2 rvec quad) a0-5) - (set! (-> v1-2 uvec quad) a1-3) - (set! (-> v1-2 fvec quad) a2-0) - (set! (-> v1-2 trans quad) a3-1) - ) + (matrix-copy! s5-0 (-> this node-list data arg0 bone transform)) (vector<-cspace! (-> s5-0 trans) (-> this node-list data arg0)) (cond (s4-0 (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> s5-0 trans quad)) + (vector-copy! (-> s3-1 start-pos) (-> s5-0 trans)) (vector-float*! (-> s3-1 move-dist) (-> this root dynam gravity-normal) -163840.0) (let ((v1-8 s3-1)) (set! (-> v1-8 radius) 1228.8) @@ -1907,10 +1898,10 @@ (s1-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> this root quat))) (s4-3 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-3 quad) (-> this root trans quad)) + (vector-copy! s4-3 (-> this root trans)) (let ((s3-2 (new 'stack-no-clear 'vector))) - (set! (-> s3-2 quad) (-> this root scale quad)) - (set! (-> this root trans quad) (-> s5-0 trans quad)) + (vector-copy! s3-2 (-> this root scale)) + (vector-copy! (-> this root trans) (-> s5-0 trans)) (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) (let ((s5-1 (get-process *default-dead-pool* joint-exploder #x4000 0))) (when s5-1 @@ -1931,8 +1922,8 @@ ) ) (quaternion-copy! (-> this root quat) s1-0) - (set! (-> this root trans quad) (-> s4-3 quad)) - (set! (-> this root scale quad) (-> s3-2 quad)) + (vector-copy! (-> this root trans) s4-3) + (vector-copy! (-> this root scale) s3-2) ) ) ) @@ -2094,7 +2085,7 @@ (s4-0 (new 'stack-no-clear 'vector)) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s2-0 (target-pos 0)) (vector<-cspace! s3-0 (-> this node-list data 77)) (let ((s1-0 sound-play-by-name) (sname (static-sound-name "cent-fire-spit")) @@ -2136,8 +2127,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> s3-0 quad)) - (set! (-> gp-0 vel quad) (-> s4-0 quad)) + (vector-copy! (-> gp-0 pos) s3-0) + (vector-copy! (-> gp-0 vel) s4-0) ) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) @@ -2353,7 +2344,7 @@ :enter (behavior () (nest-hunt-play-speech 0 (-> self effect-sphere)) (set-time! (-> self state-time)) - (set! (-> self root trans quad) (-> self launch-position quad)) + (vector-copy! (-> self root trans) (-> self launch-position)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self landing-position) (-> self launch-position)))) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -2630,7 +2621,7 @@ :enter (behavior () (nest-hunt-play-speech 0 (-> self effect-sphere)) (set-time! (-> self state-time)) - (set! (-> self root trans quad) (-> self launch-position quad)) + (vector-copy! (-> self root trans) (-> self launch-position)) (let* ((gp-0 lerp-scale) (s5-0 1638.4) (s4-0 0.0) @@ -3034,7 +3025,7 @@ (when (not (logtest? (-> self flags) (mh-centipede-flag mc7))) (when (mh-centipede-method-38 self #f) (ja :group! mh-centipede-shoot-ja :num! min) - (set! (-> self root trans quad) (-> self launch-position quad)) + (vector-copy! (-> self root trans) (-> self launch-position)) (logior! (-> self flags) (mh-centipede-flag mc7)) ) ) @@ -3104,6 +3095,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs object. (defmethod init-from-entity! ((this mh-centipede) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -3215,7 +3207,7 @@ (let ((s4-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) (when s4-2 (change-to s4-2 this) - (set! (-> this root trans quad) (-> s4-2 bounds quad)) + (vector-copy! (-> this root trans) (-> s4-2 bounds)) (if (nonzero? (-> this nav)) (closest-point-on-mesh (-> this nav) (-> this root trans) (-> this root trans) (the-as nav-poly #f)) ) @@ -3291,8 +3283,8 @@ (set! (-> this minimap) #f) (set! (-> this mm-handle) (the-as handle #f)) (set-time! (-> this prev-time)) - (set! (-> this prev-target-position quad) (-> (target-pos 0) quad)) - (set! (-> this current-target-position quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this prev-target-position) (target-pos 0)) + (vector-copy! (-> this current-target-position) (target-pos 0)) (set! (-> this effect-sphere) #f) (go (method-of-object this hidden)) 0 @@ -3483,7 +3475,7 @@ (defmethod taskman-event-handler ((this task-manager-mh-centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('centipede-died) - (set! (-> this last-centipede-position quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> this last-centipede-position) (the-as vector (-> arg3 param 0))) (let ((gp-0 (the-as object (-> this last-target-position)))) (set! (-> (the-as vector gp-0) quad) (-> (target-pos 0) quad)) gp-0 diff --git a/test/decompiler/reference/jak3/levels/nest/nst-obs_REF.gc b/test/decompiler/reference/jak3/levels/nest/nst-obs_REF.gc index aa2e360c9e9..4c1468ee614 100644 --- a/test/decompiler/reference/jak3/levels/nest/nst-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/nst-obs_REF.gc @@ -154,15 +154,15 @@ (set! *nst-metalhead-eggs-last-sound-time* (current-time)) ) (let ((v1-18 (new 'stack-no-clear 'vector))) - (set! (-> v1-18 quad) (-> self root trans quad)) + (vector-copy! v1-18 (-> self root trans)) (+! (-> v1-18 y) 8192.0) (cond ((logtest? (-> *part-group-id-table* 611 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-18 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-18) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 611)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-18 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-18) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 611)) ) ) @@ -194,13 +194,15 @@ ;; definition for method 20 of type nst-metalhead-eggs ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this nst-metalhead-eggs)) +(defmethod get-search-info-flag ((this nst-metalhead-eggs)) + "Get search-info-flag for this process." (the-as search-info-flag 24) ) ;; definition for method 11 of type nst-metalhead-eggs ;; INFO: Used lq/sq (defmethod init-from-entity! ((this nst-metalhead-eggs) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -483,6 +485,7 @@ ;; definition for method 11 of type nst-bridge-base ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this nst-bridge-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -594,7 +597,7 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 622 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -603,7 +606,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -638,6 +641,7 @@ ;; definition for method 11 of type nst-falling-stone-bridge-goo (defmethod init-from-entity! ((this nst-falling-stone-bridge-goo) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -775,7 +779,7 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 4 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 4 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -784,7 +788,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 4 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 4 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -795,7 +799,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 5 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -804,7 +808,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 5 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -815,7 +819,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 6 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 6 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -824,7 +828,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 6 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 6 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -835,7 +839,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 7 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 7 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -844,7 +848,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 7 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 7 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -876,9 +880,10 @@ (when (not (logtest? gp-8 1)) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) - (-> self node-list data (-> *nst-falling-stone-bridge-part-nodes* (logand gp-8 3)) bone transform trans quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (-> self node-list data (-> *nst-falling-stone-bridge-part-nodes* (logand gp-8 3)) bone transform trans) + ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -887,9 +892,10 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) - (-> self node-list data (-> *nst-falling-stone-bridge-part-nodes* (logand gp-8 3)) bone transform trans quad) - ) + (vector-copy! + (-> *launch-matrix* trans) + (-> self node-list data (-> *nst-falling-stone-bridge-part-nodes* (logand gp-8 3)) bone transform trans) + ) (part-tracker-spawn part-tracker :to *entity-pool* @@ -940,7 +946,7 @@ (when (= (the int f30-0) (+ gp-0 -10)) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 4 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 4 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -949,7 +955,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 4 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 4 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -960,7 +966,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 5 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -969,7 +975,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 5 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 5 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -980,7 +986,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 7 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 7 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -989,7 +995,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 7 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 7 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1000,7 +1006,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 8 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 8 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -1009,7 +1015,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 8 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 8 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1020,7 +1026,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 9 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 9 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -1029,7 +1035,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 9 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 9 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1040,7 +1046,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 619 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 10 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 10 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -1049,7 +1055,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 10 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 10 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1062,7 +1068,7 @@ (when (= (the int f30-0) (+ gp-0 -3)) (cond ((logtest? (-> *part-group-id-table* 621 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 12 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 12 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -1071,7 +1077,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 12 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 12 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -1159,6 +1165,7 @@ ;; definition for method 11 of type nst-falling-stone-bridge ;; INFO: Used lq/sq (defmethod init-from-entity! ((this nst-falling-stone-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 512) (let ((t9-1 (method-of-type nst-bridge-base init-from-entity!))) @@ -1534,6 +1541,7 @@ ;; definition for method 11 of type nst-collapsing-stone-bridge (defmethod init-from-entity! ((this nst-collapsing-stone-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (let ((t9-1 (method-of-type nst-bridge-base init-from-entity!))) (t9-1 this arg0) @@ -1588,11 +1596,11 @@ (defmethod projectile-method-26 ((this cocoon-grenade-shot)) (cond ((logtest? (-> *part-group-id-table* 105 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 105)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 105)) ) ) @@ -1753,34 +1761,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -1851,7 +1859,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -2058,11 +2066,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 617 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self incoming attack-position quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self incoming attack-position)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 617)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self incoming attack-position quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self incoming attack-position)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 617)) ) ) @@ -2107,7 +2115,7 @@ (kill-particles (-> self charge-up-part)) (cond ((logtest? (-> *part-group-id-table* 616 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 12 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 12 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -2116,7 +2124,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 12 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 12 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* @@ -2171,6 +2179,7 @@ ;; definition for method 82 of type nst-cocoon-a (defmethod event-handler ((this nst-cocoon-a) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (if (not (and (= arg2 'attack) (type? arg0 cocoon-grenade-shot))) ((method-of-type nav-enemy event-handler) (the-as nav-enemy this) arg0 arg1 arg2 arg3) ) @@ -2178,6 +2187,7 @@ ;; definition for method 59 of type nst-cocoon-a (defmethod enemy-common-post ((this nst-cocoon-a)) + "Common implementation of post. Runs ja-post." (let ((f0-1 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) (set-vector! (-> this draw color-mult) 1.0 f0-1 f0-1 1.0) ) @@ -2225,7 +2235,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) 0.0 - (set! (-> s5-0 quad) (-> this node-list data 5 bone transform fvec quad)) + (vector-copy! s5-0 (-> this node-list data 5 bone transform fvec)) (set! (-> s3-0 initial-tilt) (asin (-> s5-0 y))) (set! (-> s3-0 gravity) 102400.0) (let ((f30-0 4095996000.0) @@ -2275,7 +2285,7 @@ (set! (-> s2-0 charge) 1.0) (set! (-> s2-0 options) (projectile-options)) (logclear! (-> s2-0 options) (projectile-options po14 po15 po16)) - (set! (-> s2-0 pos quad) (-> this node-list data s1-0 bone transform trans quad)) + (vector-copy! (-> s2-0 pos) (-> this node-list data s1-0 bone transform trans)) (set! (-> s2-0 notify-handle) (the-as handle #f)) (set! (-> s2-0 owner-handle) (process->handle this)) (set! (-> s2-0 target-handle) (the-as handle #f)) @@ -2294,7 +2304,7 @@ (logior! (-> s2-0 options) (projectile-options po15)) (set! (-> s2-0 vehicle-impulse-factor) 1.5) (logior! (-> s2-0 options) (projectile-options po16)) - (set! (-> s5-0 quad) (-> this node-list data s1-0 bone transform fvec quad)) + (vector-copy! s5-0 (-> this node-list data s1-0 bone transform fvec)) (vector-normalize-copy! (-> s2-0 vel) s5-0 (-> s3-0 initial-speed)) (spawn-projectile cocoon-grenade-shot s2-0 this *default-dead-pool*) ) @@ -2307,7 +2317,8 @@ ) ;; definition for method 107 of type nst-cocoon-a -(defmethod is-pfoc-in-mesh? ((this nst-cocoon-a) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this nst-cocoon-a) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (cond ((= (-> this activate-distance) 0.0) (return #t) @@ -2323,6 +2334,7 @@ ;; definition for method 67 of type nst-cocoon-a (defmethod coin-flip? ((this nst-cocoon-a)) + "Return #t half the time, #f the other." #f ) @@ -2339,6 +2351,7 @@ ;; definition for method 120 of type nst-cocoon-a ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this nst-cocoon-a)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2398,13 +2411,14 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch connection-minimap vs none. (defmethod init-enemy! ((this nst-cocoon-a)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-nst-cocoon-a" (the-as (pointer level) #f))) (the-as pair 0) ) (set! (-> this enemy-info) *nst-cocoon-a-enemy-info*) - (init-enemy-defaults! this (-> this enemy-info)) + (setup-enemy! this (-> this enemy-info)) (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) ) @@ -2435,13 +2449,15 @@ ;; definition for method 11 of type nst-cocoon-a (defmethod init-from-entity! ((this nst-cocoon-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) ((method-of-type enemy init-from-entity!) this arg0) ) ;; definition for method 122 of type nst-cocoon-a -(defmethod go-idle2 ((this nst-cocoon-a)) +(defmethod go-fallback-init ((this nst-cocoon-a)) + "If there's no specific settings for initial state, go to this state after spawning." (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (task-node-closed? (game-task-node nest-eggs-resolution)) ) @@ -2580,6 +2596,7 @@ ;; definition for method 11 of type nst-cocoon-b (defmethod init-from-entity! ((this nst-cocoon-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2741,9 +2758,10 @@ ;; definition for method 11 of type nst-light-barrier ;; INFO: Used lq/sq (defmethod init-from-entity! ((this nst-light-barrier) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'trsqv))) (set! (-> this root) (the-as collide-shape s4-0)) - (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> s4-0 trans) (-> arg0 extra trans)) (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) (vector-identity! (-> s4-0 scale)) ) diff --git a/test/decompiler/reference/jak3/levels/nest/nst-part_REF.gc b/test/decompiler/reference/jak3/levels/nest/nst-part_REF.gc index 42395960f03..7c91f364baa 100644 --- a/test/decompiler/reference/jak3/levels/nest/nst-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/nest/nst-part_REF.gc @@ -703,7 +703,7 @@ (set! (-> a0-2 action-mask) (collide-action solid)) ) (+! (-> v1-0 y) -163840.0) - (set! (-> s5-0 start-pos quad) (-> v1-0 quad)) + (vector-copy! (-> s5-0 start-pos) v1-0) ) (vector-reset! (-> s5-0 move-dist)) (set! (-> s5-0 move-dist y) -163840.0) @@ -1304,7 +1304,7 @@ (v1-18 (-> (the-as part-tracker (-> a0-12 proc)) root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1407,7 +1407,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -1510,7 +1510,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1613,7 +1613,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1716,7 +1716,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -1819,7 +1819,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1922,7 +1922,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -2025,7 +2025,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -2128,7 +2128,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -2349,7 +2349,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -3009,7 +3009,3 @@ (defpart 2459 :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.48 -0.48)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc b/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc index f5fcbe3f7b3..ba1dd64bbcc 100644 --- a/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/precursor/precura-obs2_REF.gc @@ -270,7 +270,7 @@ ) (quaternion-copy! (-> self root quat) (the-as quaternion (&-> self stack 96))) (set-vector! (-> self root transv) 0.0 -4096.0 0.0 1.0) - (set! (-> self drop-point quad) (-> self origin quad)) + (vector-copy! (-> self drop-point) (-> self origin)) (go-virtual fall) ) ) @@ -299,8 +299,8 @@ (can-drop? self (the-as vector (-> block param 0))) ) (('drop) - (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) - (set! (-> self drop-point quad) (-> self root trans quad)) + (vector-copy! (-> self root transv) (the-as vector (-> block param 1))) + (vector-copy! (-> self drop-point) (-> self root trans)) (go-virtual fall) ) ) @@ -332,16 +332,16 @@ (if (handle->process (-> self carry other)) (drop! (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) (-> self carry)) ) - (set! (-> self root transv quad) (-> (the-as vector (-> block param 1)) quad)) - (set! (-> self drop-point quad) (-> self root trans quad)) + (vector-copy! (-> self root transv) (the-as vector (-> block param 1))) + (vector-copy! (-> self drop-point) (-> self root trans)) (go-virtual fall) ) (('move) (let ((s4-0 (-> self root)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> s4-0 trans quad)) - (set! (-> s4-0 transv quad) (-> (the-as vector (-> block param 0)) quad)) + (vector-copy! s5-0 (-> s4-0 trans)) + (vector-copy! (-> s4-0 transv) (the-as vector (-> block param 0))) (let ((s2-0 (-> self nav)) (s1-0 (-> s4-0 root-prim prim-core)) (s3-0 (new 'stack-no-clear 'vector)) @@ -500,11 +500,11 @@ (sound-play "block-break") (cond ((logtest? (-> *part-group-id-table* 195 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 195)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 195)) ) ) @@ -516,11 +516,11 @@ (sound-play "block-break") (cond ((logtest? (-> *part-group-id-table* 195 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 195)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 195)) ) ) @@ -590,7 +590,7 @@ (f0-6 (* f0-5 f0-5)) (f0-7 (- 1.0 f0-6)) ) - (set! (-> s3-0 quad) (-> arg0 surface-normal quad)) + (vector-copy! s3-0 (-> arg0 surface-normal)) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 f0-7) ) @@ -677,7 +677,8 @@ ;; definition for method 20 of type precur-bomb ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this precur-bomb)) +(defmethod get-search-info-flag ((this precur-bomb)) + "Get search-info-flag for this process." (the-as search-info-flag (logior 0 16)) ) @@ -736,10 +737,10 @@ (when (logtest? (-> s3-0 mask) (attack-mask intersection)) (let ((gp-1 (new 'stack-no-clear 'vector))) (vector-z-quaternion! gp-1 (target-rot)) - (set! (-> self drop-point quad) (-> self root trans quad)) + (vector-copy! (-> self drop-point) (-> self root trans)) (vector-normalize-copy! gp-1 gp-1 102400.0) (+! (-> gp-1 y) 102400.0) - (set! (-> self root transv quad) (-> gp-1 quad)) + (vector-copy! (-> self root transv) gp-1) ) (when (zero? (-> self bomb-timer)) (set! (-> self bomb-timer) (the-as uint (current-time))) @@ -772,10 +773,10 @@ (('fall) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-z-quaternion! gp-0 (target-rot)) - (set! (-> self drop-point quad) (-> self root trans quad)) + (vector-copy! (-> self drop-point) (-> self root trans)) (vector-normalize-copy! gp-0 gp-0 102400.0) (+! (-> gp-0 y) 102400.0) - (set! (-> self root transv quad) (-> gp-0 quad)) + (vector-copy! (-> self root transv) gp-0) ) (when (zero? (-> self bomb-timer)) (set! (-> self bomb-timer) (the-as uint (current-time))) @@ -958,7 +959,7 @@ (go-virtual idle) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root transv quad)) + (vector-copy! gp-1 (-> self root transv)) (let ((f0-9 32768.0)) (set! (-> gp-1 y) 0.0) (let* ((f0-11 (* (/ f0-9 (meters 5)) (vector-length gp-1))) @@ -991,7 +992,7 @@ :enter (behavior () (sound-play "prec-bomb-xplo") (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-1 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-1 spawn-quat)) (set! (-> gp-1 radius) 40960.0) (set! (-> gp-1 scale) 1.0) @@ -1068,14 +1069,14 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-precur-bomb" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (mem-copy! (the-as pointer (-> self origin)) (the-as pointer (-> self root trans)) 48) (set! (-> self collide-timer) (the-as uint 0)) (set! (-> self bomb-timer) (the-as uint 0)) (set! (-> self blink-timer) (the-as uint 0)) (set! (-> self blink-rate) 600.0) (set! (-> self blink) #t) - (set! (-> self default-emissive-color quad) (-> self draw color-emissive quad)) + (vector-copy! (-> self default-emissive-color) (-> self draw color-emissive)) (set! (-> self allow-drag?) #f) (set! (-> self reset-on-land?) #f) (let* ((v1-22 *game-info*) @@ -1086,7 +1087,7 @@ ) (set! (-> self hit-something?) #f) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (+! (-> gp-1 y) 12288.0) (let ((v1-28 (new 'process 'carry-info self 3 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0) 0.0))) (set! (-> v1-28 max-distance) 16384.0) @@ -1159,6 +1160,7 @@ ;; definition for method 11 of type precur-box (defmethod init-from-entity! ((this precur-box) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1282,7 +1284,7 @@ (defmethod spawn-bomb ((this precur-bomb-spawner)) (local-vars (v1-10 (pointer process))) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (format 0 "spawning bomb~%") (sound-play "prec-bomb-spawn") (format 0 "spawning bomb-post~%") @@ -1413,6 +1415,7 @@ ;; definition for method 11 of type precur-bomb-spawner (defmethod init-from-entity! ((this precur-bomb-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -1618,7 +1621,7 @@ (local-vars (sv-560 collide-query) (sv-564 float)) (set! sv-560 (new 'stack-no-clear 'collide-query)) (set! sv-564 83968.0) - (set! (-> sv-560 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-560 start-pos) arg0) (vector-normalize-copy! arg1 arg1 sv-564) (vector-normalize-copy! (-> sv-560 move-dist) arg1 sv-564) (let ((v1-5 sv-560)) @@ -1695,7 +1698,7 @@ (local-vars (sv-560 collide-query) (sv-564 float)) (set! sv-560 (new 'stack-no-clear 'collide-query)) (set! sv-564 83968.0) - (set! (-> sv-560 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-560 start-pos) arg0) (vector-float*! (-> sv-560 move-dist) arg1 sv-564) (let ((v1-7 sv-560)) (set! (-> v1-7 radius) 40.96) @@ -1724,7 +1727,7 @@ ) (vector+float*! s3-0 arg0 arg1 sv-564) (matrix-f-compose s4-0 arg1) - (set! (-> s4-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 trans) s3-0) (if (logtest? (-> *part-group-id-table* 1326 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1736,7 +1739,7 @@ ) (vector+float*! s3-0 arg0 arg1 (- sv-564)) (matrix-f-compose s4-0 (vector-float*! (new 'stack-no-clear 'vector) arg1 -1.0)) - (set! (-> s4-0 trans quad) (-> s3-0 quad)) + (vector-copy! (-> s4-0 trans) s3-0) (if (logtest? (-> *part-group-id-table* 1326 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -1878,6 +1881,7 @@ ;; definition for method 11 of type precur-laser-beam (defmethod init-from-entity! ((this precur-laser-beam) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this on-duration) 60.0) @@ -2018,10 +2022,10 @@ (defmethod task-manager-method-26 ((this task-manager-precura)) (when *target* (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s4-0 (target-pos 0)) (let ((s3-0 (new 'stack-no-clear 'vector))) (when (and (>= (-> s4-0 z) (-> *pca-sph1* z)) (>= (-> *pca-sph2* z) (-> s4-0 z))) - (set! (-> s3-0 quad) (-> *pca-sph1* quad)) + (vector-copy! s3-0 *pca-sph1*) (set! (-> s4-0 z) 0.0) (set! (-> s3-0 z) 0.0) (when (< (vector-vector-distance s4-0 s3-0) (-> *pca-sph1* r)) @@ -2177,7 +2181,7 @@ (set! sv-656 (new 'stack-no-clear 'matrix)) (set! sv-672 (new 'stack-no-clear 'collide-query)) (set! sv-688 (the-as symbol #f)) - (set! (-> sv-672 start-pos quad) (-> arg4 quad)) + (vector-copy! (-> sv-672 start-pos) arg4) (set! sv-704 (-> sv-672 move-dist)) (set! (-> sv-704 x) (rand-vu-float-range 0.0 65536.0)) (set! (-> sv-704 y) (rand-vu-float-range 0.0 65536.0)) @@ -2201,7 +2205,7 @@ ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-672) 0.0) (set-time! (-> s5-0 last-valid-time)) - (set! (-> s5-0 end-pos quad) (-> sv-672 best-other-tri intersect quad)) + (vector-copy! (-> s5-0 end-pos) (-> sv-672 best-other-tri intersect)) (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-672 start-pos))) (set! sv-688 #t) (goto cfg-7) @@ -2235,7 +2239,7 @@ (a0-26 *sp-particle-system-2d*) (a2-5 *launch-matrix*) ) - (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (vector-copy! (-> a2-5 trans) (-> s5-0 end-pos)) (t9-12 a0-26 arg3 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) ) ) @@ -2320,7 +2324,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. (defmethod set-inner-jmod-scale ((this precur-spot-shadow-effect) (arg0 vector)) - (set! (-> this jmod-inner transform scale quad) (-> arg0 quad)) + (vector-copy! (-> this jmod-inner transform scale) arg0) (none) ) @@ -2328,7 +2332,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. (defmethod set-outer-jmod-scale ((this precur-spot-shadow-effect) (arg0 vector)) - (set! (-> this jmod-outer transform scale quad) (-> arg0 quad)) + (vector-copy! (-> this jmod-outer transform scale) arg0) (none) ) @@ -2336,9 +2340,9 @@ ;; INFO: Used lq/sq (defbehavior precur-spot-shadow-effect-init-by-other precur-spot-shadow-effect ((arg0 vector) (arg1 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (quaternion-copy! (-> self root quat) (the-as quaternion arg1)) - (set! (-> self pre-flicker-pos quad) (-> self root trans quad)) + (vector-copy! (-> self pre-flicker-pos) (-> self root trans)) (set! (-> self level) (-> *level* level-default)) (initialize-skeleton self @@ -2494,7 +2498,7 @@ (set! sv-576 (new 'stack-no-clear 'collide-query)) (set! sv-580 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (set! sv-584 (vector-vector-distance arg0 arg1)) - (set! (-> sv-576 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> sv-576 start-pos) arg0) (vector-normalize-copy! (-> sv-576 move-dist) sv-580 sv-584) (let ((v1-5 sv-576)) (set! (-> v1-5 radius) 40.96) @@ -2627,7 +2631,7 @@ (let ((a0-8 (the-as precur-spot-shadow-effect (-> this shock-shadow-handle process 0))) (a1-6 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-8 root trans quad) (-> s3-0 quad)) + (vector-copy! (-> a0-8 root trans) s3-0) (set-vector! a1-6 (* 0.0001319679 f0-1) 0.4 0.4 1.0) (set-outer-jmod-scale a0-8 a1-6) ) @@ -2649,7 +2653,7 @@ (+! (-> gp-0 span-pts-start data 0 y) 4096.0) ) (when arg1 - (set! (-> gp-0 span-pts-start data 1 quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 span-pts-start data 1) arg1) (+! (-> gp-0 span-pts-start data 1 y) 4096.0) ) (set! (-> gp-0 spans-internal data 1 num-inner-points) 0) @@ -2768,6 +2772,7 @@ ;; definition for method 11 of type precur-path (defmethod init-from-entity! ((this precur-path) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (when (res-lump-data arg0 'patha pointer) @@ -2843,6 +2848,7 @@ ;; definition for method 11 of type precur-door-b (defmethod init-from-entity! ((this precur-door-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) diff --git a/test/decompiler/reference/jak3/levels/precursor/precura-obs_REF.gc b/test/decompiler/reference/jak3/levels/precursor/precura-obs_REF.gc index 9a04e274319..7e9fe8c3878 100644 --- a/test/decompiler/reference/jak3/levels/precursor/precura-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/precursor/precura-obs_REF.gc @@ -163,6 +163,7 @@ ;; definition for method 11 of type precur-switch (defmethod init-from-entity! ((this precur-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -331,6 +332,7 @@ ;; definition for method 11 of type precur-jump-plate (defmethod init-from-entity! ((this precur-jump-plate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set-time! (-> this state-time)) (set-time! (-> this turn-start)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -520,7 +522,7 @@ ) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (vector-! gp-1 (target-pos 0) (-> self root trans)) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) @@ -706,11 +708,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -766,6 +768,7 @@ ;; definition for method 11 of type precur-generator-a (defmethod init-from-entity! ((this precur-generator-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) @@ -895,11 +898,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -943,6 +946,7 @@ ;; definition for method 11 of type precur-generator-b (defmethod init-from-entity! ((this precur-generator-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -1122,11 +1126,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1187,6 +1191,7 @@ ;; definition for method 11 of type precur-generator-c ;; INFO: Used lq/sq (defmethod init-from-entity! ((this precur-generator-c) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 512) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -1285,8 +1290,8 @@ (let ((v1-1 (the-as object (-> block param 0))) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> (the-as vector (-> block param 1)) quad)) - (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + (vector-copy! gp-0 (the-as vector (-> block param 1))) + (vector-copy! (-> self root trans) (the-as vector v1-1)) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 1.0) (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) @@ -1326,7 +1331,7 @@ (vector-rotate-around-y! (-> self offset-vec) (-> self offset-vec) (* (-> self ang-vel) (seconds-per-frame))) (vector+! (-> self root trans) (-> self init-pos) (-> self offset-vec)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self offset-vec quad)) + (vector-copy! gp-0 (-> self offset-vec)) (set! (-> gp-0 y) 0.0) (vector-normalize! gp-0 1.0) (quaternion-look-at! (-> self root quat) gp-0 *up-vector*) @@ -1362,7 +1367,7 @@ ) (vector+! (-> self root trans) (-> self init-pos) (-> self offset-vec)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self offset-vec quad)) + (vector-copy! gp-0 (-> self offset-vec)) (let ((s5-0 (new 'stack-no-clear 'vector))) (rand-vu-sphere-point! s5-0 3072.0) (vector+! (-> self root trans) (-> self root trans) s5-0) @@ -1392,11 +1397,11 @@ (transform-post) (cond ((logtest? (-> *part-group-id-table* 1318 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1318)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1318)) ) ) @@ -1439,11 +1444,11 @@ (set! (-> self root) s3-0) ) (set! (-> self sound-id) (new-sound-id)) - (set! (-> self offset-vec quad) (-> arg2 quad)) + (vector-copy! (-> self offset-vec) arg2) (set! (-> self ang-vel) arg1) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1317) self)) - (set! (-> self root trans quad) (-> arg0 quad)) - (set! (-> self init-pos quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) + (vector-copy! (-> self init-pos) arg0) (initialize-skeleton self (the-as @@ -1550,7 +1555,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod spawn-gems ((this precur-generator-d)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> this proc-handle 0) (ppointer->handle (process-spawn precur-generator-d-gem s5-0 @@ -1635,11 +1640,11 @@ (set-time! (-> self state-time)) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1692,11 +1697,11 @@ (set! (-> gp-0 y) -20480.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-0 (-> self root trans) gp-0) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-0 (-> self root trans) gp-0)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-0 (-> self root trans) gp-0) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-0 (-> self root trans) gp-0)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1705,11 +1710,11 @@ (set! (-> gp-0 y) -32768.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-0 (-> self root trans) gp-0) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-0 (-> self root trans) gp-0)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-0 (-> self root trans) gp-0) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-0 (-> self root trans) gp-0)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1734,11 +1739,11 @@ (set! (-> gp-4 y) -61440.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-4 (-> self root trans) gp-4) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-4 (-> self root trans) gp-4)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-4 (-> self root trans) gp-4) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-4 (-> self root trans) gp-4)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1747,11 +1752,11 @@ (set! (-> gp-4 y) -20480.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-4 (-> self root trans) gp-4) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-4 (-> self root trans) gp-4)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-4 (-> self root trans) gp-4) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-4 (-> self root trans) gp-4)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1765,11 +1770,11 @@ (set! (-> gp-8 y) -61440.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-8 (-> self root trans) gp-8) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-8 (-> self root trans) gp-8)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-8 (-> self root trans) gp-8) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-8 (-> self root trans) gp-8)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1778,11 +1783,11 @@ (set! (-> gp-8 y) -20480.0) (cond ((logtest? (-> *part-group-id-table* 1313 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-8 (-> self root trans) gp-8) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-8 (-> self root trans) gp-8)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (vector+! gp-8 (-> self root trans) gp-8) quad)) + (vector-copy! (-> *launch-matrix* trans) (vector+! gp-8 (-> self root trans) gp-8)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1313)) ) ) @@ -1798,6 +1803,7 @@ ;; definition for method 11 of type precur-generator-d ;; INFO: Used lq/sq (defmethod init-from-entity! ((this precur-generator-d) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) @@ -2042,6 +2048,7 @@ ;; definition for method 11 of type precur-platform-round (defmethod init-from-entity! ((this precur-platform-round) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -2204,7 +2211,7 @@ ) (quaternion-copy! s5-0 (-> self root quat)) (quaternion-rotate-local-y! s5-0 s5-0 16384.0) - (when (= (status-of-level-and-borrows *level* 'lmech #f) 'active) + (when (= (level-status? *level* 'lmech #f) 'active) (mech-target-spawn (vector-matrix*! (new 'stack-no-clear 'vector) (new 'static 'vector :x 8192.0 :w 1.0) gp-0) self @@ -2279,6 +2286,7 @@ ;; definition for method 11 of type precur-door-d (defmethod init-from-entity! ((this precur-door-d) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) @@ -2560,6 +2568,7 @@ ;; definition for method 11 of type precur-door-c (defmethod init-from-entity! ((this precur-door-c) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2705,6 +2714,7 @@ ;; definition for method 11 of type precura-door-a (defmethod init-from-entity! ((this precura-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this open-started) 0) (set! (-> this open-frame) 45.0) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) diff --git a/test/decompiler/reference/jak3/levels/precursor/precurc-obs_REF.gc b/test/decompiler/reference/jak3/levels/precursor/precurc-obs_REF.gc index ca4c0f2fffd..edd24bdc99b 100644 --- a/test/decompiler/reference/jak3/levels/precursor/precurc-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/precursor/precurc-obs_REF.gc @@ -125,6 +125,7 @@ ;; definition for method 11 of type precur-door-a (defmethod init-from-entity! ((this precur-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this open-started) 0) (set! (-> this open-frame) 45.0) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) @@ -337,7 +338,7 @@ (let ((f0-9 (cos (* 65536.0 (-> this tt))))) (set! (-> this movedist) (* 20480.0 (+ -1.0 f0-9))) ) - (set! (-> s5-0 quad) (-> this entity extra trans quad)) + (vector-copy! s5-0 (-> this entity extra trans)) (vector-normalize-copy! (-> this dir) (-> s4-0 bone transform fvec) 1.0) ) (let ((a1-3 s5-0)) @@ -368,7 +369,7 @@ ) (when (-> this player-grabbed?) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> this entity extra trans quad)) + (vector-copy! s5-2 (-> this entity extra trans)) (seek! (-> this movedist) 0.0 (* 36864.0 (seconds-per-frame))) (let ((a1-7 s5-2)) (let ((v1-48 s5-2)) @@ -476,6 +477,7 @@ ;; definition for method 11 of type precur-swingpole-pop ;; WARN: Return type mismatch symbol vs object. (defmethod init-from-entity! ((this precur-swingpole-pop) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (call-parent-method this arg0) (set! (-> this player-grabbed?) #f) (set! (-> this moving?) #f) @@ -489,7 +491,3 @@ (defmethod get-trans ((this precur-swingpole-pop)) (the-as vector (-> this root root-prim prim-core)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/precursor/precurd-obs_REF.gc b/test/decompiler/reference/jak3/levels/precursor/precurd-obs_REF.gc index c9b198a13bf..b46d81d36c8 100644 --- a/test/decompiler/reference/jak3/levels/precursor/precurd-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/precursor/precurd-obs_REF.gc @@ -549,6 +549,7 @@ ;; definition for method 11 of type pre-tformer (defmethod init-from-entity! ((this pre-tformer) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -613,6 +614,7 @@ ;; definition for method 11 of type wall-window-big (defmethod init-from-entity! ((this wall-window-big) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -629,7 +631,7 @@ (defbehavior wall-window-big-init-by-other wall-window-big ((arg0 vector) (arg1 entity-actor)) (process-entity-set! self arg1) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-wall-window-big" (the-as (pointer level) #f))) @@ -664,6 +666,7 @@ ;; definition for method 11 of type precurd-door-a (defmethod init-from-entity! ((this precurd-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -748,7 +751,7 @@ (defun precur-bridge-path-trigger ((arg0 int)) (when *target* (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-0 (target-pos 0)) (and (< (-> *precur-path-trigger-points* arg0) (-> gp-0 z)) (< (-> gp-0 z) 2048000.0) (< -40960.0 (-> gp-0 x)) @@ -765,7 +768,7 @@ (defun precur-bridge-path-2nd-trigger ((arg0 int)) (when *target* (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-0 (target-pos 0)) (and (< (-> *precur-path-2nd-trigger-points* arg0) (-> gp-0 z)) (< (-> gp-0 z) 2129920.0) (< -40960.0 (-> gp-0 x)) @@ -782,7 +785,7 @@ (defun precur-bridge-blocks-trigger ((arg0 int)) (when *target* (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> (target-pos 0) quad)) + (vector-copy! gp-0 (target-pos 0)) (and (< (-> *precur-blocks-trigger-points* arg0) (-> gp-0 z)) (< (-> gp-0 z) 2048000.0) (< -40960.0 (-> gp-0 x)) @@ -1373,6 +1376,7 @@ ;; definition for method 11 of type precur-bridge-path-break ;; INFO: Used lq/sq (defmethod init-from-entity! ((this precur-bridge-path-break) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set-idx-by-name this) (init-collision! this) @@ -2398,7 +2402,7 @@ (('xform) (let ((v1-9 (-> block param 0))) (when (not (-> self triggered?)) - (set! (-> self root trans quad) (-> self entity extra trans quad)) + (vector-copy! (-> self root trans) (-> self entity extra trans)) (vector+! (-> self root trans) (-> self root trans) (the-as vector (+ v1-9 48))) ) ) @@ -2444,10 +2448,11 @@ ) (when (= (-> a0-8 type) collide-shape-prim-group) (dotimes (s4-0 (the-as int (-> gp-0 specific 0))) - (set! (-> (new 'stack-no-clear 'vector) quad) - (-> (the-as collide-shape-prim-group gp-0) child s4-0 prim-core world-sphere quad) - ) - (set! (-> s5-0 quad) (-> (the-as collide-shape-prim-group gp-0) child s4-0 prim-core world-sphere quad)) + (vector-copy! + (new 'stack-no-clear 'vector) + (-> (the-as collide-shape-prim-group gp-0) child s4-0 prim-core world-sphere) + ) + (vector-copy! s5-0 (-> (the-as collide-shape-prim-group gp-0) child s4-0 prim-core world-sphere)) (when (and (not (-> self toe-up? s4-0)) (< 831488.0 (-> s5-0 y))) (set! (-> self toe-up? s4-0) #t) (when (time-elapsed? *precurd-panel-tear-off-time* (seconds 1)) @@ -2484,6 +2489,7 @@ ;; definition for method 11 of type precur-bridge-blocks-break (defmethod init-from-entity! ((this precur-bridge-blocks-break) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set-idx-by-name this) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -2517,7 +2523,3 @@ ) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/precursor/prim-beam_REF.gc b/test/decompiler/reference/jak3/levels/precursor/prim-beam_REF.gc index 858bcda1caf..8732a736d07 100644 --- a/test/decompiler/reference/jak3/levels/precursor/prim-beam_REF.gc +++ b/test/decompiler/reference/jak3/levels/precursor/prim-beam_REF.gc @@ -121,32 +121,32 @@ (s1-0 (new 'stack-no-clear 'vector)) (f30-0 (-> this appearance width)) ) - (set! (-> s5-0 quad) (-> this pos0 quad)) + (vector-copy! s5-0 (-> this pos0)) (vector-! s1-0 (-> this pos1) (-> this pos0)) (vector-! s2-0 v1-1 s5-0) - (set! (-> s2-0 quad) (-> (math-camera-matrix) fvec quad)) + (vector-copy! s2-0 (-> (math-camera-matrix) fvec)) (vector-cross! s4-0 s2-0 s1-0) (vector-normalize! s4-0 1.0) (vector+float*! s5-0 (-> this pos0) s4-0 f30-0) - (set! (-> s3-0 0 pos quad) (-> s5-0 quad)) + (vector-copy! (-> s3-0 0 pos) s5-0) (set! (-> s3-0 0 stq z) 0.0) (set! (-> s3-0 0 stq x) 0.0) (set! (-> s3-0 0 stq y) 0.0) (let ((v1-9 (-> s3-0 1))) (vector+float*! s5-0 (-> this pos0) s4-0 (- f30-0)) - (set! (-> v1-9 pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-9 pos) s5-0) (set! (-> v1-9 stq z) 0.0) (set! (-> v1-9 stq x) 1.0) (set! (-> v1-9 stq y) 0.0) (let ((v1-10 (&+ v1-9 32))) (vector+float*! s5-0 (-> this pos1) s4-0 f30-0) - (set! (-> v1-10 pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-10 pos) s5-0) (set! (-> v1-10 stq z) 0.0) (set! (-> v1-10 stq x) 0.0) (set! (-> v1-10 stq y) (-> this appearance num-tiles)) (let ((v1-11 (&+ v1-10 32))) (vector+float*! s5-0 (-> this pos1) s4-0 (- f30-0)) - (set! (-> v1-11 pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-11 pos) s5-0) (set! (-> v1-11 stq z) 0.0) (set! (-> v1-11 stq x) 1.0) (set! (-> v1-11 stq y) (-> this appearance num-tiles)) @@ -238,10 +238,10 @@ (set! (-> self track-joint1) (-> arg0 track-joint1)) (set! (-> self track-joint2) (-> arg0 track-joint2)) (if (-> arg0 pos0) - (set! (-> self pos0 quad) (-> arg0 pos0 quad)) + (vector-copy! (-> self pos0) (-> arg0 pos0)) ) (if (-> arg0 pos1) - (set! (-> self pos1 quad) (-> arg0 pos1 quad)) + (vector-copy! (-> self pos1) (-> arg0 pos1)) ) (set! (-> self duration) (-> arg0 duration)) (mem-copy! (the-as pointer (-> self appearance)) (the-as pointer (-> arg0 appearance)) 20) @@ -257,7 +257,3 @@ (set! (-> arg0 appearance) (the-as prim-beam-settings (-> arg1 value))) (the-as handle (ppointer->handle (process-spawn prim-beam-tracker arg0 :name "prim-beam-tracker" :to arg2))) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/flyingsaw_REF.gc b/test/decompiler/reference/jak3/levels/sewer/flyingsaw_REF.gc index 3c245a5ca87..2000a9f9db8 100644 --- a/test/decompiler/reference/jak3/levels/sewer/flyingsaw_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/flyingsaw_REF.gc @@ -318,7 +318,7 @@ (vector-normalize! s5-1 1.0) (forward-down->inv-matrix (-> self spark-mat) s5-1 (new 'static 'vector :y -1.0)) ) - (set! (-> self spark-mat trans quad) (-> gp-0 spark quad)) + (vector-copy! (-> self spark-mat trans) (-> gp-0 spark)) (set-time! (-> self spark-timer)) (sound-play "flysaw-hit-wall" :position (-> self root trans)) ) @@ -338,7 +338,7 @@ ) (if (< 1228.8 f0-2) (vector+float*! (-> self root trans) (-> self root trans) v1-36 (/ 1228.8 f0-2)) - (set! (-> self root trans quad) (-> gp-0 position quad)) + (vector-copy! (-> self root trans) (-> gp-0 position)) ) ) (let ((s5-3 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self base-quat))) @@ -357,11 +357,11 @@ ) (update-with-delay! (-> self wobble-target)) (let ((s5-4 (new 'stack-no-clear 'vector))) - (set! (-> s5-4 quad) (-> self wobble-target value quad)) + (vector-copy! s5-4 (-> self wobble-target value)) (let ((gp-3 (new 'stack-no-clear 'quaternion))) (set! (-> s5-4 y) 0.0) (update! (-> self wobble) (-> self wobble-target value)) - (set! (-> s5-4 quad) (-> self wobble value quad)) + (vector-copy! s5-4 (-> self wobble value)) (set! (-> s5-4 y) 1.0) (vector-normalize! s5-4 1.0) (quaternion-from-two-vectors! gp-3 (new 'static 'vector :y 1.0) s5-4) @@ -426,6 +426,7 @@ ;; definition for method 11 of type flyingsaw ;; INFO: Used lq/sq (defmethod init-from-entity! ((this flyingsaw) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate @@ -519,7 +520,7 @@ ) (set! (-> this current-node) (the-as uint 0)) (if (-> this graph) - (set! (-> this root trans quad) (-> this graph node (-> this current-node) position quad)) + (vector-copy! (-> this root trans) (-> this graph node (-> this current-node) position)) ) (set! (-> this spin-1) (new 'process 'joint-mod (joint-mod-mode foot-rot) this 10)) (set! (-> this spin-1 track-mode) (track-mode no-trans no-scale)) @@ -537,7 +538,3 @@ (set! (-> this fly-sound-playing) #f) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc b/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc index 0269d0b265e..e44a80c649a 100644 --- a/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/jump-pad_REF.gc @@ -162,6 +162,7 @@ ;; definition for method 11 of type jump-pad (defmethod init-from-entity! ((this jump-pad) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this fan-loop-sound) #f) (set! (-> this jump-sound) #f) (init-sounds this) diff --git a/test/decompiler/reference/jak3/levels/sewer/kg-hopper_REF.gc b/test/decompiler/reference/jak3/levels/sewer/kg-hopper_REF.gc index 6319389dabd..acc66839ded 100644 --- a/test/decompiler/reference/jak3/levels/sewer/kg-hopper_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/kg-hopper_REF.gc @@ -152,10 +152,11 @@ ;; definition for method 85 of type kg-hopper (defmethod knocked-anim ((this kg-hopper) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type blue-shot)) (let* ((a2-0 (ash 1 (-> *kg-hopper-global-info* prev-blue-hit))) - (v1-3 (enemy-method-131 this 3 a2-0)) + (v1-3 (rnd-int-excluding-masked this 3 a2-0)) (a1-5 (-> this draw art-group data (-> *kg-hopper-global-info* blue-hit-anim v1-3 hit-anim-index))) ) (set! (-> *kg-hopper-global-info* prev-blue-hit) v1-3) @@ -171,7 +172,7 @@ (else (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-2 (ash 1 (-> *kg-hopper-global-info* prev-yellow-hit))) - (v1-13 (enemy-method-131 this 3 a2-2)) + (v1-13 (rnd-int-excluding-masked this 3 a2-2)) (a1-11 (-> this draw art-group data (-> *kg-hopper-global-info* yellow-hit-anim v1-13 hit-anim-index))) ) (set! (-> this land-anim-index) (-> *kg-hopper-global-info* yellow-hit-anim v1-13 land-anim-index)) @@ -191,6 +192,7 @@ ;; definition for method 86 of type kg-hopper (defmethod knocked-land-anim ((this kg-hopper) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this incoming knocked-type) (knocked-type blue-shot)) #f @@ -360,34 +362,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 4551.1113 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -428,6 +430,7 @@ ;; definition for method 81 of type kg-hopper (defmethod go-die ((this kg-hopper)) + "Go to the die state." (go (method-of-object this explode)) ) @@ -449,17 +452,17 @@ (set! (-> a1-1 hit-y-reaction) 0.6) (set! (-> a1-1 scale-rand-lo) 0.5) (set! (-> a1-1 scale-rand-hi) 1.2) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> self incoming attack-position quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> self incoming attack-position)) (debris-spawn self a1-1 *kg-hopper-debris-params* (the-as process-drawable #f)) ) (let ((v1-8 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node kg-hopper-lod0-jg chest)))) (cond ((logtest? (-> *part-group-id-table* 221 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-8 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-8) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 221)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-8 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-8) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 221)) ) ) @@ -473,6 +476,7 @@ ;; definition for method 82 of type kg-hopper (defmethod event-handler ((this kg-hopper) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -484,7 +488,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -507,10 +511,10 @@ ;; definition for method 99 of type kg-hopper ;; INFO: Used lq/sq -(defmethod jump-anim-handler ((this kg-hopper) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this kg-hopper) (arg0 jump-stage) (arg1 enemy-jump-info)) (when (= (-> this jump-why) 2) (cond - ((zero? arg0) + ((= arg0 (jump-stage init)) (logior! (-> this focus-status) (focus-status touch-water under-water)) ) (else @@ -536,16 +540,16 @@ (when v1-7 (logclear! (-> this focus-status) (focus-status under-water)) (let ((v1-10 (new 'stack-no-clear 'vector))) - (set! (-> v1-10 quad) (-> this root trans quad)) + (vector-copy! v1-10 (-> this root trans)) (when (logtest? (water-flag touch-water) (-> s3-0 flags)) (set! (-> v1-10 y) (-> s3-0 trans y)) (cond ((logtest? (-> *part-group-id-table* 192 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-10) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 192)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-10 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-10) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 192)) ) ) @@ -564,6 +568,7 @@ ;; definition for method 98 of type kg-hopper (defmethod jump-wind-up-anim ((this kg-hopper) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump-start-anim))) (a0-4 (-> this skel root-channel 0)) @@ -579,6 +584,7 @@ ;; definition for method 96 of type kg-hopper (defmethod jump-in-air-anim ((this kg-hopper) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump-air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -594,6 +600,7 @@ ;; definition for method 97 of type kg-hopper (defmethod jump-land-anim ((this kg-hopper) (arg0 enemy-jump-info)) + "Play the landing anim" (ja-channel-push! 1 (seconds 0.075)) (let ((a1-2 (-> this draw art-group data (-> this jump-land-anim))) (a0-4 (-> this skel root-channel 0)) @@ -701,9 +708,9 @@ (let ((f30-0 (vector-dot s3-0 (-> this direction)))) (new 'stack-no-clear 'vector) (let ((a1-3 (new 'stack-no-clear 'vector))) - (set! (-> a1-3 quad) (-> s5-0 quad)) + (vector-copy! a1-3 s5-0) (set! (-> a1-3 w) 6144.0) - (when (not (add-root-sphere-to-hash! (-> this nav) a1-3 #x10006c)) + (when (not (check-sphere-blocked! (-> this nav) a1-3 #x10006c)) (when (< (-> this best-score) f30-0) (set! (-> this best-score) f30-0) (let ((s2-0 (new 'stack-no-clear 'vector))) @@ -729,7 +736,7 @@ ) ) ) - (set! (-> this best-point quad) (-> s5-0 quad)) + (vector-copy! (-> this best-point) s5-0) ) ) ) @@ -776,7 +783,7 @@ (nav-enemy-method-183 self) (set! (-> self speed-y) 0.0) (set! (-> self accel-y) 0.0) - (set! (-> self next-jump-time) (the-as int (+ (current-time) (set-reaction-time! self 0 (seconds 0.4))))) + (set! (-> self next-jump-time) (the-as int (+ (current-time) (rnd-time-frame self 0 (seconds 0.4))))) (set! (-> self step-num) 0) (set! (-> self best-score) -2.0) ) @@ -804,7 +811,7 @@ (nav-enemy-method-164 self) (let ((v1-2 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> self nav state))) - (set! (-> v1-2 quad) (-> a2-0 target-pos quad)) + (vector-copy! v1-2 (-> a2-0 target-pos)) ) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked))) @@ -830,14 +837,14 @@ (ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (let ((a1-4 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-4 travel quad)) + (vector-copy! gp-0 (-> a1-4 travel)) ) (seek-toward-heading-vec! (-> self root) gp-0 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -880,7 +887,7 @@ (quaternion-rotate-y! (-> gp-1 quat) (-> gp-1 quat) f0-3) ) ) - (set! (-> gp-1 trans quad) (-> s5-0 quad)) + (vector-copy! (-> gp-1 trans) s5-0) ) ) ) @@ -932,6 +939,7 @@ ;; definition for method 120 of type kg-hopper ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this kg-hopper)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1002,11 +1010,12 @@ ;; definition for method 121 of type kg-hopper ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this kg-hopper)) + "Typical place for shared init code. Runs from entity or process style init." (stack-size-set! (-> this main-thread) 256) (logior! (-> this mask) (process-mask kg-robot)) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-defaults! this *kg-hopper-nav-enemy-info*) + (setup-enemy! this *kg-hopper-nav-enemy-info*) (set! (-> this can-go-knocked?) #t) (let ((v1-11 (-> this neck))) (set! (-> v1-11 up) (the-as uint 1)) diff --git a/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc b/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc index ba1adb27be9..9d134fcb045 100644 --- a/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc @@ -346,7 +346,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! ((this mh-wasp-shot)) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this attack-mode) 'mh-wasp-shot) (set! (-> this max-speed) 491520.0) (set! (-> this move) metalhead-shot-move) @@ -509,34 +509,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 101580.8 - :knocked-hard-vy-lo 60620.8 - :knocked-hard-vy-hi 95027.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 24.8) + :knocked-hard-vy-lo (meters 14.8) + :knocked-hard-vy-hi (meters 23.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -553,6 +553,7 @@ ;; definition for method 82 of type mh-wasp (defmethod event-handler ((this mh-wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -564,7 +565,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -582,6 +583,7 @@ ;; definition for method 56 of type mh-wasp (defmethod knocked-handler ((this mh-wasp) (arg0 vector)) + "Called when this enemy is knocked." (let ((s4-0 (-> this root))) (case (-> this incoming knocked-type) (((knocked-type explode-or-darkjak)) @@ -618,7 +620,8 @@ ) ;; definition for method 122 of type mh-wasp -(defmethod go-idle2 ((this mh-wasp)) +(defmethod go-fallback-init ((this mh-wasp)) + "If there's no specific settings for initial state, go to this state after spawning." (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) (go (method-of-object this ambush)) (go (method-of-object this notice)) @@ -627,16 +630,19 @@ ;; definition for method 78 of type mh-wasp (defmethod go-hostile ((this mh-wasp)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this hostile)) ) ;; definition for method 80 of type mh-wasp -(defmethod go-best-state ((this mh-wasp)) +(defmethod go-state-for-focused ((this mh-wasp)) + "Go to the appropriate state for the current awareness of the focused process." (go-hostile this) ) ;; definition for method 59 of type mh-wasp (defmethod enemy-common-post ((this mh-wasp)) + "Common implementation of post. Runs ja-post." (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) ((method-of-type hover-enemy enemy-common-post) this) (none) @@ -796,7 +802,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> self focus-pos quad)) + (vector-copy! v1-4 (-> self focus-pos)) (+! (-> v1-4 y) (-> self attack-miss-dist-curr)) (vector-! gp-0 v1-4 a0-2) ) @@ -886,11 +892,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 1530 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1530)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1530)) ) ) @@ -924,6 +930,7 @@ ;; definition for method 113 of type mh-wasp (defmethod get-focus! ((this mh-wasp)) + "If we're focusing on something alive, return it." (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) (when s5-0 (let* ((a0-4 (-> this root)) @@ -935,7 +942,7 @@ (if (and (and s5-0 (not (logtest? (-> s5-0 focus-status) (focus-status disable dead ignore grabbed)))) (< 0.0 (vector-dot s2-1 s3-2)) (< (vector-vector-distance s4-1 (-> this focus-pos)) 225280.0) - (and (< (fabs (vector-x-angle s3-2)) 3640.889) (enemy-method-104 this (-> this focus-pos) 5461.3335)) + (and (< (fabs (vector-x-angle s3-2)) 3640.889) (pointing-toward? this (-> this focus-pos) 5461.3335)) ) s5-0 ) @@ -946,6 +953,7 @@ ;; definition for method 85 of type mh-wasp (defmethod knocked-anim ((this mh-wasp) (arg0 enemy-knocked-info)) + "start the knocked animation." (cond ((rnd-chance? this 0.5) (set! (-> this knocked-anim) 10) @@ -971,6 +979,7 @@ ;; definition for method 86 of type mh-wasp (defmethod knocked-land-anim ((this mh-wasp) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) (a0-3 (-> this skel root-channel 0)) ) @@ -984,18 +993,21 @@ ) ;; definition for method 88 of type mh-wasp -(defmethod enemy-method-88 ((this mh-wasp) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this mh-wasp) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" (-> this root) (>= (-> arg0 on-surface-count) 1) ) ;; definition for method 89 of type mh-wasp -(defmethod within-gspot-range? ((this mh-wasp)) +(defmethod invalid-height? ((this mh-wasp)) + "Return #t if the enemy is too high in the air, or below the ground." #f ) ;; definition for method 81 of type mh-wasp (defmethod go-die ((this mh-wasp)) + "Go to the die state." (cond ((and (-> this next-state) (= (-> this next-state name) 'knocked)) (go (method-of-object this die-now)) @@ -1054,7 +1066,7 @@ (-> arg0 scale) (quaternion-rotate-local-z! (the-as quaternion sv-208) a1-3 sv-192) (quaternion->matrix s5-0 (the-as quaternion sv-208)) - (set! (-> s2-1 quad) (-> arg0 root scale quad)) + (vector-copy! s2-1 (-> arg0 root scale)) (scale-matrix! s5-0 s2-1 s5-0) (let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat))) (t9-6 vector-inv-orient-by-quat!) @@ -1099,7 +1111,7 @@ ) ) ) - (set! (-> s5-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s5-0 trans) s4-0) (spawn-from-mat (-> arg0 engine-part) s5-0) (let ((f0-18 (lerp-scale 0.75 1.0 f28-0 1638.4 f30-0))) (sound-play-by-name @@ -1147,6 +1159,7 @@ ;; definition for method 120 of type mh-wasp ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this mh-wasp)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1334,9 +1347,10 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this mh-wasp)) + "Typical place for shared init code. Runs from entity or process style init." (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) (hover-enemy-method-170 this) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (hover-enemy-method-176 this) (set! (-> this neck up) (the-as uint 1)) (set! (-> this neck nose) (the-as uint 2)) diff --git a/test/decompiler/reference/jak3/levels/sewer/needle-fish_REF.gc b/test/decompiler/reference/jak3/levels/sewer/needle-fish_REF.gc index 9f8e8c73757..ed6d30605f6 100644 --- a/test/decompiler/reference/jak3/levels/sewer/needle-fish_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/needle-fish_REF.gc @@ -174,7 +174,7 @@ (set! (-> s5-0 attack-id) a0-12) ) (set! (-> s5-0 timeout) (seconds 4)) - (set! (-> s5-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> s5-0 pos) arg1) (vector-normalize-copy! (-> s5-0 vel) a1-2 arg3) ) (the-as (pointer needle-fish-shot) (spawn-projectile needle-fish-shot s5-0 arg0 *default-dead-pool*)) @@ -420,34 +420,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -489,6 +489,7 @@ ;; definition for method 120 of type needle-fish ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this needle-fish)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -630,7 +631,7 @@ (let ((a0-2 (-> self nav state))) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-0 quad)) + (vector-copy! (-> a0-2 target-pos) v1-0) ) 0 ) @@ -654,7 +655,7 @@ :trans (behavior () (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (let ((v1-3 (-> self focus aware))) - (if (or (>= 2 (the-as int v1-3)) (= v1-3 (enemy-aware ea4)) (not (get-focus! self))) + (if (or (>= 2 (the-as int v1-3)) (= v1-3 (enemy-aware flee)) (not (get-focus! self))) (go-stare self) ) ) @@ -705,7 +706,7 @@ ) ) (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 spawn-point) (-> self root trans)) (quaternion-identity! (-> gp-2 spawn-quat)) (set! (-> gp-2 radius) 20480.0) (set! (-> gp-2 scale) 1.0) @@ -730,7 +731,8 @@ ) ;; definition for method 108 of type needle-fish -(defmethod enemy-method-108 ((this needle-fish) (arg0 process-focusable)) +(defmethod should-flee-from? ((this needle-fish) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (< (current-time) (-> this scared-timer)) ) @@ -742,6 +744,7 @@ ;; definition for method 82 of type needle-fish (defmethod event-handler ((this needle-fish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-flinch 'hit-knocked) (go (method-of-object this explode)) @@ -753,16 +756,18 @@ ) ;; definition for method 84 of type needle-fish -(defmethod send-attack-on-jump-or-knocked ((this needle-fish) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-touched-handler ((this needle-fish) (arg0 process) (arg1 event-message-block)) + "General handler for when anything touches an enemy (automatic response)." (if (= arg0 *target*) (go (method-of-object this explode)) - ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ((method-of-type nav-enemy enemy-touched-handler) this arg0 arg1) ) ) ;; definition for method 59 of type needle-fish ;; INFO: Used lq/sq (defmethod enemy-common-post ((this needle-fish)) + "Common implementation of post. Runs ja-post." (when (not (-> this tail-initialized)) (set! (-> this tail-initialized) #t) (initialize-chain-joints (-> this tail)) @@ -770,7 +775,7 @@ (update (-> this tail) this) (let ((a0-4 (handle->process (-> this focus handle)))) (if a0-4 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-4) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-4) 3)) ) ) (+! (-> this tail-clock) @@ -792,12 +797,13 @@ ;; definition for method 121 of type needle-fish ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this needle-fish)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-needle-fish" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *needle-fish-nav-enemy-info*) + (setup-enemy! this *needle-fish-nav-enemy-info*) (set! (-> this tail) (new 'process 'needle-fish-chain-physics)) (chain-physics-initialize this (-> this tail) 25 1638.4 *needle-fish-chain-setup*) (set! (-> this tail-initialized) #f) @@ -834,7 +840,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/neo-grenadier_REF.gc b/test/decompiler/reference/jak3/levels/sewer/neo-grenadier_REF.gc index 3496e9d2288..d3d0d8a392c 100644 --- a/test/decompiler/reference/jak3/levels/sewer/neo-grenadier_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/neo-grenadier_REF.gc @@ -314,34 +314,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 0.18204445 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -384,6 +384,7 @@ ;; definition for method 82 of type neo-grenadier (defmethod event-handler ((this neo-grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit-knocked) (when (= (-> this incoming knocked-type) (knocked-type yellow-shot)) @@ -440,9 +441,9 @@ ;; WARN: Return type mismatch vector vs none. (defmethod set-bank-info! ((this neo-grenadier) (arg0 vector)) (closest-point-on-mesh (-> this nav) arg0 arg0 (the-as nav-poly #f)) - (set! (-> this bank final-pos quad) (-> arg0 quad)) - (set! (-> this bank tangent-pos quad) (-> arg0 quad)) - (set! (-> this move-pos quad) (-> this bank tangent-pos quad)) + (vector-copy! (-> this bank final-pos) arg0) + (vector-copy! (-> this bank tangent-pos) arg0) + (vector-copy! (-> this move-pos) (-> this bank tangent-pos)) (none) ) @@ -519,7 +520,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (when (enemy-method-134 self 0.2) + (when (rnd-chance-for-idle? self 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.6)) (nav-enemy-method-182 self) @@ -532,7 +533,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -605,18 +606,18 @@ (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (new 'stack-no-clear 'vector) (vector-normalize! s3-1 49152.0) (closest-point-on-mesh (-> self nav) s4-0 (vector+! s4-0 s5-0 s3-1) (the-as nav-poly #f)) (when (< 32768.0 (vector-vector-distance gp-0 s4-0)) - (set! (-> self move-pos quad) (-> s4-0 quad)) + (vector-copy! (-> self move-pos) s4-0) (let ((a0-11 (-> self nav state)) (v1-32 (-> self move-pos)) ) (logclear! (-> a0-11 flags) (nav-state-flag directional-mode)) (logior! (-> a0-11 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-11 target-pos quad) (-> v1-32 quad)) + (vector-copy! (-> a0-11 target-pos) v1-32) ) 0 (go-virtual backup) @@ -664,7 +665,7 @@ :post (behavior () (let ((gp-0 (-> self bank))) (if (< (vector-vector-xz-distance (-> self root trans) (-> gp-0 tangent-pos)) 9830.4) - (set! (-> self move-pos quad) (-> gp-0 final-pos quad)) + (vector-copy! (-> self move-pos) (-> gp-0 final-pos)) ) ) (let ((a0-3 (-> self nav state)) @@ -672,7 +673,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-5 quad)) + (vector-copy! (-> a0-3 target-pos) v1-5) ) 0 (nav-enemy-travel-post) @@ -710,7 +711,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-travel-post) @@ -776,6 +777,7 @@ ;; definition for method 85 of type neo-grenadier ;; INFO: Used lq/sq (defmethod knocked-anim ((this neo-grenadier) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type none)) (let ((s4-1 (-> this @@ -788,7 +790,7 @@ ) ((= (-> this incoming knocked-type) (knocked-type yellow-shot)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this root transv quad)) + (vector-copy! s4-0 (-> this root transv)) (let* ((s3-0 quaternion-rotate-y-to-vector!) (s2-0 (new 'stack-no-clear 'quaternion)) (s1-0 (-> this root quat)) @@ -829,7 +831,7 @@ (s5-1 (new 'static 'array uint64 3 #x1b #x1c #x1d)) (s4-2 (new 'static 'array int32 4 0 0 0 0)) (a2-3 (ash 1 (-> s4-2 0))) - (v1-23 (enemy-method-131 this a1-11 a2-3)) + (v1-23 (rnd-int-excluding-masked this a1-11 a2-3)) (s5-2 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-23 8) (the-as int s5-1)))))) ) (set! (-> s4-2 0) v1-23) @@ -861,6 +863,7 @@ ;; definition for method 86 of type neo-grenadier (defmethod knocked-land-anim ((this neo-grenadier) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this incoming knocked-type) (knocked-type blue-shot)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -931,7 +934,7 @@ (setup-from-to-xz-vel! (-> self shot-trajectory) gp-0 s4-1 f0-2 -102400.0) ) ) - (set! (-> s5-1 quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! s5-1 (-> self shot-trajectory initial-velocity)) (vector-normalize! s5-1 1638.4) (vector+! gp-0 gp-0 s5-1) ) @@ -940,8 +943,8 @@ (set! (-> a1-9 charge) 1.0) (set! (-> a1-9 options) (projectile-options)) (logclear! (-> a1-9 options) (projectile-options po14 po15 po16)) - (set! (-> a1-9 pos quad) (-> gp-0 quad)) - (set! (-> a1-9 vel quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! (-> a1-9 pos) gp-0) + (vector-copy! (-> a1-9 vel) (-> self shot-trajectory initial-velocity)) (set! (-> a1-9 notify-handle) (process->handle self)) (set! (-> a1-9 owner-handle) (the-as handle #f)) (set! (-> a1-9 target-handle) (the-as handle #f)) @@ -976,7 +979,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + (vector-copy! (-> v1-1 target-pos) a0-1) ) 0 (nav-enemy-method-181 self) @@ -1009,7 +1012,7 @@ (let* ((v1-8 (vector-float*! (new 'stack-no-clear 'vector) (-> self root transv) 0.3)) (a2-2 (vector+! (new 'stack-no-clear 'vector) (-> self root trans) v1-8)) ) - (set! (-> self move-pos quad) (-> self root trans quad)) + (vector-copy! (-> self move-pos) (-> self root trans)) (closest-point-on-mesh (-> self nav) (-> self move-pos) a2-2 (the-as nav-poly #f)) ) (let ((a0-10 (-> self nav state)) @@ -1017,7 +1020,7 @@ ) (logclear! (-> a0-10 flags) (nav-state-flag directional-mode)) (logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-10 target-pos quad) (-> v1-13 quad)) + (vector-copy! (-> a0-10 target-pos) v1-13) ) 0 (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) @@ -1047,12 +1050,12 @@ (logclear! (-> self status-flags) (grenadier-status-flag gsf0)) ) (else - (when (not (enemy-method-105 self 1820.4445 #t)) + (when (not (pointing-toward-focus? self 1820.4445 #t)) (nav-enemy-method-183 self) (ja-channel-push! 1 (seconds 0.2)) (ja :group! neo-grenadier-throw-turn-in-place-ja) (ja :num-func num-func-identity :frame-num 0.0) - (until (enemy-method-105 self 910.2222 #t) + (until (pointing-toward-focus? self 910.2222 #t) (ja-blend-eval) (suspend) (ja :num! (loop! 0.75)) @@ -1174,7 +1177,7 @@ (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) (logclear! (-> self focus-status) (focus-status hit)) (cond - ((= (-> self focus aware) (enemy-aware ea3)) + ((= (-> self focus aware) (enemy-aware hostile)) (if (and (handle->process (-> self focus handle)) (not (logtest? (-> (the-as process-focusable (handle->process (-> self focus handle))) focus-status) (focus-status disable dead ignore grabbed) @@ -1194,6 +1197,7 @@ ;; definition for method 78 of type neo-grenadier (defmethod go-hostile ((this neo-grenadier)) + "Go to the hostile state, actively trying to attack the target." (if (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) (and (logtest? (-> this status-flags) (grenadier-status-flag gsf0)) (handle->process (-> this focus handle)) @@ -1231,7 +1235,7 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1247,7 +1251,7 @@ (vector-reset! a2-0) (set! (-> a2-0 y) 1.0) (let ((t0-0 (-> arg0 state))) - (set! (-> v1-3 quad) (-> t0-0 heading quad)) + (vector-copy! v1-3 (-> t0-0 heading)) ) (let* ((a1-3 (-> *perf-stats* data 33)) (a3-3 (-> a1-3 ctrl)) @@ -1289,6 +1293,7 @@ ;; definition for method 59 of type neo-grenadier ;; WARN: Return type mismatch object vs none. (defmethod enemy-common-post ((this neo-grenadier)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -1301,6 +1306,7 @@ ;; definition for method 120 of type neo-grenadier ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this neo-grenadier)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1399,12 +1405,13 @@ ;; definition for method 121 of type neo-grenadier ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this neo-grenadier)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-grenadier" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *neo-grenadier-nav-enemy-info*) + (setup-enemy! this *neo-grenadier-nav-enemy-info*) (let ((v1-5 (-> this neck))) (when v1-5 (set! (-> v1-5 up) (the-as uint 1)) @@ -1455,7 +1462,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc b/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc index c6f294da5d7..5ceda0a084c 100644 --- a/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/neo-juicer_REF.gc @@ -133,10 +133,10 @@ (case arg2 (('reset) (let ((v1-1 (the-as object (-> arg3 param 0)))) - (set! (-> this root trans quad) (-> (the-as (inline-array vector) v1-1) 0 quad)) - (set! (-> this starting-pos quad) (-> (the-as (inline-array vector) v1-1) 0 quad)) - (set! (-> this root transv quad) (-> (the-as (inline-array vector) v1-1) 1 quad)) - (set! (-> this pre-move-transv quad) (-> (the-as (inline-array vector) v1-1) 1 quad)) + (vector-copy! (-> this root trans) (-> (the-as (inline-array vector) v1-1) 0)) + (vector-copy! (-> this starting-pos) (-> (the-as (inline-array vector) v1-1) 0)) + (vector-copy! (-> this root transv) (-> (the-as (inline-array vector) v1-1) 1)) + (vector-copy! (-> this pre-move-transv) (-> (the-as (inline-array vector) v1-1) 1)) ) (set! (-> this hits) 0) (set-time! (-> this spawn-time)) @@ -209,7 +209,7 @@ (let ((a0-20 (-> this lightning s0-0)) (v1-25 s4-0) ) - (set! (-> a0-20 state meet data (+ (-> a0-20 state points-to-draw) -1) quad) (-> v1-25 quad)) + (vector-copy! (-> a0-20 state meet data (+ (-> a0-20 state points-to-draw) -1)) v1-25) ) ) ) @@ -226,11 +226,11 @@ (projectile-method-25 this) (cond ((logtest? (-> *part-group-id-table* 1524 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1524)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1524)) ) ) @@ -272,7 +272,7 @@ (let ((s5-0 (handle->process (-> arg0 victim)))) (cond (s5-0 - (set! (-> arg0 root trans quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (vector-copy! (-> arg0 root trans) (get-trans (the-as process-focusable s5-0) 3)) ((method-of-type projectile deal-damage!) arg0 s5-0 (the-as event-message-block #f)) ) (else @@ -670,34 +670,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 65536.0 - :knocked-soft-vxz-hi 94208.0 - :knocked-soft-vy-lo 77824.0 - :knocked-soft-vy-hi 98304.0 - :knocked-medium-vxz-lo 81920.0 - :knocked-medium-vxz-hi 98304.0 - :knocked-medium-vy-lo 81920.0 - :knocked-medium-vy-hi 122880.0 - :knocked-hard-vxz-lo 65536.0 - :knocked-hard-vxz-hi 95846.4 - :knocked-hard-vy-lo 122880.0 - :knocked-hard-vy-hi 163840.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 98304.0 - :knocked-red-vy-lo 90112.0 - :knocked-red-vy-hi 131072.0 - :knocked-blue-vxz-lo 24576.0 - :knocked-blue-vxz-hi 32768.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 73728.0 + :knocked-soft-vxz-lo (meters 16) + :knocked-soft-vxz-hi (meters 23) + :knocked-soft-vy-lo (meters 19) + :knocked-soft-vy-hi (meters 24) + :knocked-medium-vxz-lo (meters 20) + :knocked-medium-vxz-hi (meters 24) + :knocked-medium-vy-lo (meters 20) + :knocked-medium-vy-hi (meters 30) + :knocked-hard-vxz-lo (meters 16) + :knocked-hard-vxz-hi (meters 23.4) + :knocked-hard-vy-lo (meters 30) + :knocked-hard-vy-hi (meters 40) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 24) + :knocked-red-vy-lo (meters 22) + :knocked-red-vy-hi (meters 32) + :knocked-blue-vxz-lo (meters 6) + :knocked-blue-vxz-hi (meters 8) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 18) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -747,7 +747,7 @@ (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) + (vector-copy! s5-0 (get-trans (the-as process-focusable s3-0) 3)) (let ((s3-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform fvec) 1.0) ) @@ -786,6 +786,7 @@ ;; definition for method 59 of type neo-juicer (defmethod enemy-common-post ((this neo-juicer)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -822,6 +823,7 @@ ;; definition for method 82 of type neo-juicer (defmethod event-handler ((this neo-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit-flinch) (cond @@ -835,7 +837,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -865,7 +867,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -894,7 +896,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -935,7 +937,7 @@ (let ((f30-0 (rnd-float-range self 0.9 1.1))) (until #f (let ((gp-0 (-> self draw art-group data (-> *neo-juicer-global-info* patrol-anim (rnd-int self 2) anim-index))) - (s5-0 (set-reaction-time! self 1 (seconds 0.027))) + (s5-0 (rnd-time-frame self 1 (seconds 0.027))) ) (let ((v1-34 (ja-group))) (if (not (and v1-34 (= v1-34 gp-0))) @@ -954,8 +956,8 @@ (nav-enemy-method-182 self) (ja-channel-push! 1 (seconds 0.3)) (let ((gp-1 0)) - (until (not (enemy-method-134 self 0.4)) - (let* ((v1-61 (enemy-method-131 self 3 gp-1)) + (until (not (rnd-chance-for-idle? self 0.4)) + (let* ((v1-61 (rnd-int-excluding-masked self 3 gp-1)) (a1-15 (-> self draw art-group data (-> *neo-juicer-global-info* idle-anim v1-61 anim-index))) ) (set! gp-1 (ash 1 v1-61)) @@ -977,19 +979,21 @@ ) ;; definition for method 93 of type neo-juicer -(defmethod setup-jump! ((this neo-juicer) (arg0 enemy-jump-info)) - ((method-of-type nav-enemy setup-jump!) this arg0) +(defmethod setup-jump-trajectory! ((this neo-juicer) (arg0 enemy-jump-info)) + "Compute jump trajectory." + ((method-of-type nav-enemy setup-jump-trajectory!) this arg0) (none) ) ;; definition for method 102 of type neo-juicer -(defmethod go-directed2 ((this neo-juicer)) +(defmethod go-next-state-auto ((this neo-juicer)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (case (-> this jump-why) ((2) (go (method-of-object this ambush-cont)) ) (else - ((method-of-type nav-enemy go-directed2) this) + ((method-of-type nav-enemy go-next-state-auto) this) ) ) ) @@ -1044,7 +1048,7 @@ ) (if (< v1-1 (-> a0-0 curve num-cverts)) (set! (-> self ambush-path-pt) v1-1) - (go-best-state self) + (go-state-for-focused self) ) ) (until #f @@ -1097,14 +1101,14 @@ (let ((f30-1 (rnd-float-range self 0.8 1.2)) (gp-2 (new 'stack-no-clear 'vector)) ) - (let* ((a0-13 (enemy-method-131 self 2 s5-0)) + (let* ((a0-13 (rnd-int-excluding-masked self 2 s5-0)) (a1-8 (-> self draw art-group data (-> *neo-juicer-global-info* notice-anim a0-13 anim-index))) ) (ja-no-eval :group! a1-8 :num! (seek! max f30-1) :frame-num 0.0) ) (until (ja-done? 0) (let ((a1-9 (-> self nav state))) - (set! (-> gp-2 quad) (-> a1-9 travel quad)) + (vector-copy! gp-2 (-> a1-9 travel)) ) (seek-toward-heading-vec! (-> self root) gp-2 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) @@ -1112,7 +1116,7 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1130,7 +1134,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1190,7 +1194,7 @@ (let ((v1-8 (-> self nav state))) (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-8 target-pos) gp-0) ) 0 (if (and (>= 53248.0 f0-0) (should-check-los? (-> self los) 0) (get-focus! self)) @@ -1205,6 +1209,7 @@ ;; definition for method 113 of type neo-juicer (defmethod get-focus! ((this neo-juicer)) + "If we're focusing on something alive, return it." (let* ((t9-0 (method-of-type nav-enemy get-focus!)) (v1-1 (t9-0 this)) ) @@ -1299,7 +1304,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-1 quad)) + (vector-copy! (-> v1-1 target-pos) a0-1) ) 0 (set! (-> self torso-track-player) (the-as joint-mod #t)) @@ -1535,7 +1540,7 @@ :code (behavior () (ja-channel-push! 1 (seconds 0.6)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) - (let ((gp-0 (set-reaction-time! self (seconds 0.2) (seconds 0.7))) + (let ((gp-0 (rnd-time-frame self (seconds 0.2) (seconds 0.7))) (s5-0 (current-time)) (f28-0 f30-0) ) @@ -1564,12 +1569,13 @@ ;; definition for method 85 of type neo-juicer (defmethod knocked-anim ((this neo-juicer) (arg0 enemy-knocked-info)) + "start the knocked animation." (local-vars (a2-2 int)) (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 0) (let* ((a2-0 (ash 1 (-> *neo-juicer-global-info* prev-yellow-hit))) - (v1-3 (enemy-method-131 this 4 a2-0)) + (v1-3 (rnd-int-excluding-masked this 4 a2-0)) (a1-6 (-> this draw art-group data (-> *neo-juicer-global-info* yellow-hit-anim v1-3 anim-index))) ) (set! (-> *neo-juicer-global-info* prev-yellow-hit) v1-3) @@ -1589,7 +1595,7 @@ (set! a2-2 (logior v1-11 7)) ) ) - (let* ((v1-15 (enemy-method-131 this 6 a2-2)) + (let* ((v1-15 (rnd-int-excluding-masked this 6 a2-2)) (s5-1 (-> this draw art-group data (-> *neo-juicer-global-info* blue-hit-anim v1-15 anim-index))) ) (set! (-> *neo-juicer-global-info* prev-blue-hit) v1-15) @@ -1630,6 +1636,7 @@ ;; definition for method 86 of type neo-juicer (defmethod knocked-land-anim ((this neo-juicer) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (cond ((= (-> this incoming knocked-type) (knocked-type blue-shot)) (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) @@ -1688,13 +1695,15 @@ ) ;; definition for method 108 of type neo-juicer -(defmethod enemy-method-108 ((this neo-juicer) (arg0 process-focusable)) +(defmethod should-flee-from? ((this neo-juicer) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (focus-test? arg0 invulnerable) ) ;; definition for method 120 of type neo-juicer ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this neo-juicer)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1804,12 +1813,13 @@ ;; definition for method 121 of type neo-juicer ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this neo-juicer)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-neo-juicer" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *neo-juicer-nav-enemy-info*) + (setup-enemy! this *neo-juicer-nav-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) diff --git a/test/decompiler/reference/jak3/levels/sewer/saberfish-spawner_REF.gc b/test/decompiler/reference/jak3/levels/sewer/saberfish-spawner_REF.gc index 83b3a88a53e..bea8be2f3eb 100644 --- a/test/decompiler/reference/jak3/levels/sewer/saberfish-spawner_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/saberfish-spawner_REF.gc @@ -157,6 +157,7 @@ ;; definition for method 11 of type saberfish-spawner ;; INFO: Used lq/sq (defmethod init-from-entity! ((this saberfish-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (process-entity-set! this arg0) (set! (-> this root) (new 'process 'trsqv)) @@ -523,7 +524,7 @@ (set! sv-56 -1) (set! sv-64 40960000000.0) (let ((v1-4 (new 'stack-no-clear 'vector))) - (set! (-> v1-4 quad) (-> arg0 root trans quad)) + (vector-copy! v1-4 (-> arg0 root trans)) (set! sv-68 v1-4) ) (set! sv-72 (new 'stack-no-clear 'vector)) @@ -639,7 +640,7 @@ ) (logclear! (-> v1-74 flags) (nav-state-flag directional-mode)) (logior! (-> v1-74 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-74 target-pos quad) (-> a0-46 quad)) + (vector-copy! (-> v1-74 target-pos) a0-46) ) 0 ) @@ -748,7 +749,7 @@ (if (= arg1 'saberfish-crawl-out-of-tube) (sound-play "sf-spawner") ) - (set! (-> s4-0 trans quad) (-> this entity extra trans quad)) + (vector-copy! (-> s4-0 trans) (-> this entity extra trans)) (quaternion-copy! (-> s4-0 quat) (-> this entity quat)) (set! (-> s4-0 entity) (-> this entity)) (set! (-> s4-0 directed?) #f) @@ -757,7 +758,7 @@ (set! (-> s4-0 spawn-parent) (process->handle this)) (set! (-> s4-0 message) arg0) (set! (-> s4-0 initial-state) arg1) - (set! (-> s4-0 pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 pos) (-> this root trans)) (quaternion-copy! (-> s4-0 orient) (-> this root quat)) (set! (-> this last-spawned-process) (ppointer->handle (process-spawn saberfish this s4-0 :name "saberfish" :to arg2)) @@ -821,6 +822,7 @@ ;; definition for method 11 of type saberfish-spawn-manager-base ;; INFO: Used lq/sq (defmethod init-from-entity! ((this saberfish-spawn-manager-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set-setting! 'gem-pool-index #f 0.0 2) (set! sv-16 (new 'static 'res-tag)) @@ -1690,7 +1692,3 @@ (sleep-code) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc b/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc index 0d34e4eba3d..1446c97d745 100644 --- a/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/saberfish_REF.gc @@ -426,34 +426,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 61440.0 - :knocked-medium-vxz-hi 61440.0 - :knocked-medium-vy-lo 49152.0 - :knocked-medium-vy-hi 69632.0 - :knocked-hard-vxz-lo 61440.0 - :knocked-hard-vxz-hi 90112.0 - :knocked-hard-vy-lo 49152.0 - :knocked-hard-vy-hi 73728.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 61440.0 - :knocked-yellow-vxz-hi 61440.0 - :knocked-yellow-vy-lo 49152.0 - :knocked-yellow-vy-hi 69632.0 - :knocked-red-vxz-lo 61440.0 - :knocked-red-vxz-hi 90112.0 - :knocked-red-vy-lo 49152.0 - :knocked-red-vy-hi 73728.0 - :knocked-blue-vxz-lo 20480.0 - :knocked-blue-vxz-hi 28672.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 15) + :knocked-medium-vxz-hi (meters 15) + :knocked-medium-vy-lo (meters 12) + :knocked-medium-vy-hi (meters 17) + :knocked-hard-vxz-lo (meters 15) + :knocked-hard-vxz-hi (meters 22) + :knocked-hard-vy-lo (meters 12) + :knocked-hard-vy-hi (meters 18) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 15) + :knocked-yellow-vxz-hi (meters 15) + :knocked-yellow-vy-lo (meters 12) + :knocked-yellow-vy-hi (meters 17) + :knocked-red-vxz-lo (meters 15) + :knocked-red-vxz-hi (meters 22) + :knocked-red-vy-lo (meters 12) + :knocked-red-vy-hi (meters 18) + :knocked-blue-vxz-lo (meters 5) + :knocked-blue-vxz-hi (meters 7) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9983 :y -0.0558 :z 0.0132 :w 27913.42) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -754,6 +754,7 @@ ;; definition for method 120 of type saberfish ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this saberfish)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -854,12 +855,13 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this saberfish)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-saberfish" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *saberfish-nav-enemy-info*) + (setup-enemy! this *saberfish-nav-enemy-info*) (set! (-> this last-attack-time) 0) (set! (-> this scare-start-time) 0) (set! (-> this scare-time) 0) @@ -901,7 +903,7 @@ (set! (-> this scare-time) 0) (set! (-> this desired-dest-mesh-index) (-> this current-nav-mesh-index)) (set! (-> this is-submerged?) #f) - (set! (-> this root trans quad) (-> this pos-start quad)) + (vector-copy! (-> this root trans) (-> this pos-start)) (quaternion-copy! (-> this root quat) (-> this quat-start)) (set! (-> this move-to-ground?) #f) (let ((s5-1 (-> this skel root-channel 0))) @@ -938,7 +940,7 @@ ) ) ) - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable s4-0) 0) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable s4-0) 0)) (set-dest-nav! this (-> this focus-pos) (find-behavior<-in-water? (the-as symbol s5-0))) ) ) @@ -1083,7 +1085,7 @@ (let ((v1-15 (-> self nav state))) (logclear! (-> v1-15 flags) (nav-state-flag directional-mode)) (logior! (-> v1-15 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-15 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-15 target-pos) gp-0) ) ) 0 @@ -1116,7 +1118,7 @@ :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) (if a0-1 - (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable a0-1) 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans (the-as process-focusable a0-1) 0)) ) ) (let ((a1-2 (get-cmd self))) @@ -1476,7 +1478,7 @@ (let ((v1-8 (-> self nav state))) (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-8 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-8 target-pos) gp-0) ) ) 0 @@ -1523,7 +1525,7 @@ (let ((a1-0 (-> self nav state)) (v1-8 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-8 quad) (-> a1-0 target-pos quad)) + (vector-copy! v1-8 (-> a1-0 target-pos)) (let ((gp-0 (new 'stack-no-clear 'vector))) 0.0 (vector-! gp-0 (-> self root trans) v1-8) @@ -1534,7 +1536,7 @@ (let ((v1-13 (-> self nav state))) (logclear! (-> v1-13 flags) (nav-state-flag directional-mode)) (logior! (-> v1-13 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-13 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> v1-13 target-pos) s5-0) ) ) 0 @@ -1549,7 +1551,7 @@ (vector-z-quaternion! (-> self nav-velocity) (-> self root quat)) (set! (-> self nav-velocity y) 0.0) (vector-normalize! (-> self nav-velocity) 1.0) - (set! (-> self nav-dir quad) (-> self nav-velocity quad)) + (vector-copy! (-> self nav-dir) (-> self nav-velocity)) (set! (-> self doing-180-spin?) #f) (set-time! (-> self last-swim-flip-time)) (set! (-> self saberfish-y-rotate) 0.0) @@ -1580,7 +1582,7 @@ (let ((a0-16 (-> self nav state)) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 quad) (-> a0-16 travel quad)) + (vector-copy! s2-0 (-> a0-16 travel)) (let ((s3-0 (new 'stack-no-clear 'quaternion)) (s5-1 (new 'stack-no-clear 'quaternion)) ) @@ -1591,7 +1593,7 @@ (when (not gp-0) (set! gp-0 #t) (let ((a1-10 (new 'stack-no-clear 'vector))) - (set! (-> a1-10 quad) (-> self root trans quad)) + (vector-copy! a1-10 (-> self root trans)) (splash-spawn 0.0 a1-10 1) ) ) @@ -1698,7 +1700,7 @@ (let ((f0-0 (-> this swim-speed))) 0.0 0.0 - (set! (-> v1-3 quad) (-> arg0 quad)) + (vector-copy! v1-3 arg0) (set! (-> v1-3 y) (fmin (-> v1-3 y) (+ -8192.0 (-> this water surface-height)))) (vector-! s5-0 v1-3 (-> this root trans)) (let ((f1-4 (-> s5-0 y)) @@ -1737,7 +1739,7 @@ (let ((a0-0 (-> self nav state)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> a0-0 travel quad)) + (vector-copy! s5-0 (-> a0-0 travel)) (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) (let ((f30-0 (-> self swim-speed))) (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) @@ -1756,7 +1758,7 @@ (#f (set! f26-0 (-> self swim-anim-last-dot)) (set! f28-0 (-> self swim-rotate-last-dot)) - (set! (-> s5-0 quad) (-> gp-0 quad)) + (vector-copy! s5-0 gp-0) ) (else (let ((f0-6 (vector-dot s4-0 s5-0))) @@ -1789,7 +1791,7 @@ (a2-2 (-> self nav state)) (a1-7 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-7 quad) (-> a2-2 target-pos quad)) + (vector-copy! a1-7 (-> a2-2 target-pos)) (< f26-1 (t9-8 a0-15 a1-7)) ) (let ((v1-37 (ja-group))) @@ -1799,7 +1801,7 @@ (set! (-> self swim-travel-anim) -1) ) ((< 0.99999 f28-0) - (set! (-> gp-0 quad) (-> s5-0 quad)) + (vector-copy! gp-0 s5-0) ) (else (let ((s4-1 (new 'stack-no-clear 'vector))) @@ -1818,13 +1820,13 @@ (let ((a0-27 (-> self nav state)) (v1-48 gp-0) ) - (set! (-> a0-27 heading quad) (-> v1-48 quad)) + (vector-copy! (-> a0-27 heading) v1-48) ) 0 - (set! (-> self nav-dir quad) (-> gp-0 quad)) + (vector-copy! (-> self nav-dir) gp-0) (vector-normalize! gp-0 (-> self swim-speed)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> gp-0 quad)) + (vector-copy! s5-1 gp-0) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 24576.0) (saberfish-method-234 self s5-1) @@ -1837,10 +1839,10 @@ (let ((a0-34 (-> self nav state)) (v1-65 gp-0) ) - (set! (-> a0-34 velocity quad) (-> v1-65 quad)) + (vector-copy! (-> a0-34 velocity) v1-65) ) 0 - (set! (-> self nav-velocity quad) (-> gp-0 quad)) + (vector-copy! (-> self nav-velocity) gp-0) ) ) ) @@ -1928,7 +1930,7 @@ (let ((s4-0 #f)) (let ((s3-0 #f)) (when s5-0 - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable s5-0) 3)) (let ((f0-2 (- (vector-dot (-> self root trans) (-> self attack-dir)) (vector-dot gp-0 (-> self attack-dir))))) (if (< -61440.0 f0-2) (set! s3-0 #t) @@ -1947,7 +1949,7 @@ ) (logclear! (-> a0-7 flags) (nav-state-flag directional-mode)) (logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-7 target-pos quad) (-> v1-27 quad)) + (vector-copy! (-> a0-7 target-pos) v1-27) ) 0 (when (or (not (-> self adjusted-y-yet?)) (not s3-0)) @@ -2115,11 +2117,13 @@ ;; definition for method 67 of type saberfish (defmethod coin-flip? ((this saberfish)) + "Return #t half the time, #f the other." #f ) ;; definition for method 108 of type saberfish -(defmethod enemy-method-108 ((this saberfish) (arg0 process-focusable)) +(defmethod should-flee-from? ((this saberfish) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (not (time-elapsed? (-> this scare-start-time) (-> this scare-time))) ) @@ -2137,6 +2141,7 @@ ;; definition for method 92 of type saberfish ;; WARN: Return type mismatch enemy-jump-flags vs none. (defmethod init-jump-info! ((this saberfish) (arg0 enemy-jump-info)) + "Populate an enemy-jump-info for jumping to this enemy's event-param-point" (call-parent-method this arg0) (if (saberfish-method-243 this) (logior! (-> arg0 flags) (enemy-jump-flags ejf0)) @@ -2568,11 +2573,11 @@ (cond ((< sv-256 sv-252) (vector+float*! sv-192 (-> this root trans) sv-244 sv-196) - (set! (-> sv-204 quad) (-> sv-244 quad)) + (vector-copy! sv-204 sv-244) ) (else (vector+float*! sv-192 (-> this root trans) sv-248 sv-196) - (set! (-> sv-204 quad) (-> sv-248 quad)) + (vector-copy! sv-204 sv-248) ) ) (when (< (* sv-196 sv-196) (vector-vector-xz-distance-squared sv-192 (-> this jump-point-start))) @@ -2637,16 +2642,16 @@ (set! sv-256 (vector-dot s0-1 sv-200)) (cond ((< f30-2 40.96) - (set! (-> s2-1 quad) (-> s3-2 quad)) + (vector-copy! s2-1 s3-2) ) ((< f0-28 40.96) - (set! (-> s2-1 quad) (-> s1-1 quad)) + (vector-copy! s2-1 s1-1) ) ((< sv-256 sv-252) - (set! (-> s2-1 quad) (-> s3-2 quad)) + (vector-copy! s2-1 s3-2) ) (else - (set! (-> s2-1 quad) (-> s1-1 quad)) + (vector-copy! s2-1 s1-1) ) ) ) @@ -2679,8 +2684,8 @@ (set! sv-532 (the-as float 0.0)) (set! sv-536 (new 'stack-no-clear 'vector)) (set! sv-540 (new 'stack-no-clear 'vector)) - (set! (-> sv-536 quad) (-> this root trans quad)) - (set! (-> sv-540 quad) (-> s2-1 quad)) + (vector-copy! sv-536 (-> this root trans)) + (vector-copy! sv-540 s2-1) (set! (-> sv-536 y) (-> sv-512 y)) (set! (-> sv-540 y) (-> sv-512 y)) (let ((a1-37 (vector-! (new 'stack-no-clear 'vector) sv-516 sv-512)) @@ -2691,15 +2696,15 @@ (set-vector! v1-76 (- (-> s0-2 z)) 0.0 (-> s0-2 x) 1.0) (set! sv-252 (vector-dot a0-60 a1-37)) (if (< 0.0 sv-252) - (set! (-> sv-520 quad) (-> a0-60 quad)) - (set! (-> sv-520 quad) (-> v1-76 quad)) + (vector-copy! sv-520 a0-60) + (vector-copy! sv-520 v1-76) ) (set-vector! a0-60 (-> s1-2 z) 0.0 (- (-> s1-2 x)) 1.0) (set-vector! v1-76 (- (-> s1-2 z)) 0.0 (-> s1-2 x) 1.0) (set! sv-252 (vector-dot a0-60 a1-37)) (if (< 0.0 sv-252) - (set! (-> sv-524 quad) (-> v1-76 quad)) - (set! (-> sv-524 quad) (-> a0-60 quad)) + (vector-copy! sv-524 v1-76) + (vector-copy! sv-524 a0-60) ) ) ) @@ -2818,7 +2823,7 @@ (set! sv-80 (new 'stack-no-clear 'vector)) (set! sv-84 (the-as float -1.0)) (if arg2 - (set! (-> sv-64 quad) (-> arg3 quad)) + (vector-copy! sv-64 arg3) (vector-! sv-64 (-> this jump-point-start) (-> this jump-point-end)) ) (set! (-> sv-64 y) 0.0) @@ -2842,7 +2847,7 @@ ) (when (< sv-84 f0-7) (set! sv-84 f0-7) - (set! (-> sv-80 quad) (-> arg0 quad)) + (vector-copy! sv-80 arg0) ) ) (if (= (logand s0-0 1) 1) @@ -2851,7 +2856,7 @@ ) (set! sv-76 (+ sv-76 arg1)) ) - (set! (-> arg0 quad) (-> sv-80 quad)) + (vector-copy! arg0 sv-80) (set! (-> arg0 y) (-> this water surface-height)) (return #t) ) @@ -2881,7 +2886,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod set-dest-nav! ((this saberfish) (arg0 vector) (arg1 saberfish-find-behavior)) - (set! (-> this desired-dest-nav-point quad) (-> arg0 quad)) + (vector-copy! (-> this desired-dest-nav-point) arg0) (set! (-> this desired-dest-mesh-index) (get-nav-mesh-idx this arg0 arg1)) (when (= (-> this desired-dest-mesh-index) -1) ) @@ -2918,11 +2923,11 @@ ) (cond ((or (saberfish-method-243 this) (not (logtest? (enemy-flag ef37) (-> this enemy-flags)))) - (set! (-> s5-0 quad) (-> this nav-dir quad)) + (vector-copy! s5-0 (-> this nav-dir)) ) (else (let ((a1-3 (-> this nav state))) - (set! (-> s5-0 quad) (-> a1-3 heading quad)) + (vector-copy! s5-0 (-> a1-3 heading)) ) ) ) @@ -2952,6 +2957,7 @@ ;; definition for method 98 of type saberfish (defmethod jump-wind-up-anim ((this saberfish) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" (when (not (saberfish-method-243 this)) (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump windup-anim))) @@ -2969,6 +2975,7 @@ ;; definition for method 96 of type saberfish (defmethod jump-in-air-anim ((this saberfish) (arg0 enemy-jump-info)) + "Start playing the in-air anim" (ja-channel-push! 1 (seconds 0.1)) (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) (a0-4 (-> this skel root-channel 0)) @@ -2984,6 +2991,7 @@ ;; definition for method 97 of type saberfish (defmethod jump-land-anim ((this saberfish) (arg0 enemy-jump-info)) + "Play the landing anim" (cond ((zero? (-> this jump land-anim)) #f @@ -3007,7 +3015,8 @@ ;; definition for method 93 of type saberfish ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod setup-jump! ((this saberfish) (arg0 enemy-jump-info)) +(defmethod setup-jump-trajectory! ((this saberfish) (arg0 enemy-jump-info)) + "Compute jump trajectory." (let ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)))) (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0)) ) @@ -3026,8 +3035,8 @@ ) ) (let ((s4-0 (new 'stack-no-clear 'traj3d-params))) - (set! (-> s4-0 dest quad) (-> arg0 dest-pos quad)) - (set! (-> s4-0 src quad) (-> arg0 start-pos quad)) + (vector-copy! (-> s4-0 dest) (-> arg0 dest-pos)) + (vector-copy! (-> s4-0 src) (-> arg0 start-pos)) (let ((f30-1 11832.889)) (if (not (saberfish-method-243 this)) (set! f30-1 8192.0) @@ -3039,7 +3048,7 @@ (set! (-> arg0 traj initial-position quad) (-> arg0 start-pos quad)) (set! (-> arg0 traj gravity) -4.551111) (set! (-> arg0 traj time) (-> s4-0 time)) - (set! (-> arg0 traj initial-velocity quad) (-> s4-0 initial-velocity quad)) + (vector-copy! (-> arg0 traj initial-velocity) (-> s4-0 initial-velocity)) ) (none) ) @@ -3066,7 +3075,7 @@ (a2-0 (-> this nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-1 (-> a2-0 target-pos)) (t9-2 a0-3 a1-1 (saberfish-find-behavior none)) ) (if (saberfish-method-228 this) @@ -3081,7 +3090,7 @@ (defmethod nav-enemy-method-166 ((this saberfish) (arg0 vector) (arg1 vector)) (cond (#t - (set! (-> arg0 quad) (-> this flee-point-temp quad)) + (vector-copy! arg0 (-> this flee-point-temp)) #t ) (else @@ -3155,7 +3164,8 @@ ) ;; definition for method 107 of type saberfish -(defmethod is-pfoc-in-mesh? ((this saberfish) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this saberfish) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (if (and arg0 (not arg1)) (set! arg1 (get-trans arg0 1)) ) @@ -3179,6 +3189,7 @@ ;; definition for method 59 of type saberfish ;; INFO: Used lq/sq (defmethod enemy-common-post ((this saberfish)) + "Common implementation of post. Runs ja-post." (if (not (handle->process (-> this spawn-parent))) (go (method-of-object this die)) ) @@ -3186,7 +3197,7 @@ (let ((a1-1 (-> this nav state)) (a0-6 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-6 quad) (-> a1-1 heading quad)) + (vector-copy! a0-6 (-> a1-1 heading)) (set! (-> a0-6 y) 0.0) (vector-normalize! a0-6 1.0) ) @@ -3203,7 +3214,7 @@ (let ((a1-8 (-> this nav state)) (a0-14 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-14 quad) (-> a1-8 travel quad)) + (vector-copy! a0-14 (-> a1-8 travel)) (set! (-> a0-14 y) 0.0) (vector-normalize! a0-14 1.0) ) @@ -3222,10 +3233,10 @@ ;; definition for method 99 of type saberfish ;; INFO: Used lq/sq -(defmethod jump-anim-handler ((this saberfish) (arg0 int) (arg1 enemy-jump-info)) +(defmethod jump-anim-handler ((this saberfish) (arg0 jump-stage) (arg1 enemy-jump-info)) (when (saberfish-method-243 this) (case arg0 - ((5) + (((jump-stage landing)) (compute-alignment! (-> this align)) (align! (-> this align) (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0) (vector-v++! (-> this root trans) (-> this root transv)) @@ -3250,7 +3261,8 @@ ) ;; definition for method 102 of type saberfish -(defmethod go-directed2 ((this saberfish)) +(defmethod go-next-state-auto ((this saberfish)) + "Pick the next state automatically. Will enter directed state if this enemy is directed, or pick based on focus/aware." (if (saberfish-method-243 this) (go (method-of-object this water-land)) (call-parent-method this) @@ -3259,7 +3271,8 @@ ;; definition for method 50 of type saberfish ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this saberfish) (arg0 int)) +(defmethod update-collision-action ((this saberfish) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -3351,7 +3364,7 @@ ) (change-nav-mesh self) (water-control-method-10 (-> self water)) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -3360,13 +3373,15 @@ ;; definition for method 81 of type saberfish (defmethod go-die ((this saberfish)) + "Go to the die state." (sound-play "sabfish-death") (send-event (handle->process (-> this spawn-parent)) 'child-die) (call-parent-method this) ) ;; definition for method 20 of type saberfish -(defmethod process-mask->search-info-flag ((this saberfish)) +(defmethod get-search-info-flag ((this saberfish)) + "Get search-info-flag for this process." (let ((v0-1 (call-parent-method this))) (if (-> this is-submerged?) (set! v0-1 (logior v0-1 (search-info-flag abort))) @@ -3393,7 +3408,7 @@ :trans (behavior () (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (cond - ((= (-> self focus aware) (enemy-aware ea1)) + ((= (-> self focus aware) (enemy-aware aware1)) (go-virtual active) ) ((< 1 (the-as int (-> self focus aware))) @@ -3548,7 +3563,8 @@ ) ;; definition for method 122 of type saberfish -(defmethod go-idle2 ((this saberfish)) +(defmethod go-fallback-init ((this saberfish)) + "If there's no specific settings for initial state, go to this state after spawning." (case (-> this initial-state) (('saberfish-crawl-out-of-tube) (go (method-of-object this saberfish-crawl-out-of-tube)) @@ -3568,13 +3584,14 @@ ;; definition for method 11 of type saberfish ;; INFO: Used lq/sq (defmethod init-from-entity! ((this saberfish) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this ground-only?) #t) (set! (-> this spawn-parent) (process->handle this)) (set! (-> *saberfish-nav-enemy-info* nav-mesh) (find-nearest-nav-mesh (-> arg0 extra trans) (the-as float #x7f800000)) ) (set! (-> this initial-state) 'idle) - (set! (-> this pos-start quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this pos-start) (-> arg0 extra trans)) (quaternion-copy! (-> this quat-start) (-> arg0 quat)) (call-parent-method this arg0) ) @@ -3582,7 +3599,7 @@ ;; definition for function saberfish-init-by-other ;; INFO: Used lq/sq (defbehavior saberfish-init-by-other saberfish ((arg0 process-drawable) (arg1 saberfish-init-by-other-params)) - (set! (-> self pos-start quad) (-> arg1 pos quad)) + (vector-copy! (-> self pos-start) (-> arg1 pos)) (quaternion-copy! (-> self quat-start) (-> arg1 orient)) (set! (-> self spawn-parent) (-> arg1 spawn-parent)) (set! (-> self initial-state) (-> arg1 initial-state)) @@ -3614,6 +3631,7 @@ ;; definition for method 151 of type saberfish (defmethod should-move-to-ground? ((this saberfish)) + "Should this enemy be moved to the ground while moving?" (-> this move-to-ground?) ) @@ -3623,11 +3641,11 @@ (defmethod copy-nav-state-vel! ((this saberfish) (arg0 vector)) (cond ((saberfish-method-243 this) - (set! (-> arg0 quad) (-> this nav-velocity quad)) + (vector-copy! arg0 (-> this nav-velocity)) ) (else (let ((a0-2 (-> this nav state))) - (set! (-> arg0 quad) (-> a0-2 velocity quad)) + (vector-copy! arg0 (-> a0-2 velocity)) ) ) ) @@ -3636,6 +3654,7 @@ ;; definition for method 79 of type saberfish (defmethod go-flee ((this saberfish)) + "Go to the flee state, running away." (go (method-of-object this flee)) ) @@ -3646,7 +3665,7 @@ (when s5-0 (disable-for-duration (the-as ragdoll-proc s5-0) arg0) (logclear! (-> (the-as ragdoll-proc s5-0) ragdoll ragdoll-flags) (ragdoll-flag rf9)) - (enemy-method-90 this (the-as ragdoll-proc s5-0)) + (copy-ragdoll-orientation-to-root this (the-as ragdoll-proc s5-0)) ) ) 0 @@ -3671,6 +3690,7 @@ ;; definition for method 125 of type saberfish ;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this saberfish)) + "Has the ragdoll stopped moving?" (let* ((s5-0 (handle->process (-> this ragdoll-proc))) (v0-0 (or (not s5-0) @@ -3697,7 +3717,8 @@ ) ;; definition for method 89 of type saberfish -(defmethod within-gspot-range? ((this saberfish)) +(defmethod invalid-height? ((this saberfish)) + "Return #t if the enemy is too high in the air, or below the ground." (if (-> this knocked-under-water?) #f (call-parent-method this) @@ -3836,6 +3857,7 @@ ;; definition for method 82 of type saberfish (defmethod event-handler ((this saberfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('saberfish-query) (let ((s5-1 (the-as saberfish-spawner-query-msg (-> arg3 param 0)))) diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc index 95b2b2c2f54..faa69ccf4f3 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-laser-guard_REF.gc @@ -381,34 +381,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -427,7 +427,7 @@ ;; INFO: Used lq/sq (defun fire-laser! ((arg0 vector) (arg1 vector) (arg2 sew-laser-guard) (arg3 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 start-pos) arg0) (vector-float*! (-> s5-0 move-dist) arg1 arg3) (let ((v1-3 s5-0)) (set! (-> v1-3 radius) 40.96) @@ -469,7 +469,7 @@ (set! (-> s3-1 attack-id) a0-17) ) (set! (-> s3-1 timeout) (seconds 4)) - (set! (-> s3-1 pos quad) (-> s5-0 start-pos quad)) + (vector-copy! (-> s3-1 pos) (-> s5-0 start-pos)) (vector-normalize-copy! (-> s3-1 vel) (-> s5-0 move-dist) 4096000.0) (spawn-projectile sew-laser-shot s3-1 arg2 *default-dead-pool*) ) @@ -593,12 +593,14 @@ ;; definition for method 20 of type sew-laser-guard ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this sew-laser-guard)) +(defmethod get-search-info-flag ((this sew-laser-guard)) + "Get search-info-flag for this process." (the-as search-info-flag 1) ) ;; definition for method 82 of type sew-laser-guard (defmethod event-handler ((this sew-laser-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('start) #f @@ -652,7 +654,7 @@ (cleanup-for-death self) (ja-channel-set! 0) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (+! (-> gp-1 y) 10240.0) (suspend-for (seconds 2) (spawn (-> self part) gp-1) @@ -673,6 +675,7 @@ ;; definition for method 120 of type sew-laser-guard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this sew-laser-guard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -715,6 +718,7 @@ ;; definition for method 67 of type sew-laser-guard (defmethod coin-flip? ((this sew-laser-guard)) + "Return #t half the time, #f the other." #f ) @@ -734,12 +738,13 @@ ;; definition for method 121 of type sew-laser-guard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this sew-laser-guard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-guard" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *sew-laser-guard-enemy-info*) + (setup-enemy! this *sew-laser-guard-enemy-info*) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1505) this)) @@ -775,12 +780,14 @@ ) ;; definition for method 122 of type sew-laser-guard -(defmethod go-idle2 ((this sew-laser-guard)) +(defmethod go-fallback-init ((this sew-laser-guard)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this hostile)) ) ;; definition for method 52 of type sew-laser-guard -(defmethod damage-enemy! ((this sew-laser-guard) (arg0 object) (arg1 event-message-block)) +(defmethod damage-enemy-from-attack! ((this sew-laser-guard) (arg0 object) (arg1 event-message-block)) + "Given an attack message, apply damage." (send-event (the-as process-tree arg0) 'shove diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc index 9dd6d9acbe7..353315047d6 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc @@ -535,34 +535,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -585,7 +585,7 @@ (new 'stack-no-clear 'vector) (let ((a1-3 (new 'stack-no-clear 'vector))) (-> a0-2 y) - (set! (-> a1-3 quad) (-> this node-list data arg1 bone transform fvec quad)) + (vector-copy! a1-3 (-> this node-list data arg1 bone transform fvec)) (set! (-> a1-3 y) (/ (-> a1-3 y) 2)) (fire-laser! a0-2 a1-3 (the-as sew-laser-guard this) 491520.0) ) @@ -632,7 +632,7 @@ ;; INFO: Used lq/sq (defmethod check-suitable-focus ((this sew-laser-turret)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (set! (-> s5-0 w) (-> this awareness-radius)) (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) (countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-0 s4-0 384)) @@ -799,9 +799,9 @@ ;; WARN: Return type mismatch uint vs none. (defmethod generate-prim-verts! ((this sew-laser-turret) (arg0 float) (arg1 float)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> *x-vector* quad)) + (vector-copy! s3-0 *x-vector*) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *z-vector* quad)) + (vector-copy! s5-0 *z-vector*) (let ((s4-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'rgbaf)) ) @@ -835,13 +835,13 @@ (vector+! s4-0 s4-0 s5-0) (dotimes (v1-39 3) (let ((a0-21 (-> this strip data (-> this strip num-verts)))) - (set! (-> a0-21 pos quad) (-> s4-0 quad)) + (vector-copy! (-> a0-21 pos) s4-0) (set! (-> a0-21 stq z) (the-as float #x1)) ) (+! (-> this strip num-verts) 1) ) (let ((v1-46 (-> this strip data (-> this strip num-verts)))) - (set! (-> v1-46 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-46 pos) s4-0) (set! (-> v1-46 stq z) 0.0) (set! (-> v1-46 stq x) 0.0) (set! (-> v1-46 stq y) 0.0) @@ -850,7 +850,7 @@ (let ((v1-47 (&+ v1-46 32))) (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) (vector+! s4-0 s4-0 s5-0) - (set! (-> v1-47 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-47 pos) s4-0) (set! (-> v1-47 stq z) 0.0) (set! (-> v1-47 stq x) 1.0) (set! (-> v1-47 stq y) 0.0) @@ -859,7 +859,7 @@ (let ((v1-48 (&+ v1-47 32))) (vector+! s4-0 (-> this root trans) s3-0) (vector+float*! s4-0 s4-0 s5-0 -1.0) - (set! (-> v1-48 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-48 pos) s4-0) (set! (-> v1-48 stq z) 0.0) (set! (-> v1-48 stq x) 0.0) (set! (-> v1-48 stq y) 1.0) @@ -868,7 +868,7 @@ (let ((v1-49 (&+ v1-48 32))) (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) (vector+float*! s4-0 s4-0 s5-0 -1.0) - (set! (-> v1-49 pos quad) (-> s4-0 quad)) + (vector-copy! (-> v1-49 pos) s4-0) (set! (-> v1-49 stq z) 0.0) (set! (-> v1-49 stq x) 1.0) (set! (-> v1-49 stq y) 1.0) @@ -923,7 +923,7 @@ ) (setup-dma-and-tex (-> self strip) (-> self draw)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (set! (-> gp-0 w) (-> self awareness-radius)) (let* ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384)) (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-0 384)) @@ -1081,6 +1081,7 @@ ;; definition for method 82 of type sew-laser-turret (defmethod event-handler ((this sew-laser-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('start) (let ((v0-0 (the-as object #t))) @@ -1136,7 +1137,7 @@ ) 0 (set! (-> self hit-points) 0.0) - (play-communicator-speech! (-> *talker-speech* 49)) + (mark-played! (-> *talker-speech* 49)) ) :code (behavior () (new 'stack 'joint-exploder-tuning (the-as uint 0)) @@ -1146,7 +1147,7 @@ (cleanup-for-death self) (ja-channel-set! 0) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> self root trans quad)) + (vector-copy! gp-1 (-> self root trans)) (+! (-> gp-1 y) 10240.0) (suspend-for (seconds 2) (spawn (-> self part) gp-1) @@ -1167,6 +1168,7 @@ ;; definition for method 120 of type sew-laser-turret ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this sew-laser-turret)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1229,6 +1231,7 @@ ;; definition for method 67 of type sew-laser-turret (defmethod coin-flip? ((this sew-laser-turret)) + "Return #t half the time, #f the other." #f ) @@ -1257,12 +1260,13 @@ ;; definition for method 121 of type sew-laser-turret ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this sew-laser-turret)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-turret" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *sew-laser-turret-enemy-info*) + (setup-enemy! this *sew-laser-turret-enemy-info*) (logclear! (-> this mask) (process-mask actor-pause)) (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1518) this)) @@ -1289,12 +1293,14 @@ ) ;; definition for method 122 of type sew-laser-turret -(defmethod go-idle2 ((this sew-laser-turret)) +(defmethod go-fallback-init ((this sew-laser-turret)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this alert)) ) ;; definition for method 78 of type sew-laser-turret (defmethod go-hostile ((this sew-laser-turret)) + "Go to the hostile state, actively trying to attack the target." (cond ((and (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) (or (= v1-3 'spinning-up) (= v1-3 'hostile)) diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc index 8e18111d041..4a7fb33e294 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-platforms_REF.gc @@ -71,6 +71,7 @@ ;; definition for method 11 of type sew-plat-updown (defmethod init-from-entity! ((this sew-plat-updown) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -264,7 +265,7 @@ (quaternion-copy! s5-0 (-> self entity quat)) (quaternion->matrix gp-0 s5-0) ) - (set! (-> gp-0 trans quad) (-> self entity extra trans quad)) + (vector-copy! (-> gp-0 trans) (-> self entity extra trans)) (+! (-> gp-0 trans y) 20480.0) (spawn-from-mat (-> self part) gp-0) ) @@ -363,6 +364,7 @@ ;; definition for method 11 of type sew-moving-step-b ;; INFO: Used lq/sq (defmethod init-from-entity! ((this sew-moving-step-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (alloc-trsqv! this) (process-drawable-from-entity! this arg0) (set! (-> this sound-idle) (new-sound-id)) @@ -403,8 +405,8 @@ (vector-! s4-0 s4-0 s3-1) (vector-! s5-3 s5-3 s3-1) ) - (set! (-> this start-step-pos quad) (-> s4-0 quad)) - (set! (-> this end-step-pos quad) (-> s5-3 quad)) + (vector-copy! (-> this start-step-pos) s4-0) + (vector-copy! (-> this end-step-pos) s5-3) ) (go (method-of-object this active)) ) @@ -519,9 +521,9 @@ (defbehavior sew-moving-step-b-step-init-by-other sew-moving-step-b-step ((arg0 sew-moving-step-b-step-param)) (process-entity-set! self (-> arg0 ent)) (init-collision! self) - (set! (-> self root trans quad) (-> arg0 start-pos quad)) - (set! (-> self start-pos quad) (-> arg0 start-pos quad)) - (set! (-> self end-pos quad) (-> arg0 end-pos quad)) + (vector-copy! (-> self root trans) (-> arg0 start-pos)) + (vector-copy! (-> self start-pos) (-> arg0 start-pos)) + (vector-copy! (-> self end-pos) (-> arg0 end-pos)) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-moving-step-b" (the-as (pointer level) #f))) @@ -560,8 +562,8 @@ ;; WARN: Return type mismatch process vs sew-moving-step-b-step. (defun spawn-moving-step-b-step ((arg0 sew-moving-step-b) (arg1 float)) (let ((gp-0 (new 'stack-no-clear 'sew-moving-step-b-step-param))) - (set! (-> gp-0 start-pos quad) (-> arg0 start-step-pos quad)) - (set! (-> gp-0 end-pos quad) (-> arg0 end-step-pos quad)) + (vector-copy! (-> gp-0 start-pos) (-> arg0 start-step-pos)) + (vector-copy! (-> gp-0 end-pos) (-> arg0 end-step-pos)) (set! (-> gp-0 ent) (-> arg0 entity)) (set! (-> gp-0 period) (the-as time-frame (-> arg0 sync period))) (set! (-> gp-0 offset) arg1) @@ -847,7 +849,7 @@ (plat-event proc argc message block) ) :enter (behavior () - (set! (-> self basetrans quad) (-> self positions (-> self current-pos-index) quad)) + (vector-copy! (-> self basetrans) (-> self positions (-> self current-pos-index))) ) :trans (behavior () (plat-trans) @@ -911,7 +913,7 @@ ) (else (vector+float*! (-> self basetrans) (-> self basetrans) gp-2 f1-2) - (set! (-> self root trans quad) (-> self basetrans quad)) + (vector-copy! (-> self root trans) (-> self basetrans)) ) ) ) @@ -951,6 +953,7 @@ ;; definition for method 11 of type sew-move-plat ;; INFO: Used lq/sq (defmethod init-from-entity! ((this sew-move-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -979,7 +982,7 @@ (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (get-point-at-percent-along-path! (-> this path) (the-as vector (-> this positions)) 0.0 'interp) (get-point-at-percent-along-path! (-> this path) (-> this positions 1) 1.0 'interp) - (set! (-> this basetrans quad) (-> this root trans quad)) + (vector-copy! (-> this basetrans) (-> this root trans)) (set! (-> this current-pos-index) (sew-move-plat-method-37 this)) (logclear! (-> this mask) (process-mask actor-pause)) (go (method-of-object this waiting)) diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc index 47e2eff5d9e..68fa5a3c2b0 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sew-whirlpool_REF.gc @@ -110,6 +110,7 @@ ;; definition for method 11 of type sew-whirlpool (defmethod init-from-entity! ((this sew-whirlpool) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this spool-sound-id) diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-frog_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-frog_REF.gc index 523003521c0..ffdfbc7232b 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-frog_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-frog_REF.gc @@ -165,34 +165,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 364.0889 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.0676 :y -0.6016 :z 0.7959 :w 30666.041) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -510,6 +510,7 @@ ;; definition for method 120 of type sewer-frog ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this sewer-frog)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -586,7 +587,7 @@ (let ((a1-0 (-> self nav state)) (a0-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-0 quad) (-> a1-0 target-pos quad)) + (vector-copy! a0-0 (-> a1-0 target-pos)) (let* ((f0-0 (vector-vector-xz-distance a0-0 (-> self root trans))) (gp-0 (-> self enemy-info)) (f30-0 (lerp-scale 0.0 1.0 f0-0 12288.0 28672.0)) @@ -760,7 +761,7 @@ (a1-0 (-> self nav state)) (a0-3 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-3 quad) (-> a1-0 target-pos quad)) + (vector-copy! a0-3 (-> a1-0 target-pos)) (t9-3 a0-3) ) ((-> (method-of-type nav-enemy active) trans)) @@ -806,7 +807,7 @@ ) ) (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) - (not (enemy-method-104 self (-> self focus-pos) 10012.444)) + (not (pointing-toward? self (-> self focus-pos) 10012.444)) ) (go-virtual turn-to-face-focus) ) @@ -847,7 +848,7 @@ (a1-3 (-> self nav state)) (a0-4 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-4 quad) (-> a1-3 target-pos quad)) + (vector-copy! a0-4 (-> a1-3 target-pos)) (t9-4 a0-4) ) (sewer-frog-method-192 self) @@ -924,7 +925,7 @@ (ja :num! (seek!)) ) (set! (-> self scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 3.8 5.6))))) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-chase-post ) @@ -934,9 +935,9 @@ ;; WARN: Return type mismatch object vs none. (defbehavior sewer-frog-check-hop sewer-frog () (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> self move-dest quad)) + (vector-copy! a1-0 (-> self move-dest)) (set! (-> a1-0 w) (-> self nav-radius-backup)) - (if (add-root-sphere-to-hash! (-> self nav) a1-0 #x100068) + (if (check-sphere-blocked! (-> self nav) a1-0 #x100068) (go-virtual stare) ) ) @@ -968,7 +969,7 @@ (a1-3 (-> self nav state)) (a0-4 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-4 quad) (-> a1-3 target-pos quad)) + (vector-copy! a0-4 (-> a1-3 target-pos)) (t9-5 a0-4) ) ((-> (method-of-type nav-enemy flee) trans)) @@ -1011,7 +1012,7 @@ vector (when (and a0-2 (nav-enemy-method-166 this s5-0 (get-trans (the-as process-focusable a0-2) 0))) (set! (-> s5-0 w) (-> this nav-radius-backup)) - (not (add-root-sphere-to-hash! (-> this nav) s5-0 #x100068)) + (not (check-sphere-blocked! (-> this nav) s5-0 #x100068)) ) ) ) @@ -1019,7 +1020,7 @@ ;; definition for method 76 of type sewer-frog (defmethod go-stare2 ((this sewer-frog)) - (if (not (enemy-method-104 this (-> this focus-pos) 6371.5557)) + (if (not (pointing-toward? this (-> this focus-pos) 6371.5557)) (go (method-of-object this turn-to-face-focus)) (go (method-of-object this stare)) ) @@ -1045,7 +1046,9 @@ ) ;; definition for method 125 of type sewer-frog +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this sewer-frog)) + "Has the ragdoll stopped moving?" (let ((a0-2 (handle->process (-> this ragdoll-proc)))) (or (not a0-2) (ragdoll-proc-method-19 (the-as ragdoll-proc a0-2)) @@ -1056,7 +1059,8 @@ ;; definition for method 108 of type sewer-frog ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod enemy-method-108 ((this sewer-frog) (arg0 process-focusable)) +(defmethod should-flee-from? ((this sewer-frog) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (< (current-time) (-> this scared-timer)) (let ((v1-4 (handle->process (-> this focus handle)))) (if v1-4 @@ -1071,6 +1075,7 @@ ;; definition for method 146 of type sewer-frog (defmethod play-damage-sound ((this sewer-frog) (arg0 int)) + "Pick and play the damage/death sound." (case arg0 ((2) (if (and (-> this next-state) (= (-> this next-state name) 'knocked)) @@ -1087,10 +1092,11 @@ ;; definition for method 59 of type sewer-frog ;; INFO: Used lq/sq (defmethod enemy-common-post ((this sewer-frog)) + "Common implementation of post. Runs ja-post." (when (< 1 (the-as int (-> this focus aware))) (let ((a0-3 (handle->process (-> this focus handle)))) (if a0-3 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-3) 3) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-3) 3)) ) ) ) @@ -1101,6 +1107,7 @@ ;; definition for method 82 of type sewer-frog (defmethod event-handler ((this sewer-frog) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1112,7 +1119,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1130,12 +1137,13 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this sewer-frog)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sewer-frog" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *sewer-frog-nav-enemy-info*) + (setup-enemy! this *sewer-frog-nav-enemy-info*) (set! (-> this water) (new 'process 'water-control this 0 4096.0 8192.0 2048.0)) (set! (-> this water flags) (water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc index 36cd8bc05a0..dadc3a463ba 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-move-turret_REF.gc @@ -124,7 +124,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod sew-move-turret-method-22 ((this sew-move-turret) (arg0 int)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this node-list data arg0 bone transform fvec quad)) + (vector-copy! s5-0 (-> this node-list data arg0 bone transform fvec)) (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0)))) (let ((f0-0 (ja-frame-num 0))) (cond @@ -172,6 +172,7 @@ ;; definition for method 11 of type sew-move-turret (defmethod init-from-entity! ((this sew-move-turret) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -475,28 +476,28 @@ (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> gp-0 quad) (-> s4-0 trans quad)) + (vector-copy! gp-0 (-> s4-0 trans)) (vector+! gp-0 gp-0 v1-1) (cond ((-> this hit-actor?) (sound-play "bullet-hit-jak") (cond ((logtest? (-> *part-group-id-table* 1506 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1506)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1506)) ) ) ) ((begin (sound-play "bullet-ricco") (logtest? (-> *part-group-id-table* 1507 flags) (sp-group-flag sp13))) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1507)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1507)) ) ) @@ -528,8 +529,8 @@ ) (set! (-> gp-0 timeout) (seconds 4)) (if arg4 - (set! (-> gp-0 pos quad) (-> arg4 quad)) - (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-copy! (-> gp-0 pos) arg4) + (vector-copy! (-> gp-0 pos) arg1) ) (vector-normalize-copy! (-> gp-0 vel) v1-1 40960.0) ) diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc index 000b148d198..eac1d1b0f62 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-obs2_REF.gc @@ -40,7 +40,7 @@ (let ((s4-0 (new 'stack-no-clear 'collide-query)) (f30-0 47104.0) ) - (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 start-pos) arg0) (vector-normalize-copy! (-> s4-0 move-dist) arg1 f30-0) (let ((v1-2 s4-0)) (set! (-> v1-2 radius) 40.96) @@ -81,7 +81,7 @@ (set! (-> s2-1 attack-id) a0-17) ) (set! (-> s2-1 timeout) (seconds 4)) - (set! (-> s2-1 pos quad) (-> s4-0 start-pos quad)) + (vector-copy! (-> s2-1 pos) (-> s4-0 start-pos)) (vector-normalize-copy! (-> s2-1 vel) (-> s4-0 move-dist) 491520.0) (sound-play "laser-hit-jak") (spawn-projectile sew-laser-shot s2-1 arg2 *default-dead-pool*) @@ -140,6 +140,7 @@ ;; definition for method 11 of type sew-laser-beam (defmethod init-from-entity! ((this sew-laser-beam) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -294,6 +295,7 @@ ;; definition for method 11 of type sew-m-gate ;; INFO: Used lq/sq (defmethod init-from-entity! ((this sew-m-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -465,6 +467,7 @@ ;; definition for method 11 of type sew-pipe ;; INFO: Used lq/sq (defmethod init-from-entity! ((this sew-pipe) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -613,6 +616,7 @@ ;; definition for method 11 of type sew-grate-plat ;; INFO: Used lq/sq (defmethod init-from-entity! ((this sew-grate-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -636,7 +640,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-grate-plat" (the-as (pointer level) #f))) (the-as pair 0) ) - (set! (-> this test-pos quad) (-> this root trans quad)) + (vector-copy! (-> this test-pos) (-> this root trans)) (+! (-> this test-pos x) -40960.0) (set! (-> this closed-x) (-> this root trans x)) (set! (-> this opened-x) (+ -32768.0 (-> this root trans x))) diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc index 49496114c15..1d48c271f9d 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc @@ -104,6 +104,7 @@ ;; definition for method 11 of type sew-curved-door (defmethod init-from-entity! ((this sew-curved-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) @@ -390,6 +391,7 @@ ;; definition for method 11 of type sew-floor-switch (defmethod init-from-entity! ((this sew-floor-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -622,34 +624,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 1) :shadow-max-y (meters 1) @@ -828,7 +830,7 @@ (let ((v1-46 (vector-z-quaternion! gp-4 (-> self base-quat)))) (vector-float*! v1-46 v1-46 (* 4096.0 (* 30.0 f30-4))) (let ((t1-1 (new 'static 'vector))) - (set! (-> t1-1 quad) (-> v1-46 quad)) + (vector-copy! t1-1 v1-46) (set-setting! 'global-wind #f 0.0 t1-1) ) ) @@ -855,7 +857,7 @@ (defstate notice (sew-fan) :virtual #t :code (behavior () - (go-best-state self) + (go-state-for-focused self) ) ) @@ -939,6 +941,7 @@ ;; definition for method 82 of type sew-fan (defmethod event-handler ((this sew-fan) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('touched) (send-event arg0 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) @@ -1026,16 +1029,18 @@ ;; definition for method 67 of type sew-fan (defmethod coin-flip? ((this sew-fan)) + "Return #t half the time, #f the other." #f ) ;; definition for method 103 of type sew-fan ;; INFO: Used lq/sq -(defmethod enemy-method-103 ((this sew-fan) (arg0 vector) (arg1 float)) +(defmethod heading-matches-direction? ((this sew-fan) (arg0 vector) (arg1 float)) + "Does this enemy's heading match the given heading? Threshold in degrees." (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this base-quat))) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) (set! (-> s5-0 y) 0.0) @@ -1045,7 +1050,8 @@ ) ;; definition for method 107 of type sew-fan -(defmethod is-pfoc-in-mesh? ((this sew-fan) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this sew-fan) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." (local-vars (v0-0 symbol)) (cond ((= (-> this activate-distance) 0.0) @@ -1060,7 +1066,7 @@ (if (and *target* (focus-test? *target* edge-grab)) (return #f) ) - (return (enemy-method-103 this s5-1 5461.3335)) + (return (heading-matches-direction? this s5-1 5461.3335)) v0-0 ) ) @@ -1071,6 +1077,7 @@ ;; definition for method 120 of type sew-fan ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this sew-fan)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1140,12 +1147,13 @@ ;; definition for method 121 of type sew-fan ;; WARN: Return type mismatch sound-id vs none. (defmethod init-enemy! ((this sew-fan)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-fan" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *sew-fan-enemy-info*) + (setup-enemy! this *sew-fan-enemy-info*) (set! (-> this activate-distance) (res-lump-float (-> this entity) 'distance :default 122880.0)) (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) (when (logtest? (-> this path flags) (path-control-flag not-found)) @@ -1190,12 +1198,14 @@ ;; definition for method 11 of type sew-fan (defmethod init-from-entity! ((this sew-fan) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) ((method-of-type enemy init-from-entity!) this arg0) ) ;; definition for method 122 of type sew-fan -(defmethod go-idle2 ((this sew-fan)) +(defmethod go-fallback-init ((this sew-fan)) + "If there's no specific settings for initial state, go to this state after spawning." (go (method-of-object this idle)) ) @@ -1277,6 +1287,7 @@ ;; definition for method 11 of type sew-elevator (defmethod init-from-entity! ((this sew-elevator) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1375,6 +1386,7 @@ ;; definition for method 11 of type sew-gate (defmethod init-from-entity! ((this sew-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) @@ -1596,6 +1608,7 @@ ;; definition for method 11 of type sew-wall-switch ;; INFO: Used lq/sq (defmethod init-from-entity! ((this sew-wall-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) @@ -1668,6 +1681,7 @@ ;; definition for method 11 of type sew-fence-gate (defmethod init-from-entity! ((this sew-fence-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) @@ -1914,6 +1928,7 @@ ;; definition for method 11 of type sew-vent (defmethod init-from-entity! ((this sew-vent) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let* ((v1-1 *game-info*) @@ -2008,7 +2023,7 @@ (want-levels *load-state* a1-2) ) (want-display-level *load-state* 'ctyinda 'display) - (while (!= (status-of-level-and-borrows *level* 'ctyinda #f) 'active) + (while (!= (level-status? *level* 'ctyinda #f) 'active) (suspend) ) (let ((gp-2 (add-process *gui-control* self (gui-channel background) (gui-action queue) "pwrdown" -99.0 0))) @@ -2053,6 +2068,7 @@ ;; definition for method 11 of type sew-power-switch (defmethod init-from-entity! ((this sew-power-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 512) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -2109,6 +2125,7 @@ ;; definition for method 11 of type sew-gas-step (defmethod init-from-entity! ((this sew-gas-step) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-part_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-part_REF.gc index 88006ba2ee5..bc87ddaa5a3 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-part_REF.gc @@ -2036,7 +2036,7 @@ (set! (-> a0-1 y) (-> arg2 launchrot y)) (set! (-> a0-1 z) (-> arg2 launchrot z)) (set! (-> a0-1 w) 1.0) - (set! (-> v1-6 quad) (-> a0-1 quad)) + (vector-copy! v1-6 a0-1) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1503)) ) @@ -2048,7 +2048,7 @@ (set! (-> a0-6 y) (-> arg2 launchrot y)) (set! (-> a0-6 z) (-> arg2 launchrot z)) (set! (-> a0-6 w) 1.0) - (set! (-> v1-19 quad) (-> a0-6 quad)) + (vector-copy! v1-19 a0-6) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1503)) ) @@ -2165,7 +2165,3 @@ (defpart 4934 :init-specs ((:fade-a -0.032 -0.032)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc b/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc index bda1e864aef..1b23944773a 100644 --- a/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/dm-mine-spider_REF.gc @@ -614,34 +614,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 275251.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 67.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -688,6 +688,7 @@ ;; definition for method 82 of type dm-mine-spider ;; INFO: Used lq/sq (defmethod event-handler ((this dm-mine-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('touched) (let* ((s3-0 arg0) @@ -701,7 +702,7 @@ (a1-3 (new 'stack 'collide-query)) ) 0.0 - (set! (-> a1-3 start-pos quad) (-> this root root-prim prim-core world-sphere quad)) + (vector-copy! (-> a1-3 start-pos) (-> this root root-prim prim-core world-sphere)) (vector-! (-> a1-3 move-dist) (the-as vector (-> (the-as collide-shape s3-1) root-prim prim-core)) @@ -716,7 +717,7 @@ (set! (-> v1-6 action-mask) (collide-action solid)) ) (if (< (fill-and-probe-using-line-sphere *collide-cache* a1-3) 0.0) - (send-attack this arg0 (the-as touching-shapes-entry (-> arg3 param 0)) (-> this attack-id)) + (send-attack-from-tshape this arg0 (the-as touching-shapes-entry (-> arg3 param 0)) (-> this attack-id)) ) ) ) @@ -726,11 +727,11 @@ (sound-play "mnspider-blow") (cond ((logtest? (-> *part-group-id-table* 1029 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) ) @@ -744,9 +745,10 @@ ;; definition for method 20 of type dm-mine-spider ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this dm-mine-spider)) +(defmethod get-search-info-flag ((this dm-mine-spider)) + "Get search-info-flag for this process." (the-as search-info-flag (if (-> this trackable?) - (the-as int ((method-of-type nav-enemy process-mask->search-info-flag) this)) + (the-as int ((method-of-type nav-enemy get-search-info-flag) this)) 0 ) ) @@ -761,7 +763,7 @@ (a3-0 (-> arg0 state)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a2-0 quad) (-> a3-0 heading quad)) + (vector-copy! a2-0 (-> a3-0 heading)) (t9-0 this v1-1 a2-0) ) 0 @@ -798,7 +800,7 @@ (cond ((logtest? (enemy-flag ef39) (-> this enemy-flags)) (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag ef39)))) - (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (vector-copy! (-> this root gspot-pos) (-> this root trans)) ) (else (normalize-heading! this (-> this nav)) @@ -838,7 +840,7 @@ ) (let ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a1-4 (-> this nav state))) - (set! (-> s5-1 quad) (-> a1-4 target-pos quad)) + (vector-copy! s5-1 (-> a1-4 target-pos)) ) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) @@ -879,7 +881,7 @@ (let ((v1-32 (-> this nav state))) (logclear! (-> v1-32 flags) (nav-state-flag directional-mode)) (logior! (-> v1-32 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-32 target-pos quad) (-> s5-1 quad)) + (vector-copy! (-> v1-32 target-pos) s5-1) ) ) 0 @@ -893,6 +895,7 @@ ;; definition for method 59 of type dm-mine-spider ;; WARN: Return type mismatch float vs none. (defmethod enemy-common-post ((this dm-mine-spider)) + "Common implementation of post. Runs ja-post." (let ((t9-0 (method-of-type nav-enemy enemy-common-post))) (t9-0 this) ) @@ -909,7 +912,7 @@ ) (logclear! (-> v1-1 flags) (nav-state-flag directional-mode)) (logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-1 target-pos quad) (-> a0-2 quad)) + (vector-copy! (-> v1-1 target-pos) a0-2) ) 0 (none) @@ -960,11 +963,11 @@ (sound-play "mnspider-blow") (cond ((logtest? (-> *part-group-id-table* 1029 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) ) @@ -1065,7 +1068,7 @@ (t0-0 (-> self nav state)) (a3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a3-0 quad) (-> t0-0 target-pos quad)) + (vector-copy! a3-0 (-> t0-0 target-pos)) (t9-0 a0-0 (the-as bucket-id a1-0) @@ -1139,7 +1142,7 @@ (ja :num! (seek!)) ) (let ((gp-2 (new 'stack-no-clear 'vector))) - (set! (-> gp-2 quad) (-> self root trans quad)) + (vector-copy! gp-2 (-> self root trans)) (let ((s5-2 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) 14745.6))) (vector+! s5-2 gp-2 s5-2) (ja-no-eval :group! dm-mine-spider-climb-ja :num! (seek!) :frame-num 0.0) @@ -1168,21 +1171,23 @@ ) ;; definition for method 88 of type dm-mine-spider -(defmethod enemy-method-88 ((this dm-mine-spider) (arg0 enemy-knocked-info)) +(defmethod done-being-knocked? ((this dm-mine-spider) (arg0 enemy-knocked-info)) + "has the enemy hit the ground or stopped after being knocked back?" #f ) ;; definition for method 11 of type dm-mine-spider ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this dm-mine-spider) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) ;; definition for method 119 of type dm-mine-spider ;; WARN: Return type mismatch int vs object. -(defmethod init-enemy-defaults! ((this dm-mine-spider) (arg0 nav-enemy-info)) +(defmethod setup-enemy! ((this dm-mine-spider) (arg0 nav-enemy-info)) (set! (-> arg0 nav-mesh) *default-nav-mesh*) - (let ((t9-0 (method-of-type nav-enemy init-enemy-defaults!))) + (let ((t9-0 (method-of-type nav-enemy setup-enemy!))) (t9-0 this arg0) ) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1214,6 +1219,7 @@ ;; definition for method 120 of type dm-mine-spider ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this dm-mine-spider)) + "Typical place to construct collision shapes" (set! (-> this size) (rnd-float-range this 0.8 1.2)) (let ((f30-0 (* 3276.8 (-> this size))) (s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))) @@ -1248,12 +1254,13 @@ ;; definition for method 121 of type dm-mine-spider (defmethod init-enemy! ((this dm-mine-spider)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dm-mine-spider" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *dm-mine-spider-nav-enemy-info*) + (setup-enemy! this *dm-mine-spider-nav-enemy-info*) (set! (-> this move-angle) 10922.667) (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) #t @@ -1360,8 +1367,8 @@ ;; WARN: Return type mismatch int vs none. (defmethod dm-mine-spider-spawner-method-32 ((this dm-mine-spider-spawner) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'cquery-with-vec))) - (set! (-> s5-0 vec0 quad) (-> arg0 quad)) - (set! (-> s5-0 cquery start-pos quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec0) arg0) + (vector-copy! (-> s5-0 cquery start-pos) (-> s5-0 vec0)) (set-vector! (-> s5-0 cquery move-dist) 0.0 -40960.0 0.0 1.0) (let ((v1-3 (-> s5-0 cquery))) (set! (-> v1-3 radius) 1024.0) @@ -1376,8 +1383,8 @@ (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* (-> s5-0 cquery)))) (when (>= f0-5 0.0) (vector+float*! (-> s5-0 vec0) (-> s5-0 cquery start-pos) (-> s5-0 cquery move-dist) f0-5) - (set! (-> s5-0 vec1 quad) (-> s5-0 cquery best-other-tri normal quad)) - (set! (-> arg0 quad) (-> s5-0 vec0 quad)) + (vector-copy! (-> s5-0 vec1) (-> s5-0 cquery best-other-tri normal)) + (vector-copy! arg0 (-> s5-0 vec0)) ) ) ) @@ -1394,12 +1401,12 @@ (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (let ((a1-2 (new 'stack-no-clear 'nav-poly))) (set! (-> a1-2 vertex1 x) 122880.0) (set! (-> a1-2 data 20) (the-as uint 2)) (vector-! (the-as vector (-> a1-2 vertex)) s3-0 (the-as vector (-> s4-0 bounds))) - (set! (-> s3-0 quad) (-> a1-2 vertex 0 quad)) + (vector-copy! s3-0 (-> a1-2 vertex 0)) (let ((a1-3 (nav-mesh-method-45 s4-0 a1-2))) (when a1-3 (let ((s2-1 (new 'stack-no-clear 'vector))) @@ -1410,7 +1417,7 @@ ) (vector+! s3-0 s3-0 (the-as vector (-> s4-0 bounds))) (dm-mine-spider-spawner-method-32 this s3-0) - (set! (-> arg0 quad) (-> s3-0 quad)) + (vector-copy! arg0 s3-0) (set! (-> this nav-id) (-> s4-0 entity aid)) (return #t) ) @@ -1461,11 +1468,11 @@ (when (< (-> self hit-points) 0) (cond ((logtest? (-> *part-group-id-table* 1029 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1029)) ) ) @@ -1524,7 +1531,7 @@ (let ((s5-1 (vector+! (new 'stack-no-clear 'vector) (-> self root trans) (new 'static 'vector :w 1.0)))) (when (dm-mine-spider-spawner-method-33 self s5-1) (let ((gp-1 (new 'stack-no-clear 'enemy-init-by-other-params))) - (set! (-> gp-1 trans quad) (-> s5-1 quad)) + (vector-copy! (-> gp-1 trans) s5-1) (let ((s5-2 quaternion-copy!) (s4-0 (-> gp-1 quat)) (s3-0 quaternion<-rotate-y-vector) @@ -1616,7 +1623,8 @@ ;; definition for method 20 of type dm-mine-spider-spawner ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this dm-mine-spider-spawner)) +(defmethod get-search-info-flag ((this dm-mine-spider-spawner)) + "Get search-info-flag for this process." (the-as search-info-flag 32) ) @@ -1654,6 +1662,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch none vs object. (defmethod init-from-entity! ((this dm-mine-spider-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag) (sv-32 vector)) (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) diff --git a/test/decompiler/reference/jak3/levels/stadium/king-rider_REF.gc b/test/decompiler/reference/jak3/levels/stadium/king-rider_REF.gc index dbfa0c344f9..734757cfd76 100644 --- a/test/decompiler/reference/jak3/levels/stadium/king-rider_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/king-rider_REF.gc @@ -54,7 +54,7 @@ (set! (-> gp-0 uvec z) (sin (-> gp-0 uvec x))) (set! (-> gp-0 uvec w) (cos (-> gp-0 uvec x))) (set! (-> gp-0 uvec y) (seconds-per-frame)) - (set! (-> gp-0 rvec quad) (-> s5-0 local-accel quad)) + (vector-copy! (-> gp-0 rvec) (-> s5-0 local-accel)) (let ((f1-6 (+ (* 0.03 (-> gp-0 uvec z)) (* -1.0 (-> gp-0 rvec x) (-> s5-0 left-right-accel-factor))))) (+! (-> self left-right-interp) (* (- f1-6 (-> self left-right-interp)) (fmin 1.0 (* 8.0 (-> gp-0 uvec y))))) ) @@ -219,7 +219,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (set! (-> self level) (level-get *level* 'lpattack)) (initialize-skeleton @@ -271,7 +271,3 @@ ) (the-as king-rider s5-1) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/stadium/rapid-gunner_REF.gc b/test/decompiler/reference/jak3/levels/stadium/rapid-gunner_REF.gc index fed3b95445c..e5b37de43b6 100644 --- a/test/decompiler/reference/jak3/levels/stadium/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/rapid-gunner_REF.gc @@ -167,34 +167,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 78643.2 - :knocked-medium-vxz-hi 117964.8 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 135168.0 - :knocked-hard-vy-hi 151552.0 - :knocked-huge-vxz-lo 78643.2 - :knocked-huge-vxz-hi 117964.8 - :knocked-huge-vy-lo 135168.0 - :knocked-huge-vy-hi 151552.0 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 19.2) + :knocked-medium-vxz-hi (meters 28.8) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 33) + :knocked-hard-vy-hi (meters 37) + :knocked-huge-vxz-lo (meters 19.2) + :knocked-huge-vxz-hi (meters 28.8) + :knocked-huge-vy-lo (meters 33) + :knocked-huge-vy-hi (meters 37) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 32970.816) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -584,6 +584,7 @@ ;; definition for method 120 of type rapid-gunner ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this rapid-gunner)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -859,7 +860,7 @@ ) (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-2 target-pos quad) (-> v1-8 quad)) + (vector-copy! (-> a0-2 target-pos) v1-8) ) 0 (nav-enemy-travel-post) @@ -913,7 +914,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! (-> self draw art-group data 19) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1070,7 +1071,7 @@ (a1-2 (-> self move-dest)) (f0-0 (-> v1-14 extra-nav-sphere w)) ) - (set! (-> v1-14 extra-nav-sphere quad) (-> a1-2 quad)) + (vector-copy! (-> v1-14 extra-nav-sphere) a1-2) (set! (-> v1-14 extra-nav-sphere w) f0-0) ) 0 @@ -1104,7 +1105,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (new 'stack-no-clear 'vector))) - (set! (-> gp-0 quad) (-> self root trans quad)) + (vector-copy! gp-0 (-> self root trans)) (let ((s5-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> self root quat)))) (ja-no-eval :group! (-> self draw art-group data 22) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -1122,7 +1123,7 @@ (suspend) (nav-enemy-falling-post) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -1217,7 +1218,7 @@ (suspend) (ja :num! (seek! max 0.2)) ) - (go-best-state self) + (go-state-for-focused self) ) :post #f ) @@ -1259,7 +1260,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -1270,6 +1271,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs process. (defmethod update-focus ((this rapid-gunner)) + "Potentially update the focus, if there is something better to focus on." (with-pp (let ((t9-0 (method-of-type enemy update-focus))) (t9-0 this) @@ -1292,7 +1294,7 @@ ) (let ((a0-5 (handle->process (-> this focus handle)))) (if a0-5 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-5) 1) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-5) 1)) ) ) (the-as process 0) @@ -1301,7 +1303,8 @@ ;; definition for method 108 of type rapid-gunner ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-108 ((this rapid-gunner) (arg0 process-focusable)) +(defmethod should-flee-from? ((this rapid-gunner) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (with-pp (the-as symbol (or (focus-test? arg0 invulnerable) (let ((v1-3 (new 'stack-no-clear 'event-message-block))) @@ -1317,6 +1320,7 @@ ;; definition for method 82 of type rapid-gunner (defmethod event-handler ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1328,7 +1332,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1357,19 +1361,21 @@ ) ;; definition for method 122 of type rapid-gunner -(defmethod go-idle2 ((this rapid-gunner)) +(defmethod go-fallback-init ((this rapid-gunner)) + "If there's no specific settings for initial state, go to this state after spawning." (let ((v1-0 (-> this turret-actor))) (if (if v1-0 (-> v1-0 extra process) ) (go (method-of-object this turret-seek)) - ((method-of-type nav-enemy go-idle2) this) + ((method-of-type nav-enemy go-fallback-init) this) ) ) ) ;; definition for method 67 of type rapid-gunner (defmethod coin-flip? ((this rapid-gunner)) + "Return #t half the time, #f the other." #f ) @@ -1377,12 +1383,13 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this rapid-gunner)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-rapid-gunner" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *rapid-gunner-nav-enemy-info*) + (setup-enemy! this *rapid-gunner-nav-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -1408,7 +1415,7 @@ ) (set! (-> this turret-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (if (-> this turret-actor) - (set! (-> this turret-pos quad) (-> this turret-actor extra trans quad)) + (vector-copy! (-> this turret-pos) (-> this turret-actor extra trans)) ) (setup-masks (-> this draw) 0 4) (logior! (-> this focus collide-with) (collide-spec bot)) @@ -1420,13 +1427,10 @@ ;; definition for method 56 of type rapid-gunner ;; WARN: Return type mismatch float vs object. (defmethod knocked-handler ((this rapid-gunner) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (let ((f30-0 (rnd-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp 73728.0 90112.0 f30-0)) (set! (-> arg0 y) (lerp 57344.0 65536.0 f30-0)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/stadium/rubble-attack_REF.gc b/test/decompiler/reference/jak3/levels/stadium/rubble-attack_REF.gc index cb030d814db..7639eda9bf6 100644 --- a/test/decompiler/reference/jak3/levels/stadium/rubble-attack_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/rubble-attack_REF.gc @@ -48,7 +48,7 @@ (defmethod projectile-method-26 ((this rub-missile)) (cond ((logtest? (-> *part-group-id-table* 1021 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to this @@ -57,7 +57,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 1021) :duration (seconds 0.167)) ) ) @@ -348,7 +348,7 @@ ;; INFO: Used lq/sq (defbehavior dm-missile-target-init-by-other dm-missile-target ((arg0 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-dm-missile-target" (the-as (pointer level) #f))) @@ -557,7 +557,7 @@ ) (set! (-> s5-0 y) (+ 204800.0 (-> s3-0 y) (-> s5-0 y))) (let ((s4-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s4-1 start-pos quad) (-> s5-0 quad)) + (vector-copy! (-> s4-1 start-pos) s5-0) (set-vector! (-> s4-1 move-dist) 0.0 -409600.0 0.0 1.0) (let ((v1-21 s4-1)) (set! (-> v1-21 radius) 40.96) @@ -578,7 +578,7 @@ ) (cond (s2-0 - (set! (-> s1-1 quad) (-> s2-0 quad)) + (vector-copy! s1-1 s2-0) ) (else (let ((s0-2 s1-1) @@ -595,8 +595,8 @@ ) (set! (-> s4-2 initial-tilt) 8192.0) (set! (-> s4-2 gravity) 409600.0) - (set! (-> s4-2 src quad) (-> s1-1 quad)) - (set! (-> s4-2 dest quad) (-> s5-0 quad)) + (vector-copy! (-> s4-2 src) s1-1) + (vector-copy! (-> s4-2 dest) s5-0) (when (traj3d-calc-initial-velocity-using-tilt s4-2) (let ((s3-1 (new 'stack-no-clear 'projectile-init-by-other-params))) (set! (-> this missile-target) @@ -606,11 +606,11 @@ (set! (-> s3-1 charge) 1.0) (set! (-> s3-1 options) (projectile-options)) (logclear! (-> s3-1 options) (projectile-options po14 po15 po16)) - (set! (-> s3-1 pos quad) (-> s1-1 quad)) + (vector-copy! (-> s3-1 pos) s1-1) (set! (-> s3-1 notify-handle) (the-as handle #f)) (set! (-> s3-1 owner-handle) (process->handle this)) (set! (-> s3-1 target-handle) (ppointer->handle (-> this missile-target process))) - (set! (-> s3-1 target-pos quad) (-> s5-0 quad)) + (vector-copy! (-> s3-1 target-pos) s5-0) (set! (-> s3-1 ignore-handle) (process->handle this)) (let* ((v1-56 *game-info*) (a0-50 (+ (-> v1-56 attack-id) 1)) @@ -625,7 +625,7 @@ (logior! (-> s3-1 options) (projectile-options po15)) (set! (-> s3-1 vehicle-impulse-factor) 7.5) (logior! (-> s3-1 options) (projectile-options po16)) - (set! (-> s3-1 vel quad) (-> s4-2 initial-velocity quad)) + (vector-copy! (-> s3-1 vel) (-> s4-2 initial-velocity)) (set! (-> this missile) (process->handle (-> (spawn-projectile rub-missile s3-1 this *default-dead-pool*) 0))) ) ) @@ -742,7 +742,7 @@ ) :code (behavior () (local-vars (v1-23 object)) - (while (!= (status-of-level-and-borrows *level* 'lpattack #f) 'active) + (while (!= (level-status? *level* 'lpattack #f) 'active) (set-time! (-> self missile-timer)) (suspend) ) @@ -845,7 +845,3 @@ (set! (-> this first-dp-noticed?) #f) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/stadium/rubble-obs_REF.gc b/test/decompiler/reference/jak3/levels/stadium/rubble-obs_REF.gc index b6bd539e5b4..6ec3ec6aaaa 100644 --- a/test/decompiler/reference/jak3/levels/stadium/rubble-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/rubble-obs_REF.gc @@ -101,11 +101,11 @@ (sound-play "rub-fall-impact") (cond ((logtest? (-> *part-group-id-table* 1026 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 11 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 11 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1026)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 11 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 11 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1026)) ) ) @@ -233,6 +233,7 @@ ;; definition for method 11 of type rub-tower (defmethod init-from-entity! ((this rub-tower) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -357,11 +358,11 @@ (spawn-joint-exploder self) (cond ((logtest? (-> *part-group-id-table* 1024 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1024)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1024)) ) ) @@ -416,7 +417,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod spawn-joint-exploder ((this rub-electric-gate-switch)) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) (target-pos 0)) (set! (-> gp-0 fountain-rand-transv-hi x) 122880.0) (set! (-> gp-0 fountain-rand-transv-hi y) 245760.0) (set! (-> gp-0 fountain-rand-transv-hi z) 4096.0) @@ -467,6 +468,7 @@ ;; definition for method 11 of type rub-electric-gate-switch (defmethod init-from-entity! ((this rub-electric-gate-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) @@ -614,11 +616,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 1027 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (the-as rigid-body-impact gp-1) point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as rigid-body-impact gp-1) point)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1027)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (the-as rigid-body-impact gp-1) point quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as rigid-body-impact gp-1) point)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1027)) ) ) @@ -850,6 +852,7 @@ ;; definition for method 11 of type rub-elec-gate ;; INFO: Used lq/sq (defmethod init-from-entity! ((this rub-elec-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -959,6 +962,7 @@ ;; definition for method 11 of type rub-electric-gate-panel (defmethod init-from-entity! ((this rub-electric-gate-panel) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -1191,7 +1195,3 @@ (defmethod get-skel ((this rub-electric-gate-panel-d)) (art-group-get-by-name *level* "skel-rub-electric-gate-panel-d" (the-as (pointer level) #f)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/stadium/stadium-obs_REF.gc b/test/decompiler/reference/jak3/levels/stadium/stadium-obs_REF.gc index e03637d02ac..1db084da239 100644 --- a/test/decompiler/reference/jak3/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/stadium/stadium-obs_REF.gc @@ -51,6 +51,7 @@ ;; definition for method 11 of type stadium-flag-base (defmethod init-from-entity! ((this stadium-flag-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -225,11 +226,11 @@ (sound-play "door-blow") (cond ((logtest? (-> *part-group-id-table* 1001 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1001)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self node-list data 3 bone transform trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self node-list data 3 bone transform trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1001)) ) ) @@ -275,6 +276,7 @@ ;; definition for method 11 of type rub-dark-jak-door (defmethod init-from-entity! ((this rub-dark-jak-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (when (and (task-node-closed? (game-task-node palace-ruins-patrol-resolution)) (not (task-node-closed? (game-task-node palace-ruins-attack-resolution))) ) @@ -413,6 +415,7 @@ ;; definition for method 11 of type rub-falling-step ;; INFO: Used lq/sq (defmethod init-from-entity! ((this rub-falling-step) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -613,7 +616,7 @@ ) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 150) this)) (quaternion->matrix (-> this mat) (-> this root quat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) (go (method-of-object this idle)) ) @@ -803,7 +806,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod do-explode ((this rub-rhino-door)) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (target-pos 0) quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) (target-pos 0)) (set! (-> gp-0 fountain-rand-transv-hi x) 122880.0) (set! (-> gp-0 fountain-rand-transv-hi y) 245760.0) (set! (-> gp-0 fountain-rand-transv-hi z) 4096.0) @@ -857,6 +860,7 @@ ;; definition for method 11 of type rub-rhino-door (defmethod init-from-entity! ((this rub-rhino-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (when (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) (cleanup-for-death this) (return #f) @@ -983,13 +987,10 @@ ;; definition for method 11 of type mh-tower-smoke-stda (defmethod init-from-entity! ((this mh-tower-smoke-stda) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1004) this)) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/flamer-hover_REF.gc b/test/decompiler/reference/jak3/levels/temple/flamer-hover_REF.gc index ad540ffd156..a779d20959f 100644 --- a/test/decompiler/reference/jak3/levels/temple/flamer-hover_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/flamer-hover_REF.gc @@ -125,34 +125,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 101580.8 - :knocked-hard-vy-lo 60620.8 - :knocked-hard-vy-hi 95027.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 24.8) + :knocked-hard-vy-lo (meters 14.8) + :knocked-hard-vy-hi (meters 23.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -180,6 +180,7 @@ ;; definition for method 59 of type flamer-hover ;; INFO: Used lq/sq (defmethod enemy-common-post ((this flamer-hover)) + "Common implementation of post. Runs ja-post." (when (time-elapsed? (the-as int (-> this flit-timer)) (rand-vu-int-range (seconds 1.2) (seconds 3))) (set! (-> this flit-angle) (the float @@ -189,7 +190,7 @@ (set! (-> this flit-timer) (the-as uint (current-time))) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> *up-vector* quad)) + (vector-copy! s5-1 *up-vector*) (vector-normalize! s5-1 2048.0) (vector/! s5-1 s5-1 (-> this root scale)) (vector-rotate-around-z! s5-1 s5-1 (-> this flit-angle)) @@ -218,7 +219,7 @@ (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 122880.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-12 s4-0)) (set! (-> v1-12 radius) 3276.8) @@ -357,7 +358,7 @@ (if (and (time-elapsed? (the-as int (-> self last-fire-time)) (seconds 3)) (and (< (vector-vector-distance (-> self focus-pos) (-> self root trans)) 245760.0) (get-focus! self) - (enemy-method-104 self (-> self focus-pos) 910.2222) + (pointing-toward? self (-> self focus-pos) 910.2222) ) ) (go-virtual attack) @@ -378,7 +379,7 @@ (s5-1 (new 'stack-no-clear 'vector)) ) (setup-from-to-xz-vel! (-> self shot-trajectory) gp-0 a2-1 122880.0 -102400.0) - (set! (-> s5-1 quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! s5-1 (-> self shot-trajectory initial-velocity)) (vector-normalize! s5-1 1638.4) (vector+! gp-0 gp-0 s5-1) ) @@ -387,8 +388,8 @@ (set! (-> a1-6 charge) 1.0) (set! (-> a1-6 options) (projectile-options)) (logclear! (-> a1-6 options) (projectile-options po14 po15 po16)) - (set! (-> a1-6 pos quad) (-> gp-0 quad)) - (set! (-> a1-6 vel quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! (-> a1-6 pos) gp-0) + (vector-copy! (-> a1-6 vel) (-> self shot-trajectory initial-velocity)) (set! (-> a1-6 notify-handle) (process->handle self)) (set! (-> a1-6 owner-handle) (the-as handle #f)) (set! (-> a1-6 target-handle) (the-as handle #f)) @@ -516,7 +517,8 @@ ;; definition for method 50 of type flamer-hover ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this flamer-hover) (arg0 int)) +(defmethod update-collision-action ((this flamer-hover) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -552,6 +554,7 @@ ;; definition for method 85 of type flamer-hover ;; WARN: Return type mismatch object vs symbol. (defmethod knocked-anim ((this flamer-hover) (arg0 enemy-knocked-info)) + "start the knocked animation." (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol @@ -562,7 +565,7 @@ (s4-0 (new 'static 'array uint64 3 #x12 #x13 #x14)) (s3-0 (new 'static 'array int32 4 0 0 0 0)) (a2-0 (ash 1 (-> s3-0 0))) - (v1-6 (enemy-method-131 this a1-3 a2-0)) + (v1-6 (rnd-int-excluding-masked this a1-3 a2-0)) (s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0)))))) ) (set! (-> s3-0 0) v1-6) @@ -605,12 +608,14 @@ ;; definition for method 67 of type flamer-hover (defmethod coin-flip? ((this flamer-hover)) + "Return #t half the time, #f the other." #f ) ;; definition for method 120 of type flamer-hover ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this flamer-hover)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -758,8 +763,9 @@ ;; definition for method 121 of type flamer-hover ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this flamer-hover)) + "Typical place for shared init code. Runs from entity or process style init." (hover-enemy-method-170 this) - (init-enemy-defaults! this (get-enemy-info this)) + (setup-enemy! this (get-enemy-info this)) (hover-enemy-method-176 this) (set! (-> this neck up) (the-as uint 1)) (set! (-> this neck nose) (the-as uint 2)) @@ -797,7 +803,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/hover-training_REF.gc b/test/decompiler/reference/jak3/levels/temple/hover-training_REF.gc index 1b1cca6a881..916ea395eda 100644 --- a/test/decompiler/reference/jak3/levels/temple/hover-training_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/hover-training_REF.gc @@ -547,12 +547,12 @@ ) ) ) - (set! (-> gp-4 s1-0 quad) (-> self entity trans quad)) + (vector-copy! (-> gp-4 s1-0) (-> self entity trans)) (let ((s3-1 (+ s1-0 1))) (dotimes (s1-1 (length (-> self actor-group (-> self group-num)))) (let ((v1-61 (-> self actor-group (-> self group-num) data s1-1))) (when (and v1-61 (-> v1-61 actor)) - (set! (-> gp-4 s3-1 quad) (-> v1-61 actor trans quad)) + (vector-copy! (-> gp-4 s3-1) (-> v1-61 actor trans)) (+! s3-1 1) ) ) @@ -616,7 +616,7 @@ (let ((v1-117 (-> self actor-group 0 data))) (when (and v1-117 (-> v1-117 0 actor)) (let ((gp-7 (new 'stack-no-clear 'vector))) - (set! (-> gp-7 quad) (-> v1-117 0 actor trans quad)) + (vector-copy! gp-7 (-> v1-117 0 actor trans)) (vector-seek-3d-smooth! (-> self root trans) gp-7 (* 409600.0 (seconds-per-frame)) 0.5) (cond ((< 409.6 (vector-vector-distance (-> self root trans) gp-7)) @@ -640,6 +640,7 @@ ;; definition for method 11 of type tpl-token ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-token) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (with-pp (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) @@ -995,6 +996,7 @@ ;; definition for method 11 of type hover-training-manager ;; INFO: Used lq/sq (defmethod init-from-entity! ((this hover-training-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (process-entity-set! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1323,6 +1325,7 @@ ;; definition for method 11 of type tpl-symbol (defmethod init-from-entity! ((this tpl-symbol) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc b/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc index 705e14aa043..fa348f074cb 100644 --- a/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/temple-obs2_REF.gc @@ -219,6 +219,7 @@ ;; definition for method 11 of type tpl-gate (defmethod init-from-entity! ((this tpl-gate) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) @@ -564,11 +565,12 @@ ;; definition for method 11 of type tpl-watcher-manager ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-watcher-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this within-outer-ring) #f) (set! (-> this within-inner-ring) #f) (set! (-> this ouched) #f) - (set! (-> this trans quad) (-> arg0 trans quad)) + (vector-copy! (-> this trans) (-> arg0 trans)) (logclear! (-> this mask) (process-mask actor-pause)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-4 (res-lump-data arg0 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -698,7 +700,8 @@ ;; definition for method 20 of type tpl-watcher ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this tpl-watcher)) +(defmethod get-search-info-flag ((this tpl-watcher)) + "Get search-info-flag for this process." (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) @@ -869,7 +872,7 @@ (s2-0 vector-xz-normalize!) (a0-7 v1-10) ) - (set! (-> a0-7 quad) (-> v1-10 quad)) + (vector-copy! a0-7 v1-10) (set! (-> a0-7 y) 0.0) (let* ((a1-7 (s2-0 (vector-normalize! a0-7 1.0) 1.0)) (a2-2 (vector-lerp-clamp! (new 'stack-no-clear 'vector) a1-7 *up-vector* f30-0)) @@ -1017,11 +1020,11 @@ :code (behavior () (cond ((logtest? (-> *part-group-id-table* 672 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 672)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 672)) ) ) @@ -1177,6 +1180,7 @@ ;; definition for method 11 of type tpl-watcher ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-watcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 384) (init-collision! this) @@ -1365,6 +1369,7 @@ ;; definition for method 11 of type tpl-door-switch (defmethod init-from-entity! ((this tpl-door-switch) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -1447,6 +1452,7 @@ ;; definition for method 11 of type tpl-door-a (defmethod init-from-entity! ((this tpl-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((a0-2 (res-lump-struct arg0 'task-name structure))) (when (and a0-2 (task-closed? (the-as string a0-2))) (cleanup-for-death this) @@ -1532,6 +1538,7 @@ ;; definition for method 11 of type tpl-door-b (defmethod init-from-entity! ((this tpl-door-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1894,6 +1901,7 @@ ;; definition for method 11 of type tpl-spinning-plat ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-spinning-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (tpl-spinning-plat-method-24 this) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1902,7 +1910,7 @@ (the-as pair 0) ) (logclear! (-> this mask) (process-mask actor-pause)) - (set! (-> this basal-trans quad) (-> this root trans quad)) + (vector-copy! (-> this basal-trans) (-> this root trans)) (let* ((v1-8 *game-info*) (a0-10 (+ (-> v1-8 attack-id) 1)) ) @@ -1970,6 +1978,7 @@ ;; definition for method 11 of type tpl-oracle-eye (defmethod init-from-entity! ((this tpl-oracle-eye) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2056,6 +2065,7 @@ ;; definition for method 11 of type tpl-banner-b (defmethod init-from-entity! ((this tpl-banner-b) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -2214,6 +2224,7 @@ ;; definition for method 11 of type tpl-banner (defmethod init-from-entity! ((this tpl-banner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc index f59635ded15..2d773a9647c 100644 --- a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc @@ -270,6 +270,7 @@ ;; definition for method 11 of type tpl-outer-airlock-door (defmethod init-from-entity! ((this tpl-outer-airlock-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -348,6 +349,7 @@ ;; definition for method 11 of type tpl-mardoor (defmethod init-from-entity! ((this tpl-mardoor) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -479,7 +481,7 @@ :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-0 (-> self info sphere-array 0))) - (set! (-> gp-0 pos quad) (-> a0-0 quad)) + (vector-copy! (-> gp-0 pos) a0-0) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf5)) @@ -1113,8 +1115,8 @@ (let ((a2-4 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* (-> self kill-angle)))) (quaternion*! (-> self root quat) (-> self kill-quat) a2-4) ) - (set! (-> self other-eyeball-jmod transform scale quad) (-> self root scale quad)) - (set! (-> self eyeball-jmod transform scale quad) (-> self root scale quad)) + (vector-copy! (-> self other-eyeball-jmod transform scale) (-> self root scale)) + (vector-copy! (-> self eyeball-jmod transform scale) (-> self root scale)) (let* ((f0-9 (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self state-time))) 0.0 60.0)) (f0-11 (* f0-9 f0-9)) ) @@ -1179,6 +1181,7 @@ ;; definition for method 11 of type tpl-holo-eye ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-holo-eye) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (stack-size-set! (-> this main-thread) 320) (set! (-> this root) (new 'process 'trsqv)) @@ -1201,7 +1204,7 @@ ) ) ) - (set! (-> this init-trans quad) (-> this root trans quad)) + (vector-copy! (-> this init-trans) (-> this root trans)) (init (-> this eyeball-jmod) this (the-as uint 4) (joint-mod-base-flags attached scale)) (init (-> this other-eyeball-jmod) this (the-as uint 9) (joint-mod-base-flags attached trans quat scale)) (set! (-> this perm-part) @@ -1391,6 +1394,7 @@ ;; definition for method 11 of type tpl-spike-trap (defmethod init-from-entity! ((this tpl-spike-trap) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) projectile-bounce-reaction) @@ -1563,7 +1567,7 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-20 quad) vf6) - (set! (-> a0-8 state meet data (+ (-> a0-8 state points-to-draw) -1) quad) (-> v1-20 quad)) + (vector-copy! (-> a0-8 state meet data (+ (-> a0-8 state points-to-draw) -1)) v1-20) ) ) (let ((v1-24 (-> this lightning s5-0)) @@ -1765,6 +1769,7 @@ ;; definition for method 11 of type tpl-elec-swing-pole ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-elec-swing-pole) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1779,7 +1784,7 @@ (set! (-> this electrify) #f) (set! (-> this sound-id) (new-sound-id)) (init-collision! this) - (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (vector-copy! (-> this root trans) (-> arg0 extra trans)) (quaternion-copy! (-> this root quat) (-> arg0 quat)) (vector-identity! (-> this root scale)) (vector-z-quaternion! (-> this dir) (-> this root quat)) @@ -2043,6 +2048,7 @@ ;; definition for method 11 of type tpl-spindle ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-spindle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 int)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -2203,6 +2209,7 @@ ;; definition for method 11 of type tpl-fan-two ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-fan-two) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 int)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -2349,6 +2356,7 @@ ;; definition for method 11 of type tpl-fan-three ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tpl-fan-three) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 int)) (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -2541,6 +2549,7 @@ ;; definition for method 11 of type tpl-break-alcove (defmethod init-from-entity! ((this tpl-break-alcove) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) @@ -2729,6 +2738,7 @@ ;; definition for method 11 of type tpl-break-door-a (defmethod init-from-entity! ((this tpl-break-door-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) diff --git a/test/decompiler/reference/jak3/levels/temple/templed-obs_REF.gc b/test/decompiler/reference/jak3/levels/temple/templed-obs_REF.gc index 6ba91c8d804..c12720d2c02 100644 --- a/test/decompiler/reference/jak3/levels/temple/templed-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/templed-obs_REF.gc @@ -733,11 +733,11 @@ (set! sv-32 (-> this node-list data (tpl-bbridge-panel arg0) bone transform trans)) (cond ((logtest? (-> *part-group-id-table* 701 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> sv-32 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-32) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 701)) ) (else - (set! (-> *launch-matrix* trans quad) (-> sv-32 quad)) + (vector-copy! (-> *launch-matrix* trans) sv-32) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 701)) ) ) @@ -776,7 +776,7 @@ (let ((v1-24 (-> this node-list data (tpl-bbridge-panel arg0) bone transform trans))) (cond ((logtest? (-> *part-group-id-table* 700 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-24 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-24) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* @@ -785,7 +785,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-24 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-24) (part-tracker-spawn part-tracker :to *entity-pool* @@ -836,11 +836,11 @@ (let ((v1-81 (-> this node-list data (tpl-bbridge-panel arg0) bone transform trans))) (cond ((logtest? (-> *part-group-id-table* 700 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-81 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-81) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 700)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-81 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-81) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 700)) ) ) @@ -1035,6 +1035,7 @@ ;; definition for method 11 of type tpl-break-bridge (defmethod init-from-entity! ((this tpl-break-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -1104,7 +1105,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/templex-obs_REF.gc b/test/decompiler/reference/jak3/levels/temple/templex-obs_REF.gc index e627473074f..fe2f914eb8f 100644 --- a/test/decompiler/reference/jak3/levels/temple/templex-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/templex-obs_REF.gc @@ -211,6 +211,7 @@ ;; definition for method 11 of type tpl-stone-break (defmethod init-from-entity! ((this tpl-stone-break) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -386,7 +387,3 @@ (go (method-of-object this idle)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/templex-scenes_REF.gc b/test/decompiler/reference/jak3/levels/temple/templex-scenes_REF.gc index 61096a10bcb..9298575b04e 100644 --- a/test/decompiler/reference/jak3/levels/temple/templex-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/templex-scenes_REF.gc @@ -115,6 +115,7 @@ ;; definition for method 11 of type tpl-inner-airlock-door (defmethod init-from-entity! ((this tpl-inner-airlock-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -166,7 +167,3 @@ (set! (-> this sound-behind?) #t) (go (method-of-object this close) #t) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/tomb-baby-spider_REF.gc b/test/decompiler/reference/jak3/levels/temple/tomb-baby-spider_REF.gc index 0a0bdeb6d0c..e98f0df661c 100644 --- a/test/decompiler/reference/jak3/levels/temple/tomb-baby-spider_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/tomb-baby-spider_REF.gc @@ -121,34 +121,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 80281.6 - :knocked-soft-vxz-hi 87654.4 - :knocked-soft-vy-lo 67993.6 - :knocked-soft-vy-hi 112230.4 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 55705.6 - :knocked-hard-vxz-hi 71270.4 - :knocked-hard-vy-lo 88473.6 - :knocked-hard-vy-hi 132710.4 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 55705.6 - :knocked-red-vxz-hi 71270.4 - :knocked-red-vy-lo 88473.6 - :knocked-red-vy-hi 132710.4 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 19.6) + :knocked-soft-vxz-hi (meters 21.4) + :knocked-soft-vy-lo (meters 16.6) + :knocked-soft-vy-hi (meters 27.4) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 13.6) + :knocked-hard-vxz-hi (meters 17.4) + :knocked-hard-vy-lo (meters 21.6) + :knocked-hard-vy-hi (meters 32.4) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 13.6) + :knocked-red-vxz-hi (meters 17.4) + :knocked-red-vy-lo (meters 21.6) + :knocked-red-vy-hi (meters 32.4) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -202,7 +202,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (when (enemy-method-134 self 0.2) + (when (rnd-chance-for-idle? self 0.2) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.2)) (let ((v1-37 self)) @@ -220,7 +220,7 @@ (suspend) (ja :num! (seek! max f30-0)) ) - (until (not (enemy-method-134 self 0.2)) + (until (not (rnd-chance-for-idle? self 0.2)) (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek! max f30-0) :frame-num 0.0 @@ -261,18 +261,18 @@ (defstate notice (tomb-baby-spider) :virtual #t :code (behavior () - (go-best-state self) + (go-state-for-focused self) (ja-channel-push! 1 (seconds 0.2)) (let ((f30-0 (rnd-float-range self 0.8 1.2))) (let ((gp-0 (new 'stack-no-clear 'vector))) (let ((a0-4 (handle->process (-> self focus handle)))) (cond (a0-4 - (set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-4) 0) quad)) + (vector-copy! gp-0 (get-trans (the-as process-focusable a0-4) 0)) ) (else (let ((a1-4 (-> self nav state))) - (set! (-> gp-0 quad) (-> a1-4 target-pos quad)) + (vector-copy! gp-0 (-> a1-4 target-pos)) ) ) ) @@ -290,7 +290,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -306,7 +306,7 @@ (set! (-> v1-9 local-sphere w) 4915.2) ) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-14 *game-info*) (v0-2 (+ (-> v1-14 attack-id) 1)) ) @@ -326,7 +326,7 @@ (nav-enemy-method-176 self) ) :trans (behavior () - (reset-penetrate! self) + (reset-penetrate-later! self) (if (logtest? (-> self enemy-flags) (enemy-flag victory)) (logclear! (-> self enemy-flags) (enemy-flag victory)) ) @@ -377,7 +377,7 @@ (suspend) (ja :num! (seek!)) ) - (when (not (enemy-method-105 self 6371.5557 #t)) + (when (not (pointing-toward-focus? self 6371.5557 #t)) (let ((v1-27 self)) (set! (-> v1-27 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-27 enemy-flags)))) ) @@ -387,7 +387,7 @@ (a2-3 (-> self nav state)) (v1-30 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-30 quad) (-> a2-3 target-pos quad)) + (vector-copy! v1-30 (-> a2-3 target-pos)) (let* ((s5-0 (t9-4 (vector-! a0-7 v1-30 (-> self root trans)) 1.0)) (f30-0 (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle s5-0))) ) @@ -404,7 +404,7 @@ ) ) ) - (until (enemy-method-105 self 910.2222 #t) + (until (pointing-toward-focus? self 910.2222 #t) (ja-blend-eval) (suspend) (ja :num! (loop!)) @@ -450,7 +450,9 @@ (let ((a0-1 (get-focus! self))) (when a0-1 (let ((a0-2 (get-trans a0-1 0))) - (if (and (< (vector-vector-distance a0-2 (-> self root trans)) 20480.0) (enemy-method-105 self 1274.3112 #t)) + (if (and (< (vector-vector-distance a0-2 (-> self root trans)) 20480.0) + (pointing-toward-focus? self 1274.3112 #t) + ) (go-virtual attack) ) ) @@ -461,6 +463,7 @@ ;; definition for method 85 of type tomb-baby-spider (defmethod knocked-anim ((this tomb-baby-spider) (arg0 enemy-knocked-info)) + "start the knocked animation." (let* ((a2-0 (the-as collide-shape-prim-group (-> this root root-prim))) (v1-2 (-> a2-0 child 3)) ) @@ -506,6 +509,7 @@ ;; definition for method 86 of type tomb-baby-spider (defmethod knocked-land-anim ((this tomb-baby-spider) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (case (-> this incoming knocked-type) (((knocked-type blue-shot)) (let ((v1-3 (-> this skel root-channel 0))) @@ -539,6 +543,7 @@ ;; definition for method 87 of type tomb-baby-spider (defmethod knocked-anim-handler ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((3) (let ((s4-0 (ja-done? 0))) @@ -606,7 +611,8 @@ ) ;; definition for method 110 of type tomb-baby-spider -(defmethod send-attack ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod send-attack-from-tshape ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + "Send an attack from this enemy to something else." (let* ((s1-0 arg0) (s2-0 (if (type? s1-0 process-focusable) s1-0 @@ -644,6 +650,7 @@ ;; definition for method 120 of type tomb-baby-spider ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this tomb-baby-spider)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -719,12 +726,13 @@ ;; definition for method 121 of type tomb-baby-spider ;; WARN: Return type mismatch vector vs none. (defmethod init-enemy! ((this tomb-baby-spider)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-baby-spider" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *tomb-baby-spider-nav-enemy-info*) + (setup-enemy! this *tomb-baby-spider-nav-enemy-info*) (let ((f0-0 (rnd-float-range this 0.75 1.0))) (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) ) @@ -751,7 +759,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc index c0d7caf3dd0..c5a2fb06153 100644 --- a/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/title/title-obs_REF.gc @@ -444,7 +444,7 @@ (want-levels *load-state* a1-12) ) (want-display-level *load-state* 'wasintro 'display) - (while (!= (status-of-level-and-borrows *level* 'wasintro #f) 'active) + (while (!= (level-status? *level* 'wasintro #f) 'active) (suspend) ) (set-setting! 'fog-special-interp-targ #f 0.15 0) @@ -618,7 +618,7 @@ ) (v0-3 (-> self root trans)) ) - (set! (-> v0-3 quad) (-> v1-14 quad)) + (vector-copy! v0-3 v1-14) v0-3 ) ) @@ -1411,9 +1411,9 @@ (gp-2 (new 'stack-no-clear 'vector)) ) (let ((a3-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-40 quad) (-> *math-camera* trans quad)) + (vector-copy! v1-40 (-> *math-camera* trans)) (set-vector! a3-0 (-> self pos-x) 0.0 0.0 1.0) - (set! (-> a2-3 quad) (-> *math-camera* inv-camera-rot fvec quad)) + (vector-copy! a2-3 (-> *math-camera* inv-camera-rot fvec)) (let ((a0-42 a1-7)) (let ((t0-8 (-> *math-camera* inv-camera-rot fvec))) (let ((t1-0 (-> self zoom))) @@ -1429,7 +1429,7 @@ ) (reverse-transform-point! gp-2 a1-7 a2-3 a3-0) ) - (set! (-> self root trans quad) (-> gp-2 quad)) + (vector-copy! (-> self root trans) gp-2) ) (matrix->quaternion (-> self root quat) (-> *math-camera* inv-camera-rot)) (quaternion*! @@ -2738,7 +2738,3 @@ ) :post target-no-move-post ) - - - - diff --git a/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc b/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc index 4f81400e140..e0cbbf3e9c4 100644 --- a/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc @@ -113,6 +113,7 @@ ;; definition for method 11 of type actor-group-watcher ;; INFO: Used lq/sq (defmethod init-from-entity! ((this actor-group-watcher) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) @@ -434,6 +435,7 @@ ;; definition for method 11 of type tow-large-plat ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tow-large-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) @@ -634,6 +636,7 @@ ;; definition for method 11 of type tow-energy-bridge (defmethod init-from-entity! ((this tow-energy-bridge) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) @@ -835,18 +838,7 @@ (let ((a0-0 (joint-node tow-spawner-lod0-jg spawnerspew)) (a1-0 (new 'stack-no-clear 'matrix)) ) - (let* ((v1-1 a1-0) - (t0-0 (-> a0-0 bone transform)) - (a0-2 (-> t0-0 rvec quad)) - (a2-0 (-> t0-0 uvec quad)) - (a3-0 (-> t0-0 fvec quad)) - (t0-1 (-> t0-0 trans quad)) - ) - (set! (-> v1-1 rvec quad) a0-2) - (set! (-> v1-1 uvec quad) a2-0) - (set! (-> v1-1 fvec quad) a3-0) - (set! (-> v1-1 trans quad) t0-1) - ) + (matrix-copy! a1-0 (-> a0-0 bone transform)) (vector+float*! (-> a1-0 trans) (-> a1-0 trans) (-> a1-0 fvec) 8192.0) (spawn-from-mat (-> self part) a1-0) ) @@ -867,7 +859,7 @@ (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (the-as (array collide-shape) (new 'stack 'boxed-array collide-shape 8))) ) - (set! (-> s3-0 quad) (-> arg0 quad)) + (vector-copy! s3-0 arg0) (set! (-> s3-0 w) arg1) (let ((gp-1 (fill-actor-list-for-box *actor-hash* s3-0 (-> s4-0 data) (-> s4-0 length)))) (or (zero? gp-1) (begin @@ -905,7 +897,7 @@ (when (and (project-point-to-nav-mesh (-> this entity) s5-0 s5-0 (the-as nav-poly #f) 40960.0) (can-spawn-creature? this s5-0 12288.0) ) - (set! (-> s3-0 trans quad) (-> s4-0 quad)) + (vector-copy! (-> s3-0 trans) s4-0) (quaternion-copy! (-> s3-0 quat) (-> this root quat)) (set! (-> s3-0 entity) (-> this entity)) (set! (-> s3-0 directed?) #f) @@ -941,6 +933,7 @@ ;; definition for method 11 of type tow-spawner (defmethod init-from-entity! ((this tow-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -1036,6 +1029,7 @@ ;; definition for method 11 of type tow-tentacle ;; INFO: Used lq/sq (defmethod init-from-entity! ((this tow-tentacle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 collide-shape-prim-sphere) (sv-32 collide-shape-prim-sphere) (sv-48 vector)) (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) diff --git a/test/decompiler/reference/jak3/levels/volcano/flamer-lava_REF.gc b/test/decompiler/reference/jak3/levels/volcano/flamer-lava_REF.gc index 495dd04411c..8e4011c5dcd 100644 --- a/test/decompiler/reference/jak3/levels/volcano/flamer-lava_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/flamer-lava_REF.gc @@ -7,6 +7,7 @@ ) ;; definition for method 3 of type flying-formation +;; INFO: this function exists in multiple non-identical object files (defmethod inspect ((this flying-formation)) (when (not this) (set! this this) @@ -206,34 +207,34 @@ :ragdoll-rotate-velocity-mult 1.0 :jump-height-min (meters 3) :jump-height-factor 0.5 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 90112.0 - :knocked-blue-vy-lo 90112.0 - :knocked-blue-vy-hi 172032.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 22) + :knocked-blue-vy-lo (meters 22) + :knocked-blue-vy-hi (meters 42) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 10) @@ -277,6 +278,7 @@ ;; definition for method 82 of type flamer-lava ;; INFO: Used lq/sq (defmethod event-handler ((this flamer-lava) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-flinch 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -288,7 +290,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -421,7 +423,7 @@ ) (else (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> (get-trans arg1 0) quad)) + (vector-copy! s1-0 (get-trans arg1 0)) (let ((s3-1 (new 'stack-no-clear 'vector))) (let ((s2-1 (new 'stack-no-clear 'vector))) (vector-! s3-1 s1-0 (-> this root trans)) @@ -449,7 +451,7 @@ ) ) (else - (set! (-> arg0 quad) (-> this idle-pos quad)) + (vector-copy! arg0 (-> this idle-pos)) arg0 ) ) @@ -490,7 +492,7 @@ ) (logclear! (-> a0-8 flags) (nav-state-flag directional-mode)) (logior! (-> a0-8 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-8 target-pos quad) (-> v1-16 quad)) + (vector-copy! (-> a0-8 target-pos) v1-16) ) 0 (flamer-lava-method-197 self) @@ -614,7 +616,7 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a2-4 quad) vf1) ) - (set! (-> this main-joint-pos quad) (-> a1-1 quad)) + (vector-copy! (-> this main-joint-pos) a1-1) (let* ((f0-2 0.4) (f1-1 (- 1.0 f0-2)) (a1-5 (-> this main-joint-vel)) @@ -623,7 +625,7 @@ (set! (-> a1-5 y) (+ (* f0-2 (-> a0-2 y)) (* f1-1 (-> a1-5 y)))) (set! (-> a1-5 z) (+ (* f0-2 (-> a0-2 z)) (* f1-1 (-> a1-5 z)))) ) - (set! (-> this main-joint-acc quad) (-> v1-1 quad)) + (vector-copy! (-> this main-joint-acc) v1-1) ) 0 0 @@ -634,6 +636,7 @@ ;; definition for method 59 of type flamer-lava (defmethod enemy-common-post ((this flamer-lava)) + "Common implementation of post. Runs ja-post." (update-vol! (-> this sound) (-> this sound-volume)) (shadow-draw-probe this) ((method-of-type nav-enemy enemy-common-post) this) @@ -655,7 +658,7 @@ (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 122880.0) ) - (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 start-pos) (-> this root trans)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-12 s4-0)) (set! (-> v1-12 radius) 3276.8) @@ -769,7 +772,7 @@ ((zero? v1-0) (let ((a1-1 (new 'stack-no-clear 'collide-query))) (cond - ((set-ground-pat! this a1-1 (collide-spec backgnd) 8192.0 30720.0 1024.0 (the-as process #f)) + ((find-ground-and-set-pat! this a1-1 (collide-spec backgnd) 8192.0 30720.0 1024.0 (the-as process #f)) (set! (-> this base-pos y) (+ 26624.0 (-> this root gspot-pos y))) ) (else @@ -804,7 +807,7 @@ ) ) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> *up-vector* quad)) + (vector-copy! s5-2 *up-vector*) (vector-normalize! s5-2 2048.0) (vector/! s5-2 s5-2 (-> this root scale)) (vector-rotate-around-z! s5-2 s5-2 (-> this flit-angle)) @@ -851,7 +854,7 @@ (t9-0) ) ) - (set! (-> self root trans quad) (-> self idle-pos quad)) + (vector-copy! (-> self root trans) (-> self idle-pos)) ) ) @@ -864,7 +867,7 @@ (t9-0) ) ) - (set! (-> self root trans quad) (-> self idle-pos quad)) + (vector-copy! (-> self root trans) (-> self idle-pos)) ) :trans (behavior () (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (flamer-lava-method-196 self)) @@ -1030,7 +1033,7 @@ ) (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-18 target-pos quad) (-> v1-17 quad)) + (vector-copy! (-> a0-18 target-pos) v1-17) ) 0 (set! (-> self ground-mode) 1) @@ -1180,7 +1183,7 @@ (gp-1 (new 'stack-no-clear 'vector)) ) (setup-from-to-xz-vel! (-> self shot-trajectory) s5-0 a2-1 122880.0 -102400.0) - (set! (-> gp-1 quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! gp-1 (-> self shot-trajectory initial-velocity)) (vector-normalize! gp-1 1638.4) (vector+! s5-0 s5-0 gp-1) ) @@ -1189,8 +1192,8 @@ (set! (-> gp-2 charge) 1.0) (set! (-> gp-2 options) (projectile-options)) (logclear! (-> gp-2 options) (projectile-options po14 po15 po16)) - (set! (-> gp-2 pos quad) (-> s5-0 quad)) - (set! (-> gp-2 vel quad) (-> self shot-trajectory initial-velocity quad)) + (vector-copy! (-> gp-2 pos) s5-0) + (vector-copy! (-> gp-2 vel) (-> self shot-trajectory initial-velocity)) (set! (-> gp-2 notify-handle) (process->handle self)) (set! (-> gp-2 owner-handle) (the-as handle #f)) (set! (-> gp-2 target-handle) (the-as handle #f)) @@ -1244,7 +1247,8 @@ ;; definition for method 50 of type flamer-lava ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this flamer-lava) (arg0 int)) +(defmethod update-collision-action ((this flamer-lava) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -1280,6 +1284,7 @@ ;; definition for method 85 of type flamer-lava ;; WARN: Return type mismatch object vs symbol. (defmethod knocked-anim ((this flamer-lava) (arg0 enemy-knocked-info)) + "start the knocked animation." (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol @@ -1290,7 +1295,7 @@ (s4-0 (new 'static 'array int64 3 18 19 20)) (s3-0 (new 'static 'array int32 4 0 0 0 0)) (a2-0 (ash 1 (-> s3-0 0))) - (v1-6 (enemy-method-131 this a1-3 a2-0)) + (v1-6 (rnd-int-excluding-masked this a1-3 a2-0)) (s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0)))))) ) (set! (-> s3-0 0) v1-6) @@ -1349,7 +1354,7 @@ (when (logtest? (-> gp-0 status) (collide-status on-surface)) (when (not (-> self hit-surface?)) (set! (-> self hit-surface?) #t) - (set! (-> self surface-normal quad) (-> gp-0 poly-normal quad)) + (vector-copy! (-> self surface-normal) (-> gp-0 poly-normal)) ) ) (when (and (-> self hit-surface?) (= (-> self hit-points) 0.0)) @@ -1466,12 +1471,14 @@ ;; definition for method 67 of type flamer-lava (defmethod coin-flip? ((this flamer-lava)) + "Return #t half the time, #f the other." #f ) ;; definition for method 120 of type flamer-lava ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this flamer-lava)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1554,12 +1561,13 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this flamer-lava)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flamer-lava" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flamer-lava-nav-enemy-info*) + (setup-enemy! this *flamer-lava-nav-enemy-info*) (set! (-> this neck up) (the-as uint 1)) (set! (-> this neck nose) (the-as uint 2)) (set! (-> this neck ear) (the-as uint 0)) @@ -1573,9 +1581,9 @@ (set! (-> this root dynam gravity-length) 225280.0) (set! (-> this root dynam gravity-max) 225280.0) (let ((v1-25 (-> this root trans))) - (set! (-> this base-pos quad) (-> v1-25 quad)) + (vector-copy! (-> this base-pos) v1-25) (+! (-> v1-25 y) 26624.0) - (set! (-> this idle-pos quad) (-> v1-25 quad)) + (vector-copy! (-> this idle-pos) v1-25) ) (init (-> this flit-joint) this (the-as uint 3) (joint-mod-base-flags attached trans)) (let ((f0-7 (res-lump-float (-> this entity) 'rotoffset))) @@ -1586,7 +1594,7 @@ (let ((f0-8 (quaternion-y-angle (-> this root quat)))) (matrix-rotate-y! (-> this zone-to-world) f0-8) ) - (set! (-> this zone-to-world trans quad) (-> this root trans quad)) + (vector-copy! (-> this zone-to-world trans) (-> this root trans)) (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) (set! (-> this formation-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (let ((s5-1 (-> this offset)) @@ -1601,9 +1609,10 @@ (set! (-> t0-1 y) 0.0) (set! (-> t0-1 z) 94208.0) (set! (-> t0-1 w) 1.0) - (set! (-> s5-1 quad) - (-> (the-as vector (t9-12 a0-24 a1-13 a2-6 a3-2 t0-1 (the-as (pointer res-tag) #f) *res-static-buf*)) quad) - ) + (vector-copy! + s5-1 + (the-as vector (t9-12 a0-24 a1-13 a2-6 a3-2 t0-1 (the-as (pointer res-tag) #f) *res-static-buf*)) + ) ) (set! (-> this path) (new 'process 'curve-control this 'intro -1000000000.0)) (set! (-> this path-pos) 0.0) @@ -1644,7 +1653,8 @@ ;; definition for method 122 of type flamer-lava ;; WARN: Return type mismatch int vs object. -(defmethod go-idle2 ((this flamer-lava)) +(defmethod go-fallback-init ((this flamer-lava)) + "If there's no specific settings for initial state, go to this state after spawning." (if (-> this formation-entity) (go (method-of-object this wait-for-formation)) (go (method-of-object this idle)) @@ -1672,7 +1682,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/volcano/flut-wild_REF.gc b/test/decompiler/reference/jak3/levels/volcano/flut-wild_REF.gc index 8969607d684..5c77248653d 100644 --- a/test/decompiler/reference/jak3/levels/volcano/flut-wild_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/flut-wild_REF.gc @@ -87,34 +87,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x -1.0 :w 1194.157) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -645,7 +645,7 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -672,7 +672,7 @@ (a2-0 (-> self nav state)) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-0 target-pos quad)) + (vector-copy! a1-1 (-> a2-0 target-pos)) (and (< (t9-2 a0-1 a1-1) 8192.0) (< (the-as int (-> self focus aware)) 4)) ) (go-stare self) @@ -701,7 +701,7 @@ (let ((v1-9 (-> self nav state))) (logclear! (-> v1-9 flags) (nav-state-flag directional-mode)) (logior! (-> v1-9 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-9 target-pos quad) (-> gp-1 quad)) + (vector-copy! (-> v1-9 target-pos) gp-1) ) ) 0 @@ -741,6 +741,7 @@ ;; definition for method 56 of type flut-wild ;; WARN: Return type mismatch float vs object. (defmethod knocked-handler ((this flut-wild) (arg0 vector)) + "Called when this enemy is knocked." (get-knockback-dir! this arg0) (let ((f30-0 (rnd-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp 24576.0 57344.0 f30-0)) @@ -750,16 +751,19 @@ ;; definition for method 98 of type flut-wild (defmethod jump-wind-up-anim ((this flut-wild) (arg0 enemy-jump-info)) + "Start playing the wind-up anim" #f ) ;; definition for method 108 of type flut-wild -(defmethod enemy-method-108 ((this flut-wild) (arg0 process-focusable)) +(defmethod should-flee-from? ((this flut-wild) (arg0 process-focusable)) + "Return if this enemy should flee from the process." #t ) ;; definition for method 79 of type flut-wild (defmethod go-flee ((this flut-wild)) + "Go to the flee state, running away." (if (< (path-control-method-23 (-> this path) (-> this root trans)) 1.0) (go (method-of-object this flee-path)) (go (method-of-object this flee)) @@ -768,6 +772,7 @@ ;; definition for method 59 of type flut-wild (defmethod enemy-common-post ((this flut-wild)) + "Common implementation of post. Runs ja-post." (if (task-node-closed? (game-task-node volcano-darkeco-catch-flut)) (go (method-of-object this disappear)) ) @@ -825,6 +830,7 @@ ;; definition for method 82 of type flut-wild ;; INFO: Used lq/sq (defmethod event-handler ((this flut-wild) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -836,7 +842,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -861,6 +867,7 @@ ;; definition for method 120 of type flut-wild ;; WARN: Return type mismatch collide-shape-moving vs none. (defmethod init-enemy-collision! ((this flut-wild)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -941,22 +948,24 @@ ) ;; definition for method 122 of type flut-wild -(defmethod go-idle2 ((this flut-wild)) +(defmethod go-fallback-init ((this flut-wild)) + "If there's no specific settings for initial state, go to this state after spawning." (if (task-node-closed? (game-task-node volcano-darkeco-catch-flut)) (go (method-of-object this disappear)) - ((method-of-type nav-enemy go-idle2) this) + ((method-of-type nav-enemy go-fallback-init) this) ) ) ;; definition for method 121 of type flut-wild ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this flut-wild)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-flut" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *flut-wild-enemy-info*) + (setup-enemy! this *flut-wild-enemy-info*) (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -1071,7 +1080,3 @@ (set-setting! 'pilot-exit #f 0.0 0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/volcano/spiky-frog_REF.gc b/test/decompiler/reference/jak3/levels/volcano/spiky-frog_REF.gc index aba9167ab02..28656103a65 100644 --- a/test/decompiler/reference/jak3/levels/volcano/spiky-frog_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/spiky-frog_REF.gc @@ -148,34 +148,34 @@ :jump-height-min (meters 2.87) :jump-height-factor 0.1 :knocked-seek-ry-clamp 4551.1113 - :knocked-soft-vxz-lo 75776.0 - :knocked-soft-vxz-hi 75776.0 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 81920.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 79872.0 - :knocked-hard-vxz-hi 79872.0 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 75776.0 - :knocked-yellow-vxz-hi 75776.0 - :knocked-yellow-vy-lo 81920.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 73728.0 - :knocked-red-vxz-hi 73728.0 - :knocked-red-vy-lo 96256.0 - :knocked-red-vy-hi 96256.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 18.5) + :knocked-soft-vxz-hi (meters 18.5) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 20) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.5) + :knocked-hard-vxz-hi (meters 19.5) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 18.5) + :knocked-yellow-vxz-hi (meters 18.5) + :knocked-yellow-vy-lo (meters 20) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 18) + :knocked-red-vxz-hi (meters 18) + :knocked-red-vy-lo (meters 23.5) + :knocked-red-vy-hi (meters 23.5) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :scale (new 'static 'vector :x 0.8 :y 0.8 :z 0.8) :bg-collide-with (collide-spec backgnd crate obstacle) @@ -431,7 +431,7 @@ (set! (-> v1-0 nav callback-info) *null-nav-callback-info*) ) 0 - (dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.01))) + (dotimes (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.01))) (cond ((zero? (rnd-int self 4)) (let ((v1-7 (ja-group))) @@ -521,7 +521,7 @@ (ja :num! (seek! max f30-0)) ) ) - (go-best-state self) + (go-state-for-focused self) ) ) @@ -562,6 +562,7 @@ ;; definition for method 78 of type spiky-frog (defmethod go-hostile ((this spiky-frog)) + "Go to the hostile state, actively trying to attack the target." (if (get-focus! this) (go (method-of-object this rolling-start)) (go (method-of-object this hostile)) @@ -577,7 +578,7 @@ ((get-focus! self) (go-virtual rolling-start) ) - ((not (enemy-method-104 self (-> self focus-pos) 8192.0)) + ((not (pointing-toward? self (-> self focus-pos) 8192.0)) (go-virtual turn) ) ) @@ -606,7 +607,7 @@ (logior! (-> self enemy-flags) (enemy-flag lock-focus)) (logior! (-> self focus-status) (focus-status dangerous)) (set! (-> self root penetrate-using) (penetrate generic-attack lunge)) - (reset-penetrate! self) + (reset-penetrate-later! self) (let* ((v1-9 *game-info*) (a0-5 (+ (-> v1-9 attack-id) 1)) ) @@ -670,7 +671,7 @@ (let ((v1-16 (-> self nav state))) (logclear! (-> v1-16 flags) (nav-state-flag directional-mode)) (logior! (-> v1-16 flags) (nav-state-flag target-poly-dirty)) - (set! (-> v1-16 target-pos quad) (-> gp-0 quad)) + (vector-copy! (-> v1-16 target-pos) gp-0) ) ) 0 @@ -778,7 +779,7 @@ (suspend) (ja :num! (seek!)) ) - (go-best-state self) + (go-state-for-focused self) ) :post (behavior () (let ((a0-0 self)) @@ -826,7 +827,7 @@ ) (logclear! (-> a0-3 flags) (nav-state-flag directional-mode)) (logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-3 target-pos quad) (-> v1-17 quad)) + (vector-copy! (-> a0-3 target-pos) v1-17) ) ) 0 @@ -902,7 +903,7 @@ ) ) ) - (go-best-state self) + (go-state-for-focused self) ) :post nav-enemy-simple-post ) @@ -930,7 +931,7 @@ ) ) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set-ground-pat! self a1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f)) + (find-ground-and-set-pat! self a1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f)) ) ) :exit (behavior () @@ -965,7 +966,7 @@ ) ) ) - (if (enemy-method-109 self) + (if (out-of-bounds? self) (go-die self) (go-hostile self) ) @@ -973,7 +974,9 @@ ) ;; definition for method 125 of type spiky-frog +;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this spiky-frog)) + "Has the ragdoll stopped moving?" (let ((s5-0 (the-as ragdoll-proc (handle->process (-> this ragdoll-proc))))) (or (not s5-0) (or (ragdoll-proc-method-19 s5-0) @@ -1025,6 +1028,7 @@ ;; definition for method 82 of type spiky-frog (defmethod event-handler ((this spiky-frog) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('hit 'hit-flinch 'hit-knocked) (logclear! (-> this mask) (process-mask actor-pause)) @@ -1036,7 +1040,7 @@ (logior! (-> this focus-status) (focus-status dead)) ) (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) - (enemy-method-69 this) + (focus-on-attacker! this) (logior! (-> this enemy-flags) (enemy-flag lock-focus)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) @@ -1052,10 +1056,11 @@ ;; definition for method 59 of type spiky-frog ;; INFO: Used lq/sq (defmethod enemy-common-post ((this spiky-frog)) + "Common implementation of post. Runs ja-post." (when (< 1 (the-as int (-> this focus aware))) (let ((a0-3 (handle->process (-> this focus handle)))) (if a0-3 - (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-3) 1) quad)) + (vector-copy! (-> this focus-pos) (get-trans (the-as process-focusable a0-3) 1)) ) ) ) @@ -1082,6 +1087,7 @@ ;; definition for method 120 of type spiky-frog ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this spiky-frog)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1165,12 +1171,13 @@ ;; definition for method 121 of type spiky-frog ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this spiky-frog)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-spiky-frog" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *spiky-frog-nav-enemy-info*) + (setup-enemy! this *spiky-frog-nav-enemy-info*) (init-eyes! this 0 24) (init-eyes! this 1 25) (set! (-> this sound-id) (new-sound-id)) diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc index c6329631457..adec2347698 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-obs2_REF.gc @@ -241,6 +241,7 @@ ;; definition for method 11 of type vol-lava-plat-spawner (defmethod init-from-entity! ((this vol-lava-plat-spawner) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this path) (new 'process 'curve-control @@ -426,6 +427,7 @@ ;; definition for method 11 of type vol-break-ground (defmethod init-from-entity! ((this vol-break-ground) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -984,7 +986,7 @@ (set! (-> s4-0 z) 0.0) (set! (-> s4-0 w) 0.0) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> this rbody position quad)) + (vector-copy! s3-0 (-> this rbody position)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 x) 0.0) (set! (-> s2-0 y) 8192.0) @@ -998,9 +1000,9 @@ ) 0 (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> this to-hole-vec quad)) + (vector-copy! s4-1 (-> this to-hole-vec)) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> this rbody position quad)) + (vector-copy! s3-1 (-> this rbody position)) (set! (-> s4-1 y) (/ (-> s4-1 y) -10)) (vector-float*! s4-1 s4-1 (lerp-scale 0.0 30.0 (-> this hole-dist-xz) 20480.0 4096.0)) (apply-impact! (-> this rbody) s3-1 s4-1) @@ -1076,7 +1078,7 @@ ) ) ) - (set! (-> s3-0 quad) (-> (get-trans (the-as process-focusable a0-8) 0) quad)) + (vector-copy! s3-0 (get-trans (the-as process-focusable a0-8) 0)) ) (vector-reset! s4-0) (let ((s2-2 (-> this hole)) @@ -1168,7 +1170,7 @@ ;; WARN: Return type mismatch symbol vs none. (defmethod rbody-post ((this vol-stone-lid)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> this rbody position quad)) + (vector-copy! (-> a1-0 start-pos) (-> this rbody position)) (vector-float*! (-> a1-0 move-dist) (-> this rbody lin-velocity) (seconds-per-frame)) (let ((v1-3 a1-0)) (set! (-> v1-3 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc index c03b3bd23ba..22b716c4122 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-obs_REF.gc @@ -107,6 +107,7 @@ ;; definition for method 11 of type vol-rising-step (defmethod init-from-entity! ((this vol-rising-step) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (vol-rising-step-method-24 this) (process-drawable-from-entity! this arg0) @@ -530,7 +531,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'matrix))) (quaternion->matrix gp-0 (-> self root quat)) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (spawn-from-mat (-> self part) gp-0) ) 0 @@ -547,6 +548,7 @@ ;; definition for method 11 of type lava-shoot (defmethod init-from-entity! ((this lava-shoot) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) @@ -961,13 +963,13 @@ (set! (-> this rope) (new 'process 'vol-balance-plat-chain-physics)) (chain-physics-initialize this (-> this rope) 4 8192.0 *vol-balance-plat-chain-setup*) (alloc-rbody-control! this *vol-balance-plat-rigid-body-constants*) - (set! (-> this init-pos quad) (-> this root trans quad)) + (vector-copy! (-> this init-pos) (-> this root trans)) (let ((a0-10 (-> this node-list data 4))) (set! (-> a0-10 param0) (lambda ((arg0 cspace) (arg1 transformq)) (let ((gp-0 (-> arg0 param1))) (cspace<-parented-transformq-joint! arg0 arg1) - (set! (-> arg0 bone transform trans quad) (-> (the-as vol-balance-plat gp-0) init-pos quad)) + (vector-copy! (-> arg0 bone transform trans) (-> (the-as vol-balance-plat gp-0) init-pos)) ) (none) ) @@ -1290,20 +1292,9 @@ ) ) (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-22 gp-0) - (a3-29 *identity-matrix*) - (v1-18 (-> a3-29 rvec quad)) - (a0-6 (-> a3-29 uvec quad)) - (a1-4 (-> a3-29 fvec quad)) - (a3-30 (-> a3-29 trans quad)) - ) - (set! (-> a2-22 rvec quad) v1-18) - (set! (-> a2-22 uvec quad) a0-6) - (set! (-> a2-22 fvec quad) a1-4) - (set! (-> a2-22 trans quad) a3-30) - ) + (matrix-copy! gp-0 *identity-matrix*) (matrix<-quat gp-0 (-> self root quat)) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (spawn-from-mat (-> self part) gp-0) ) 0 @@ -1320,6 +1311,7 @@ ;; definition for method 11 of type vol-steam-explosion (defmethod init-from-entity! ((this vol-steam-explosion) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 128) (vol-steam-explosion-method-23 this) (process-drawable-from-entity! this arg0) @@ -1748,7 +1740,7 @@ ) (set! (-> self root) s5-0) ) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (initialize-skeleton self (the-as skeleton-group (art-group-get-by-name *level* "skel-vol-lava-ball" (the-as (pointer level) #f))) @@ -1886,20 +1878,9 @@ ) ) (let ((gp-2 (new 'stack-no-clear 'matrix))) - (let* ((a2-5 gp-2) - (a3-3 *identity-matrix*) - (v1-38 (-> a3-3 rvec quad)) - (a0-23 (-> a3-3 uvec quad)) - (a1-8 (-> a3-3 fvec quad)) - (a3-4 (-> a3-3 trans quad)) - ) - (set! (-> a2-5 rvec quad) v1-38) - (set! (-> a2-5 uvec quad) a0-23) - (set! (-> a2-5 fvec quad) a1-8) - (set! (-> a2-5 trans quad) a3-4) - ) + (matrix-copy! gp-2 *identity-matrix*) (matrix<-quat gp-2 (-> self root quat)) - (set! (-> gp-2 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-2 trans) (-> self root trans)) (spawn-from-mat (-> self part) gp-2) ) ) @@ -1916,6 +1897,7 @@ ;; definition for method 11 of type vol-lava-ball-spout (defmethod init-from-entity! ((this vol-lava-ball-spout) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) @@ -2037,6 +2019,7 @@ ;; definition for method 11 of type vol-collapsing-rock (defmethod init-from-entity! ((this vol-collapsing-rock) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-part_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-part_REF.gc index f60e60693ac..688bbe96e1c 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-part_REF.gc @@ -253,7 +253,7 @@ (set! (-> a0-1 y) (-> arg2 launchrot y)) (set! (-> a0-1 z) (-> arg2 launchrot z)) (set! (-> a0-1 w) 1.0) - (set! (-> v1-6 quad) (-> a0-1 quad)) + (vector-copy! v1-6 a0-1) ) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1391)) ) @@ -265,7 +265,7 @@ (set! (-> a0-6 y) (-> arg2 launchrot y)) (set! (-> a0-6 z) (-> arg2 launchrot z)) (set! (-> a0-6 w) 1.0) - (set! (-> v1-19 quad) (-> a0-6 quad)) + (vector-copy! v1-19 a0-6) ) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1391)) ) @@ -736,7 +736,3 @@ (defpart 4618 :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x) (:fade-a -0.128)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/volcano/volcano-scenes_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcano-scenes_REF.gc index 18292de36e4..be59d5ab9c3 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcano-scenes_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcano-scenes_REF.gc @@ -530,7 +530,7 @@ (logand! (-> self draw mgeo effect v1-13 effect-usage) -9) ) (let ((gp-1 (new 'stack-no-clear 'vector))) - (set! (-> gp-1 quad) (-> (camera-pos) quad)) + (vector-copy! gp-1 (camera-pos)) (dotimes (s5-0 (-> *vol-invis-joint-list* length)) (when (-> *vol-invis-joint-list* s5-0 spawn?) (let ((v1-26 (-> *vol-invis-joint-list* s5-0 joint)) diff --git a/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc b/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc index c14e6dce135..1d8fdf0b8b5 100644 --- a/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/volcano/volcanox-obs_REF.gc @@ -408,8 +408,8 @@ (let ((a2-4 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *y-vector* (-> self kill-angle)))) (quaternion*! (-> self root quat) (-> self kill-quat) a2-4) ) - (set! (-> self other-eyeball-jmod transform scale quad) (-> self root scale quad)) - (set! (-> self eyeball-jmod transform scale quad) (-> self root scale quad)) + (vector-copy! (-> self other-eyeball-jmod transform scale) (-> self root scale)) + (vector-copy! (-> self eyeball-jmod transform scale) (-> self root scale)) (let* ((f0-9 (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self state-time))) 0.0 60.0)) (f0-11 (* f0-9 f0-9)) ) @@ -469,6 +469,7 @@ ;; definition for method 11 of type vol-holo-eye ;; INFO: Used lq/sq (defmethod init-from-entity! ((this vol-holo-eye) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (sv-16 res-tag)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -490,7 +491,7 @@ ) ) ) - (set! (-> this init-trans quad) (-> this root trans quad)) + (vector-copy! (-> this init-trans) (-> this root trans)) (init (-> this eyeball-jmod) this (the-as uint 4) (joint-mod-base-flags attached scale)) (init (-> this other-eyeball-jmod) this (the-as uint 9) (joint-mod-base-flags attached trans quat scale)) (set! (-> this perm-part) @@ -571,6 +572,7 @@ ;; definition for method 11 of type tpl-glider-broken (defmethod init-from-entity! ((this tpl-glider-broken) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -713,6 +715,7 @@ ;; definition for method 11 of type dm-spines (defmethod init-from-entity! ((this dm-spines) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this level) (level-get *level* 'volcanox)) (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) "init for the auto spawner" diff --git a/test/decompiler/reference/jak3/levels/wascity/bbush/des-bush-time-chase_REF.gc b/test/decompiler/reference/jak3/levels/wascity/bbush/des-bush-time-chase_REF.gc index a8ea2936953..03f4d2559d7 100644 --- a/test/decompiler/reference/jak3/levels/wascity/bbush/des-bush-time-chase_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/bbush/des-bush-time-chase_REF.gc @@ -247,7 +247,7 @@ (case message (('trans) (let ((v1-1 (the-as object (-> block param 0)))) - (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + (vector-copy! (-> self root trans) (the-as vector v1-1)) ) (send-event (handle->process (-> self trail)) 'start-tracking) ) @@ -361,7 +361,7 @@ (set! (-> *bb-timer-chase-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *bb-timer-chase-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *bb-timer-chase-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *bb-timer-chase-trail* use-tape-mode?) #f) @@ -499,7 +499,7 @@ ;; INFO: Used lq/sq (defbehavior trail-effect-init-by-other trail-effect ((arg0 vector)) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self root trans) arg0) (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1534) self)) (set! (-> self goal-part) (create-launch-control (-> *part-group-id-table* 1532) self)) (let ((gp-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) @@ -622,11 +622,11 @@ :enter (behavior () (cond ((logtest? (-> *part-group-id-table* 1531 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1531)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1531)) ) ) @@ -652,6 +652,7 @@ ;; definition for method 11 of type bb-goal ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this bb-goal) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1432,6 +1433,7 @@ ;; definition for method 11 of type bb-freeze ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this bb-freeze) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 32) (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1750,7 +1752,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod set-sbanks ((this task-manager-bbush-timer-chase)) (cond - ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + ((= (level-status? *level* 'waswide #f) 'active) (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) (set-setting! 'music 'wastimer 0.0 0) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/chase/kanga-lizard_REF.gc b/test/decompiler/reference/jak3/levels/wascity/chase/kanga-lizard_REF.gc index 3aa58e2aa7d..c4007137b52 100644 --- a/test/decompiler/reference/jak3/levels/wascity/chase/kanga-lizard_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/chase/kanga-lizard_REF.gc @@ -720,34 +720,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9999 :y -0.0032 :z 0.0024 :w 13772.991) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -991,6 +991,7 @@ ;; definition for method 67 of type kanga-lizard (defmethod coin-flip? ((this kanga-lizard)) + "Return #t half the time, #f the other." #f ) @@ -1006,6 +1007,7 @@ ;; definition for method 82 of type kanga-lizard (defmethod event-handler ((this kanga-lizard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('death-end) (when (-> this minimap) @@ -1019,7 +1021,8 @@ ) ;; definition for method 122 of type kanga-lizard -(defmethod go-idle2 ((this kanga-lizard)) +(defmethod go-fallback-init ((this kanga-lizard)) + "If there's no specific settings for initial state, go to this state after spawning." (when (= (-> this nav state mesh) *default-nav-mesh*) (set! (-> *kanga-lizard-nav-enemy-info* nav-mesh) #f) (go (method-of-object this reinit-if-find-nav-mesh)) @@ -1065,17 +1068,20 @@ ) ;; definition for method 108 of type kanga-lizard -(defmethod enemy-method-108 ((this kanga-lizard) (arg0 process-focusable)) +(defmethod should-flee-from? ((this kanga-lizard) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (not (logtest? (-> arg0 focus-status) (focus-status ignore))) ) ;; definition for method 107 of type kanga-lizard -(defmethod is-pfoc-in-mesh? ((this kanga-lizard) (arg0 process-focusable) (arg1 vector)) +(defmethod can-become-hostile-to? ((this kanga-lizard) (arg0 process-focusable) (arg1 vector)) + "Return if this enemy can become hostile to the process." #t ) ;; definition for method 64 of type kanga-lizard -(defmethod update-awareness! ((this kanga-lizard) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod get-awareness-of-proc ((this kanga-lizard) (arg0 process-focusable) (arg1 enemy-best-focus)) + "Check what the enemies awareness of this pfoc would be. Optionally return more awareness stats in enemy-best-focus." (cond ((< (+ (current-time) (seconds -3)) (-> this last-focus-ping)) (set! (-> this enemy-info notice-distance) 409600.0) @@ -1090,7 +1096,7 @@ (set! (-> this enemy-info proximity-notice-distance) 286720.0) ) ) - (let* ((t9-0 (method-of-type nav-enemy update-awareness!)) + (let* ((t9-0 (method-of-type nav-enemy get-awareness-of-proc)) (v0-0 (t9-0 this arg0 arg1)) ) (set! (-> this enemy-info notice-distance) 286720.0) @@ -1101,7 +1107,8 @@ ;; definition for method 20 of type kanga-lizard ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this kanga-lizard)) +(defmethod get-search-info-flag ((this kanga-lizard)) + "Get search-info-flag for this process." (set-time! (-> this last-focus-ping)) (the-as search-info-flag 0) ) @@ -1109,6 +1116,7 @@ ;; definition for method 120 of type kanga-lizard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this kanga-lizard)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1155,6 +1163,7 @@ ;; definition for method 121 of type kanga-lizard ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this kanga-lizard)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-kanga-lizard" (the-as (pointer level) #f))) @@ -1164,7 +1173,7 @@ (set! (-> *kanga-lizard-nav-enemy-info* nav-mesh) #f) (set! (-> *kanga-lizard-nav-enemy-info* nav-mesh) *default-nav-mesh*) ) - (init-enemy-defaults! this *kanga-lizard-nav-enemy-info*) + (setup-enemy! this *kanga-lizard-nav-enemy-info*) (let ((v1-8 (-> this nav))) (set! (-> v1-8 speed-scale) 1.0) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/cty-faction_REF.gc b/test/decompiler/reference/jak3/levels/wascity/cty-faction_REF.gc index f175815c1cc..075650522d0 100644 --- a/test/decompiler/reference/jak3/levels/wascity/cty-faction_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/cty-faction_REF.gc @@ -445,9 +445,7 @@ ) (cond (s5-2 - (when (or (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) - (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) - ) + (when (or (= (level-status? *level* 'ctypesc #f) 'active) (= (level-status? *level* 'ctypesb #f) 'active)) (if (zero? (-> this start-fight-music-time)) (set-time! (-> this start-fight-music-time)) ) @@ -914,27 +912,25 @@ (defun is-faction-level-loaded? ((arg0 cty-faction-level)) (case arg0 (((cty-faction-level pesc)) - (= (status-of-level-and-borrows *level* 'ctypesc #f) 'active) + (= (level-status? *level* 'ctypesc #f) 'active) ) (((cty-faction-level pesb)) - (= (status-of-level-and-borrows *level* 'ctypesb #f) 'active) + (= (level-status? *level* 'ctypesb #f) 'active) ) (((cty-faction-level pesa)) - (= (status-of-level-and-borrows *level* 'ctypesa #f) 'active) + (= (level-status? *level* 'ctypesa #f) 'active) ) (((cty-faction-level pepa)) - (= (status-of-level-and-borrows *level* 'ctypepa #f) 'active) + (= (level-status? *level* 'ctypepa #f) 'active) ) (((cty-faction-level car)) - (or (= (status-of-level-and-borrows *level* 'ctycara #f) 'active) - (= (status-of-level-and-borrows *level* 'ctycarb #f) 'active) - ) + (or (= (level-status? *level* 'ctycara #f) 'active) (= (level-status? *level* 'ctycarb #f) 'active)) ) (((cty-faction-level pepc)) - (= (status-of-level-and-borrows *level* 'ctypepc #f) 'active) + (= (level-status? *level* 'ctypepc #f) 'active) ) (((cty-faction-level pepb)) - (= (status-of-level-and-borrows *level* 'ctypepb #f) 'active) + (= (level-status? *level* 'ctypepb #f) 'active) ) ) ) @@ -1042,7 +1038,3 @@ ) #f ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/ctymark-obs-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs-h_REF.gc index 3d064573d40..5895048fc94 100644 --- a/test/decompiler/reference/jak3/levels/wascity/ctymark-obs-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs-h_REF.gc @@ -77,7 +77,7 @@ (set! (-> this fact pickup-type) (pickup-type none)) 0 ) - (set! (-> this base quad) (-> this root trans quad)) + (vector-copy! (-> this base) (-> this root trans)) (crate-post) (nav-mesh-connect-from-ent this) (none) @@ -109,7 +109,7 @@ (vector-! (new 'stack-no-clear 'vector) (-> v1-9 root trans) (-> self root trans)) *up-vector* ) - (set! (-> self explode-matrix trans quad) (-> self root trans quad)) + (vector-copy! (-> self explode-matrix trans) (-> self root trans)) ) ) ) @@ -296,7 +296,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc index b4dfde36859..a1b8a2530da 100644 --- a/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/ctymark-obs_REF.gc @@ -1508,7 +1508,7 @@ (s4-0 (-> *sp-particle-system-2d* cpuinfo-table (-> self sparts-index gp-0))) ) (when (and (nonzero? (-> s4-0 key)) (= (-> s4-0 key group) (lookup-part-group-by-name "group-ctywide-fruit"))) - (set! (-> s5-0 start-pos quad) (-> self sparts-pos gp-0 quad)) + (vector-copy! (-> s5-0 start-pos) (-> self sparts-pos gp-0)) (+! (-> s5-0 start-pos y) 4096.0) (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0) (let ((v1-11 s5-0)) @@ -1609,6 +1609,7 @@ ;; definition for method 11 of type fruit-stand (defmethod init-from-entity! ((this fruit-stand) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (fruit-stand-method-29 this) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc b/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc index 0e6bf4cb5fd..211f435944b 100644 --- a/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/defend/was-pre-game_REF.gc @@ -1936,7 +1936,7 @@ ) (sp-group-flag sp13) ) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) (when gp-0 (let ((t9-1 (method-of-type part-tracker-subsampler activate))) @@ -1981,7 +1981,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000 0))) (when gp-1 (let ((t9-4 (method-of-type part-tracker activate))) @@ -2082,7 +2082,7 @@ ) (sp-group-flag sp13) ) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-4 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) (when gp-4 (let ((t9-10 (method-of-type part-tracker-subsampler activate))) @@ -2127,7 +2127,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-5 (get-process *default-dead-pool* part-tracker #x4000 0))) (when gp-5 (let ((t9-13 (method-of-type part-tracker activate))) @@ -2201,7 +2201,7 @@ ) (sp-group-flag sp13) ) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-0 (get-process *default-dead-pool* part-tracker-subsampler #x4000 0))) (when gp-0 (let ((t9-1 (method-of-type part-tracker-subsampler activate))) @@ -2246,7 +2246,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (let ((gp-1 (get-process *default-dead-pool* part-tracker #x4000 0))) (when gp-1 (let ((t9-4 (method-of-type part-tracker activate))) @@ -2311,7 +2311,7 @@ (set! (-> self start-delay) arg3) (set! (-> self gravity) arg4) (set! (-> self root) (new 'process 'trsqv)) - (set! (-> self screen-pos quad) (-> arg1 quad)) + (vector-copy! (-> self screen-pos) arg1) (logclear! (-> self mask) (process-mask actor-pause)) (initialize-skeleton self @@ -3111,6 +3111,7 @@ ;; definition for method 11 of type was-pre-game (defmethod init-from-entity! ((this was-pre-game) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) diff --git a/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc b/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc index f7824354acd..8739763cd61 100644 --- a/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/dm-flyer_REF.gc @@ -134,7 +134,7 @@ (set! (-> *dm-flyer-missile-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *dm-flyer-missile-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *dm-flyer-missile-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *dm-flyer-missile-trail* use-tape-mode?) #f) @@ -220,7 +220,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'matrix))) (let ((s5-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> s5-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> s5-0 spawn-quat)) (set! (-> s5-0 radius) 40960.0) (set! (-> s5-0 scale) 1.0) @@ -239,7 +239,7 @@ (cond ((< (* f0-6 f0-6) (vector-vector-distance-squared (-> self root trans) (target-pos 0))) (forward-up->inv-matrix gp-0 (-> self pre-move-transv) *up-vector*) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 539 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -253,7 +253,7 @@ ) (else (quaternion->matrix gp-0 (-> *target* control quat)) - (set! (-> gp-0 trans quad) (-> *target* control trans quad)) + (vector-copy! (-> gp-0 trans) (-> *target* control trans)) (if (logtest? (-> *part-group-id-table* 541 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -340,21 +340,21 @@ ((-> this hit-actor?) (cond ((logtest? (-> *part-group-id-table* 102 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 102)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 102)) ) ) ) ((logtest? (-> *part-group-id-table* 101 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 101)) ) (else - (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> this root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 101)) ) ) @@ -450,7 +450,7 @@ (let ((v1-32 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) (a1-13 (-> arg0 hit-pos)) ) - (set! (-> a1-13 quad) (-> s5-0 trans quad)) + (vector-copy! a1-13 (-> s5-0 trans)) (vector+! a1-13 a1-13 v1-32) (move-to-point! (-> arg0 root) a1-13) ) @@ -546,7 +546,7 @@ (wascity-turret-add-radar (-> this root trans)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this root transv quad)) + (vector-copy! s4-0 (-> this root transv)) (vector-normalize! s4-0 17612.8) (vector+! s5-0 (-> this root trans) s4-0) ) @@ -582,7 +582,7 @@ (the-as pair 0) ) (set! (-> this hit-actor?) #f) - (set! (-> this tail-pos quad) (-> this root trans quad)) + (vector-copy! (-> this tail-pos) (-> this root trans)) (set! (-> this swirl) (rand-vu-float-range 0.0 65536.0)) (set! (-> this swirlvel) (rand-vu-float-range 8192.0 24576.0)) (set! (-> this swirlvel) (* (-> this swirlvel) (if (>= (rand-vu) 0.5) diff --git a/test/decompiler/reference/jak3/levels/wascity/dogat_REF.gc b/test/decompiler/reference/jak3/levels/wascity/dogat_REF.gc index 32d9af0dbc8..a5e3738a402 100644 --- a/test/decompiler/reference/jak3/levels/wascity/dogat_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/dogat_REF.gc @@ -176,34 +176,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 72089.6 - :knocked-soft-vxz-hi 108134.4 - :knocked-soft-vy-lo 81920.0 - :knocked-soft-vy-hi 122880.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 78643.2 - :knocked-hard-vxz-hi 117964.8 - :knocked-hard-vy-lo 183500.8 - :knocked-hard-vy-hi 209715.2 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 40960.0 - :knocked-yellow-vxz-hi 49152.0 - :knocked-yellow-vy-lo 57344.0 - :knocked-yellow-vy-hi 81920.0 - :knocked-red-vxz-lo 24576.0 - :knocked-red-vxz-hi 196608.0 - :knocked-red-vy-lo 94208.0 - :knocked-red-vy-hi 151552.0 - :knocked-blue-vxz-lo 40960.0 - :knocked-blue-vxz-hi 49152.0 - :knocked-blue-vy-lo 24576.0 - :knocked-blue-vy-hi 81920.0 + :knocked-soft-vxz-lo (meters 17.6) + :knocked-soft-vxz-hi (meters 26.4) + :knocked-soft-vy-lo (meters 20) + :knocked-soft-vy-hi (meters 30) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 19.2) + :knocked-hard-vxz-hi (meters 28.8) + :knocked-hard-vy-lo (meters 44.8) + :knocked-hard-vy-hi (meters 51.2) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 10) + :knocked-yellow-vxz-hi (meters 12) + :knocked-yellow-vy-lo (meters 14) + :knocked-yellow-vy-hi (meters 20) + :knocked-red-vxz-lo (meters 6) + :knocked-red-vxz-hi (meters 48) + :knocked-red-vy-lo (meters 23) + :knocked-red-vy-hi (meters 37) + :knocked-blue-vxz-lo (meters 10) + :knocked-blue-vxz-hi (meters 12) + :knocked-blue-vy-lo (meters 6) + :knocked-blue-vy-hi (meters 20) :ragdoll-info #f :shadow-size (meters 2) :shadow-max-y (meters 1) @@ -281,7 +281,7 @@ :trans (behavior () (let ((v1-0 (-> self focus aware))) (cond - ((= v1-0 (enemy-aware ea4)) + ((= v1-0 (enemy-aware flee)) (go-flee self) ) ((< (the-as int v1-0) 1) @@ -375,7 +375,7 @@ (label cfg-8) (if v1-12 (vector+! (-> self move-dest) gp-0 s5-0) - (set! (-> self move-dest quad) (-> gp-0 quad)) + (vector-copy! (-> self move-dest) gp-0) ) ) ) @@ -403,7 +403,7 @@ ) (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + (vector-copy! (-> a0-0 target-pos) v1-1) ) 0 (nav-enemy-method-187 self) @@ -435,25 +435,31 @@ ;; definition for method 78 of type dogat (defmethod go-hostile ((this dogat)) + "Go to the hostile state, actively trying to attack the target." (set-time! (-> this scared-timer)) (go (method-of-object this flee)) ) ;; definition for method 108 of type dogat -(defmethod enemy-method-108 ((this dogat) (arg0 process-focusable)) +(defmethod should-flee-from? ((this dogat) (arg0 process-focusable)) + "Return if this enemy should flee from the process." (or (< (vector-vector-xz-distance (-> this root trans) (get-trans arg0 0)) 143360.0) (not (time-elapsed? (-> this scared-timer) (seconds 4))) ) ) ;; definition for method 114 of type dogat -(defmethod send-attack-to-all-tshapes ((this dogat) (arg0 process-focusable) (arg1 event-message-block)) +(defmethod find-and-damage-attackers ((this dogat) (arg0 process-focusable) (arg1 event-message-block)) + "Find things that have attacked us, then deal damage back. + This is used for attacks that damage both the player and the enemy, + like hitting a guard with a jetboard." 0 ) ;; definition for method 120 of type dogat ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this dogat)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -506,7 +512,8 @@ ;; definition for method 50 of type dogat ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-50 ((this dogat) (arg0 int)) +(defmethod update-collision-action ((this dogat) (arg0 int)) + "Change the collision for certain conditions (knocked, etc)" (let ((v1-0 arg0)) (cond ((= v1-0 1) @@ -530,12 +537,13 @@ ;; definition for method 121 of type dogat ;; WARN: Return type mismatch shadow-control vs none. (defmethod init-enemy! ((this dogat)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-dogat" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *dogat-nav-enemy-info*) + (setup-enemy! this *dogat-nav-enemy-info*) (set-vector! (-> this root scale) 2.5 2.5 2.5 1.0) (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) (logior! (-> this skel status) (joint-control-status sync-math)) @@ -554,7 +562,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/doors/wasdoors-init_REF.gc b/test/decompiler/reference/jak3/levels/wascity/doors/wasdoors-init_REF.gc index 0946c95e201..958934633c4 100644 --- a/test/decompiler/reference/jak3/levels/wascity/doors/wasdoors-init_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/doors/wasdoors-init_REF.gc @@ -5,8 +5,8 @@ ;; INFO: Used lq/sq (defun wasdoors-point-inside? ((arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) - (set! (-> gp-0 0 quad) (-> (new 'static 'vector :z -1.0 :w 957235.2) quad)) - (set! (-> gp-0 1 quad) (-> (new 'static 'vector :x 9246720.0 :y 125747.2 :z 625049.6 :w 450560.0) quad)) + (vector-copy! (-> gp-0 0) (new 'static 'vector :z -1.0 :w 957235.2)) + (vector-copy! (-> gp-0 1) (new 'static 'vector :x 9246720.0 :y 125747.2 :z 625049.6 :w 450560.0)) (set! (-> gp-0 2 x) (vector4-dot (-> gp-0 0) arg0)) (set! (-> gp-0 2 y) (vector-vector-distance (-> gp-0 1) arg0)) (and (< 0.0 (-> gp-0 2 x)) (< (-> gp-0 2 y) (-> gp-0 1 w))) @@ -221,7 +221,7 @@ (a0-0 *level*) ) (cond - ((= (status-of-level-and-borrows a0-0 'desert #f) gp-0) + ((= (level-status? a0-0 'desert #f) gp-0) (wasdoors-cleanup (the-as level a0-0)) ) (else @@ -275,7 +275,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/flee-info_REF.gc b/test/decompiler/reference/jak3/levels/wascity/flee-info_REF.gc index b02da295229..3232b2a5f8b 100644 --- a/test/decompiler/reference/jak3/levels/wascity/flee-info_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/flee-info_REF.gc @@ -38,7 +38,7 @@ (a2-1 s2-0) (a1-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> a2-1 position quad)) + (vector-copy! a1-1 (-> a2-1 position)) (set! (-> a1-1 w) 1.0) (let ((s0-0 (t9-0 a0-1 a1-1)) (s1-0 (-> s2-0 branch-count)) @@ -60,7 +60,7 @@ ;; INFO: Used lq/sq (defmethod flee-info-method-10 ((this flee-info) (arg0 citizen) (arg1 vector)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> arg0 root trans quad)) + (vector-copy! a1-1 (-> arg0 root trans)) (set! (-> a1-1 w) 81920.0) (let ((s5-0 (find-segment arg0 a1-1 arg1))) (if s5-0 @@ -126,15 +126,15 @@ (when s4-0 (vehicle-controller-method-11 s5-0) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> s5-0 turn-exit-point quad)) + (vector-copy! s3-1 (-> s5-0 turn-exit-point)) (vehicle-controller-method-10 s5-0 s4-0) - (set! (-> s5-0 path-prev-point quad) (-> s3-1 quad)) + (vector-copy! (-> s5-0 path-prev-point) s3-1) ) (set! (-> s5-0 branch) s4-0) (let ((a1-4 (-> s4-0 dest-node)) (v1-21 (-> s5-0 turn-exit-point)) ) - (set! (-> v1-21 quad) (-> a1-4 position quad)) + (vector-copy! v1-21 (-> a1-4 position)) (set! (-> v1-21 w) 1.0) ) ) @@ -143,7 +143,7 @@ ) ) (when (< (-> arg0 cp-next-time) (current-time)) - (set! (-> arg0 cp-next-time) (+ (current-time) (set-reaction-time! arg0 (seconds 2) (seconds 4)))) + (set! (-> arg0 cp-next-time) (+ (current-time) (rnd-time-frame arg0 (seconds 2) (seconds 4)))) (citizen-method-203 arg0 (-> arg0 cp-force)) ) (add-offset-to-target! (-> arg0 nav state) (-> arg0 cp-force)) @@ -152,14 +152,10 @@ ) (logclear! (-> a0-18 flags) (nav-state-flag directional-mode)) (logior! (-> a0-18 flags) (nav-state-flag target-poly-dirty)) - (set! (-> a0-18 target-pos quad) (-> v1-32 quad)) + (vector-copy! (-> a0-18 target-pos) v1-32) ) 0 - (set! (-> (new 'stack-no-clear 'vector) quad) (-> arg0 nav state target-pos quad)) + (vector-copy! (new 'stack-no-clear 'vector) (-> arg0 nav state target-pos)) (nav-enemy-method-187 arg0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/formation-object_REF.gc b/test/decompiler/reference/jak3/levels/wascity/formation-object_REF.gc index 228c8b92726..d8084b99c6b 100644 --- a/test/decompiler/reference/jak3/levels/wascity/formation-object_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/formation-object_REF.gc @@ -165,7 +165,7 @@ ) ) ) - (set! (-> this root trans quad) (-> s5-2 position quad)) + (vector-copy! (-> this root trans) (-> s5-2 position)) (set! (-> s5-2 handle-parent) (process->handle this)) (set! (-> s5-2 object-type) (traffic-type guard-a)) (logior! (-> s5-2 flags) (traffic-spawn-flags tsf4)) @@ -217,7 +217,7 @@ (defbehavior formation-init-by-other formation-object ((arg0 traffic-object-spawn-params)) (stack-size-set! (-> self main-thread) 128) (init-collision! self) - (set! (-> self root trans quad) (-> arg0 position quad)) + (vector-copy! (-> self root trans) (-> arg0 position)) (quaternion-copy! (-> self root quat) (-> arg0 rotation)) (traffic-entity-hack (-> arg0 object-type)) (set! (-> self formation) (new 'process 'formation-layout)) @@ -403,7 +403,7 @@ (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> self controller turn-exit-point quad)) + (vector-copy! s5-0 (-> self controller turn-exit-point)) (vehicle-controller-method-14 (-> self controller) (the-as vehicle self)) (vector-! gp-0 (-> self controller turn-exit-point) s5-0) (set! (-> gp-0 y) 0.0) @@ -468,7 +468,7 @@ ) ) (if a0-6 - (set! (-> this root trans quad) (-> (get-trans (the-as process-focusable a0-6) 0) quad)) + (vector-copy! (-> this root trans) (get-trans (the-as process-focusable a0-6) 0)) ) ) (set! (-> this root trans y) (+ 20480.0 (-> this root trans y))) diff --git a/test/decompiler/reference/jak3/levels/wascity/formations_REF.gc b/test/decompiler/reference/jak3/levels/wascity/formations_REF.gc index 74a130f522a..53483b7d0b2 100644 --- a/test/decompiler/reference/jak3/levels/wascity/formations_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/formations_REF.gc @@ -63,7 +63,7 @@ (f0-0 0.0) ) (dotimes (a0-2 v1-1) - (set! (-> this formation-points a0-2 quad) (-> s4-0 a0-2 quad)) + (vector-copy! (-> this formation-points a0-2) (-> s4-0 a0-2)) (let* ((a1-6 (-> this formation-points a0-2)) (f1-3 (+ (* (-> a1-6 x) (-> a1-6 x)) (* (-> a1-6 z) (-> a1-6 z)))) ) @@ -120,7 +120,3 @@ ;; failed to figure out what this is: (set! (-> *formation-list* 1 layout) *formation-layout-wedge*) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/leaper/was-leaper-race_REF.gc b/test/decompiler/reference/jak3/levels/wascity/leaper/was-leaper-race_REF.gc index 7b56f878caf..64395575d59 100644 --- a/test/decompiler/reference/jak3/levels/wascity/leaper/was-leaper-race_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/leaper/was-leaper-race_REF.gc @@ -425,7 +425,7 @@ (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 13) (the-as int #f) (the-as vector #t) 0)) ) (when s4-0 - (set! (-> gp-0 quad) (-> s4-0 control trans quad)) + (vector-copy! gp-0 (-> s4-0 control trans)) (+! (-> gp-0 y) 8192.0) (vector-! gp-0 gp-0 (-> self root trans)) (let ((s5-0 (-> self root quat))) @@ -614,13 +614,14 @@ ;; definition for method 11 of type wascity-race-ring ;; INFO: Used lq/sq (defmethod init-from-entity! ((this wascity-race-ring) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (set! (-> this active?) #f) (set! (-> this minimap) #f) (quaternion->matrix (-> this mat) (-> this root quat)) - (set! (-> this mat trans quad) (-> this root trans quad)) + (vector-copy! (-> this mat trans) (-> this root trans)) (set! (-> this taskman) (the-as handle #f)) (set! (-> this part) (create-launch-control (-> *part-group-id-table* 518) this)) (set! (-> this player-part) (create-launch-control (-> *part-group-id-table* 519) this)) @@ -788,7 +789,7 @@ (new 'static 'talker-speech-class :name "dax366" :channel (gui-channel daxter) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x14 :neg #x1 :on-close #f @@ -1212,9 +1213,7 @@ ) ) (when (not s5-2) - (when (and (= (status-of-level-and-borrows *level* 'wascitya #f) 'active) - (= (status-of-level-and-borrows *level* 'wascityb #f) 'active) - ) + (when (and (= (level-status? *level* 'wascitya #f) 'active) (= (level-status? *level* 'wascityb #f) 'active)) (let ((s4-3 (-> (level-get *level* 'wasleapr) bsp nav-meshes 0 nav-mesh))) (when s4-3 (set! (-> s4-3 next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> s4-3 entity) 'next-actor 0))) @@ -1356,7 +1355,3 @@ (set-setting! 'airlock #f 0.0 0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/maker-projectile_REF.gc b/test/decompiler/reference/jak3/levels/wascity/maker-projectile_REF.gc index 47e02ce8e94..edb4f767f86 100644 --- a/test/decompiler/reference/jak3/levels/wascity/maker-projectile_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/maker-projectile_REF.gc @@ -110,7 +110,7 @@ (set! (-> *maker-grenade-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *maker-grenade-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *maker-grenade-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *maker-grenade-trail* use-tape-mode?) #f) @@ -775,7 +775,7 @@ :code (behavior () (let ((gp-0 (new 'stack-no-clear 'matrix))) (let ((s5-0 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-0 spawn-point quad) (-> self root trans quad)) + (vector-copy! (-> s5-0 spawn-point) (-> self root trans)) (quaternion-identity! (-> s5-0 spawn-quat)) (set! (-> s5-0 radius) (-> self blast-radius)) (set! (-> s5-0 scale) 1.0) @@ -794,7 +794,7 @@ (cond ((< (* f0-6 f0-6) (vector-vector-distance-squared (-> self root trans) (target-pos 0))) (forward-up->inv-matrix gp-0 (-> self pre-move-transv) *up-vector*) - (set! (-> gp-0 trans quad) (-> self root trans quad)) + (vector-copy! (-> gp-0 trans) (-> self root trans)) (if (logtest? (-> *part-group-id-table* 539 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -808,7 +808,7 @@ ) (else (quaternion->matrix gp-0 (-> *target* control quat)) - (set! (-> gp-0 trans quad) (-> *target* control trans quad)) + (vector-copy! (-> gp-0 trans) (-> *target* control trans)) (if (logtest? (-> *part-group-id-table* 541 flags) (sp-group-flag sp13)) (part-tracker-spawn part-tracker-subsampler @@ -846,7 +846,7 @@ (let ((t9-0 (method-of-type projectile-bounce handle-proj-hit!))) (when (not (t9-0 this arg0 arg1)) (when (type? arg0 wascity-turret-shot) - (set! (-> this pre-move-transv quad) (-> (the-as wascity-turret-shot arg0) pre-move-transv quad)) + (vector-copy! (-> this pre-move-transv) (-> (the-as wascity-turret-shot arg0) pre-move-transv)) (go (method-of-object this impact)) ) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/palace/waspala-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/palace/waspala-obs_REF.gc index 7302e83a446..1e79bbb45ef 100644 --- a/test/decompiler/reference/jak3/levels/wascity/palace/waspala-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/palace/waspala-obs_REF.gc @@ -98,6 +98,7 @@ ;; definition for method 11 of type waspala-paddle-wheel (defmethod init-from-entity! ((this waspala-paddle-wheel) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) @@ -208,6 +209,7 @@ ;; definition for method 11 of type waspala-windmill (defmethod init-from-entity! ((this waspala-windmill) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -375,6 +377,7 @@ ;; definition for method 11 of type waspala-blocker (defmethod init-from-entity! ((this waspala-blocker) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/test/decompiler/reference/jak3/levels/wascity/squad-control-city_REF.gc b/test/decompiler/reference/jak3/levels/wascity/squad-control-city_REF.gc index 1f541507b51..07f6da90b0b 100644 --- a/test/decompiler/reference/jak3/levels/wascity/squad-control-city_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/squad-control-city_REF.gc @@ -365,7 +365,7 @@ (vector-float*! s5-1 s5-1 0.0625) ) (else - (set! (-> s5-1 quad) (-> (the-as process-focusable s4-0) root transv quad)) + (vector-copy! s5-1 (-> (the-as process-focusable s4-0) root transv)) ) ) (set! (-> s5-1 y) 0.0) diff --git a/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc b/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc index eebe50d449f..27370f499b4 100644 --- a/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/tizard_REF.gc @@ -385,7 +385,8 @@ ;; definition for method 20 of type tizard ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this tizard)) +(defmethod get-search-info-flag ((this tizard)) + "Get search-info-flag for this process." (the-as search-info-flag 8) ) @@ -444,6 +445,7 @@ ;; definition for method 11 of type tizard (defmethod init-from-entity! ((this tizard) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) diff --git a/test/decompiler/reference/jak3/levels/wascity/traffic-util_REF.gc b/test/decompiler/reference/jak3/levels/wascity/traffic-util_REF.gc index 085dc7a95c3..9f80d912d10 100644 --- a/test/decompiler/reference/jak3/levels/wascity/traffic-util_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/traffic-util_REF.gc @@ -309,8 +309,8 @@ (dotimes (s3-0 16) (let ((v1-3 (-> this array s3-0))) (when (logtest? (-> v1-3 flags) (traffic-suppression-box-flag in-use)) - (set! (-> s5-0 min quad) (-> v1-3 bbox min quad)) - (set! (-> s5-0 max quad) (-> v1-3 bbox max quad)) + (vector-copy! (-> s5-0 min) (-> v1-3 bbox min)) + (vector-copy! (-> s5-0 max) (-> v1-3 bbox max)) (set! (-> s5-0 min w) 1.0) (set! (-> s5-0 max w) 1.0) (add-debug-box #t (bucket-id debug-no-zbuf1) (-> s5-0 min) (-> s5-0 max) s4-0) @@ -536,8 +536,8 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init-vis-ray ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) - (set! (-> arg0 pos quad) (-> arg1 quad)) - (set! (-> arg0 dest-pos quad) (-> arg2 quad)) + (vector-copy! (-> arg0 pos) arg1) + (vector-copy! (-> arg0 dest-pos) arg2) (let ((v1-2 (new 'stack-no-clear 'vector))) (vector-! v1-2 arg2 arg1) (set! (-> arg0 len) (vector-length v1-2)) @@ -594,7 +594,7 @@ ) (cond ((= s4-0 -1) - (set! (-> arg0 pos quad) (-> arg0 dest-pos quad)) + (vector-copy! (-> arg0 pos) (-> arg0 dest-pos)) (set! (-> arg0 len) 0.0) ) (else @@ -641,7 +641,7 @@ (let ((a1-1 s2-0) (v1-0 (-> s5-0 2)) ) - (set! (-> v1-0 quad) (-> a1-1 position quad)) + (vector-copy! v1-0 (-> a1-1 position)) (set! (-> v1-0 w) 1.0) ) (let ((v1-1 s2-0) @@ -658,7 +658,7 @@ (set! (-> s1-0 w) 1.0) ) (vector-! (-> s5-0 5) (-> s5-0 2) arg0) - (set! (-> s5-0 4 quad) (-> s5-0 3 quad)) + (vector-copy! (-> s5-0 4) (-> s5-0 3)) (set! (-> s5-0 4 x) (-> s5-0 3 z)) (set! (-> s5-0 4 z) (- (-> s5-0 3 x))) (when (< 0.0 (vector-dot (-> s5-0 5) (-> s5-0 4))) @@ -703,7 +703,7 @@ (f0-35 (/ (* f28-0 f1-12) f30-0)) ) (let ((f1-15 (/ (* f1-12 f1-12) f30-0))) - (set! (-> arg2 quad) (-> arg0 quad)) + (vector-copy! arg2 arg0) (let ((a1-13 arg2)) (let ((v1-26 arg2)) (let ((a0-14 (-> s5-0 0))) @@ -765,7 +765,7 @@ (let ((a1-1 s3-0) (v1-4 (-> gp-0 min)) ) - (set! (-> v1-4 quad) (-> a1-1 position quad)) + (vector-copy! v1-4 (-> a1-1 position)) (set! (-> v1-4 w) 1.0) ) (dotimes (s2-0 (-> s3-0 branch-count)) @@ -773,7 +773,7 @@ (let ((a1-4 (-> s1-0 dest-node)) (v1-6 (-> gp-0 max)) ) - (set! (-> v1-6 quad) (-> a1-4 position quad)) + (vector-copy! v1-6 (-> a1-4 position)) (set! (-> v1-6 w) 1.0) ) (set! (-> s1-0 max-user-count) @@ -868,7 +868,7 @@ (let ((a1-1 s3-0) (v1-26 sv-168) ) - (set! (-> v1-26 quad) (-> a1-1 position quad)) + (vector-copy! v1-26 (-> a1-1 position)) (set! (-> v1-26 w) 1.0) ) (cond @@ -876,7 +876,7 @@ (let ((a1-4 (-> a2-0 dest-node)) (v1-29 sv-164) ) - (set! (-> v1-29 quad) (-> a1-4 position quad)) + (vector-copy! v1-29 (-> a1-4 position)) (set! (-> v1-29 w) 1.0) ) ) @@ -944,7 +944,7 @@ (let ((a1-16 s4-2) (v1-72 sv-244) ) - (set! (-> v1-72 quad) (-> a1-16 position quad)) + (vector-copy! v1-72 (-> a1-16 position)) (set! (-> v1-72 w) 1.0) ) (cond @@ -952,7 +952,7 @@ (let ((a1-19 (-> sv-184 dest-node)) (v1-76 sv-252) ) - (set! (-> v1-76 quad) (-> a1-19 position quad)) + (vector-copy! v1-76 (-> a1-19 position)) (set! (-> v1-76 w) 1.0) ) ) @@ -962,7 +962,7 @@ ) (init-vis-ray this sv-104 sv-244 sv-252) (while (< 0.0 (-> sv-104 len)) - (set! (-> sv-248 quad) (-> sv-104 pos quad)) + (vector-copy! sv-248 (-> sv-104 pos)) (set! sv-260 (-> sv-104 cell)) (city-level-info-method-11 this sv-104) (let ((a2-14 (-> sv-260 incoming-segment-count))) @@ -981,7 +981,7 @@ ) (let ((s2-1 (-> sv-260 segment-array a2-14))) (set! (-> s2-1 vertex 0 quad) (-> sv-248 quad)) - (set! (-> s2-1 vertex 1 quad) (-> sv-104 pos quad)) + (vector-copy! (-> s2-1 vertex 1) (-> sv-104 pos)) (set! (-> s2-1 length) (vector-vector-distance (the-as vector (-> s2-1 vertex)) (-> s2-1 vertex 1))) (let* ((f0-9 (if (logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian)) 24576.0 @@ -1198,13 +1198,13 @@ (let ((a1-7 sv-16) (v1-35 sv-88) ) - (set! (-> v1-35 quad) (-> a1-7 position quad)) + (vector-copy! v1-35 (-> a1-7 position)) (set! (-> v1-35 w) 1.0) ) (let ((a1-10 sv-80) (v1-36 sv-92) ) - (set! (-> v1-36 quad) (-> a1-10 position quad)) + (vector-copy! v1-36 (-> a1-10 position)) (set! (-> v1-36 w) 1.0) ) (vector-! sv-84 sv-92 sv-88) @@ -1235,7 +1235,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasall-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasall-obs_REF.gc index 53e0334be05..97b8ab2d705 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasall-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasall-obs_REF.gc @@ -27,6 +27,7 @@ ;; definition for method 11 of type wascity-airlock (defmethod init-from-entity! ((this wascity-airlock) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) @@ -102,6 +103,7 @@ ;; definition for method 11 of type wascity-airlock-small (defmethod init-from-entity! ((this wascity-airlock-small) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) @@ -220,6 +222,7 @@ ;; definition for method 11 of type wascity-elevator-door (defmethod init-from-entity! ((this wascity-elevator-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) @@ -311,7 +314,7 @@ (defbehavior tentacle-follow-post tentacle () (let ((a0-0 *target*)) (when a0-0 - (set! (-> self focus-pos quad) (-> (get-trans a0-0 0) quad)) + (vector-copy! (-> self focus-pos) (get-trans a0-0 0)) (set-vector! (-> self root trans) (-> self focus-pos x) (-> self root trans y) (-> self focus-pos z) 1.0) ) ) @@ -375,9 +378,9 @@ (set-time! (-> self active-timer)) ) (when (and gp-0 (time-elapsed? (-> self active-timer) (seconds 0.1))) - (set! (-> self root trans quad) (-> (get-trans gp-0 0) quad)) + (vector-copy! (-> self root trans) (get-trans gp-0 0)) (set! (-> self root trans y) (+ -114688.0 (get-base-height *ocean-map*))) - (set! (-> self init-pos quad) (-> self root trans quad)) + (vector-copy! (-> self init-pos) (-> self root trans)) (if (focus-test? gp-0 under-water) (go-virtual un-dive-player) (go-virtual attacking-0) @@ -476,11 +479,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 409 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 409)) ) (else - (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (vector-copy! (-> *launch-matrix* trans) gp-0) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 409)) ) ) @@ -537,6 +540,7 @@ ;; definition for method 11 of type tentacle (defmethod init-from-entity! ((this tentacle) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (stack-size-set! (-> this main-thread) 64) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasall-tasks_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasall-tasks_REF.gc index 46cb263fef7..a57c36635fe 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasall-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasall-tasks_REF.gc @@ -287,7 +287,7 @@ (!= (-> *bigmap* load-index) 20) ) (let ((s4-1 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s4-1 pos quad) (-> (the-as process-focusable s5-0) root trans quad)) + (vector-copy! (-> s4-1 pos) (-> (the-as process-focusable s5-0) root trans)) (quaternion-identity! (-> s4-1 quat)) (set! (-> s4-1 flags) (task-arrow-flags)) (set! (-> s4-1 map-icon) (the-as uint 13)) @@ -369,7 +369,7 @@ (until #f (suspend) (cond - ((= (status-of-level-and-borrows *level* 'desert #f) 'active) + ((= (level-status? *level* 'desert #f) 'active) (set-setting! 'scarf 'abs 1.0 0) (set-setting! 'goggles 'abs 1.0 0) ) @@ -536,7 +536,7 @@ (defstate active (task-manager-desert-interceptors-attack) :virtual #t :code (behavior () - (while (!= (status-of-level-and-borrows *level* 'desert #f) 'active) + (while (!= (level-status? *level* 'desert #f) 'active) (suspend) ) (suspend) @@ -1251,7 +1251,7 @@ (format *stdebug* "nest-hunt task manager waiting for scorpion~%") ) ((not (handle->process (-> this sig-handle))) - (if (= (status-of-level-and-borrows *level* 'lwassig #f) 'active) + (if (= (level-status? *level* 'lwassig #f) 'active) (set! (-> this sig-handle) (process->handle (sig-rider-spawn (the-as vehicle (handle->process (-> this vehicle-handle))) #f)) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc index 7c8d48fded4..6e22a3b1cb7 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wascity-turret_REF.gc @@ -225,15 +225,15 @@ ) (set! (-> *game-info* health-bar-vehicle) 0.0) (let ((v1-12 (new 'stack-no-clear 'vector))) - (set! (-> v1-12 quad) (-> this root trans quad)) + (vector-copy! v1-12 (-> this root trans)) (+! (-> v1-12 y) 8192.0) (cond ((logtest? (-> *part-group-id-table* 542 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-12 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-12) (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 542)) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-12 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-12) (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 542)) ) ) @@ -336,11 +336,11 @@ (s5-0 (new 'stack-no-clear 'matrix)) ) (quaternion->matrix s4-0 (-> this root quat)) - (set! (-> s4-0 trans quad) (-> this root trans quad)) + (vector-copy! (-> s4-0 trans) (-> this root trans)) (matrix-identity! s5-0) - (set! (-> s5-0 trans quad) (-> *wascity-display-offset* quad)) + (vector-copy! (-> s5-0 trans) *wascity-display-offset*) (matrix*! s5-0 s5-0 s4-0) - (set! (-> s4-0 trans quad) (-> s5-0 trans quad)) + (vector-copy! (-> s4-0 trans) (-> s5-0 trans)) (dotimes (s3-0 (the-as int (-> this radar-object-counter))) (let* ((f0-1 (* 2867.2 (-> this radar-object s3-0 x))) (f1-2 (* 819.2 (+ -0.12 (-> this radar-object s3-0 y)))) @@ -670,7 +670,7 @@ (('radar-pos) (let ((v1-26 (new 'stack-no-clear 'vector))) (when (< (-> this radar-object-counter) (the-as uint 64)) - (set! (-> v1-26 quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! v1-26 (the-as vector (-> arg3 param 0))) (let ((a0-21 (-> this radar-object (-> this radar-object-counter)))) (set! (-> a0-21 x) (-> v1-26 x)) (set! (-> a0-21 y) (-> v1-26 y)) @@ -858,8 +858,8 @@ (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options po13 po17)) (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) - (set! (-> gp-0 pos quad) (-> arg0 quad)) - (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 7372800.0) quad)) + (vector-copy! (-> gp-0 pos) arg0) + (vector-copy! (-> gp-0 vel) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 7372800.0)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) (set! (-> gp-0 target-handle) (the-as handle #f)) @@ -1252,7 +1252,7 @@ (f30-0 91.022224) ) (quaternion->matrix s5-0 (-> this root quat)) - (set! (-> s5-0 trans quad) (-> (wascity-turret-gun-pos) quad)) + (vector-copy! (-> s5-0 trans) (wascity-turret-gun-pos)) (seek! (-> this lerp) 0.0 (* 0.25 (seconds-per-frame))) (set! (-> this lerp2) 0.0) (vector-lerp! (-> this aim-dir) (-> s5-0 fvec) (-> this aim-dir) (-> this lerp)) @@ -1349,9 +1349,9 @@ (set! sv-1040 (new 'stack-no-clear 'vector)) (set! sv-976 (-> (the-as collide-shape (-> (the-as process-drawable s2-2) root)) root-prim)) (set! sv-944 -1) - (set! (-> s1-1 quad) (-> sv-976 prim-core world-sphere quad)) - (set! (-> sv-1024 quad) (-> s1-1 quad)) - (set! (-> s0-1 quad) (-> s1-1 quad)) + (vector-copy! s1-1 (-> sv-976 prim-core world-sphere)) + (vector-copy! sv-1024 s1-1) + (vector-copy! s0-1 s1-1) (when (= (-> s2-2 type) skeet) (set! sv-960 s2-2) (let ((f28-1 (/ f28-0 (meters 1800)))) @@ -1402,9 +1402,9 @@ (set! (-> a1-20 message) 'is-section-shot) (set! (-> a1-20 param 0) (-> (the-as collide-shape-prim-group sv-976) child sv-992 prim-id)) (when (and (not (send-event-function s2-2 a1-20)) (< f26-2 f28-2)) - (set! (-> s0-1 quad) (-> (the-as collide-shape-prim-group sv-976) child sv-992 prim-core world-sphere quad)) - (set! (-> sv-1024 quad) (-> s0-1 quad)) - (set! (-> s1-1 quad) (-> s0-1 quad)) + (vector-copy! s0-1 (-> (the-as collide-shape-prim-group sv-976) child sv-992 prim-core world-sphere)) + (vector-copy! sv-1024 s0-1) + (vector-copy! s1-1 s0-1) (if #f (add-debug-sphere #t (bucket-id debug) s0-1 (-> s0-1 w) *color-blue*) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/wascitya-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wascitya-obs_REF.gc index 47cde372355..490a7f558a8 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wascitya-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wascitya-obs_REF.gc @@ -27,6 +27,7 @@ ;; definition for method 11 of type wascity-stad-door (defmethod init-from-entity! ((this wascity-stad-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc index 53ee46760a4..e2f13f062db 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasdef-manager_REF.gc @@ -551,7 +551,7 @@ (set! (-> *maker-entry-trail* zbuffer?) #f) ;; failed to figure out what this is: -(set! (-> *maker-entry-trail* lie-vector quad) (-> *up-vector* quad)) +(vector-copy! (-> *maker-entry-trail* lie-vector) *up-vector*) ;; failed to figure out what this is: (set! (-> *maker-entry-trail* use-tape-mode?) #f) @@ -922,7 +922,7 @@ (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 start-pos quad) (-> arg0 quad)) + (vector-copy! (-> s4-0 start-pos) arg0) (+! (-> s4-0 start-pos y) 81920.0) (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) (let ((v1-3 s4-0)) @@ -1314,18 +1314,7 @@ (set! *maker-first-hit* #t) ) (let ((s3-2 (new 'stack-no-clear 'vector))) - (let ((a2-7 (new 'stack-no-clear 'matrix))) - (let* ((a3-6 (-> self node-list data s4-1 bone transform)) - (v1-65 (-> a3-6 rvec quad)) - (a0-70 (-> a3-6 uvec quad)) - (a1-14 (-> a3-6 fvec quad)) - (a3-7 (-> a3-6 trans quad)) - ) - (set! (-> a2-7 rvec quad) v1-65) - (set! (-> a2-7 uvec quad) a0-70) - (set! (-> a2-7 fvec quad) a1-14) - (set! (-> a2-7 trans quad) a3-7) - ) + (let ((a2-7 (matrix-copy! (new 'stack-no-clear 'matrix) (-> self node-list data s4-1 bone transform)))) (maker-world-to-local-vec! s3-2 (-> (the-as attack-info gp-0) trans) a2-7) ) (when (< (the-as uint 2) (-> self damage-info s5-1 counter)) @@ -1364,11 +1353,11 @@ ) (cond ((logtest? (-> *part-group-id-table* 538 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> (the-as attack-info gp-0) trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as attack-info gp-0) trans)) (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 538)) ) (else - (set! (-> *launch-matrix* trans quad) (-> (the-as attack-info gp-0) trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> (the-as attack-info gp-0) trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 538)) ) ) @@ -1468,7 +1457,7 @@ (s4-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 bone transform fvec) 1.0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s3-0 (target-pos 0)) (new 'stack-no-clear 'vector) 0.0 0.0 @@ -1509,8 +1498,8 @@ (set! (-> s3-1 charge) 1.0) (set! (-> s3-1 options) (projectile-options)) (logclear! (-> s3-1 options) (projectile-options po14 po15 po16)) - (set! (-> s3-1 pos quad) (-> s5-0 quad)) - (set! (-> s3-1 vel quad) (-> s2-3 quad)) + (vector-copy! (-> s3-1 pos) s5-0) + (vector-copy! (-> s3-1 vel) s2-3) ) (set! (-> s3-1 notify-handle) (the-as handle #f)) (set! (-> s3-1 owner-handle) (the-as handle #f)) @@ -1543,12 +1532,12 @@ (set! (-> s3-2 charge) 1.0) (set! (-> s3-2 options) (projectile-options)) (logclear! (-> s3-2 options) (projectile-options po14 po15 po16)) - (set! (-> s3-2 pos quad) (-> s5-0 quad)) - (set! (-> s3-2 vel quad) (-> s4-1 quad)) + (vector-copy! (-> s3-2 pos) s5-0) + (vector-copy! (-> s3-2 vel) s4-1) (set! (-> s3-2 notify-handle) (the-as handle #f)) (set! (-> s3-2 owner-handle) (process->handle this)) (set! (-> s3-2 target-handle) (the-as handle #f)) - (set! (-> s3-2 target-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> s3-2 target-pos) (target-pos 0)) (set! (-> s3-2 ignore-handle) (process->handle this)) (let* ((v1-50 *game-info*) (a0-41 (+ (-> v1-50 attack-id) 1)) @@ -1764,7 +1753,7 @@ ) ) (let ((a0-16 (new 'stack-no-clear 'vector))) - (set! (-> a0-16 quad) (-> self root trans quad)) + (vector-copy! a0-16 (-> self root trans)) (+! (-> a0-16 y) 143360.0) (wascity-turret-add-radar a0-16) ) @@ -1847,7 +1836,7 @@ (set! (-> s4-2 y) (get-base-height *ocean-map*)) (cond ((logtest? (-> *part-group-id-table* 535 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-2 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-2) (part-tracker-spawn part-tracker-subsampler :to self @@ -1856,7 +1845,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-2 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-2) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 535) :duration (seconds 1)) ) ) @@ -1874,7 +1863,7 @@ (set! (-> s4-5 y) (get-base-height *ocean-map*)) (cond ((logtest? (-> *part-group-id-table* 535 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-5 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-5) (part-tracker-spawn part-tracker-subsampler :to self @@ -1883,7 +1872,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-5 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-5) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 535) :duration (seconds 1)) ) ) @@ -1897,7 +1886,7 @@ (vector+! (-> self root trans) (-> self root trans) gp-0) ) (let ((a0-42 (new 'stack-no-clear 'vector))) - (set! (-> a0-42 quad) (-> self root trans quad)) + (vector-copy! a0-42 (-> self root trans)) (+! (-> a0-42 y) 307200.0) (wascity-turret-add-radar a0-42) ) @@ -2031,14 +2020,14 @@ :virtual #t :event maker-standard-event-handler :enter (behavior () - (set! (-> self pacc quad) (-> self pvel quad)) + (vector-copy! (-> self pacc) (-> self pvel)) (vector-normalize! (-> self pacc) 20480.0) (if (not (-> self maker-sound-playing?)) (set! (-> self maker-sound-playing?) #t) ) (cond ((logtest? (-> *part-group-id-table* 534 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self @@ -2047,7 +2036,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 534) :duration (seconds 1)) ) ) @@ -2081,12 +2070,12 @@ ) (set! (-> self made-splash?) #t) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> self root trans quad)) + (vector-copy! s4-0 (-> self root trans)) (set! (-> s4-0 y) (get-base-height *ocean-map*)) (sound-play "ball-splash") (cond ((logtest? (-> *part-group-id-table* 536 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker-subsampler :to self @@ -2095,7 +2084,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> s4-0 quad)) + (vector-copy! (-> *launch-matrix* trans) s4-0) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 536) :duration (seconds 5)) ) ) @@ -2133,7 +2122,7 @@ ) ) (let ((a0-46 (new 'stack-no-clear 'vector))) - (set! (-> a0-46 quad) (-> self root trans quad)) + (vector-copy! a0-46 (-> self root trans)) (+! (-> a0-46 y) 143360.0) (wascity-turret-add-radar a0-46) ) @@ -2151,7 +2140,7 @@ (set! (-> a1-1 gravity) -163840.0) (set! (-> a1-1 scale-rand-lo) 7.5) (set! (-> a1-1 scale-rand-hi) 10.0) - (set! (-> a1-1 fountain-rand-transv-lo quad) (-> this root trans quad)) + (vector-copy! (-> a1-1 fountain-rand-transv-lo) (-> this root trans)) (debris-spawn this a1-1 *maker-debris-params* (the-as process-drawable #f)) ) 0 @@ -2201,7 +2190,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 545 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> v1-7 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-7) (part-tracker-spawn part-tracker-subsampler :to self @@ -2210,7 +2199,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> v1-7 quad)) + (vector-copy! (-> *launch-matrix* trans) v1-7) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 545) :duration (seconds 5)) ) ) @@ -2387,10 +2376,10 @@ (defmethod maker-method-34 ((this maker)) (cond ((= (-> this path-idx) -1) - (set! (-> this seek-pos quad) (-> (target-pos 0) quad)) + (vector-copy! (-> this seek-pos) (target-pos 0)) ) (else - (set! (-> this seek-pos quad) (-> *maker-traverse-paths* (-> this path-idx) (-> this path-pt) quad)) + (vector-copy! (-> this seek-pos) (-> *maker-traverse-paths* (-> this path-idx) (-> this path-pt))) (if (< (-> this seek-pos z) -1937408.0) (set! (-> this seek-pos y) (get-ocean-floor-height (-> this seek-pos))) ) @@ -2414,7 +2403,7 @@ (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-9) ) (quaternion->matrix s5-1 (-> this root quat)) - (set! (-> this pvel quad) (-> s5-1 fvec quad)) + (vector-copy! (-> this pvel) (-> s5-1 fvec)) (set! (-> this pvel y) 0.0) (vector-normalize! (-> this pvel) 81920.0) (set! (-> this pvel y) (* 81920.0 (/ (- (-> this seek-pos y) (-> this root trans y)) @@ -2474,7 +2463,7 @@ (set! (-> self path-idx) arg0) (set! (-> self path-pt) 0) (set! (-> self path-len) (length (-> *maker-traverse-paths* arg0))) - (set! (-> self seek-pos quad) (-> *maker-traverse-paths* arg0 0 quad)) + (vector-copy! (-> self seek-pos) (-> *maker-traverse-paths* arg0 0)) (if (< (-> self seek-pos z) -1937408.0) (set! (-> self seek-pos y) (get-ocean-floor-height (-> self seek-pos))) ) @@ -2497,7 +2486,7 @@ (+! (-> s4-1 y) 819200.0) ) ) - (set! (-> self root trans quad) (-> s4-1 quad)) + (vector-copy! (-> self root trans) s4-1) (vector-! (-> self pvel) (-> self seek-pos) (-> self root trans)) (vector-normalize! (-> self pvel) arg2) (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) f30-0) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasgun-hud_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasgun-hud_REF.gc index 3fc69f8b018..bc9e73bbc69 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasgun-hud_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasgun-hud_REF.gc @@ -294,7 +294,7 @@ (('maker-update) (when (< (-> this maker-idx) (the-as uint 15)) (let ((v1-12 (-> this minfo (-> this maker-idx)))) - (set! (-> v1-12 pos quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (vector-copy! (-> v1-12 pos) (the-as vector (-> arg3 param 0))) (set! (-> v1-12 hit-points) (the-as float (-> arg3 param 1))) (set! (-> v1-12 targeted) (the-as symbol (-> arg3 param 2))) ) @@ -313,7 +313,7 @@ (b! #t cfg-4 :delay (nop!)) (label cfg-1) (b! (nonzero? (-> this scoretimes v1-0)) cfg-3 :delay (empty-form)) - (set! (-> this position v1-0 quad) (-> arg2 quad)) + (vector-copy! (-> this position v1-0) arg2) (set! (-> this vel v1-0) 0.0) (set! (-> this multiplier v1-0) (the-as uint arg1)) (set! (-> this scores v1-0) arg0) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc index 02dd25f48cf..37d7ec083c7 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasgun-manager_REF.gc @@ -1315,11 +1315,11 @@ (set! (-> self disappear) #t) (cond ((logtest? (-> *part-group-id-table* 546 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 546)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 546)) ) ) @@ -1351,7 +1351,7 @@ ) (cond ((logtest? (-> *part-group-id-table* 533 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to self @@ -1360,7 +1360,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 533) :duration (seconds 5)) ) ) @@ -1702,7 +1702,7 @@ ;; INFO: Used lq/sq (defbehavior skeet-init-by-other skeet ((arg0 task-manager-wascity-gungame) (arg1 skeet-mode) (arg2 vector) (arg3 float) (arg4 float)) (init-collision! self) - (set! (-> self root trans quad) (-> arg2 quad)) + (vector-copy! (-> self root trans) arg2) (set! (-> self angle) (-> arg2 w)) (quaternion-identity! (-> self root quat)) (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) 16384.0) @@ -1812,7 +1812,7 @@ (defun spawn-skeet ((arg0 task-manager-wascity-gungame) (arg1 skeet-mode) (arg2 vector) (arg3 float) (arg4 float)) (cond ((logtest? (-> *part-group-id-table* 533 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> arg2 quad)) + (vector-copy! (-> *launch-matrix* trans) arg2) (part-tracker-spawn part-tracker-subsampler :to arg0 @@ -1821,7 +1821,7 @@ ) ) (else - (set! (-> *launch-matrix* trans quad) (-> arg2 quad)) + (vector-copy! (-> *launch-matrix* trans) arg2) (part-tracker-spawn part-tracker :to arg0 :group (-> *part-group-id-table* 533) :duration (seconds 5)) ) ) @@ -1892,7 +1892,7 @@ (.svf (&-> a1-0 quad) vf6) ) (set! (-> gp-0 w) (-> *skeet-offset-table* s4-0 w)) - (set! (-> *skeet-offset-table* s4-0 quad) (-> gp-0 quad)) + (vector-copy! (-> *skeet-offset-table* s4-0) gp-0) (+! s4-0 1) ) ) @@ -1910,7 +1910,7 @@ (if (= (-> *skeet-offset-table* 1 y) 0.0) (def-launch-circle) ) - (set! (-> s4-0 quad) (-> *skeet-offset-table* arg2 quad)) + (vector-copy! s4-0 (-> *skeet-offset-table* arg2)) (spawn-skeet arg0 arg1 s4-0 arg3 arg4) ) (none) @@ -1984,7 +1984,7 @@ ) (send-event (handle->process (-> this wct)) 'radar-reset) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (target-pos 0) quad)) + (vector-copy! s5-0 (target-pos 0)) (let ((a1-3 (new 'stack-no-clear 'vector))) (set! (-> a1-3 x) 6582272.0) (set! (-> a1-3 y) 262144.0) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-eggs-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-eggs-h_REF.gc index 15b526462a5..98c359a7012 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-eggs-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-eggs-h_REF.gc @@ -7,7 +7,7 @@ (new 'static 'talker-speech-class :name "dam002" :channel (gui-channel voicebox) - :flags (talker-flags tf0 tf3) + :flags (talker-flags play-only-once auto-save-once-on-exit) :speech #x1 :neg #x1 :on-close '(kiosk-complete) @@ -16,7 +16,7 @@ (new 'static 'talker-speech-class :name "sig173" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2 :neg #x1 :on-close #f @@ -25,7 +25,7 @@ (new 'static 'talker-speech-class :name "sig174" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x3 :neg #x1 :on-close #f @@ -34,7 +34,7 @@ (new 'static 'talker-speech-class :name "sig175" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x4 :neg #x1 :on-close #f @@ -43,7 +43,7 @@ (new 'static 'talker-speech-class :name "sig176" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x5 :neg #x1 :on-close #f @@ -52,7 +52,7 @@ (new 'static 'talker-speech-class :name "sig177" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x6 :neg #x1 :on-close #f @@ -61,7 +61,7 @@ (new 'static 'talker-speech-class :name "sig178" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x7 :neg #x1 :on-close #f @@ -70,7 +70,7 @@ (new 'static 'talker-speech-class :name "sig197" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x8 :neg #x1 :on-close #f @@ -335,7 +335,7 @@ (new 'static 'talker-speech-class :name "sig260" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x29 :neg #x1 :on-close #f @@ -344,7 +344,7 @@ (new 'static 'talker-speech-class :name "sig261" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2a :neg #x1 :on-close #f @@ -353,7 +353,7 @@ (new 'static 'talker-speech-class :name "sig262" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2b :neg #x1 :on-close #f @@ -362,7 +362,7 @@ (new 'static 'talker-speech-class :name "sig264" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2c :neg #x1 :on-close #f @@ -371,7 +371,7 @@ (new 'static 'talker-speech-class :name "sig269" :channel (gui-channel sig) - :flags (talker-flags tf0) + :flags (talker-flags play-only-once) :speech #x2d :neg #x1 :on-close #f @@ -446,7 +446,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-gas_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-gas_REF.gc index 7c6087ca337..b132996a197 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-gas_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-gas_REF.gc @@ -76,8 +76,8 @@ (set-setting! 'pilot-death #t 0.0 0) (set-setting! 'music 'nestgas 0.0 0) (if (and (< 6225920.0 (vector-vector-xz-distance (camera-pos) *nest-poison-center*)) - (!= (status-of-level-and-borrows *level* 'nsta #f) 'active) - (!= (status-of-level-and-borrows *level* 'nstb #f) 'active) + (!= (level-status? *level* 'nsta #f) 'active) + (!= (level-status? *level* 'nstb #f) 'active) ) (go-virtual paused) ) @@ -232,17 +232,15 @@ (format *stdebug* "task-manager: ~A paused~%" (-> self node-info name)) ) (if (and (< (vector-vector-xz-distance (camera-pos) *nest-poison-center*) 5980160.0) - (or (= (status-of-level-and-borrows *level* 'nsta #f) 'active) - (= (status-of-level-and-borrows *level* 'nstb #f) 'active) - ) + (or (= (level-status? *level* 'nsta #f) 'active) (= (level-status? *level* 'nstb #f) 'active)) ) (go-virtual active) ) (-> *minimap-class-list* 26) - (when (and (-> self minimap) (= (status-of-level-and-borrows *level* 'wasdoors #f) 'active)) + (when (and (-> self minimap) (= (level-status? *level* 'wasdoors #f) 'active)) (logior! (-> self minimap flags) (minimap-flag fade-out)) (let ((gp-2 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-2 pos quad) (-> *garage-center* quad)) + (vector-copy! (-> gp-2 pos) *garage-center*) (quaternion-identity! (-> gp-2 quat)) (set! (-> gp-2 flags) (task-arrow-flags taf5)) (set! (-> gp-2 map-icon) (the-as uint 12)) @@ -272,9 +270,8 @@ (let ((f30-0 (lerp-scale 1.0 0.0 (vector-vector-xz-distance (camera-pos) *nest-poison-center*) 1638400.0 6144000.0)) ) (cond - ((and (< 0.0 f30-0) (or (= (status-of-level-and-borrows *level* 'nsta #f) 'active) - (= (status-of-level-and-borrows *level* 'nstb #f) 'active) - ) + ((and (< 0.0 f30-0) + (or (= (level-status? *level* 'nsta #f) 'active) (= (level-status? *level* 'nstb #f) 'active)) ) (let* ((s5-1 lerp-scale) (s4-1 0.4) @@ -289,7 +286,7 @@ (while (< 0.0 f30-1) (when (or (< 1.0 f30-1) (rand-vu-percent? f30-1)) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> *z-vector* quad)) + (vector-copy! s5-2 *z-vector*) (vector-rotate-around-y! s5-2 s5-2 (* 182.04445 (rand-vu-float-range -180.0 180.0))) (vector-float*! s5-2 s5-2 (* 4096.0 (rand-vu-float-range 5.0 40.0))) (set! (-> s5-2 y) (* 4096.0 (rand-vu-float-range -5.0 18.0))) @@ -433,7 +430,3 @@ (defpart 2492 :init-specs ((:fade-a -0.053333335) (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14))) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-tasks_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-tasks_REF.gc index 5a5c8c67f86..18159e5724b 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-tasks_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/nst-tasks_REF.gc @@ -122,7 +122,7 @@ (defmethod task-manager-method-26 ((this task-manager-nest-cocoons)) (set-nst-poison! (the-as mood-context 0)) (cond - ((= (status-of-level-and-borrows *level* 'nstb #f) 'active) + ((= (level-status? *level* 'nstb #f) 'active) (if (task-manager-nest-cocoons-method-34 this) (task-manager-nest-cocoons-method-33 this) (init-actor-group! this) @@ -137,9 +137,7 @@ ) (cond ((and (< 819200.0 (vector-vector-xz-distance (target-pos 0) (the-as vector (-> *minimap-class-list* 9)))) - (or (= (status-of-level-and-borrows *level* 'desert #f) 'active) - (= (status-of-level-and-borrows *level* 'waswide #f) 'active) - ) + (or (= (level-status? *level* 'desert #f) 'active) (= (level-status? *level* 'waswide #f) 'active)) ) (if (not (-> this minimap)) (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 9) (the-as int #f) (the-as vector #f) 0)) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/sig-rider_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/sig-rider_REF.gc index 6f4eaececae..e1517b17a38 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/sig-rider_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/sig-rider_REF.gc @@ -53,7 +53,7 @@ (set! (-> gp-0 uvec z) (sin (-> gp-0 uvec x))) (set! (-> gp-0 uvec w) (cos (-> gp-0 uvec x))) (set! (-> gp-0 uvec y) (seconds-per-frame)) - (set! (-> gp-0 rvec quad) (-> s5-0 local-accel quad)) + (vector-copy! (-> gp-0 rvec) (-> s5-0 local-accel)) (let ((f1-6 (+ (* 0.03 (-> gp-0 uvec z)) (* -1.0 (-> gp-0 rvec x) (-> s5-0 left-right-accel-factor))))) (+! (-> self left-right-interp) (* (- f1-6 (-> self left-right-interp)) (fmin 1.0 (* 8.0 (-> gp-0 uvec y))))) ) @@ -262,7 +262,7 @@ ) (set! (-> self root) s4-0) ) - (set! (-> self root trans quad) (-> arg0 root trans quad)) + (vector-copy! (-> self root trans) (-> arg0 root trans)) (quaternion-copy! (-> self root quat) (-> arg0 root quat)) (set! (-> self level) (level-get *level* 'lwassig)) (initialize-skeleton @@ -297,7 +297,7 @@ ;; WARN: Return type mismatch process vs sig-rider. (defun sig-rider-spawn ((arg0 vehicle) (arg1 symbol)) (let ((s4-0 (the-as process #f))) - (when (= (status-of-level-and-borrows *level* 'lwassig #f) 'active) + (when (= (level-status? *level* 'lwassig #f) 'active) (dotimes (s4-1 4) (let ((s3-1 (get-rider-in-seat arg0 s4-1))) (when (type? s3-1 sig-rider) diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstada-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstada-obs_REF.gc index 07e06710792..6230afe80d6 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstada-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstada-obs_REF.gc @@ -274,6 +274,7 @@ ;; definition for method 11 of type wstd-door (defmethod init-from-entity! ((this wstd-door) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) @@ -723,7 +724,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod update-part-and-sfx! ((this wstd-arena-plat)) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -756,6 +757,7 @@ ;; definition for method 11 of type wstd-arena-plat (defmethod init-from-entity! ((this wstd-arena-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (local-vars (v1-75 uint128)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -912,6 +914,7 @@ ;; definition for method 11 of type wstd-flag-a (defmethod init-from-entity! ((this wstd-flag-a) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton @@ -972,6 +975,7 @@ ;; definition for method 11 of type wstd-blocker (defmethod init-from-entity! ((this wstd-blocker) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1153,7 +1157,7 @@ (when (and (time-elapsed? (+ (-> self dur-sound) (seconds 1.2)) (-> self next-sound)) (-> self start-sound)) (set! (-> self snd-id-2) (-> self snd-id-1)) (set! (-> self volume-2) (-> self volume-1)) - (set! (-> self trans-2 quad) (-> self trans-1 quad)) + (vector-copy! (-> self trans-2) (-> self trans-1)) (cond ((nonzero? (-> self channel)) 32 @@ -1241,6 +1245,7 @@ ;; definition for method 11 of type crowd-manager ;; INFO: Used lq/sq (defmethod init-from-entity! ((this crowd-manager) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! *crowd-manager* (the-as (pointer crowd-manager) (process->ppointer this))) (set! (-> this snd-count) (the-as uint 0)) (set! (-> this snd-id-1) (new 'static 'sound-id)) @@ -1249,10 +1254,6 @@ (set! (-> this crowd-intensity) 0.0) (set! (-> this training?) (task-node-open? (game-task-node arena-training-1-collect))) (set! (-> this darkjak?) #f) - (set! (-> this trans quad) (-> arg0 trans quad)) + (vector-copy! (-> this trans) (-> arg0 trans)) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstada-part_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstada-part_REF.gc index 9d4e18d03f1..cd1450cd42e 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstada-part_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstada-part_REF.gc @@ -1207,7 +1207,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1319,7 +1319,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -1431,7 +1431,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1543,7 +1543,7 @@ (v1-18 (-> a0-12 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-12 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-12 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-18 x) (-> s2-1 x))) (set! (-> arg2 y) (+ (-> v1-18 y) (-> s2-1 y))) @@ -1655,7 +1655,7 @@ (v1-16 (-> a0-10 proc root trans)) (s5-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-1 quad) (-> (the-as part-tracker (-> a0-10 proc)) mat fvec quad)) + (vector-copy! s5-1 (-> (the-as part-tracker (-> a0-10 proc)) mat fvec)) 0.0 (set! (-> arg2 x) (+ (-> v1-16 x) (-> s3-1 x))) (set! (-> arg2 y) (+ (-> v1-16 y) (-> s3-1 y))) @@ -2144,7 +2144,7 @@ :enter (behavior () (dotimes (gp-0 15) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> *crowd-dudes-position* gp-0 quad)) + (vector-copy! s5-0 (-> *crowd-dudes-position* gp-0)) (let ((s4-0 (-> self spectators gp-0))) (if (rand-vu-percent? 0.5) (logior! (-> s4-0 flags) 1) @@ -2218,6 +2218,7 @@ ;; definition for method 11 of type wasstada-crowd (defmethod init-from-entity! ((this wasstada-crowd) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (matrix-identity! (-> this mat)) (matrix<-quat (-> this mat) (-> arg0 quat)) (matrix<-trans (-> this mat) (-> arg0 extra trans)) @@ -2228,7 +2229,3 @@ (set! (-> this hola) 0.0) (go (method-of-object this idle)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc index 2777960c23b..994acc52da6 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadb-obs_REF.gc @@ -485,11 +485,11 @@ (('touch 'attack) (cond ((logtest? (-> *part-group-id-table* 500 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 500)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self root trans)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 500)) ) ) @@ -525,11 +525,11 @@ (ppointer->handle (cond ((logtest? (-> *part-group-id-table* 501 flags) (sp-group-flag sp13)) - (set! (-> *launch-matrix* trans quad) (-> self gspot quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self gspot)) (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 501)) ) (else - (set! (-> *launch-matrix* trans quad) (-> self gspot quad)) + (vector-copy! (-> *launch-matrix* trans) (-> self gspot)) (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 501)) ) ) @@ -620,7 +620,7 @@ ;; INFO: Used lq/sq (defmethod probe-background ((this arena-token)) (let ((s5-0 (new 'stack 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> this root trans quad)) + (vector-copy! (-> s5-0 start-pos) (-> this root trans)) (set-vector! (-> s5-0 move-dist) 0.0 -204800.0 0.0 1.0) (let ((v1-3 s5-0)) (set! (-> v1-3 radius) 40.96) @@ -633,7 +633,7 @@ (set! (-> v1-3 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) - (set! (-> this gspot quad) (-> s5-0 best-other-tri intersect quad)) + (vector-copy! (-> this gspot) (-> s5-0 best-other-tri intersect)) (+! (-> this gspot y) 204.8) #t ) @@ -642,6 +642,7 @@ ;; definition for method 11 of type arena-token (defmethod init-from-entity! ((this arena-token) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (logior! (-> this mask) (process-mask collectable)) (init-collision! this) (process-drawable-from-entity! this arg0) @@ -780,7 +781,7 @@ ) ) (if a0-5 - (set! (-> gp-0 fountain-rand-transv-lo quad) (-> (get-trans a0-5 0) quad)) + (vector-copy! (-> gp-0 fountain-rand-transv-lo) (get-trans a0-5 0)) ) ) (set! (-> gp-0 fountain-rand-transv-hi x) 24576.0) @@ -847,6 +848,7 @@ ;; definition for method 11 of type wstd-training-dummy (defmethod init-from-entity! ((this wstd-training-dummy) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (init-collision! this) (process-drawable-from-entity! this arg0) (logclear! (-> this mask) (process-mask actor-pause)) @@ -923,7 +925,7 @@ :parent (task-manager-arena-training active) :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> gp-0 pos quad) (-> self entity trans quad)) + (vector-copy! (-> gp-0 pos) (-> self entity trans)) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf3)) (set! (-> gp-0 map-icon) (the-as uint 13)) @@ -1199,7 +1201,7 @@ ) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-16 (new 'static 'vector :x 9527214.0 :y 196812.8 :z -1693368.4 :w 1.0))) - (set! (-> gp-1 pos quad) (-> a0-16 quad)) + (vector-copy! (-> gp-1 pos) a0-16) ) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags)) @@ -1444,7 +1446,7 @@ ) ) (when a0-4 - (set! (-> gp-1 fountain-rand-transv-lo quad) (-> (get-trans a0-4 0) quad)) + (vector-copy! (-> gp-1 fountain-rand-transv-lo) (get-trans a0-4 0)) (+! (-> gp-1 fountain-rand-transv-lo y) -16384.0) ) ) @@ -1481,6 +1483,7 @@ ;; definition for method 11 of type wstd-trapdoor (defmethod init-from-entity! ((this wstd-trapdoor) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1560,6 +1563,7 @@ ;; definition for method 11 of type wstd-flag (defmethod init-from-entity! ((this wstd-flag) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) (initialize-skeleton diff --git a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc index 110ba4f8c96..5e2435436a4 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wasstadium/wasstadc-obs_REF.gc @@ -27,7 +27,7 @@ :enter (behavior () (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-0 (new 'static 'vector :x 9527214.0 :y 196812.8 :z -1693368.4 :w 1.0))) - (set! (-> gp-0 pos quad) (-> a0-0 quad)) + (vector-copy! (-> gp-0 pos) a0-0) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf5)) @@ -109,7 +109,7 @@ (local-vars (v0-2 symbol)) (gpr->fpr #x7f800000) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> this root trans quad)) + (vector-copy! s4-0 (-> this root trans)) (set! (-> s4-0 w) 32768.0) (if (and *target* (< (vector-vector-distance (target-pos 0) s4-0) (-> s4-0 w))) (return #f) @@ -152,7 +152,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s4-0 pickup-type) (pickup-type ammo-random)) - (set! (-> s5-0 quad) (-> this root trans quad)) + (vector-copy! s5-0 (-> this root trans)) (when (or (zero? (-> this crate-h)) (not (handle->process (-> this crate-h)))) (let* ((s4-1 (ppointer->process (process-spawn crate #f s5-0 'wood s4-0 :name "crate" :to *entity-pool*))) (s5-1 (if (type? s4-1 process-focusable) @@ -593,7 +593,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod update-part-and-sfx! ((this wstd-fight-plat)) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -692,7 +692,7 @@ ) :trans (behavior () (wstd-fight-plat-method-40 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) (when (and (< (-> self next-crate-spawn) (current-time)) (or (< (-> *game-info* gun-ammo 0) 20.0) @@ -751,7 +751,7 @@ ) (init-vf0-vector) (wstd-fight-plat-method-40 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (when (-> self spawn-lava?) (activate! @@ -771,7 +771,7 @@ (vector-matrix*! gp-1 (-> *fight-plat-lava-pos* (rand-vu-int-count (-> *fight-plat-lava-pos* length))) s3-1) ) (set! (-> gp-1 y) 40960.0) - (set! (-> self part-lava-pos quad) (-> gp-1 quad)) + (vector-copy! (-> self part-lava-pos) gp-1) ) (set! (-> self next-lava-part) (+ (current-time) (seconds 0.01))) ) @@ -913,6 +913,7 @@ ;; definition for method 11 of type wstd-fight-plat ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this wstd-fight-plat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -920,8 +921,8 @@ ;; INFO: Used lq/sq (defbehavior wstd-fight-plat-init-by-other wstd-fight-plat ((arg0 vector) (arg1 int) (arg2 float) (arg3 float)) (init-collision! self) - (set! (-> self basepos quad) (-> arg0 quad)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self basepos) arg0) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (initialize-skeleton @@ -1036,7 +1037,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod update-part-and-sfx! ((this wstd-fight-plat-smlplat)) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -1123,7 +1124,7 @@ (go-virtual go-up-fma) ) (wstd-fight-plat-smlplat-method-42 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) ) @@ -1195,7 +1196,7 @@ (go-virtual go-up-fma) ) (wstd-fight-plat-smlplat-method-42 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) ) @@ -1240,7 +1241,7 @@ ) :trans (behavior () (wstd-fight-plat-smlplat-method-42 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) ) @@ -1291,6 +1292,7 @@ ;; definition for method 11 of type wstd-fight-plat-smlplat ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this wstd-fight-plat-smlplat) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1298,8 +1300,8 @@ ;; INFO: Used lq/sq (defbehavior wstd-fight-plat-smlplat-init-by-other wstd-fight-plat-smlplat ((arg0 vector) (arg1 object) (arg2 float)) (init-collision! self) - (set! (-> self basepos quad) (-> arg0 quad)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self basepos) arg0) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 0.7 0.7 0.7 1.0) (initialize-skeleton @@ -1413,7 +1415,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod update-part-and-sfx! ((this wstd-fight-plat-large)) (when (nonzero? (-> this sound)) - (set! (-> this sound trans quad) (-> this root trans quad)) + (vector-copy! (-> this sound trans) (-> this root trans)) (update! (-> this sound)) ) (none) @@ -1564,7 +1566,7 @@ ) ) (set! (-> s5-0 y) 40960.0) - (set! (-> this part-lava-pos quad) (-> s5-0 quad)) + (vector-copy! (-> this part-lava-pos) s5-0) ) (set! (-> this next-lava-part) (+ (current-time) (seconds 0.01))) ) @@ -1602,7 +1604,7 @@ ) :trans (behavior () (wstd-fight-plat-large-method-41 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (plat-trans) ) @@ -1668,7 +1670,7 @@ ) (init-vf0-vector) (wstd-fight-plat-large-method-41 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (when (-> self spawn-lava?) (wstd-fight-plat-large-method-42 self) @@ -1798,7 +1800,7 @@ ) (init-vf0-vector) (wstd-fight-plat-large-method-41 self) - (set! (-> self basetrans quad) (-> self basepos quad)) + (vector-copy! (-> self basetrans) (-> self basepos)) (+! (-> self basetrans y) (-> self delta-y)) (if (-> self spawn-lava?) (wstd-fight-plat-large-method-42 self) @@ -1921,6 +1923,7 @@ ;; definition for method 11 of type wstd-fight-plat-large ;; WARN: Return type mismatch entity-perm-status vs object. (defmethod init-from-entity! ((this wstd-fight-plat-large) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (process-entity-status! this (entity-perm-status dead) #t) ) @@ -1930,8 +1933,8 @@ (defbehavior wstd-fight-plat-large-init-by-other wstd-fight-plat-large ((arg0 vector) (arg1 int) (arg2 float)) (local-vars (t0-0 none)) (init-collision! self) - (set! (-> self basepos quad) (-> arg0 quad)) - (set! (-> self root trans quad) (-> arg0 quad)) + (vector-copy! (-> self basepos) arg0) + (vector-copy! (-> self root trans) arg0) (quaternion-identity! (-> self root quat)) (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) (initialize-skeleton @@ -2091,7 +2094,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s4-0 pickup-type) arg2) - (set! (-> s5-0 quad) (-> arg0 quad)) + (vector-copy! s5-0 arg0) (let* ((s4-1 (ppointer->process (process-spawn crate #f s5-0 'wood s4-0 :name "crate" :to *entity-pool*))) (s5-1 (if (type? s4-1 process-focusable) s4-1 @@ -2220,7 +2223,7 @@ (arg4 symbol) ) (let ((s5-0 (new 'stack-no-clear 'marauder-init-by-other-params))) - (set! (-> s5-0 trans quad) (-> arg0 quad)) + (vector-copy! (-> s5-0 trans) arg0) (quaternion-copy! (-> s5-0 quat) arg1) (set! (-> s5-0 entity) #f) (set! (-> s5-0 directed?) #f) @@ -2646,7 +2649,7 @@ ) (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-11 (new 'static 'vector :x 9527214.0 :y 196812.8 :z -1693368.4 :w 1.0))) - (set! (-> gp-1 pos quad) (-> a0-11 quad)) + (vector-copy! (-> gp-1 pos) a0-11) ) (quaternion-identity! (-> gp-1 quat)) (set! (-> gp-1 flags) (task-arrow-flags)) @@ -3058,7 +3061,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-6 (new 'static 'vector :x 9527214.0 :y 196812.8 :z -1693368.4 :w 1.0))) - (set! (-> gp-0 pos quad) (-> a0-6 quad)) + (vector-copy! (-> gp-0 pos) a0-6) ) (quaternion-identity! (-> gp-0 quat)) (set! (-> gp-0 flags) (task-arrow-flags taf8)) @@ -3410,7 +3413,7 @@ (else (let ((s5-6 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-54 (new 'static 'vector :x 9419366.0 :y 47349.76 :z -1833369.6 :w 1.0))) - (set! (-> s5-6 pos quad) (-> a0-54 quad)) + (vector-copy! (-> s5-6 pos) a0-54) ) (quaternion-identity! (-> s5-6 quat)) (set! (-> s5-6 flags) (task-arrow-flags taf5 taf8)) @@ -3653,7 +3656,7 @@ (else (let ((s5-3 (new 'stack-no-clear 'task-arrow-params))) (let ((a0-24 (new 'static 'vector :x 9523200.0 :y 49152.0 :z -1929216.0 :w 1.0))) - (set! (-> s5-3 pos quad) (-> a0-24 quad)) + (vector-copy! (-> s5-3 pos) a0-24) ) (quaternion-identity! (-> s5-3 quat)) (set! (-> s5-3 flags) (task-arrow-flags taf5 taf8)) diff --git a/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc b/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc index f68b7a4fbe8..b93b3f5586e 100644 --- a/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/waswide-obs_REF.gc @@ -64,6 +64,7 @@ ;; definition for method 11 of type wascity-windmill (defmethod init-from-entity! ((this wascity-windmill) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -132,6 +133,7 @@ ;; definition for method 11 of type wascity-flag-base (defmethod init-from-entity! ((this wascity-flag-base) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -300,6 +302,7 @@ ;; definition for method 11 of type wascity-wind-fan (defmethod init-from-entity! ((this wascity-wind-fan) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (set! (-> this root) (new 'process 'trsqv)) (process-drawable-from-entity! this arg0) @@ -537,7 +540,7 @@ (set! (-> a0-19 param2) (the-as basic 0)) ) (let ((v1-23 (-> self shakers 1))) - (set! (-> v1-23 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-23 axis) gp-2) (set! (-> v1-23 start-time) (+ (current-time) (seconds -0.06))) (set! (-> v1-23 decay-time) 600.0) (set! (-> v1-23 freq) 150.0) @@ -553,7 +556,7 @@ (set! (-> v1-25 param2) (the-as basic 1)) ) (let ((v1-26 (-> self shakers 2))) - (set! (-> v1-26 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-26 axis) gp-2) (set! (-> v1-26 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-26 decay-time) 600.0) (set! (-> v1-26 freq) 150.0) @@ -568,7 +571,7 @@ (set! (-> v1-28 param2) (the-as basic 2)) ) (let ((v1-29 (-> self shakers 3))) - (set! (-> v1-29 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-29 axis) gp-2) (set! (-> v1-29 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-29 decay-time) 600.0) (set! (-> v1-29 freq) 150.0) @@ -583,7 +586,7 @@ (set! (-> v1-31 param2) (the-as basic 2)) ) (let ((v1-32 (-> self shakers 4))) - (set! (-> v1-32 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-32 axis) gp-2) (set! (-> v1-32 start-time) (+ (current-time) (seconds -0.2))) (set! (-> v1-32 decay-time) 600.0) (set! (-> v1-32 freq) 150.0) @@ -598,7 +601,7 @@ (set! (-> v1-34 param2) (the-as basic 2)) ) (let ((v1-35 (-> self shakers 5))) - (set! (-> v1-35 axis quad) (-> gp-2 quad)) + (vector-copy! (-> v1-35 axis) gp-2) (set! (-> v1-35 start-time) (+ (current-time) (seconds -0.4))) (set! (-> v1-35 decay-time) 600.0) (set! (-> v1-35 freq) 150.0) @@ -618,7 +621,7 @@ (else (sound-play "cactus-burst") (let ((gp-4 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> gp-4 fountain-rand-transv-lo quad) (-> s5-0 root trans quad)) + (vector-copy! (-> gp-4 fountain-rand-transv-lo) (-> s5-0 root trans)) (set! (-> gp-4 fountain-rand-transv-hi x) 4096.0) (set! (-> gp-4 fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -693,6 +696,7 @@ ;; definition for method 11 of type wascity-cactus (defmethod init-from-entity! ((this wascity-cactus) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (ctywide-entity-hack) (wascity-cactus-method-30 this) (process-drawable-from-entity! this arg0) @@ -867,6 +871,7 @@ ;; definition for method 11 of type wascity-water-pump (defmethod init-from-entity! ((this wascity-water-pump) (arg0 entity-actor)) + "Set up a newly created process from the entity that created it." (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) diff --git a/test/decompiler/reference/jak3/levels/wascity/wlander-female_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wlander-female_REF.gc index 8cc8f48a2bf..f0bbc4b6548 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wlander-female_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wlander-female_REF.gc @@ -170,34 +170,34 @@ :jump-height-min (meters 3) :jump-height-factor 0.5 :knocked-seek-ry-clamp 2730.6667 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 20480.0 - :knocked-soft-vy-hi 40960.0 - :knocked-medium-vxz-lo 40960.0 - :knocked-medium-vxz-hi 73728.0 - :knocked-medium-vy-lo 24576.0 - :knocked-medium-vy-hi 53248.0 - :knocked-hard-vxz-lo 53248.0 - :knocked-hard-vxz-hi 102400.0 - :knocked-hard-vy-lo 40960.0 - :knocked-hard-vy-hi 81920.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 8192.0 - :knocked-yellow-vxz-hi 16384.0 - :knocked-yellow-vy-lo 12288.0 - :knocked-yellow-vy-hi 24576.0 - :knocked-red-vxz-lo 12288.0 - :knocked-red-vxz-hi 24576.0 - :knocked-red-vy-lo 20480.0 - :knocked-red-vy-hi 36864.0 - :knocked-blue-vxz-lo 16384.0 - :knocked-blue-vxz-hi 32768.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 5) + :knocked-soft-vy-hi (meters 10) + :knocked-medium-vxz-lo (meters 10) + :knocked-medium-vxz-hi (meters 18) + :knocked-medium-vy-lo (meters 6) + :knocked-medium-vy-hi (meters 13) + :knocked-hard-vxz-lo (meters 13) + :knocked-hard-vxz-hi (meters 25) + :knocked-hard-vy-lo (meters 10) + :knocked-hard-vy-hi (meters 20) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 2) + :knocked-yellow-vxz-hi (meters 4) + :knocked-yellow-vy-lo (meters 3) + :knocked-yellow-vy-hi (meters 6) + :knocked-red-vxz-lo (meters 3) + :knocked-red-vxz-hi (meters 6) + :knocked-red-vy-lo (meters 5) + :knocked-red-vy-hi (meters 9) + :knocked-blue-vxz-lo (meters 4) + :knocked-blue-vxz-hi (meters 8) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9956 :y 0.0755 :z -0.0549 :w 34275.477) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -430,6 +430,7 @@ ;; definition for method 67 of type waster-b (defmethod coin-flip? ((this waster-b)) + "Return #t half the time, #f the other." #f ) @@ -442,6 +443,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs degrees. (defmethod get-knockback-angle ((this waster-b)) + "Get the yaw angle for the current knock." (let ((f30-0 (quaternion-y-angle (-> this root quat)))) (case (-> this incoming knocked-type) (((knocked-type yellow-shot) (knocked-type blue-shot)) @@ -449,7 +451,7 @@ (when a0-5 (get-trans (the-as process-focusable a0-5) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> this root transv quad)) + (vector-copy! s5-0 (-> this root transv)) (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) @@ -462,7 +464,7 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> this root transv quad)) + (vector-copy! s5-1 (-> this root transv)) (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) @@ -503,6 +505,7 @@ ;; definition for method 87 of type waster-b (defmethod knocked-anim-handler ((this waster-b) (arg0 int) (arg1 enemy-knocked-info)) + "start or play the approriate animation for an enemy being knocked." (case arg0 ((1) (case (-> this incoming knocked-type) @@ -554,11 +557,12 @@ ;; definition for method 85 of type waster-b (defmethod knocked-anim ((this waster-b) (arg0 enemy-knocked-info)) + "start the knocked animation." (case (-> this incoming knocked-type) (((knocked-type yellow-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) - (v1-3 (enemy-method-131 this 1 a2-0)) + (v1-3 (rnd-int-excluding-masked this 1 a2-0)) (a1-7 (-> this draw @@ -585,7 +589,7 @@ (((knocked-type blue-shot)) (ja-channel-push! 1 (seconds 0.01)) (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) - (v1-12 (enemy-method-131 this 3 a2-2)) + (v1-12 (rnd-int-excluding-masked this 3 a2-2)) (a1-14 (-> this draw @@ -632,6 +636,7 @@ ;; definition for method 86 of type waster-b (defmethod knocked-land-anim ((this waster-b) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.1)) (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) @@ -775,6 +780,7 @@ ;; definition for method 120 of type waster-b ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this waster-b)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -834,12 +840,13 @@ ;; definition for method 121 of type waster-b ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this waster-b)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-waster-b" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *waster-b-nav-enemy-info*) + (setup-enemy! this *waster-b-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -847,7 +854,7 @@ (set! (-> this draw lod-set lod 0 dist) 204800.0) (set! (-> this draw lod-set lod 1 dist) 491520.0) (set! (-> this info) *waster-b-global-info*) - (try-update-focus (-> this focus) *target* this) + (focus-on! (-> this focus) *target* this) (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) (set! (-> this anim-shuffle) 12) (let ((v1-18 (rnd-int this 3))) @@ -1052,7 +1059,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc b/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc index 57a32e4d927..55cad1bc865 100644 --- a/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc +++ b/test/decompiler/reference/jak3/levels/wascity/wlander-male_REF.gc @@ -83,7 +83,8 @@ ;; definition for method 123 of type wlander ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-123 ((this wlander)) +(defmethod allow-ragdoll? ((this wlander)) + "Can this enemy ragdoll now?" (the-as symbol (or (and (>= (-> this incoming blue-juggle-count) (the-as uint 2)) (-> this incoming knocked-type) 6) @@ -96,6 +97,7 @@ ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch symbol vs object. (defmethod ragdoll-settled? ((this wlander)) + "Has the ragdoll stopped moving?" (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (or (not s5-0) (or (ragdoll-proc-method-19 (the-as ragdoll-proc s5-0)) @@ -104,8 +106,8 @@ (* 4096.0 (seconds-per-frame)) ) (< (cos (* 182.04445 (seconds-per-frame))) (-> (the-as ragdoll-proc s5-0) ragdoll rotate-vel w)) - (not (enemy-method-109 this)) - (not (within-gspot-range? this)) + (not (out-of-bounds? this)) + (not (invalid-height? this)) ) ) ) @@ -114,7 +116,8 @@ ;; definition for method 20 of type wlander ;; WARN: Return type mismatch int vs search-info-flag. -(defmethod process-mask->search-info-flag ((this wlander)) +(defmethod get-search-info-flag ((this wlander)) + "Get search-info-flag for this process." (let ((v1-1 (handle->process (-> this focus handle)))) (the-as search-info-flag (if (if v1-1 (= (-> v1-1 type) target) @@ -129,6 +132,7 @@ ;; definition for method 126 of type wlander ;; WARN: Return type mismatch float vs vector. (defmethod ragdoll-spawn! ((this wlander) (arg0 symbol) (arg1 symbol)) + "If possible, spawn ragdoll and start using it." (let ((t9-0 (method-of-type nav-enemy ragdoll-spawn!))) (t9-0 this arg0 arg1) ) @@ -144,6 +148,7 @@ ;; definition for method 125 of type wlander ;; INFO: this function exists in multiple non-identical object files (defmethod ragdoll-settled? ((this wlander)) + "Has the ragdoll stopped moving?" (let ((s5-0 (handle->process (-> this ragdoll-proc)))) (if s5-0 (seek! (-> (the-as ragdoll-proc s5-0) ragdoll momentum) 0.7 (seconds-per-frame)) @@ -164,6 +169,7 @@ ;; INFO: Used lq/sq ;; WARN: disable def twice: 165. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod event-handler ((this wlander) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (case arg2 (('help) (let ((v1-1 (-> arg3 param 0)) @@ -199,7 +205,7 @@ ) ) (when a1-12 - (enemy-method-70 this (the-as process-focusable a1-12) (the-as enemy-aware #f)) + (set-focus! this (the-as process-focusable a1-12) (the-as enemy-aware #f)) (call-for-help this (* 4096.0 (* 10.0 (-> this mad-level)))) (if (-> this male) (speech-control-method-12 *speech-control* this (speech-type civ-m-shot-by-player)) @@ -237,7 +243,7 @@ (let ((v1-37 (the-as traffic-danger-info (-> arg3 param 0)))) (set! (-> this cp-valid?) #t) (set! (-> this cp-sphere quad) (-> v1-37 sphere quad)) - (set! (-> this cp-vec quad) (-> v1-37 velocity quad)) + (vector-copy! (-> this cp-vec) (-> v1-37 velocity)) (when (= (-> v1-37 danger-type) 8) (set! (-> this allow-dive) #f) (set! (-> this cp-factor) 50.0) @@ -274,10 +280,10 @@ (v1-5 *null-vector*) ) (logior! (-> a0-2 flags) (nav-state-flag directional-mode)) - (set! (-> a0-2 travel quad) (-> v1-5 quad)) + (vector-copy! (-> a0-2 travel) v1-5) ) 0 - (try-locate-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) + (move-to-ground self (meters 10) (meters 10) #t (-> self gnd-collide-with)) (set! (-> self gnd-height) (-> self root gspot-pos y)) (vector-reset! (-> self root transv)) ) @@ -335,7 +341,7 @@ (let ((gp-0 (-> self root))) (cond ((focus-test? self under-water) - (accelerate-fall! self (-> gp-0 transv)) + (adjust-transv-under-water! self (-> gp-0 transv)) ) (else (if (logtest? (-> gp-0 status) (collide-status touch-surface)) @@ -343,7 +349,7 @@ ) (when (and (not (-> self knocked-collide)) (!= (-> self incoming knocked-type) 4)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> (ja-linear-vel 0) quad)) + (vector-copy! s5-0 (ja-linear-vel 0)) (vector-orient-by-quat! s5-0 s5-0 (-> gp-0 quat)) (vector-xz-normalize! (-> gp-0 transv) @@ -486,6 +492,7 @@ ;; definition for method 78 of type wlander (defmethod go-hostile ((this wlander)) + "Go to the hostile state, actively trying to attack the target." (go (method-of-object this hostile)) ) @@ -554,7 +561,7 @@ ) ) (else - (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) + (vector-copy! (-> this target-pos) (get-trans (the-as process-focusable s4-0) 3)) ) ) ) @@ -685,7 +692,7 @@ (clamp-vector-to-mesh-no-gaps (-> self nav) (-> self root trans) s4-0 s3-0 s5-0) ) (if (-> s5-0 found-boundary) - (set! (-> self root trans quad) (-> s5-0 intersection quad)) + (vector-copy! (-> self root trans) (-> s5-0 intersection)) (vector+! (-> self root trans) (-> self root trans) gp-0) ) ) @@ -768,12 +775,12 @@ ) (cond ((should-check-los? (-> self los) 0) - (set! (-> self target-pos quad) (-> (get-trans gp-0 3) quad)) - (if (and (enemy-method-105 self 6371.5557 #t) (>= 12288.0 f30-0)) + (vector-copy! (-> self target-pos) (get-trans gp-0 3)) + (if (and (pointing-toward-focus? self 6371.5557 #t) (>= 12288.0 f30-0)) (go-virtual close-attack) ) (if (or (< f30-0 204800.0) - (and (enemy-method-105 self 910.2222 #t) (< (seconds 4) (- (current-time) (-> self last-time-far)))) + (and (pointing-toward-focus? self 910.2222 #t) (< (seconds 4) (- (current-time) (-> self last-time-far)))) ) (go-virtual gun-shoot) ) @@ -908,8 +915,8 @@ ) (cond ((should-check-los? (-> self los) 0) - (set! (-> self target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) - (if (and (enemy-method-105 self 6371.5557 #t) (>= 12288.0 f30-0)) + (vector-copy! (-> self target-pos) (get-trans (the-as process-focusable gp-0) 3)) + (if (and (pointing-toward-focus? self 6371.5557 #t) (>= 12288.0 f30-0)) (go-virtual close-attack) ) (set-time! (-> self last-time-los)) @@ -935,7 +942,7 @@ (let ((v1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'array 'collide-shape 64)) ) - (set! (-> v1-0 quad) (-> this root trans quad)) + (vector-copy! v1-0 (-> this root trans)) (set! (-> v1-0 w) arg0) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* v1-0 s5-0 64)) (let* ((s3-0 (-> s5-0 s4-0)) @@ -973,7 +980,7 @@ (let ((a1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'array 'collide-shape 64)) ) - (set! (-> a1-0 quad) (-> this root trans quad)) + (vector-copy! a1-0 (-> this root trans)) (set! (-> a1-0 w) 245760.0) (countdown (s4-0 (fill-actor-list-for-box *actor-hash* a1-0 s5-0 64)) (let* ((s3-0 (-> s5-0 s4-0)) @@ -997,7 +1004,7 @@ (not (focus-test? (the-as process-focusable a1-3) dead)) (logtest? (process-mask enemy) (-> a1-3 mask)) ) - (try-update-focus (-> this focus) (the-as process-focusable a1-3) this) + (focus-on! (-> this focus) (the-as process-focusable a1-3) this) (return #f) ) ) @@ -1130,34 +1137,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 49152.0 - :knocked-medium-vy-hi 102400.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 32768.0 - :knocked-yellow-vy-hi 49152.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 32768.0 - :knocked-red-vy-hi 49152.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 32768.0 - :knocked-blue-vy-hi 49152.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 15) + :knocked-soft-vy-hi (meters 15) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 12) + :knocked-medium-vy-hi (meters 25) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 24) + :knocked-hard-vy-hi (meters 26) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 8) + :knocked-yellow-vy-hi (meters 12) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 8) + :knocked-red-vy-hi (meters 12) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 8) + :knocked-blue-vy-hi (meters 12) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 0.9955 :y 0.0573 :z 0.0754 :w 35528.34) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -1461,7 +1468,8 @@ ) ;; definition for method 123 of type wlander-male -(defmethod enemy-method-123 ((this wlander-male)) +(defmethod allow-ragdoll? ((this wlander-male)) + "Can this enemy ragdoll now?" (when (call-parent-method this) (set! (-> this skel postbind-function) wlander-male-joint-callback) #t @@ -1470,6 +1478,7 @@ ;; definition for method 85 of type wlander-male (defmethod knocked-anim ((this wlander-male) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 (seconds 0.01)) (cond ((zero? (-> this hit-face)) @@ -1500,6 +1509,7 @@ ;; definition for method 86 of type wlander-male (defmethod knocked-land-anim ((this wlander-male) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.01)) (cond ((zero? (-> this hit-face)) @@ -1541,7 +1551,7 @@ (ja :num! (seek!)) ) (until #f - (while (not (enemy-method-105 self 4187.0225 #t)) + (while (not (pointing-toward-focus? self 4187.0225 #t)) (let* ((gp-0 (handle->process (-> self focus handle))) (s5-0 (if (type? gp-0 process-focusable) gp-0 @@ -1682,6 +1692,7 @@ ;; definition for method 120 of type wlander-male ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this wlander-male)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -1766,12 +1777,13 @@ ;; definition for method 121 of type wlander-male ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this wlander-male)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wlander-male" (the-as (pointer level) #f))) (the-as pair 0) ) - (init-enemy-defaults! this *wlander-male-nav-enemy-info*) + (setup-enemy! this *wlander-male-nav-enemy-info*) (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) @@ -1924,7 +1936,7 @@ ) ) ) - (set! (-> this shoot-time) (set-reaction-time! this (seconds 1) (seconds 3))) + (set! (-> this shoot-time) (rnd-time-frame this (seconds 1) (seconds 3))) (set! (-> this shot-sound) (rnd-int this 7)) (toggle-cspec this #f -1) (ja-channel-set! 0) @@ -2062,34 +2074,34 @@ :jump-height-min (meters 0.5) :jump-height-factor 0.1 :knocked-seek-ry-clamp 6371.5557 - :knocked-soft-vxz-lo 32768.0 - :knocked-soft-vxz-hi 53248.0 - :knocked-soft-vy-lo 61440.0 - :knocked-soft-vy-hi 61440.0 - :knocked-medium-vxz-lo 147456.0 - :knocked-medium-vxz-hi 196608.0 - :knocked-medium-vy-lo 135168.0 - :knocked-medium-vy-hi 151552.0 - :knocked-hard-vxz-lo 40960.0 - :knocked-hard-vxz-hi 61440.0 - :knocked-hard-vy-lo 98304.0 - :knocked-hard-vy-hi 106496.0 - :knocked-huge-vxz-lo 164659.2 - :knocked-huge-vxz-hi 249036.8 - :knocked-huge-vy-lo 183500.8 - :knocked-huge-vy-hi 217907.2 - :knocked-yellow-vxz-lo 20480.0 - :knocked-yellow-vxz-hi 24576.0 - :knocked-yellow-vy-lo 28672.0 - :knocked-yellow-vy-hi 40960.0 - :knocked-red-vxz-lo 65536.0 - :knocked-red-vxz-hi 81920.0 - :knocked-red-vy-lo 61440.0 - :knocked-red-vy-hi 61440.0 - :knocked-blue-vxz-lo 32768.0 - :knocked-blue-vxz-hi 65536.0 - :knocked-blue-vy-lo 16384.0 - :knocked-blue-vy-hi 32768.0 + :knocked-soft-vxz-lo (meters 8) + :knocked-soft-vxz-hi (meters 13) + :knocked-soft-vy-lo (meters 15) + :knocked-soft-vy-hi (meters 15) + :knocked-medium-vxz-lo (meters 36) + :knocked-medium-vxz-hi (meters 48) + :knocked-medium-vy-lo (meters 33) + :knocked-medium-vy-hi (meters 37) + :knocked-hard-vxz-lo (meters 10) + :knocked-hard-vxz-hi (meters 15) + :knocked-hard-vy-lo (meters 24) + :knocked-hard-vy-hi (meters 26) + :knocked-huge-vxz-lo (meters 40.2) + :knocked-huge-vxz-hi (meters 60.8) + :knocked-huge-vy-lo (meters 44.8) + :knocked-huge-vy-hi (meters 53.2) + :knocked-yellow-vxz-lo (meters 5) + :knocked-yellow-vxz-hi (meters 6) + :knocked-yellow-vy-lo (meters 7) + :knocked-yellow-vy-hi (meters 10) + :knocked-red-vxz-lo (meters 16) + :knocked-red-vxz-hi (meters 20) + :knocked-red-vy-lo (meters 15) + :knocked-red-vy-hi (meters 15) + :knocked-blue-vxz-lo (meters 8) + :knocked-blue-vxz-hi (meters 16) + :knocked-blue-vy-lo (meters 4) + :knocked-blue-vy-hi (meters 8) :ragdoll-info (new 'static 'ragdoll-setup :orient-tform (new 'static 'vector :x 1.0 :w 37977.51) :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) @@ -2402,6 +2414,7 @@ ;; definition for method 82 of type wlander-female (defmethod event-handler ((this wlander-female) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + "Commmon handler for events." (local-vars (v0-0 object)) (case arg2 (('event-gunout) @@ -2424,6 +2437,7 @@ ;; definition for method 85 of type wlander-female (defmethod knocked-anim ((this wlander-female) (arg0 enemy-knocked-info)) + "start the knocked animation." (ja-channel-push! 1 (seconds 0.01)) (cond ((zero? (-> this hit-face)) @@ -2454,6 +2468,7 @@ ;; definition for method 86 of type wlander-female (defmethod knocked-land-anim ((this wlander-female) (arg0 enemy-knocked-info)) + "start the knocked-land animation." (ja-channel-push! 1 (seconds 0.01)) (cond ((zero? (-> this hit-face)) @@ -2557,7 +2572,7 @@ (ja :num! (seek!)) ) (until #f - (while (not (enemy-method-105 self 4187.0225 #t)) + (while (not (pointing-toward-focus? self 4187.0225 #t)) (let* ((gp-0 (handle->process (-> self focus handle))) (s5-0 (if (type? gp-0 process-focusable) gp-0 @@ -2652,6 +2667,7 @@ ;; definition for method 120 of type wlander-female ;; WARN: Return type mismatch int vs none. (defmethod init-enemy-collision! ((this wlander-female)) + "Typical place to construct collision shapes" (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) @@ -2730,13 +2746,14 @@ ;; definition for method 121 of type wlander-female ;; WARN: Return type mismatch int vs none. (defmethod init-enemy! ((this wlander-female)) + "Typical place for shared init code. Runs from entity or process style init." (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-wlander-female" (the-as (pointer level) #f))) (the-as pair 0) ) (set! (-> this skel postbind-function) wlander-female-joint-callback) - (init-enemy-defaults! this *wlander-female-nav-enemy-info*) + (setup-enemy! this *wlander-female-nav-enemy-info*) (let ((v1-6 (-> this nav))) (set! (-> v1-6 speed-scale) 1.0) ) @@ -2843,7 +2860,7 @@ ) ) (set! (-> this anim-get-up-front) 17) - (set! (-> this shoot-time) (set-reaction-time! this (seconds 1) (seconds 3))) + (set! (-> this shoot-time) (rnd-time-frame this (seconds 1) (seconds 3))) (set! (-> this shot-sound) (rnd-int this 7)) (set! (-> this gunout) (if (rnd-int this 2) #f diff --git a/test/offline/config/jak3/config.jsonc b/test/offline/config/jak3/config.jsonc index 1b3e1226090..41e3f959fad 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -388,7 +388,9 @@ // asm "(method 19 cloth-system)", "(method 37 cloth-system)", - "(method 19 rope-prim-system)" + "(method 19 rope-prim-system)", + // funny casts with matrix. + "sprite-add-matrix-data" ], "skip_compile_states": {