From 4274f44d4fdab6e108b4a8495c7324642381da92 Mon Sep 17 00:00:00 2001 From: water Date: Sat, 30 Sep 2023 10:40:47 -0400 Subject: [PATCH] jak1 --- decompiler/IR2/FormExpressionAnalysis.cpp | 4 ++- .../jak1/engine/common-obs/collectables.gc | 2 +- goal_src/jak1/engine/common-obs/nav-enemy.gc | 2 +- goal_src/jak1/engine/common-obs/rigid-body.gc | 8 +---- goal_src/jak1/engine/common-obs/sharkey.gc | 2 +- goal_src/jak1/engine/target/logic-target.gc | 2 +- goal_src/jak1/engine/target/target2.gc | 2 +- goal_src/jak1/kernel/gcommon.gc | 6 ++++ goal_src/jak1/kernel/gstate.gc | 22 ++++++++++++++ goal_src/jak1/levels/beach/beach-obs.gc | 5 +--- goal_src/jak1/levels/beach/beach-rocks.gc | 7 ++--- goal_src/jak1/levels/beach/pelican.gc | 5 +--- goal_src/jak1/levels/citadel/citadel-obs.gc | 20 ++++++------- goal_src/jak1/levels/citadel/citadel-sages.gc | 8 ++--- goal_src/jak1/levels/citadel/citb-plat.gc | 6 ++-- .../jak1/levels/common/battlecontroller.gc | 7 ++--- goal_src/jak1/levels/jungle/fisher.gc | 6 ++-- goal_src/jak1/levels/jungle/hopper.gc | 2 +- .../jak1/levels/jungle/jungle-elevator.gc | 2 +- goal_src/jak1/levels/jungle/jungle-obs.gc | 5 +--- goal_src/jak1/levels/jungle/junglefish.gc | 2 +- goal_src/jak1/levels/jungleb/plant-boss.gc | 5 +--- goal_src/jak1/levels/lavatube/lavatube-obs.gc | 5 +--- goal_src/jak1/levels/maincave/baby-spider.gc | 2 +- .../jak1/levels/maincave/driller-lurker.gc | 5 +--- goal_src/jak1/levels/maincave/gnawer.gc | 5 +--- .../jak1/levels/misty/babak-with-cannon.gc | 2 +- goal_src/jak1/levels/misty/balloonlurker.gc | 5 +--- goal_src/jak1/levels/misty/misty-conveyor.gc | 5 +--- goal_src/jak1/levels/misty/misty-obs.gc | 7 ++--- goal_src/jak1/levels/ogre/ogre-obs.gc | 28 +++++++---------- goal_src/jak1/levels/ogre/ogreboss.gc | 8 +---- goal_src/jak1/levels/robocave/cave-trap.gc | 5 +--- goal_src/jak1/levels/snow/ice-cube.gc | 2 +- goal_src/jak1/levels/snow/snow-ball.gc | 6 +--- goal_src/jak1/levels/snow/snow-bumper.gc | 5 +--- goal_src/jak1/levels/snow/snow-obs.gc | 5 +--- goal_src/jak1/levels/snow/yeti.gc | 2 +- goal_src/jak1/levels/sunken/bully.gc | 5 +--- goal_src/jak1/levels/sunken/helix-water.gc | 5 +--- goal_src/jak1/levels/sunken/puffer.gc | 5 +--- goal_src/jak1/levels/sunken/qbert-plat.gc | 2 +- .../jak1/levels/sunken/square-platform.gc | 5 +--- goal_src/jak1/levels/sunken/steam-cap.gc | 5 +--- .../jak1/levels/sunken/sunken-pipegame.gc | 5 +--- goal_src/jak1/levels/swamp/billy.gc | 9 ++---- goal_src/jak1/levels/swamp/kermit.gc | 2 +- goal_src/jak1/levels/swamp/swamp-bat.gc | 5 +--- goal_src/jak1/levels/swamp/swamp-obs.gc | 2 +- goal_src/jak1/levels/swamp/swamp-rat.gc | 2 +- goal_src/jak1/levels/training/training-obs.gc | 2 +- .../jak1/levels/village1/fishermans-boat.gc | 8 +---- goal_src/jak1/levels/village1/village-obs.gc | 5 +--- .../jak1/levels/village2/sunken-elevator.gc | 2 +- goal_src/jak1/levels/village2/swamp-blimp.gc | 5 +--- goal_src/jak1/levels/village2/village2-obs.gc | 2 +- .../levels/village_common/villagep-obs.gc | 2 +- goal_src/jak2/kernel/gcommon.gc | 6 ++++ goal_src/jak2/kernel/gstate.gc | 23 ++++++++++++++ .../reference/jak1/decompiler-macros.gc | 29 ++++++++++++++++++ .../engine/common-obs/collectables_REF.gc | 2 +- .../jak1/engine/common-obs/nav-enemy_REF.gc | 3 +- .../jak1/engine/common-obs/rigid-body_REF.gc | 9 +----- .../jak1/engine/common-obs/sharkey_REF.gc | 2 +- .../jak1/engine/target/logic-target_REF.gc | 2 +- .../jak1/engine/target/target2_REF.gc | 2 +- .../jak1/levels/beach/beach-obs_REF.gc | 6 +--- .../jak1/levels/beach/beach-rocks_REF.gc | 8 ++--- .../jak1/levels/beach/pelican_REF.gc | 6 +--- .../jak1/levels/citadel/citadel-obs_REF.gc | 20 ++++++------- .../jak1/levels/citadel/citadel-sages_REF.gc | 8 ++--- .../jak1/levels/citadel/citb-plat_REF.gc | 6 ++-- .../levels/common/battlecontroller_REF.gc | 8 ++--- .../jak1/levels/jungle/fisher_REF.gc | 6 ++-- .../jak1/levels/jungle/hopper_REF.gc | 2 +- .../jak1/levels/jungle/jungle-elevator_REF.gc | 2 +- .../jak1/levels/jungle/jungle-obs_REF.gc | 6 +--- .../jak1/levels/jungle/junglefish_REF.gc | 2 +- .../jak1/levels/jungleb/plant-boss_REF.gc | 6 +--- .../jak1/levels/lavatube/lavatube-obs_REF.gc | 6 +--- .../jak1/levels/maincave/baby-spider_REF.gc | 2 +- .../levels/maincave/driller-lurker_REF.gc | 6 +--- .../jak1/levels/maincave/gnawer_REF.gc | 6 +--- .../levels/misty/babak-with-cannon_REF.gc | 2 +- .../jak1/levels/misty/balloonlurker_REF.gc | 6 +--- .../jak1/levels/misty/misty-conveyor_REF.gc | 6 +--- .../jak1/levels/misty/misty-obs_REF.gc | 7 ++--- .../jak1/levels/ogre/ogre-obs_REF.gc | 29 +++++++----------- .../jak1/levels/ogre/ogreboss_REF.gc | 9 +----- .../jak1/levels/robocave/cave-trap_REF.gc | 6 +--- .../jak1/levels/snow/ice-cube_REF.gc | 3 +- .../jak1/levels/snow/snow-ball_REF.gc | 7 +---- .../jak1/levels/snow/snow-bumper_REF.gc | 6 +--- .../jak1/levels/snow/snow-obs_REF.gc | 6 +--- .../reference/jak1/levels/snow/yeti_REF.gc | 3 +- .../reference/jak1/levels/sunken/bully_REF.gc | 6 +--- .../jak1/levels/sunken/helix-water_REF.gc | 6 +--- .../jak1/levels/sunken/puffer_REF.gc | 6 +--- .../jak1/levels/sunken/qbert-plat_REF.gc | 2 +- .../jak1/levels/sunken/square-platform_REF.gc | 6 +--- .../jak1/levels/sunken/steam-cap_REF.gc | 6 +--- .../jak1/levels/sunken/sunken-pipegame_REF.gc | 6 +--- .../reference/jak1/levels/swamp/billy_REF.gc | 10 ++----- .../reference/jak1/levels/swamp/kermit_REF.gc | 2 +- .../jak1/levels/swamp/swamp-bat_REF.gc | 6 +--- .../jak1/levels/swamp/swamp-obs_REF.gc | 2 +- .../jak1/levels/swamp/swamp-rat_REF.gc | 2 +- .../jak1/levels/training/training-obs_REF.gc | 2 +- .../levels/village1/fishermans-boat_REF.gc | 9 +----- .../jak1/levels/village1/village-obs_REF.gc | 6 +--- .../levels/village2/sunken-elevator_REF.gc | 2 +- .../jak1/levels/village2/swamp-blimp_REF.gc | 6 +--- .../jak1/levels/village2/village2-obs_REF.gc | 2 +- .../levels/village_common/villagep-obs_REF.gc | 9 ++---- .../reference/jak2/decompiler-macros.gc | 30 +++++++++++++++++++ 115 files changed, 290 insertions(+), 415 deletions(-) diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 6c27969f15..fd6bc26c21 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -2621,7 +2621,9 @@ void SetVarElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta } } -FormElement* SetFormFormElement::make_set_time(const Env& env, FormPool& pool, FormStack& stack) { +FormElement* SetFormFormElement::make_set_time(const Env& /*env*/, + FormPool& pool, + FormStack& /*stack*/) { auto matcher = match( Matcher::op(GenericOpMatcher::func(Matcher::constant_token("current-time")), {}), m_src); if (matcher.matched) { diff --git a/goal_src/jak1/engine/common-obs/collectables.gc b/goal_src/jak1/engine/common-obs/collectables.gc index 73d0562f02..ed41c7de49 100644 --- a/goal_src/jak1/engine/common-obs/collectables.gc +++ b/goal_src/jak1/engine/common-obs/collectables.gc @@ -1484,7 +1484,7 @@ :enter (behavior ((arg0 object) (arg1 handle)) (set-time! (-> self state-time)) (set! (-> self state-object) #t) - (let ((t9-1 (-> (the-as (state eco-collectable) (find-parent-method fuel-cell 23)) enter))) + (let ((t9-1 (-> (the-as (state eco-collectable) (find-parent-state)) enter))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak1/engine/common-obs/nav-enemy.gc b/goal_src/jak1/engine/common-obs/nav-enemy.gc index fc46bfed42..17e584aef6 100644 --- a/goal_src/jak1/engine/common-obs/nav-enemy.gc +++ b/goal_src/jak1/engine/common-obs/nav-enemy.gc @@ -50,7 +50,7 @@ (if (nonzero? (-> this rand-gen)) (set! (-> this rand-gen) (the-as random-generator (+ (the-as int (-> this rand-gen)) arg0))) ) - (the-as nav-enemy ((the-as (function process-drawable int none) (find-parent-method nav-enemy 7)) this arg0)) + (call-parent-method this arg0) ) (defmethod new-patrol-point! nav-enemy ((this nav-enemy)) diff --git a/goal_src/jak1/engine/common-obs/rigid-body.gc b/goal_src/jak1/engine/common-obs/rigid-body.gc index bfd3c0e873..6e79103e78 100644 --- a/goal_src/jak1/engine/common-obs/rigid-body.gc +++ b/goal_src/jak1/engine/common-obs/rigid-body.gc @@ -319,13 +319,7 @@ (the-as rigid-body-control-point-inline-array (+ (the-as int (-> this control-point-array)) arg0)) ) ) - (the-as - rigid-body-platform - ((the-as (function process-drawable int process-drawable) (find-parent-method rigid-body-platform 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) (defmethod rigid-body-platform-method-22 rigid-body-platform ((this rigid-body-platform) (arg0 vector) (arg1 float)) diff --git a/goal_src/jak1/engine/common-obs/sharkey.gc b/goal_src/jak1/engine/common-obs/sharkey.gc index 9d28a7110f..d703c928b3 100644 --- a/goal_src/jak1/engine/common-obs/sharkey.gc +++ b/goal_src/jak1/engine/common-obs/sharkey.gc @@ -146,7 +146,7 @@ nav-enemy-default-event-handler (set! (-> this last-y) f28-0) ) ) - ((the-as (function nav-enemy none) (find-parent-method sharkey 39)) this) + (call-parent-method this) 0 (none) ) diff --git a/goal_src/jak1/engine/target/logic-target.gc b/goal_src/jak1/engine/target/logic-target.gc index 6eeedf12ad..4ad351cd0d 100644 --- a/goal_src/jak1/engine/target/logic-target.gc +++ b/goal_src/jak1/engine/target/logic-target.gc @@ -2041,7 +2041,7 @@ (defmethod deactivate target ((this target)) (set-zero! *camera-smush-control*) - ((the-as (function process-drawable none) (find-parent-method target 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak1/engine/target/target2.gc b/goal_src/jak1/engine/target/target2.gc index b8ab1c2f27..7011cb998a 100644 --- a/goal_src/jak1/engine/target/target2.gc +++ b/goal_src/jak1/engine/target/target2.gc @@ -175,7 +175,7 @@ ) (enable-hud) (set! (-> *target* fp-hud) (the-as handle #f)) - ((the-as (function process none) (find-parent-method first-person-hud 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak1/kernel/gcommon.gc b/goal_src/jak1/kernel/gcommon.gc index a1a23bf596..aa64657e57 100644 --- a/goal_src/jak1/kernel/gcommon.gc +++ b/goal_src/jak1/kernel/gcommon.gc @@ -362,6 +362,12 @@ current-method ) +(defmacro call-parent-method (&rest args) + "Find the first different implementation of the current method in a parent type and call it with these arguments." + `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) + ,@args) + ) + (defmacro as-type (this type) "Macro to _safely_ convert to a different type, returning #f if the type doesn't match. Does a runtime type check so it's expensive." diff --git a/goal_src/jak1/kernel/gstate.gc b/goal_src/jak1/kernel/gstate.gc index ca0e63387c..d7aff09965 100644 --- a/goal_src/jak1/kernel/gstate.gc +++ b/goal_src/jak1/kernel/gstate.gc @@ -144,6 +144,11 @@ It type checks the arguments for the entry function. (set! *defstate-type-stack* '()) `(none) ) + +;; set when inside a defstate. +(seval (define *defstate-current-type* #f)) +(seval (define *defstate-current-state-name* #f)) + ;; *no-state* is just used for the compiler to know whether a handler was actually set or not (defmacro defstate (state-name parents &key (virtual #f) @@ -163,6 +168,10 @@ It type checks the arguments for the entry function. *defstate-type-stack*) ) (set! *defstate-type-stack* '()) + (when virtual + (set! *defstate-current-type* defstate-type) + (set! *defstate-current-state-name* state-name) + ) ;; check for default handlers (let ((default-handlers (assoc defstate-type *default-state-handlers*))) (when default-handlers @@ -225,6 +234,19 @@ It type checks the arguments for the entry function. ) ) +(defmacro find-parent-state () + "Find the first different implementation of the current virtual state above this one." + (when (or (not *defstate-current-type*) + (not *defstate-current-state-name*)) + (error "use of find-parent-state outside of a defstate.") + ) + `(cast-to-method-type + ,*defstate-current-type* + ,*defstate-current-state-name* + (find-parent-method ,*defstate-current-type* (method-id-of-type ,*defstate-current-type* ,*defstate-current-state-name*)) + ) + ) + (defmacro behavior (bindings &rest body) "Define an anonymous behavior for a process state. This may only be used inside a defstate!" diff --git a/goal_src/jak1/levels/beach/beach-obs.gc b/goal_src/jak1/levels/beach/beach-obs.gc index 96cb58bfd2..206495c40e 100644 --- a/goal_src/jak1/levels/beach/beach-obs.gc +++ b/goal_src/jak1/levels/beach/beach-obs.gc @@ -962,10 +962,7 @@ (if (nonzero? (-> this wobbler)) (&+! (-> this wobbler) arg0) ) - (the-as - flutflutegg - ((the-as (function process-drawable int process-drawable) (find-parent-method flutflutegg 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement. diff --git a/goal_src/jak1/levels/beach/beach-rocks.gc b/goal_src/jak1/levels/beach/beach-rocks.gc index 56334995a7..18e93e1469 100644 --- a/goal_src/jak1/levels/beach/beach-rocks.gc +++ b/goal_src/jak1/levels/beach/beach-rocks.gc @@ -255,10 +255,7 @@ (if (nonzero? (-> this part-landing)) (set! (-> this part-landing) (the-as sparticle-launch-control (+ (the-as int (-> this part-landing)) arg0))) ) - (the-as - beach-rock - ((the-as (function process-drawable int none) (find-parent-method beach-rock 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod deactivate beach-rock ((this beach-rock)) @@ -268,7 +265,7 @@ (if (nonzero? (-> this part-landing)) (kill-and-free-particles (-> this part-landing)) ) - ((the-as (function process-drawable none) (find-parent-method beach-rock 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak1/levels/beach/pelican.gc b/goal_src/jak1/levels/beach/pelican.gc index 1b948f8fb2..c38245c3b4 100644 --- a/goal_src/jak1/levels/beach/pelican.gc +++ b/goal_src/jak1/levels/beach/pelican.gc @@ -95,10 +95,7 @@ (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) - (the-as - pelican - ((the-as (function process-drawable int process-drawable) (find-parent-method pelican 7)) this arg0) - ) + (call-parent-method this arg0) ) (defskelgroup *pelican-sg* pelican pelican-lod0-jg pelican-fly-ja diff --git a/goal_src/jak1/levels/citadel/citadel-obs.gc b/goal_src/jak1/levels/citadel/citadel-obs.gc index 22d17078a2..c6c122ffe5 100644 --- a/goal_src/jak1/levels/citadel/citadel-obs.gc +++ b/goal_src/jak1/levels/citadel/citadel-obs.gc @@ -180,7 +180,7 @@ ) (defmethod setup-new-process! citb-arm ((this citb-arm)) - ((the-as (function citb-arm-section none) (find-parent-method citb-arm 21)) this) + (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) (set-vector! (-> this cull-dir-local) 0.0 0.0 -1.0 1.0) (set! (-> this cull-dot) (cos 5461.3335)) @@ -198,7 +198,7 @@ (defmethod setup-new-process! citb-arm-shoulder ((this citb-arm-shoulder)) - ((the-as (function citb-arm-section none) (find-parent-method citb-arm-shoulder 21)) this) + (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) (set-vector! (-> this cull-dir-local) 1.0 0.0 1.0 1.0) (set! (-> this cull-dot) (cos 8374.045)) @@ -262,7 +262,7 @@ (defmethod setup-new-process! citb-arm-a ((this citb-arm-a)) (initialize-skeleton this *citb-arm-a-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-a 21)) this) + (call-parent-method this) (set! (-> this root-override root-prim local-sphere z) -184320.0) 0 (none) @@ -270,7 +270,7 @@ (defmethod setup-new-process! citb-arm-b ((this citb-arm-b)) (initialize-skeleton this *citb-arm-b-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-b 21)) this) + (call-parent-method this) (set! (-> this root-override root-prim local-sphere z) -225280.0) 0 (none) @@ -278,7 +278,7 @@ (defmethod setup-new-process! citb-arm-c ((this citb-arm-c)) (initialize-skeleton this *citb-arm-c-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-c 21)) this) + (call-parent-method this) (set! (-> this root-override root-prim local-sphere z) -266240.0) 0 (none) @@ -286,7 +286,7 @@ (defmethod setup-new-process! citb-arm-d ((this citb-arm-d)) (initialize-skeleton this *citb-arm-d-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-d 21)) this) + (call-parent-method this) (set! (-> this root-override root-prim local-sphere z) -307200.0) 0 (none) @@ -294,14 +294,14 @@ (defmethod setup-new-process! citb-arm-shoulder-a ((this citb-arm-shoulder-a)) (initialize-skeleton this *citb-arm-shoulder-a-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-shoulder-a 21)) (the-as citb-arm this)) + (call-parent-method this) 0 (none) ) (defmethod setup-new-process! citb-arm-shoulder-b ((this citb-arm-shoulder-b)) (initialize-skeleton this *citb-arm-shoulder-b-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-shoulder-b 21)) (the-as citb-arm this)) + (call-parent-method this) 0 (none) ) @@ -1541,7 +1541,7 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (let ((t9-2 (-> (the-as (state battlecontroller) (find-parent-method citb-battlecontroller 26)) code))) + (let ((t9-2 (-> (find-parent-state) code))) (if t9-2 ((the-as (function none :behavior battlecontroller) t9-2)) ) @@ -1550,7 +1550,7 @@ ) (defmethod battlecontroller-method-27 citb-battlecontroller ((this citb-battlecontroller)) - ((the-as (function battlecontroller none) (find-parent-method citb-battlecontroller 27)) this) + (call-parent-method this) (set! (-> this activate-distance) 143360.0) 0 (none) diff --git a/goal_src/jak1/levels/citadel/citadel-sages.gc b/goal_src/jak1/levels/citadel/citadel-sages.gc index 08cdb42588..d94a2d31e2 100644 --- a/goal_src/jak1/levels/citadel/citadel-sages.gc +++ b/goal_src/jak1/levels/citadel/citadel-sages.gc @@ -515,7 +515,7 @@ ) ) (set! (-> this sound-name) "redsage-fires") - ((the-as (function citb-sage none) (find-parent-method red-sagecage 44)) this) + (call-parent-method this) (the-as symbol 0) ) @@ -633,7 +633,7 @@ ) ) (set! (-> this sound-name) "bluesage-fires") - ((the-as (function citb-sage none) (find-parent-method blue-sagecage 44)) this) + (call-parent-method this) (the-as symbol 0) ) @@ -746,7 +746,7 @@ ) ) (set! (-> this sound-name) "yellsage-fire") - ((the-as (function citb-sage none) (find-parent-method yellow-sagecage 44)) this) + (call-parent-method this) (the-as symbol 0) ) @@ -826,7 +826,7 @@ ) ) (set! (-> this sound-name) "greensage-fires") - ((the-as (function citb-sage none) (find-parent-method green-sagecage 44)) this) + (call-parent-method this) (the-as symbol 0) ) diff --git a/goal_src/jak1/levels/citadel/citb-plat.gc b/goal_src/jak1/levels/citadel/citb-plat.gc index 7301dd672e..da6dca2f61 100644 --- a/goal_src/jak1/levels/citadel/citb-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-plat.gc @@ -434,7 +434,7 @@ ) (defmethod rigid-body-platform-method-23 citb-chain-plat ((this citb-chain-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method citb-chain-plat 23)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this orig-trans)) 0 (none) @@ -1035,7 +1035,7 @@ :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) - (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method citb-exit-plat 23)) trans))) + (let ((t9-1 (-> (the-as (state plat-button) (find-parent-state)) trans))) (if t9-1 (t9-1) ) @@ -1051,7 +1051,7 @@ :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) - (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method citb-exit-plat 24)) trans))) + (let ((t9-1 (-> (the-as (state plat-button) (find-parent-state)) trans))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak1/levels/common/battlecontroller.gc b/goal_src/jak1/levels/common/battlecontroller.gc index fd041ee21b..b49021b6ff 100644 --- a/goal_src/jak1/levels/common/battlecontroller.gc +++ b/goal_src/jak1/levels/common/battlecontroller.gc @@ -590,10 +590,7 @@ battlecontroller-default-event-handler (if (nonzero? (-> this path-spawn)) (&+! (-> this path-spawn) arg0) ) - (the-as - battlecontroller - ((the-as (function process-drawable int process-drawable) (find-parent-method battlecontroller 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod deactivate battlecontroller ((this battlecontroller)) @@ -603,7 +600,7 @@ battlecontroller-default-event-handler (battlecontroller-off) (set! pp gp-0) ) - ((the-as (function process-drawable none) (find-parent-method battlecontroller 10)) this) + (call-parent-method this) 0 (none) ) diff --git a/goal_src/jak1/levels/jungle/fisher.gc b/goal_src/jak1/levels/jungle/fisher.gc index 71d97713ff..50eaa72746 100644 --- a/goal_src/jak1/levels/jungle/fisher.gc +++ b/goal_src/jak1/levels/jungle/fisher.gc @@ -1175,7 +1175,7 @@ (go (method-of-object this play-anim)) ) (else - ((the-as (function fisher none) (find-parent-method fisher 38)) this) + (call-parent-method this) ) ) (none) @@ -1753,7 +1753,7 @@ (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 80 bone transform vector 1)))) ) ) - (let ((t9-14 (-> (the-as state (find-parent-method fisher 24)) trans))) + (let ((t9-14 (-> (find-parent-state) trans))) (if t9-14 (t9-14) ) @@ -1764,7 +1764,7 @@ (defstate idle (fisher) :virtual #t :trans (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method fisher 30)) trans))) + (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak1/levels/jungle/hopper.gc b/goal_src/jak1/levels/jungle/hopper.gc index 094bf305c8..de888e5806 100644 --- a/goal_src/jak1/levels/jungle/hopper.gc +++ b/goal_src/jak1/levels/jungle/hopper.gc @@ -32,7 +32,7 @@ nav-enemy-default-event-handler (set! (-> v1-1 settings bot-plane w) (- (- (-> this shadow-min-y) (-> this collide-info trans y)))) ) 0 - ((the-as (function nav-enemy none) (find-parent-method hopper 39)) this) + (call-parent-method this) 0 (none) ) diff --git a/goal_src/jak1/levels/jungle/jungle-elevator.gc b/goal_src/jak1/levels/jungle/jungle-elevator.gc index e4b3926299..3cbbea8b31 100644 --- a/goal_src/jak1/levels/jungle/jungle-elevator.gc +++ b/goal_src/jak1/levels/jungle/jungle-elevator.gc @@ -49,7 +49,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> self root-override trans quad)) - (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method jungle-elevator 23)) trans))) + (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak1/levels/jungle/jungle-obs.gc b/goal_src/jak1/levels/jungle/jungle-obs.gc index 3e308f0c2d..80ec11dc43 100644 --- a/goal_src/jak1/levels/jungle/jungle-obs.gc +++ b/goal_src/jak1/levels/jungle/jungle-obs.gc @@ -1087,10 +1087,7 @@ (if (nonzero? (-> this back-prim)) (&+! (-> this back-prim) arg0) ) - (the-as - jngpusher - ((the-as (function process-drawable int process-drawable) (find-parent-method jngpusher 7)) this arg0) - ) + (call-parent-method this arg0) ) (defskelgroup *jngpusher-sg* jngpusher 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 10)) diff --git a/goal_src/jak1/levels/jungle/junglefish.gc b/goal_src/jak1/levels/jungle/junglefish.gc index 69bcaa6475..9c0b07c438 100644 --- a/goal_src/jak1/levels/jungle/junglefish.gc +++ b/goal_src/jak1/levels/jungle/junglefish.gc @@ -25,7 +25,7 @@ nav-enemy-default-event-handler (defmethod common-post junglefish ((this junglefish)) (water-control-method-10 (-> this water)) - ((the-as (function nav-enemy none) (find-parent-method junglefish 39)) this) + (call-parent-method this) 0 (none) ) diff --git a/goal_src/jak1/levels/jungleb/plant-boss.gc b/goal_src/jak1/levels/jungleb/plant-boss.gc index 5958f1950c..0711f749f2 100644 --- a/goal_src/jak1/levels/jungleb/plant-boss.gc +++ b/goal_src/jak1/levels/jungleb/plant-boss.gc @@ -67,10 +67,7 @@ (&+! (-> this death-prim v1-8) arg0) ) ) - (the-as - plant-boss - ((the-as (function process-drawable int process-drawable) (find-parent-method plant-boss 7)) this arg0) - ) + (call-parent-method this arg0) ) (deftype plant-boss-arm (process-drawable) diff --git a/goal_src/jak1/levels/lavatube/lavatube-obs.gc b/goal_src/jak1/levels/lavatube/lavatube-obs.gc index 831efc2445..93c3dd1038 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-obs.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-obs.gc @@ -403,10 +403,7 @@ (if (nonzero? (-> this spawn-array)) (&+! (-> this spawn-array) arg0) ) - (the-as - darkecobarrel - ((the-as (function darkecobarrel-base int darkecobarrel-base) (find-parent-method darkecobarrel 7)) this arg0) - ) + (call-parent-method this arg0) ) (defskelgroup *darkecobarrel-sg* darkecobarrel darkecobarrel-lod0-jg darkecobarrel-idle-ja diff --git a/goal_src/jak1/levels/maincave/baby-spider.gc b/goal_src/jak1/levels/maincave/baby-spider.gc index 8500fbd5ea..f94e7bc230 100644 --- a/goal_src/jak1/levels/maincave/baby-spider.gc +++ b/goal_src/jak1/levels/maincave/baby-spider.gc @@ -232,7 +232,7 @@ baby-spider-default-event-handler (vector-z-quaternion! (new-stack-vector0) (-> this collide-info quat)) (-> this up-vector) ) - ((the-as (function nav-enemy none) (find-parent-method baby-spider 39)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak1/levels/maincave/driller-lurker.gc b/goal_src/jak1/levels/maincave/driller-lurker.gc index 9e8534afc2..a6accc3946 100644 --- a/goal_src/jak1/levels/maincave/driller-lurker.gc +++ b/goal_src/jak1/levels/maincave/driller-lurker.gc @@ -957,10 +957,7 @@ (if (nonzero? (-> this sound2)) (&+! (-> this sound2) arg0) ) - (the-as - driller-lurker - ((the-as (function process-drawable int process-drawable) (find-parent-method driller-lurker 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod deactivate driller-lurker ((this driller-lurker)) diff --git a/goal_src/jak1/levels/maincave/gnawer.gc b/goal_src/jak1/levels/maincave/gnawer.gc index 7d34a1fe27..7591d10d4c 100644 --- a/goal_src/jak1/levels/maincave/gnawer.gc +++ b/goal_src/jak1/levels/maincave/gnawer.gc @@ -1313,10 +1313,7 @@ (if (nonzero? (-> this sound2)) (&+! (-> this sound2) arg0) ) - (the-as - gnawer - ((the-as (function nav-enemy int nav-enemy) (find-parent-method gnawer 7)) (the-as nav-enemy this) arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! gnawer ((this gnawer) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/misty/babak-with-cannon.gc b/goal_src/jak1/levels/misty/babak-with-cannon.gc index ba4adeab9b..622e6cf942 100644 --- a/goal_src/jak1/levels/misty/babak-with-cannon.gc +++ b/goal_src/jak1/levels/misty/babak-with-cannon.gc @@ -308,7 +308,7 @@ nav-enemy-default-event-handler (if (and *target* (= (-> *target* current-level name) 'misty)) (spool-push *art-control* "mistycam-cannon" 0 self -1.0) ) - (let ((t9-3 (-> (the-as (state nav-enemy) (find-parent-method babak-with-cannon 23)) trans))) + (let ((t9-3 (-> (find-parent-state) trans))) (if t9-3 (t9-3) ) diff --git a/goal_src/jak1/levels/misty/balloonlurker.gc b/goal_src/jak1/levels/misty/balloonlurker.gc index 18fdef3ccb..47b43e41f0 100644 --- a/goal_src/jak1/levels/misty/balloonlurker.gc +++ b/goal_src/jak1/levels/misty/balloonlurker.gc @@ -816,10 +816,7 @@ (if (nonzero? (-> this mine 1)) (&+! (-> this mine 1) arg0) ) - (the-as - balloonlurker - ((the-as (function process-drawable int process-drawable) (find-parent-method balloonlurker 7)) this arg0) - ) + (call-parent-method this arg0) ) (defstate balloonlurker-pilot-idle (balloonlurker-pilot) diff --git a/goal_src/jak1/levels/misty/misty-conveyor.gc b/goal_src/jak1/levels/misty/misty-conveyor.gc index 49664b0e32..c078bb7688 100644 --- a/goal_src/jak1/levels/misty/misty-conveyor.gc +++ b/goal_src/jak1/levels/misty/misty-conveyor.gc @@ -562,10 +562,7 @@ (if (nonzero? (-> this pivot)) (&+! (-> this pivot) arg0) ) - (the-as - keg-conveyor - ((the-as (function process-drawable int process-drawable) (find-parent-method keg-conveyor 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Function (method 11 keg-conveyor) has a return type of none, but the expression builder found a return statement. diff --git a/goal_src/jak1/levels/misty/misty-obs.gc b/goal_src/jak1/levels/misty/misty-obs.gc index 182b9a4798..95d2a251fe 100644 --- a/goal_src/jak1/levels/misty/misty-obs.gc +++ b/goal_src/jak1/levels/misty/misty-obs.gc @@ -1574,10 +1574,7 @@ ) (defmethod rigid-body-platform-method-23 bone-platform ((this bone-platform) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method bone-platform 23)) - this - (the-as basic arg0) - ) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) @@ -1756,7 +1753,7 @@ ) (defmethod battlecontroller-method-27 misty-battlecontroller ((this misty-battlecontroller)) - ((the-as (function battlecontroller none) (find-parent-method misty-battlecontroller 27)) this) + (call-parent-method this) (set! (-> this misty-ambush-collision-hack) #t) 0 (none) diff --git a/goal_src/jak1/levels/ogre/ogre-obs.gc b/goal_src/jak1/levels/ogre/ogre-obs.gc index fa1db29ed1..2d6322888a 100644 --- a/goal_src/jak1/levels/ogre/ogre-obs.gc +++ b/goal_src/jak1/levels/ogre/ogre-obs.gc @@ -440,10 +440,7 @@ (defmethod rigid-body-platform-method-23 ogre-plat ((this ogre-plat) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method ogre-plat 23)) - this - (the-as basic arg0) - ) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) @@ -610,7 +607,7 @@ (set! (-> this float-y-offset) 0.0) (+! (-> this root-overlay trans y) (-> this idle-y-offset)) (rigid-body-platform-method-29 this *ogre-step-constants*) - ((the-as (function ogre-plat none) (find-parent-method ogre-step 31)) this) + (call-parent-method this) (let ((a0-5 (entity-actor-lookup (-> this entity) 'alt-actor 0))) (if (and a0-5 (logtest? (-> a0-5 extra perm status) (entity-perm-status complete))) (set! (-> this active) #t) @@ -668,7 +665,7 @@ (defmethod rigid-body-platform-method-31 ogre-step-a ((this ogre-step-a)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-a-sg* '()) - ((the-as (function ogre-step none) (find-parent-method ogre-step-a 31)) this) + (call-parent-method this) 0 (none) ) @@ -676,7 +673,7 @@ (defmethod rigid-body-platform-method-31 ogre-step-b ((this ogre-step-b)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-b-sg* '()) - ((the-as (function ogre-step none) (find-parent-method ogre-step-b 31)) this) + (call-parent-method this) 0 (none) ) @@ -684,7 +681,7 @@ (defmethod rigid-body-platform-method-31 ogre-step-c ((this ogre-step-c)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 26624.0) (initialize-skeleton this *ogre-step-c-sg* '()) - ((the-as (function ogre-step none) (find-parent-method ogre-step-c 31)) this) + (call-parent-method this) 0 (none) ) @@ -692,7 +689,7 @@ (defmethod rigid-body-platform-method-31 ogre-step-d ((this ogre-step-d)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-b-sg* '()) - ((the-as (function ogre-step none) (find-parent-method ogre-step-d 31)) this) + (call-parent-method this) 0 (none) ) @@ -737,7 +734,7 @@ (set! (-> this idle-y-offset) -6144.0) (set! (-> this float-y-offset) 4096.0) (rigid-body-platform-method-29 this *ogre-isle-constants*) - ((the-as (function ogre-plat none) (find-parent-method ogre-isle 31)) this) + (call-parent-method this) (set! (-> this active) #t) 0 (none) @@ -774,7 +771,7 @@ (+! (-> this root-overlay trans x) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0) (initialize-skeleton this *ogre-isle-b-sg* '()) - ((the-as (function ogre-isle none) (find-parent-method ogre-isle-b 31)) this) + (call-parent-method this) 0 (none) ) @@ -783,7 +780,7 @@ (+! (-> this root-overlay trans x) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0) (initialize-skeleton this *ogre-isle-b-sg* '()) - ((the-as (function ogre-isle none) (find-parent-method ogre-isle-c 31)) this) + (call-parent-method this) 0 (none) ) @@ -793,7 +790,7 @@ (+! (-> this root-overlay trans z) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 22528.0) (initialize-skeleton this *ogre-isle-d-sg* '()) - ((the-as (function ogre-isle none) (find-parent-method ogre-isle-d 31)) this) + (call-parent-method this) 0 (none) ) @@ -828,10 +825,7 @@ (&+! (-> this joint-mod-array v1-0) arg0) ) ) - (the-as - ogre-bridge - ((the-as (function process-drawable int process-drawable) (find-parent-method ogre-bridge 7)) this arg0) - ) + (call-parent-method this arg0) ) (defbehavior ogre-bridge-update-joints ogre-bridge () diff --git a/goal_src/jak1/levels/ogre/ogreboss.gc b/goal_src/jak1/levels/ogre/ogreboss.gc index e85f00c2c1..f41bd8aef0 100644 --- a/goal_src/jak1/levels/ogre/ogreboss.gc +++ b/goal_src/jak1/levels/ogre/ogreboss.gc @@ -751,13 +751,7 @@ (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - ogreboss-super-boulder - ((the-as (function process-drawable int process-drawable) (find-parent-method ogreboss-super-boulder 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) (defstate ogreboss-super-boulder-killed-player (ogreboss-super-boulder) diff --git a/goal_src/jak1/levels/robocave/cave-trap.gc b/goal_src/jak1/levels/robocave/cave-trap.gc index 7fe96af989..1830f3606f 100644 --- a/goal_src/jak1/levels/robocave/cave-trap.gc +++ b/goal_src/jak1/levels/robocave/cave-trap.gc @@ -285,10 +285,7 @@ (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0) ) - (the-as - cave-trap - ((the-as (function process-drawable int process-drawable) (find-parent-method cave-trap 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! cave-trap ((this cave-trap) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/snow/ice-cube.gc b/goal_src/jak1/levels/snow/ice-cube.gc index 82b27c87ed..bb46873783 100644 --- a/goal_src/jak1/levels/snow/ice-cube.gc +++ b/goal_src/jak1/levels/snow/ice-cube.gc @@ -588,7 +588,7 @@ (if (nonzero? (-> this part4)) (&+! (-> this part4) arg0) ) - (the-as ice-cube ((the-as (function nav-enemy int nav-enemy) (find-parent-method ice-cube 7)) this arg0)) + (call-parent-method this arg0) ) (defmethod init-from-entity! ice-cube ((this ice-cube) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/snow/snow-ball.gc b/goal_src/jak1/levels/snow/snow-ball.gc index 120f71801c..ccbf5313c9 100644 --- a/goal_src/jak1/levels/snow/snow-ball.gc +++ b/goal_src/jak1/levels/snow/snow-ball.gc @@ -560,11 +560,7 @@ (&+! (-> this path v1-0) arg0) ) ) - (the-as snow-ball ((the-as (function process-drawable int process-drawable) (find-parent-method snow-ball 7)) - (the-as process-drawable this) - arg0 - ) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! snow-ball ((this snow-ball) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/snow/snow-bumper.gc b/goal_src/jak1/levels/snow/snow-bumper.gc index 995a473cc6..37696e6add 100644 --- a/goal_src/jak1/levels/snow/snow-bumper.gc +++ b/goal_src/jak1/levels/snow/snow-bumper.gc @@ -299,10 +299,7 @@ (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) - (the-as - snow-bumper - ((the-as (function process-drawable int process-drawable) (find-parent-method snow-bumper 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! snow-bumper ((this snow-bumper) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/snow/snow-obs.gc b/goal_src/jak1/levels/snow/snow-obs.gc index 6e6bcba1df..792f80fdc7 100644 --- a/goal_src/jak1/levels/snow/snow-obs.gc +++ b/goal_src/jak1/levels/snow/snow-obs.gc @@ -1001,10 +1001,7 @@ (if (nonzero? (-> this part3)) (&+! (-> this part3) arg0) ) - (the-as - snow-fort-gate - ((the-as (function process-drawable int process-drawable) (find-parent-method snow-fort-gate 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! snow-fort-gate ((this snow-fort-gate) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/snow/yeti.gc b/goal_src/jak1/levels/snow/yeti.gc index 46dd85e8e4..ebd02e0ef1 100644 --- a/goal_src/jak1/levels/snow/yeti.gc +++ b/goal_src/jak1/levels/snow/yeti.gc @@ -541,7 +541,7 @@ (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) - (the-as yeti-slave ((the-as (function nav-enemy int nav-enemy) (find-parent-method yeti-slave 7)) this arg0)) + (call-parent-method this arg0) ) (defbehavior yeti-slave-init-by-other yeti-slave ((arg0 entity) (arg1 yeti) (arg2 vector) (arg3 vector) (arg4 symbol)) diff --git a/goal_src/jak1/levels/sunken/bully.gc b/goal_src/jak1/levels/sunken/bully.gc index b6cc6bf961..58817f5370 100644 --- a/goal_src/jak1/levels/sunken/bully.gc +++ b/goal_src/jak1/levels/sunken/bully.gc @@ -734,10 +734,7 @@ (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) - (the-as - bully - ((the-as (function process-drawable int process-drawable) (find-parent-method bully 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! bully ((this bully) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/sunken/helix-water.gc b/goal_src/jak1/levels/sunken/helix-water.gc index b3811611b8..ad2e9bc04a 100644 --- a/goal_src/jak1/levels/sunken/helix-water.gc +++ b/goal_src/jak1/levels/sunken/helix-water.gc @@ -669,10 +669,7 @@ (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0) ) - (the-as - helix-water - ((the-as (function process-drawable int process-drawable) (find-parent-method helix-water 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! helix-water ((this helix-water) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/sunken/puffer.gc b/goal_src/jak1/levels/sunken/puffer.gc index 131f703770..41730670f6 100644 --- a/goal_src/jak1/levels/sunken/puffer.gc +++ b/goal_src/jak1/levels/sunken/puffer.gc @@ -1054,10 +1054,7 @@ (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) - (the-as - puffer - ((the-as (function process-drawable int process-drawable) (find-parent-method puffer 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! puffer ((this puffer) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/sunken/qbert-plat.gc b/goal_src/jak1/levels/sunken/qbert-plat.gc index 1f5eb4f5e5..d51e5ae9e4 100644 --- a/goal_src/jak1/levels/sunken/qbert-plat.gc +++ b/goal_src/jak1/levels/sunken/qbert-plat.gc @@ -280,7 +280,7 @@ ) (defmethod rigid-body-platform-method-23 qbert-plat ((this qbert-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method qbert-plat 23)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) diff --git a/goal_src/jak1/levels/sunken/square-platform.gc b/goal_src/jak1/levels/sunken/square-platform.gc index b586d61d92..b55a31ab7b 100644 --- a/goal_src/jak1/levels/sunken/square-platform.gc +++ b/goal_src/jak1/levels/sunken/square-platform.gc @@ -404,10 +404,7 @@ (if (nonzero? (-> this part4)) (&+! (-> this part4) arg0) ) - (the-as - square-platform - ((the-as (function baseplat int baseplat) (find-parent-method square-platform 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! square-platform ((this square-platform) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/sunken/steam-cap.gc b/goal_src/jak1/levels/sunken/steam-cap.gc index 4bf8e2f92c..70a1b78d0f 100644 --- a/goal_src/jak1/levels/sunken/steam-cap.gc +++ b/goal_src/jak1/levels/sunken/steam-cap.gc @@ -650,10 +650,7 @@ (if (nonzero? (-> this part3)) (&+! (-> this part3) arg0) ) - (the-as - steam-cap - ((the-as (function process-drawable int process-drawable) (find-parent-method steam-cap 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod deactivate steam-cap ((this steam-cap)) diff --git a/goal_src/jak1/levels/sunken/sunken-pipegame.gc b/goal_src/jak1/levels/sunken/sunken-pipegame.gc index 4b0c15185b..43d2beed5b 100644 --- a/goal_src/jak1/levels/sunken/sunken-pipegame.gc +++ b/goal_src/jak1/levels/sunken/sunken-pipegame.gc @@ -911,10 +911,7 @@ ) ) ) - (the-as - sunken-pipegame - ((the-as (function process-drawable int process-drawable) (find-parent-method sunken-pipegame 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-from-entity! sunken-pipegame ((this sunken-pipegame) (arg0 entity-actor)) diff --git a/goal_src/jak1/levels/swamp/billy.gc b/goal_src/jak1/levels/swamp/billy.gc index 65ac57a163..15f099c039 100644 --- a/goal_src/jak1/levels/swamp/billy.gc +++ b/goal_src/jak1/levels/swamp/billy.gc @@ -43,10 +43,7 @@ (&+! (-> this path-data v1-0) arg0) ) ) - (the-as - billy - ((the-as (function process-drawable int process-drawable) (find-parent-method billy 7)) this arg0) - ) + (call-parent-method this arg0) ) (deftype billy-snack (process-drawable) @@ -207,7 +204,7 @@ (defstate nav-enemy-victory (billy-rat) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state nav-enemy) (find-parent-method billy-rat 33)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -438,7 +435,7 @@ (go (method-of-object this play-anim)) ) (else - ((the-as (function nav-enemy none) (find-parent-method billy 38)) (the-as nav-enemy this)) + (call-parent-method this) ) ) (none) diff --git a/goal_src/jak1/levels/swamp/kermit.gc b/goal_src/jak1/levels/swamp/kermit.gc index 75e35b45d6..79329cdbc2 100644 --- a/goal_src/jak1/levels/swamp/kermit.gc +++ b/goal_src/jak1/levels/swamp/kermit.gc @@ -829,7 +829,7 @@ nav-enemy-default-event-handler (defmethod common-post kermit ((this kermit)) - ((the-as (function nav-enemy none) (find-parent-method kermit 39)) this) + (call-parent-method this) (when (-> this charged-up) ) 0 diff --git a/goal_src/jak1/levels/swamp/swamp-bat.gc b/goal_src/jak1/levels/swamp/swamp-bat.gc index 9edcf2640f..4ee9f2be26 100644 --- a/goal_src/jak1/levels/swamp/swamp-bat.gc +++ b/goal_src/jak1/levels/swamp/swamp-bat.gc @@ -62,10 +62,7 @@ (&+! (-> this path-list v1-0) arg0) ) ) - (the-as - swamp-bat - ((the-as (function process-drawable int process-drawable) (find-parent-method swamp-bat 7)) this arg0) - ) + (call-parent-method this arg0) ) (deftype swamp-bat-slave (process-drawable) diff --git a/goal_src/jak1/levels/swamp/swamp-obs.gc b/goal_src/jak1/levels/swamp/swamp-obs.gc index ac800315f9..8bb613a26d 100644 --- a/goal_src/jak1/levels/swamp/swamp-obs.gc +++ b/goal_src/jak1/levels/swamp/swamp-obs.gc @@ -748,7 +748,7 @@ ) (defmethod rigid-body-platform-method-23 tar-plat ((this tar-plat) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method tar-plat 23)) this (the-as basic arg0)) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) diff --git a/goal_src/jak1/levels/swamp/swamp-rat.gc b/goal_src/jak1/levels/swamp/swamp-rat.gc index 9caae1fa29..3c19dafebd 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat.gc @@ -85,7 +85,7 @@ swamp-rat-default-event-handler (vector-z-quaternion! (new-stack-vector0) (-> this collide-info quat)) (-> this up-vector) ) - ((the-as (function nav-enemy none) (find-parent-method swamp-rat 39)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak1/levels/training/training-obs.gc b/goal_src/jak1/levels/training/training-obs.gc index 27b6921834..c3546b7167 100644 --- a/goal_src/jak1/levels/training/training-obs.gc +++ b/goal_src/jak1/levels/training/training-obs.gc @@ -242,7 +242,7 @@ ) (defmethod rigid-body-platform-method-23 tra-pontoon ((this tra-pontoon) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method tra-pontoon 23)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) diff --git a/goal_src/jak1/levels/village1/fishermans-boat.gc b/goal_src/jak1/levels/village1/fishermans-boat.gc index f5625fa8cb..7884b267ce 100644 --- a/goal_src/jak1/levels/village1/fishermans-boat.gc +++ b/goal_src/jak1/levels/village1/fishermans-boat.gc @@ -1218,13 +1218,7 @@ (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0) ) - (the-as - fishermans-boat - ((the-as (function rigid-body-platform int rigid-body-platform) (find-parent-method fishermans-boat 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) (defmethod rigid-body-platform-method-30 fishermans-boat ((this fishermans-boat)) diff --git a/goal_src/jak1/levels/village1/village-obs.gc b/goal_src/jak1/levels/village1/village-obs.gc index 05be0d3d1b..74c2ce8d5c 100644 --- a/goal_src/jak1/levels/village1/village-obs.gc +++ b/goal_src/jak1/levels/village1/village-obs.gc @@ -924,10 +924,7 @@ (if (nonzero? (-> this pivot)) (&+! (-> this pivot) arg0) ) - (the-as - hutlamp - ((the-as (function process-drawable int process-drawable) (find-parent-method hutlamp 7)) this arg0) - ) + (call-parent-method this arg0) ) (defskelgroup *hutlamp-sg* hutlamp hutlamp-lod0-jg hutlamp-idle-ja diff --git a/goal_src/jak1/levels/village2/sunken-elevator.gc b/goal_src/jak1/levels/village2/sunken-elevator.gc index f99a5f7d06..96abe2e2aa 100644 --- a/goal_src/jak1/levels/village2/sunken-elevator.gc +++ b/goal_src/jak1/levels/village2/sunken-elevator.gc @@ -148,7 +148,7 @@ ) (set! *teleport* #t) (set! (-> s5-0 quad) (-> self root-override trans quad)) - (let ((t9-1 (-> (the-as (state sunken-elevator) (find-parent-method sunken-elevator 23)) trans))) + (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak1/levels/village2/swamp-blimp.gc b/goal_src/jak1/levels/village2/swamp-blimp.gc index 5af193d4c6..68d012090a 100644 --- a/goal_src/jak1/levels/village2/swamp-blimp.gc +++ b/goal_src/jak1/levels/village2/swamp-blimp.gc @@ -584,10 +584,7 @@ (if (nonzero? (-> this bag)) (&+! (-> this bag) arg0) ) - (the-as - swamp-blimp - ((the-as (function process-drawable int process-drawable) (find-parent-method swamp-blimp 7)) this arg0) - ) + (call-parent-method this arg0) ) (defstate swamp-tetherrock-die (swamp-tetherrock) diff --git a/goal_src/jak1/levels/village2/village2-obs.gc b/goal_src/jak1/levels/village2/village2-obs.gc index 66164dbaf4..c1e07cf0c7 100644 --- a/goal_src/jak1/levels/village2/village2-obs.gc +++ b/goal_src/jak1/levels/village2/village2-obs.gc @@ -183,7 +183,7 @@ ) (defmethod rigid-body-platform-method-23 pontoon ((this pontoon) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method pontoon 23)) this (the-as basic arg0)) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) diff --git a/goal_src/jak1/levels/village_common/villagep-obs.gc b/goal_src/jak1/levels/village_common/villagep-obs.gc index 9a52803175..83a098b089 100644 --- a/goal_src/jak1/levels/village_common/villagep-obs.gc +++ b/goal_src/jak1/levels/village_common/villagep-obs.gc @@ -842,7 +842,7 @@ ) ) ) - (let ((t9-10 (-> (the-as (state basebutton) (find-parent-method warp-gate-switch 21)) code))) + (let ((t9-10 (-> (the-as (state basebutton) (find-parent-state)) code))) (if t9-10 ((the-as (function none :behavior basebutton) t9-10)) ) diff --git a/goal_src/jak2/kernel/gcommon.gc b/goal_src/jak2/kernel/gcommon.gc index d7d5037aba..8c3b8d4202 100644 --- a/goal_src/jak2/kernel/gcommon.gc +++ b/goal_src/jak2/kernel/gcommon.gc @@ -323,6 +323,12 @@ v0-0 ) +(defmacro call-parent-method (&rest args) + "Find the first different implementation of the current method in a parent type and call it with these arguments." + `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) + ,@args) + ) + (defun ref ((arg0 object) (arg1 int)) "Get the n-th item in a linked list. No range checking." (dotimes (v1-0 arg1) diff --git a/goal_src/jak2/kernel/gstate.gc b/goal_src/jak2/kernel/gstate.gc index 52c6400fed..4a01bd3e93 100644 --- a/goal_src/jak2/kernel/gstate.gc +++ b/goal_src/jak2/kernel/gstate.gc @@ -145,6 +145,11 @@ It type checks the arguments for the entry function. (set! *defstate-type-stack* '()) `(none) ) + +;; set when inside a defstate. +(seval (define *defstate-current-type* #f)) +(seval (define *defstate-current-state-name* #f)) + ;; *no-state* is just used for the compiler to know whether a handler was actually set or not (defmacro defstate (state-name parents &key (virtual #f) @@ -164,6 +169,10 @@ It type checks the arguments for the entry function. *defstate-type-stack*) ) (set! *defstate-type-stack* '()) + (when virtual + (set! *defstate-current-type* defstate-type) + (set! *defstate-current-state-name* state-name) + ) ;; check for default handlers (let ((default-handlers (assoc defstate-type *default-state-handlers*))) (when default-handlers @@ -226,6 +235,20 @@ It type checks the arguments for the entry function. ) ) +(defmacro find-parent-state () + "Find the first different implementation of the current virtual state above this one." + (when (or (not *defstate-current-type*) + (not *defstate-current-state-name*)) + (error "use of find-parent-state outside of a defstate.") + ) + `(cast-to-method-type + ,*defstate-current-type* + ,*defstate-current-state-name* + (find-parent-method ,*defstate-current-type* (method-id-of-type ,*defstate-current-type* ,*defstate-current-state-name*)) + ) + ) + + (defmacro behavior (bindings &rest body) "Define an anonymous behavior for a process state. This may only be used inside a defstate!" diff --git a/test/decompiler/reference/jak1/decompiler-macros.gc b/test/decompiler/reference/jak1/decompiler-macros.gc index 17cd3a2fe3..645a626986 100644 --- a/test/decompiler/reference/jak1/decompiler-macros.gc +++ b/test/decompiler/reference/jak1/decompiler-macros.gc @@ -408,6 +408,11 @@ (set! *defstate-type-stack* '()) `(none) ) + +;; set when inside a defstate. +(seval (define *defstate-current-type* #f)) +(seval (define *defstate-current-state-name* #f)) + ;; *no-state* is just used for the compiler to know whether a handler was actually set or not (defmacro defstate (state-name parents &key (virtual #f) @@ -427,6 +432,10 @@ *defstate-type-stack*) ) (set! *defstate-type-stack* '()) + (when virtual + (set! *defstate-current-type* defstate-type) + (set! *defstate-current-state-name* state-name) + ) ;; check for default handlers (let ((default-handlers (assoc defstate-type *default-state-handlers*))) (when default-handlers @@ -498,6 +507,26 @@ ) ) +(defmacro find-parent-state () + "Find the first different implementation of the current virtual state above this one." + (when (or (not *defstate-current-type*) + (not *defstate-current-state-name*)) + (error "use of find-parent-state outside of a defstate.") + ) + `(cast-to-method-type + ,*defstate-current-type* + ,*defstate-current-state-name* + (find-parent-method ,*defstate-current-type* (method-id-of-type ,*defstate-current-type* ,*defstate-current-state-name*)) + ) + ) + +(defmacro call-parent-method (&rest args) + "Find the first different implementation of the current method in a parent type and call it with these arguments." + `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) + ,@args) + ) + + ;; set the default handler functions for a process's state handlers (seval (define *default-state-handlers* '())) (defmacro defstatehandler (proc diff --git a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc index fbca31d839..1cf2122838 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc @@ -1623,7 +1623,7 @@ :enter (behavior ((arg0 object) (arg1 handle)) (set-time! (-> self state-time)) (set! (-> self state-object) #t) - (let ((t9-1 (-> (the-as (state eco-collectable) (find-parent-method fuel-cell 23)) enter))) + (let ((t9-1 (-> (the-as (state eco-collectable) (find-parent-state)) enter))) (if t9-1 (t9-1) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc index 3aa7ff2024..c09a020e65 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy_REF.gc @@ -43,7 +43,6 @@ ) ;; definition for method 7 of type nav-enemy -;; INFO: Return type mismatch none vs nav-enemy. (defmethod relocate nav-enemy ((this nav-enemy) (arg0 int)) (if (nonzero? (-> this neck)) (set! (-> this neck) (the-as joint-mod (+ (the-as int (-> this neck)) arg0))) @@ -51,7 +50,7 @@ (if (nonzero? (-> this rand-gen)) (set! (-> this rand-gen) (the-as random-generator (+ (the-as int (-> this rand-gen)) arg0))) ) - (the-as nav-enemy ((the-as (function process-drawable int none) (find-parent-method nav-enemy 7)) this arg0)) + (call-parent-method this arg0) ) ;; definition for method 42 of type nav-enemy diff --git a/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc index 852682d6e6..7534c56ad5 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/rigid-body_REF.gc @@ -401,20 +401,13 @@ ) ;; definition for method 7 of type rigid-body-platform -;; INFO: Return type mismatch process-drawable vs rigid-body-platform. (defmethod relocate rigid-body-platform ((this rigid-body-platform) (arg0 int)) (if (nonzero? (-> this control-point-array)) (set! (-> this control-point-array) (the-as rigid-body-control-point-inline-array (+ (the-as int (-> this control-point-array)) arg0)) ) ) - (the-as - rigid-body-platform - ((the-as (function process-drawable int process-drawable) (find-parent-method rigid-body-platform 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) ;; definition for method 22 of type rigid-body-platform diff --git a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc index f94aca3919..6446fff52b 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc @@ -180,7 +180,7 @@ nav-enemy-default-event-handler (set! (-> this last-y) f28-0) ) ) - ((the-as (function nav-enemy none) (find-parent-method sharkey 39)) this) + (call-parent-method this) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc index 50994927f3..3fe0bc1e4c 100644 --- a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc @@ -2102,7 +2102,7 @@ ;; definition for method 10 of type target (defmethod deactivate target ((this target)) (set-zero! *camera-smush-control*) - ((the-as (function process-drawable none) (find-parent-method target 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak1/engine/target/target2_REF.gc b/test/decompiler/reference/jak1/engine/target/target2_REF.gc index 469a811a1b..f2c88c66af 100644 --- a/test/decompiler/reference/jak1/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target2_REF.gc @@ -184,7 +184,7 @@ ) (enable-hud) (set! (-> *target* fp-hud) (the-as handle #f)) - ((the-as (function process none) (find-parent-method first-person-hud 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc index ed71bb6407..9bec20b155 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -1067,15 +1067,11 @@ ) ;; definition for method 7 of type flutflutegg -;; INFO: Return type mismatch process-drawable vs flutflutegg. (defmethod relocate flutflutegg ((this flutflutegg) (arg0 int)) (if (nonzero? (-> this wobbler)) (&+! (-> this wobbler) arg0) ) - (the-as - flutflutegg - ((the-as (function process-drawable int process-drawable) (find-parent-method flutflutegg 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 20 of type flutflutegg diff --git a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc index 3b4995bc20..f3cc172747 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc @@ -267,7 +267,6 @@ ) ;; definition for method 7 of type beach-rock -;; INFO: Return type mismatch none vs beach-rock. (defmethod relocate beach-rock ((this beach-rock) (arg0 int)) (if (nonzero? (-> this part-falling)) (set! (-> this part-falling) (the-as sparticle-launch-control (+ (the-as int (-> this part-falling)) arg0))) @@ -275,10 +274,7 @@ (if (nonzero? (-> this part-landing)) (set! (-> this part-landing) (the-as sparticle-launch-control (+ (the-as int (-> this part-landing)) arg0))) ) - (the-as - beach-rock - ((the-as (function process-drawable int none) (find-parent-method beach-rock 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 10 of type beach-rock @@ -289,7 +285,7 @@ (if (nonzero? (-> this part-landing)) (kill-and-free-particles (-> this part-landing)) ) - ((the-as (function process-drawable none) (find-parent-method beach-rock 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc index 5164aa030b..ab74e7a4c5 100644 --- a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc @@ -126,7 +126,6 @@ ) ;; definition for method 7 of type pelican -;; INFO: Return type mismatch process-drawable vs pelican. (defmethod relocate pelican ((this pelican) (arg0 int)) (countdown (v1-0 8) (if (nonzero? (-> this path-data v1-0)) @@ -139,10 +138,7 @@ (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) - (the-as - pelican - ((the-as (function process-drawable int process-drawable) (find-parent-method pelican 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc index 8621d9585c..e3b1def148 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc @@ -213,7 +213,7 @@ ;; definition for method 21 of type citb-arm ;; INFO: Return type mismatch int vs none. (defmethod setup-new-process! citb-arm ((this citb-arm)) - ((the-as (function citb-arm-section none) (find-parent-method citb-arm 21)) this) + (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) (set-vector! (-> this cull-dir-local) 0.0 0.0 -1.0 1.0) (set! (-> this cull-dot) (cos 5461.3335)) @@ -241,7 +241,7 @@ ;; definition for method 21 of type citb-arm-shoulder ;; INFO: Return type mismatch int vs none. (defmethod setup-new-process! citb-arm-shoulder ((this citb-arm-shoulder)) - ((the-as (function citb-arm-section none) (find-parent-method citb-arm-shoulder 21)) this) + (call-parent-method this) (set! (-> this draw origin-joint-index) (the-as uint 4)) (set-vector! (-> this cull-dir-local) 1.0 0.0 1.0 1.0) (set! (-> this cull-dot) (cos 8374.045)) @@ -355,7 +355,7 @@ ;; INFO: Return type mismatch int vs none. (defmethod setup-new-process! citb-arm-a ((this citb-arm-a)) (initialize-skeleton this *citb-arm-a-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-a 21)) this) + (call-parent-method this) (set! (-> this root-override root-prim local-sphere z) -184320.0) 0 (none) @@ -365,7 +365,7 @@ ;; INFO: Return type mismatch int vs none. (defmethod setup-new-process! citb-arm-b ((this citb-arm-b)) (initialize-skeleton this *citb-arm-b-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-b 21)) this) + (call-parent-method this) (set! (-> this root-override root-prim local-sphere z) -225280.0) 0 (none) @@ -375,7 +375,7 @@ ;; INFO: Return type mismatch int vs none. (defmethod setup-new-process! citb-arm-c ((this citb-arm-c)) (initialize-skeleton this *citb-arm-c-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-c 21)) this) + (call-parent-method this) (set! (-> this root-override root-prim local-sphere z) -266240.0) 0 (none) @@ -385,7 +385,7 @@ ;; INFO: Return type mismatch int vs none. (defmethod setup-new-process! citb-arm-d ((this citb-arm-d)) (initialize-skeleton this *citb-arm-d-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-d 21)) this) + (call-parent-method this) (set! (-> this root-override root-prim local-sphere z) -307200.0) 0 (none) @@ -395,7 +395,7 @@ ;; INFO: Return type mismatch int vs none. (defmethod setup-new-process! citb-arm-shoulder-a ((this citb-arm-shoulder-a)) (initialize-skeleton this *citb-arm-shoulder-a-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-shoulder-a 21)) (the-as citb-arm this)) + (call-parent-method this) 0 (none) ) @@ -404,7 +404,7 @@ ;; INFO: Return type mismatch int vs none. (defmethod setup-new-process! citb-arm-shoulder-b ((this citb-arm-shoulder-b)) (initialize-skeleton this *citb-arm-shoulder-b-sg* '()) - ((the-as (function citb-arm none) (find-parent-method citb-arm-shoulder-b 21)) (the-as citb-arm this)) + (call-parent-method this) 0 (none) ) @@ -1883,7 +1883,7 @@ :virtual #t :code (behavior () (process-entity-status! self (entity-perm-status complete) #t) - (let ((t9-2 (-> (the-as (state battlecontroller) (find-parent-method citb-battlecontroller 26)) code))) + (let ((t9-2 (-> (find-parent-state) code))) (if t9-2 ((the-as (function none :behavior battlecontroller) t9-2)) ) @@ -1894,7 +1894,7 @@ ;; definition for method 27 of type citb-battlecontroller ;; INFO: Return type mismatch int vs none. (defmethod battlecontroller-method-27 citb-battlecontroller ((this citb-battlecontroller)) - ((the-as (function battlecontroller none) (find-parent-method citb-battlecontroller 27)) this) + (call-parent-method this) (set! (-> this activate-distance) 143360.0) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc index 1c4e208ffe..b232f9e4a6 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc @@ -587,7 +587,7 @@ ) ) (set! (-> this sound-name) "redsage-fires") - ((the-as (function citb-sage none) (find-parent-method red-sagecage 44)) this) + (call-parent-method this) (the-as symbol 0) ) @@ -723,7 +723,7 @@ ) ) (set! (-> this sound-name) "bluesage-fires") - ((the-as (function citb-sage none) (find-parent-method blue-sagecage 44)) this) + (call-parent-method this) (the-as symbol 0) ) @@ -854,7 +854,7 @@ ) ) (set! (-> this sound-name) "yellsage-fire") - ((the-as (function citb-sage none) (find-parent-method yellow-sagecage 44)) this) + (call-parent-method this) (the-as symbol 0) ) @@ -953,7 +953,7 @@ ) ) (set! (-> this sound-name) "greensage-fires") - ((the-as (function citb-sage none) (find-parent-method green-sagecage 44)) this) + (call-parent-method this) (the-as symbol 0) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc index 6d0a3f2194..12c636090e 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc @@ -517,7 +517,7 @@ ;; definition for method 23 of type citb-chain-plat ;; INFO: Return type mismatch int vs none. (defmethod rigid-body-platform-method-23 citb-chain-plat ((this citb-chain-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method citb-chain-plat 23)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this orig-trans)) 0 (none) @@ -1206,7 +1206,7 @@ :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) - (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method citb-exit-plat 23)) trans))) + (let ((t9-1 (-> (the-as (state plat-button) (find-parent-state)) trans))) (if t9-1 (t9-1) ) @@ -1223,7 +1223,7 @@ :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root-override trans quad)) - (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method citb-exit-plat 24)) trans))) + (let ((t9-1 (-> (the-as (state plat-button) (find-parent-state)) trans))) (if t9-1 (t9-1) ) diff --git a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc index 226fc8ecc6..777f91387d 100644 --- a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc @@ -664,7 +664,6 @@ battlecontroller-default-event-handler ) ;; definition for method 7 of type battlecontroller -;; INFO: Return type mismatch process-drawable vs battlecontroller. (defmethod relocate battlecontroller ((this battlecontroller) (arg0 int)) (dotimes (v1-0 (-> this spawner-count)) (let ((a0-3 (-> this spawner-array v1-0))) @@ -676,10 +675,7 @@ battlecontroller-default-event-handler (if (nonzero? (-> this path-spawn)) (&+! (-> this path-spawn) arg0) ) - (the-as - battlecontroller - ((the-as (function process-drawable int process-drawable) (find-parent-method battlecontroller 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 10 of type battlecontroller @@ -691,7 +687,7 @@ battlecontroller-default-event-handler (battlecontroller-off) (set! pp gp-0) ) - ((the-as (function process-drawable none) (find-parent-method battlecontroller 10)) this) + (call-parent-method this) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc index 9d8f17f6f5..2ae690d7df 100644 --- a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc @@ -1275,7 +1275,7 @@ (go (method-of-object this play-anim)) ) (else - ((the-as (function fisher none) (find-parent-method fisher 38)) this) + (call-parent-method this) ) ) (none) @@ -1826,7 +1826,7 @@ (fisher-fish-water gp-0 (+ 32768.0 (vector-y-angle (-> self node-list data 80 bone transform vector 1)))) ) ) - (let ((t9-14 (-> (the-as state (find-parent-method fisher 24)) trans))) + (let ((t9-14 (-> (find-parent-state) trans))) (if t9-14 (t9-14) ) @@ -1838,7 +1838,7 @@ (defstate idle (fisher) :virtual #t :trans (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method fisher 30)) trans))) + (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc index 1f4b314031..f8f2d66aec 100644 --- a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc @@ -40,7 +40,7 @@ nav-enemy-default-event-handler (set! (-> v1-1 settings bot-plane w) (- (- (-> this shadow-min-y) (-> this collide-info trans y)))) ) 0 - ((the-as (function nav-enemy none) (find-parent-method hopper 39)) this) + (call-parent-method this) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc index 90132492b6..82ff4a448e 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc @@ -56,7 +56,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> self root-override trans quad)) - (let ((t9-1 (-> (the-as (state plat-button) (find-parent-method jungle-elevator 23)) trans))) + (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc index 6460bf7f86..38e6c8048f 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc @@ -1268,15 +1268,11 @@ ) ;; definition for method 7 of type jngpusher -;; INFO: Return type mismatch process-drawable vs jngpusher. (defmethod relocate jngpusher ((this jngpusher) (arg0 int)) (if (nonzero? (-> this back-prim)) (&+! (-> this back-prim) arg0) ) - (the-as - jngpusher - ((the-as (function process-drawable int process-drawable) (find-parent-method jngpusher 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc b/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc index 7b1d396f2c..038471d61d 100644 --- a/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc @@ -31,7 +31,7 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. (defmethod common-post junglefish ((this junglefish)) (water-control-method-10 (-> this water)) - ((the-as (function nav-enemy none) (find-parent-method junglefish 39)) this) + (call-parent-method this) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc index facfbd3470..2c64c9b175 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc @@ -72,7 +72,6 @@ ) ;; definition for method 7 of type plant-boss -;; INFO: Return type mismatch process-drawable vs plant-boss. (defmethod relocate plant-boss ((this plant-boss) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) @@ -88,10 +87,7 @@ (&+! (-> this death-prim v1-8) arg0) ) ) - (the-as - plant-boss - ((the-as (function process-drawable int process-drawable) (find-parent-method plant-boss 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition of type plant-boss-arm diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc index 0502dd5ad2..448ceb4e46 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc @@ -482,15 +482,11 @@ ) ;; definition for method 7 of type darkecobarrel -;; INFO: Return type mismatch darkecobarrel-base vs darkecobarrel. (defmethod relocate darkecobarrel ((this darkecobarrel) (arg0 int)) (if (nonzero? (-> this spawn-array)) (&+! (-> this spawn-array) arg0) ) - (the-as - darkecobarrel - ((the-as (function darkecobarrel-base int darkecobarrel-base) (find-parent-method darkecobarrel 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc index 3414b5661d..5b9b1ab03a 100644 --- a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc @@ -272,7 +272,7 @@ baby-spider-default-event-handler (vector-z-quaternion! (new-stack-vector0) (-> this collide-info quat)) (-> this up-vector) ) - ((the-as (function nav-enemy none) (find-parent-method baby-spider 39)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc index f8e4f1e421..2159eb21f9 100644 --- a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc @@ -987,7 +987,6 @@ ) ;; definition for method 7 of type driller-lurker -;; INFO: Return type mismatch process-drawable vs driller-lurker. (defmethod relocate driller-lurker ((this driller-lurker) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) @@ -998,10 +997,7 @@ (if (nonzero? (-> this sound2)) (&+! (-> this sound2) arg0) ) - (the-as - driller-lurker - ((the-as (function process-drawable int process-drawable) (find-parent-method driller-lurker 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 10 of type driller-lurker diff --git a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc index 3f303c5013..ffedb7d0e8 100644 --- a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc @@ -1413,7 +1413,6 @@ ) ;; definition for method 7 of type gnawer -;; INFO: Return type mismatch nav-enemy vs gnawer. (defmethod relocate gnawer ((this gnawer) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) @@ -1421,10 +1420,7 @@ (if (nonzero? (-> this sound2)) (&+! (-> this sound2) arg0) ) - (the-as - gnawer - ((the-as (function nav-enemy int nav-enemy) (find-parent-method gnawer 7)) (the-as nav-enemy this) arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type gnawer diff --git a/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc index af3bee82bf..43d1535469 100644 --- a/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/babak-with-cannon_REF.gc @@ -324,7 +324,7 @@ nav-enemy-default-event-handler (if (and *target* (= (-> *target* current-level name) 'misty)) (spool-push *art-control* "mistycam-cannon" 0 self -1.0) ) - (let ((t9-3 (-> (the-as (state nav-enemy) (find-parent-method babak-with-cannon 23)) trans))) + (let ((t9-3 (-> (find-parent-state) trans))) (if t9-3 (t9-3) ) diff --git a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc index 3ea4f4b731..52111b6113 100644 --- a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc @@ -894,7 +894,6 @@ ) ;; definition for method 7 of type balloonlurker -;; INFO: Return type mismatch process-drawable vs balloonlurker. (defmethod relocate balloonlurker ((this balloonlurker) (arg0 int)) (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0) @@ -908,10 +907,7 @@ (if (nonzero? (-> this mine 1)) (&+! (-> this mine 1) arg0) ) - (the-as - balloonlurker - ((the-as (function process-drawable int process-drawable) (find-parent-method balloonlurker 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc index 7a65302368..506b261cf9 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc @@ -612,15 +612,11 @@ ) ;; definition for method 7 of type keg-conveyor -;; INFO: Return type mismatch process-drawable vs keg-conveyor. (defmethod relocate keg-conveyor ((this keg-conveyor) (arg0 int)) (if (nonzero? (-> this pivot)) (&+! (-> this pivot) arg0) ) - (the-as - keg-conveyor - ((the-as (function process-drawable int process-drawable) (find-parent-method keg-conveyor 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type keg-conveyor diff --git a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc index 9df7fb3fb8..2784158866 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc @@ -1721,10 +1721,7 @@ ;; definition for method 23 of type bone-platform ;; INFO: Return type mismatch int vs none. (defmethod rigid-body-platform-method-23 bone-platform ((this bone-platform) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method bone-platform 23)) - this - (the-as basic arg0) - ) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) @@ -1956,7 +1953,7 @@ ;; definition for method 27 of type misty-battlecontroller ;; INFO: Return type mismatch int vs none. (defmethod battlecontroller-method-27 misty-battlecontroller ((this misty-battlecontroller)) - ((the-as (function battlecontroller none) (find-parent-method misty-battlecontroller 27)) this) + (call-parent-method this) (set! (-> this misty-ambush-collision-hack) #t) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc index a9f0518c83..859c4938dd 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc @@ -489,10 +489,7 @@ ;; definition for method 23 of type ogre-plat ;; INFO: Return type mismatch int vs none. (defmethod rigid-body-platform-method-23 ogre-plat ((this ogre-plat) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method ogre-plat 23)) - this - (the-as basic arg0) - ) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) @@ -677,7 +674,7 @@ (set! (-> this float-y-offset) 0.0) (+! (-> this root-overlay trans y) (-> this idle-y-offset)) (rigid-body-platform-method-29 this *ogre-step-constants*) - ((the-as (function ogre-plat none) (find-parent-method ogre-step 31)) this) + (call-parent-method this) (let ((a0-5 (entity-actor-lookup (-> this entity) 'alt-actor 0))) (if (and a0-5 (logtest? (-> a0-5 extra perm status) (entity-perm-status complete))) (set! (-> this active) #t) @@ -771,7 +768,7 @@ (defmethod rigid-body-platform-method-31 ogre-step-a ((this ogre-step-a)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-a-sg* '()) - ((the-as (function ogre-step none) (find-parent-method ogre-step-a 31)) this) + (call-parent-method this) 0 (none) ) @@ -781,7 +778,7 @@ (defmethod rigid-body-platform-method-31 ogre-step-b ((this ogre-step-b)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-b-sg* '()) - ((the-as (function ogre-step none) (find-parent-method ogre-step-b 31)) this) + (call-parent-method this) 0 (none) ) @@ -791,7 +788,7 @@ (defmethod rigid-body-platform-method-31 ogre-step-c ((this ogre-step-c)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 26624.0) (initialize-skeleton this *ogre-step-c-sg* '()) - ((the-as (function ogre-step none) (find-parent-method ogre-step-c 31)) this) + (call-parent-method this) 0 (none) ) @@ -801,7 +798,7 @@ (defmethod rigid-body-platform-method-31 ogre-step-d ((this ogre-step-d)) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0) (initialize-skeleton this *ogre-step-b-sg* '()) - ((the-as (function ogre-step none) (find-parent-method ogre-step-d 31)) this) + (call-parent-method this) 0 (none) ) @@ -857,7 +854,7 @@ (set! (-> this idle-y-offset) -6144.0) (set! (-> this float-y-offset) 4096.0) (rigid-body-platform-method-29 this *ogre-isle-constants*) - ((the-as (function ogre-plat none) (find-parent-method ogre-isle 31)) this) + (call-parent-method this) (set! (-> this active) #t) 0 (none) @@ -920,7 +917,7 @@ (+! (-> this root-overlay trans x) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0) (initialize-skeleton this *ogre-isle-b-sg* '()) - ((the-as (function ogre-isle none) (find-parent-method ogre-isle-b 31)) this) + (call-parent-method this) 0 (none) ) @@ -931,7 +928,7 @@ (+! (-> this root-overlay trans x) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0) (initialize-skeleton this *ogre-isle-b-sg* '()) - ((the-as (function ogre-isle none) (find-parent-method ogre-isle-c 31)) this) + (call-parent-method this) 0 (none) ) @@ -943,7 +940,7 @@ (+! (-> this root-overlay trans z) -8192.0) (set-vector! (-> this root-overlay root-prim local-sphere) 0.0 8192.0 0.0 22528.0) (initialize-skeleton this *ogre-isle-d-sg* '()) - ((the-as (function ogre-isle none) (find-parent-method ogre-isle-d 31)) this) + (call-parent-method this) 0 (none) ) @@ -984,17 +981,13 @@ ) ;; definition for method 7 of type ogre-bridge -;; INFO: Return type mismatch process-drawable vs ogre-bridge. (defmethod relocate ogre-bridge ((this ogre-bridge) (arg0 int)) (dotimes (v1-0 8) (if (nonzero? (-> this joint-mod-array v1-0)) (&+! (-> this joint-mod-array v1-0) arg0) ) ) - (the-as - ogre-bridge - ((the-as (function process-drawable int process-drawable) (find-parent-method ogre-bridge 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for function ogre-bridge-update-joints diff --git a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc index 8b7d15e20f..decadd6dfb 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc @@ -771,18 +771,11 @@ ) ;; definition for method 7 of type ogreboss-super-boulder -;; INFO: Return type mismatch process-drawable vs ogreboss-super-boulder. (defmethod relocate ogreboss-super-boulder ((this ogreboss-super-boulder) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - ogreboss-super-boulder - ((the-as (function process-drawable int process-drawable) (find-parent-method ogreboss-super-boulder 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc b/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc index 03d8be7682..e8f9968c4c 100644 --- a/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc @@ -320,15 +320,11 @@ ) ;; definition for method 7 of type cave-trap -;; INFO: Return type mismatch process-drawable vs cave-trap. (defmethod relocate cave-trap ((this cave-trap) (arg0 int)) (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0) ) - (the-as - cave-trap - ((the-as (function process-drawable int process-drawable) (find-parent-method cave-trap 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type cave-trap diff --git a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc index f46679d1bb..6bb4facc00 100644 --- a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc @@ -623,7 +623,6 @@ ) ;; definition for method 7 of type ice-cube -;; INFO: Return type mismatch nav-enemy vs ice-cube. (defmethod relocate ice-cube ((this ice-cube) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) @@ -634,7 +633,7 @@ (if (nonzero? (-> this part4)) (&+! (-> this part4) arg0) ) - (the-as ice-cube ((the-as (function nav-enemy int nav-enemy) (find-parent-method ice-cube 7)) this arg0)) + (call-parent-method this arg0) ) ;; definition for method 11 of type ice-cube diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc index 8f5fd442a0..b0723cb1c7 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc @@ -633,18 +633,13 @@ ) ;; definition for method 7 of type snow-ball -;; INFO: Return type mismatch process-drawable vs snow-ball. (defmethod relocate snow-ball ((this snow-ball) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this path v1-0)) (&+! (-> this path v1-0) arg0) ) ) - (the-as snow-ball ((the-as (function process-drawable int process-drawable) (find-parent-method snow-ball 7)) - (the-as process-drawable this) - arg0 - ) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type snow-ball diff --git a/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc index d39743c241..7560d8e9ed 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc @@ -316,15 +316,11 @@ ) ;; definition for method 7 of type snow-bumper -;; INFO: Return type mismatch process-drawable vs snow-bumper. (defmethod relocate snow-bumper ((this snow-bumper) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) - (the-as - snow-bumper - ((the-as (function process-drawable int process-drawable) (find-parent-method snow-bumper 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type snow-bumper diff --git a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc index b71cbb686c..67c6553a7a 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc @@ -1089,7 +1089,6 @@ ) ;; definition for method 7 of type snow-fort-gate -;; INFO: Return type mismatch process-drawable vs snow-fort-gate. (defmethod relocate snow-fort-gate ((this snow-fort-gate) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) @@ -1097,10 +1096,7 @@ (if (nonzero? (-> this part3)) (&+! (-> this part3) arg0) ) - (the-as - snow-fort-gate - ((the-as (function process-drawable int process-drawable) (find-parent-method snow-fort-gate 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type snow-fort-gate diff --git a/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc b/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc index 382c0aae6c..c67589370a 100644 --- a/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc @@ -572,12 +572,11 @@ ) ;; definition for method 7 of type yeti-slave -;; INFO: Return type mismatch nav-enemy vs yeti-slave. (defmethod relocate yeti-slave ((this yeti-slave) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) ) - (the-as yeti-slave ((the-as (function nav-enemy int nav-enemy) (find-parent-method yeti-slave 7)) this arg0)) + (call-parent-method this arg0) ) ;; definition for function yeti-slave-init-by-other diff --git a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc index 41792faa3e..c8f213afb1 100644 --- a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc @@ -779,15 +779,11 @@ ) ;; definition for method 7 of type bully -;; INFO: Return type mismatch process-drawable vs bully. (defmethod relocate bully ((this bully) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) - (the-as - bully - ((the-as (function process-drawable int process-drawable) (find-parent-method bully 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type bully diff --git a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc index e276abf93a..7776347354 100644 --- a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc @@ -715,15 +715,11 @@ ) ;; definition for method 7 of type helix-water -;; INFO: Return type mismatch process-drawable vs helix-water. (defmethod relocate helix-water ((this helix-water) (arg0 int)) (if (nonzero? (-> this alt-actors)) (&+! (-> this alt-actors) arg0) ) - (the-as - helix-water - ((the-as (function process-drawable int process-drawable) (find-parent-method helix-water 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type helix-water diff --git a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc index 4ddaea648f..ae486eae5d 100644 --- a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc @@ -1119,15 +1119,11 @@ ) ;; definition for method 7 of type puffer -;; INFO: Return type mismatch process-drawable vs puffer. (defmethod relocate puffer ((this puffer) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) - (the-as - puffer - ((the-as (function process-drawable int process-drawable) (find-parent-method puffer 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type puffer diff --git a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc index 1743cbb464..4140d632b4 100644 --- a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc @@ -328,7 +328,7 @@ ;; definition for method 23 of type qbert-plat ;; INFO: Return type mismatch int vs none. (defmethod rigid-body-platform-method-23 qbert-plat ((this qbert-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method qbert-plat 23)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc b/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc index fdbef2f1d8..565e2d60ce 100644 --- a/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc @@ -446,7 +446,6 @@ ) ;; definition for method 7 of type square-platform -;; INFO: Return type mismatch baseplat vs square-platform. (defmethod relocate square-platform ((this square-platform) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) @@ -457,10 +456,7 @@ (if (nonzero? (-> this part4)) (&+! (-> this part4) arg0) ) - (the-as - square-platform - ((the-as (function baseplat int baseplat) (find-parent-method square-platform 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type square-platform diff --git a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc index 89be9fd4dc..c98bbefd07 100644 --- a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc @@ -690,7 +690,6 @@ ) ;; definition for method 7 of type steam-cap -;; INFO: Return type mismatch process-drawable vs steam-cap. (defmethod relocate steam-cap ((this steam-cap) (arg0 int)) (if (nonzero? (-> this part2)) (&+! (-> this part2) arg0) @@ -698,10 +697,7 @@ (if (nonzero? (-> this part3)) (&+! (-> this part3) arg0) ) - (the-as - steam-cap - ((the-as (function process-drawable int process-drawable) (find-parent-method steam-cap 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 10 of type steam-cap diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc index dce450794e..fa363686dd 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc @@ -970,7 +970,6 @@ ) ;; definition for method 7 of type sunken-pipegame -;; INFO: Return type mismatch process-drawable vs sunken-pipegame. (defmethod relocate sunken-pipegame ((this sunken-pipegame) (arg0 int)) (dotimes (v1-0 3) (let ((a0-4 (-> this prize v1-0))) @@ -986,10 +985,7 @@ ) ) ) - (the-as - sunken-pipegame - ((the-as (function process-drawable int process-drawable) (find-parent-method sunken-pipegame 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type sunken-pipegame diff --git a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc index d97c9fd913..95c63d3931 100644 --- a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc @@ -52,17 +52,13 @@ ) ;; definition for method 7 of type billy -;; INFO: Return type mismatch process-drawable vs billy. (defmethod relocate billy ((this billy) (arg0 int)) (countdown (v1-0 3) (if (nonzero? (-> this path-data v1-0)) (&+! (-> this path-data v1-0) arg0) ) ) - (the-as - billy - ((the-as (function process-drawable int process-drawable) (find-parent-method billy 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition of type billy-snack @@ -257,7 +253,7 @@ (defstate nav-enemy-victory (billy-rat) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state nav-enemy) (find-parent-method billy-rat 33)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -499,7 +495,7 @@ (go (method-of-object this play-anim)) ) (else - ((the-as (function nav-enemy none) (find-parent-method billy 38)) (the-as nav-enemy this)) + (call-parent-method this) ) ) (none) diff --git a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc index 3e51388ac2..bc68b0234d 100644 --- a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc @@ -926,7 +926,7 @@ nav-enemy-default-event-handler ;; definition for method 39 of type kermit ;; INFO: Return type mismatch int vs none. (defmethod common-post kermit ((this kermit)) - ((the-as (function nav-enemy none) (find-parent-method kermit 39)) this) + (call-parent-method this) (when (-> this charged-up) ) 0 diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc index 7afc91c410..a008ca2fa6 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc @@ -74,17 +74,13 @@ ) ;; definition for method 7 of type swamp-bat -;; INFO: Return type mismatch process-drawable vs swamp-bat. (defmethod relocate swamp-bat ((this swamp-bat) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this path-list v1-0)) (&+! (-> this path-list v1-0) arg0) ) ) - (the-as - swamp-bat - ((the-as (function process-drawable int process-drawable) (find-parent-method swamp-bat 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition of type swamp-bat-slave diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc index a6af529ca5..292fa1bc02 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc @@ -821,7 +821,7 @@ ;; definition for method 23 of type tar-plat ;; INFO: Return type mismatch int vs none. (defmethod rigid-body-platform-method-23 tar-plat ((this tar-plat) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method tar-plat 23)) this (the-as basic arg0)) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc index 6e9713e07f..db0a77795f 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc @@ -100,7 +100,7 @@ swamp-rat-default-event-handler (vector-z-quaternion! (new-stack-vector0) (-> this collide-info quat)) (-> this up-vector) ) - ((the-as (function nav-enemy none) (find-parent-method swamp-rat 39)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc index c4fefd5a7b..bf7df04745 100644 --- a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc @@ -279,7 +279,7 @@ ;; definition for method 23 of type tra-pontoon ;; INFO: Return type mismatch int vs none. (defmethod rigid-body-platform-method-23 tra-pontoon ((this tra-pontoon) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method tra-pontoon 23)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc index bef42ed0d7..554b05cec0 100644 --- a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc @@ -1347,19 +1347,12 @@ ) ;; definition for method 7 of type fishermans-boat -;; INFO: Return type mismatch rigid-body-platform vs fishermans-boat. (defmethod relocate fishermans-boat ((this fishermans-boat) (arg0 int)) (relocate (-> this controller) arg0) (if (nonzero? (-> this propeller)) (&+! (-> this propeller) arg0) ) - (the-as - fishermans-boat - ((the-as (function rigid-body-platform int rigid-body-platform) (find-parent-method fishermans-boat 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) ;; definition for method 30 of type fishermans-boat diff --git a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc index 3b9d7f0c6b..739c9cf286 100644 --- a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc @@ -1060,15 +1060,11 @@ ) ;; definition for method 7 of type hutlamp -;; INFO: Return type mismatch process-drawable vs hutlamp. (defmethod relocate hutlamp ((this hutlamp) (arg0 int)) (if (nonzero? (-> this pivot)) (&+! (-> this pivot) arg0) ) - (the-as - hutlamp - ((the-as (function process-drawable int process-drawable) (find-parent-method hutlamp 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc b/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc index a582682917..2ecc69bb8b 100644 --- a/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc @@ -158,7 +158,7 @@ ) (set! *teleport* #t) (set! (-> s5-0 quad) (-> self root-override trans quad)) - (let ((t9-1 (-> (the-as (state sunken-elevator) (find-parent-method sunken-elevator 23)) trans))) + (let ((t9-1 (-> (find-parent-state) trans))) (if t9-1 (t9-1) ) diff --git a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc index dfd5c8af4e..a693d679ba 100644 --- a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc @@ -750,7 +750,6 @@ ) ;; definition for method 7 of type swamp-blimp -;; INFO: Return type mismatch process-drawable vs swamp-blimp. (defmethod relocate swamp-blimp ((this swamp-blimp) (arg0 int)) (if (nonzero? (-> this gondola)) (&+! (-> this gondola) arg0) @@ -758,10 +757,7 @@ (if (nonzero? (-> this bag)) (&+! (-> this bag) arg0) ) - (the-as - swamp-blimp - ((the-as (function process-drawable int process-drawable) (find-parent-method swamp-blimp 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc index 83590cf481..3ce9a58f00 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc @@ -210,7 +210,7 @@ ;; definition for method 23 of type pontoon ;; INFO: Return type mismatch int vs none. (defmethod rigid-body-platform-method-23 pontoon ((this pontoon) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method pontoon 23)) this (the-as basic arg0)) + (call-parent-method this arg0) (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc index 5007c89efe..227ba9d89e 100644 --- a/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village_common/villagep-obs_REF.gc @@ -629,7 +629,6 @@ ) ;; definition for method 31 of type warp-gate-switch -;; INFO: Return type mismatch none vs int. (defmethod press! warp-gate-switch ((this warp-gate-switch) (arg0 symbol)) (with-pp (when arg0 @@ -664,11 +663,7 @@ ) ) ) - (the-as int ((the-as (function basebutton symbol none) (find-parent-method warp-gate-switch 31)) - (the-as basebutton arg0) - arg0 - ) - ) + (call-parent-method (the-as warp-gate-switch arg0) arg0) ) ) @@ -888,7 +883,7 @@ ) ) ) - (let ((t9-10 (-> (the-as (state basebutton) (find-parent-method warp-gate-switch 21)) code))) + (let ((t9-10 (-> (the-as (state basebutton) (find-parent-state)) code))) (if t9-10 ((the-as (function none :behavior basebutton) t9-10)) ) diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index 4a3646c9af..55b8f4f78c 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -464,6 +464,11 @@ (set! *defstate-type-stack* '()) `(none) ) + +;; set when inside a defstate. +(seval (define *defstate-current-type* #f)) +(seval (define *defstate-current-state-name* #f)) + ;; *no-state* is just used for the compiler to know whether a handler was actually set or not (defmacro defstate (state-name parents &key (virtual #f) @@ -483,6 +488,10 @@ *defstate-type-stack*) ) (set! *defstate-type-stack* '()) + (when virtual + (set! *defstate-current-type* defstate-type) + (set! *defstate-current-state-name* state-name) + ) ;; check for default handlers (let ((default-handlers (assoc defstate-type *default-state-handlers*))) (when default-handlers @@ -545,6 +554,27 @@ ) ) + +(defmacro find-parent-state () + "Find the first different implementation of the current virtual state above this one." + (when (or (not *defstate-current-type*) + (not *defstate-current-state-name*)) + (error "use of find-parent-state outside of a defstate.") + ) + `(cast-to-method-type + ,*defstate-current-type* + ,*defstate-current-state-name* + (find-parent-method ,*defstate-current-type* (method-id-of-type ,*defstate-current-type* ,*defstate-current-state-name*)) + ) + ) + +(defmacro call-parent-method (&rest args) + "Find the first different implementation of the current method in a parent type and call it with these arguments." + `((the (current-method-function-type) (find-parent-method (current-method-type) (current-method-id))) + ,@args) + ) + + (defmacro behavior (bindings &rest body) "Define an anonymous behavior for a process state. This may only be used inside a defstate!"