diff --git a/common/formatter/formatter.cpp b/common/formatter/formatter.cpp index 99b3b7b9d22..5eec750e4c7 100644 --- a/common/formatter/formatter.cpp +++ b/common/formatter/formatter.cpp @@ -55,7 +55,7 @@ std::string apply_formatting( } // TODO - might want to make some kind of per-form config struct, simplify the passing around of // info below - for (int i = 0; i < curr_node.refs.size(); i++) { + for (int i = 0; i < (int)curr_node.refs.size(); i++) { const auto& ref = curr_node.refs.at(i); // Figure out if the element should be inlined or not bool inline_element = inline_form; diff --git a/common/formatter/rules/formatting_rules.cpp b/common/formatter/rules/formatting_rules.cpp index 6078b68ddba..bc737f120e8 100644 --- a/common/formatter/rules/formatting_rules.cpp +++ b/common/formatter/rules/formatting_rules.cpp @@ -22,7 +22,7 @@ void separate_by_newline(std::string& curr_text, // We only are concerned with top level forms or elements // Skip the last element, no trailing new-lines (let the editors handle this!) // Also peek ahead to see if there was a comment on this line, if so don't separate things! - if (!containing_node.metadata.is_top_level || index >= containing_node.refs.size() - 1 || + if (!containing_node.metadata.is_top_level || index >= (int)containing_node.refs.size() - 1 || (containing_node.refs.at(index + 1).metadata.is_comment && containing_node.refs.at(index + 1).metadata.is_inline)) { return; @@ -100,7 +100,7 @@ bool form_should_be_constant_paired(const FormatterTreeNode& node) { return false; } int num_pairs = 0; - for (int i = 0; i < node.refs.size() - 1; i++) { + for (int i = 0; i < (int)node.refs.size() - 1; i++) { const auto& ref = node.refs.at(i); const auto& next_ref = node.refs.at(i + 1); if (ref.token && next_ref.token) { @@ -147,7 +147,7 @@ int compute_form_width_after_index(const FormatterTreeNode& node, } } int form_width = 0; - for (int i = 0; i < node.refs.size(); i++) { + for (int i = 0; i < (int)node.refs.size(); i++) { const auto& ref = node.refs.at(i); if (depth == 0 && i < index) { continue; @@ -275,7 +275,7 @@ void append_newline(std::string& curr_text, const bool flowing, const bool constant_pair_form, const bool force_newline) { - if (force_newline && index >= 1 || (node.metadata.is_comment && !node.metadata.is_inline)) { + if ((force_newline && index >= 1) || (node.metadata.is_comment && !node.metadata.is_inline)) { curr_text = str_util::rtrim(curr_text) + "\n"; return; } @@ -362,8 +362,8 @@ void align_lines(std::string& text, alignment_width = 1; } std::string aligned_form = ""; - for (int i = 0; i < lines.size(); i++) { - if (i >= start_index) { + for (size_t i = 0; i < lines.size(); i++) { + if ((int)i >= start_index) { aligned_form += str_util::repeat(alignment_width, " "); } aligned_form += lines.at(i); diff --git a/common/log/log.cpp b/common/log/log.cpp index 9b98cda2e58..47423624c7c 100644 --- a/common/log/log.cpp +++ b/common/log/log.cpp @@ -147,7 +147,7 @@ void set_file(const std::string& filename, existing_log_files = file_util::sort_filepaths(existing_log_files, true); if (existing_log_files.size() > (LOG_ROTATE_MAX - 1)) { lg::info("removing {} log files", existing_log_files.size() - (LOG_ROTATE_MAX - 1)); - for (int i = 0; i < existing_log_files.size() - (LOG_ROTATE_MAX - 1); i++) { + for (int i = 0; i < (int)existing_log_files.size() - (LOG_ROTATE_MAX - 1); i++) { lg::info("removing {}", existing_log_files.at(i).string()); fs::remove(existing_log_files.at(i)); } diff --git a/decompiler/IR2/AtomicOpTypeAnalysis.cpp b/decompiler/IR2/AtomicOpTypeAnalysis.cpp index 3983b369464..f1c1502dd09 100644 --- a/decompiler/IR2/AtomicOpTypeAnalysis.cpp +++ b/decompiler/IR2/AtomicOpTypeAnalysis.cpp @@ -93,6 +93,8 @@ TP_Type SimpleAtom::get_type(const TypeState& input, return TP_Type::make_run_function_in_process_function(); } else if (m_string == "set-to-run" && env.func->name() != "enter-state") { return TP_Type::make_set_to_run_function(); + } else if (m_string == "find-parent-method") { + return TP_Type::make_find_parent_method_function(); } // look up the type of the symbol @@ -1355,10 +1357,6 @@ TypeState CallOp::propagate_types_internal(const TypeState& input, in_type = TypeSpec("function", new_arg_types); } - if (in_type.arg_count() < 1) { - throw std::runtime_error("Called a function, but we do not know its type"); - } - if (in_type.arg_count() == 2 && in_type.get_arg(0) == TypeSpec("_varargs_")) { // we're calling a varags function, which is format. We can determine the argument count // by looking at the format string, if we can get it. @@ -1418,12 +1416,79 @@ TypeState CallOp::propagate_types_internal(const TypeState& input, arg_type.print()); } } + + bool use_normal_last_arg = true; + + if (in_tp.kind == TP_Type::Kind::FIND_PARENT_METHOD_FUNCTION) { + bool can_use_call_parent = true; + TypeSpec call_parent_result_type; + const auto& guessed_name = env.func->guessed_name; + + if (guessed_name.kind == FunctionName::FunctionKind::METHOD || + guessed_name.kind == FunctionName::FunctionKind::V_STATE) { + // should call something like: + // (find-parent-method sharkey 39) + const auto& type_arg = input.get(Register(Reg::GPR, Reg::A0)); + if (can_use_call_parent && type_arg.kind != TP_Type::Kind::TYPE_OF_TYPE_NO_VIRTUAL) { + lg::warn( + "Can't use call-parent-method because the first argument to find-parent-method is a " + "{}, which should be a type", + type_arg.print()); + can_use_call_parent = false; + } + + if (can_use_call_parent && type_arg.get_type_objects_typespec() != guessed_name.type_name) { + lg::warn( + "Can't use call-parent-method because the first argument type is wrong: got {}, but " + "expected {}", + type_arg.get_type_objects_typespec().print(), guessed_name.type_name); + can_use_call_parent = false; + } + const auto& id_arg = input.get(Register(Reg::GPR, Reg::A1)); + int expected_id = -1; + if (guessed_name.kind == FunctionName::FunctionKind::V_STATE) { + auto state_info = dts.ts.lookup_method(guessed_name.type_name, guessed_name.state_name); + expected_id = state_info.id; + call_parent_result_type = + state_info.type.substitute_for_method_call(guessed_name.type_name); + } else { + expected_id = guessed_name.method_id; + call_parent_result_type = env.func->type; // same type as this method! + } + if (can_use_call_parent && !id_arg.is_integer_constant(expected_id)) { + lg::warn( + "Can't use call-parent-method because the second argument is wrong: got {}, but " + "expected a constant integer {}", + id_arg.print(), expected_id); + can_use_call_parent = false; + } + + } else { + can_use_call_parent = false; + lg::warn( + "Can't use call-parent-method because find-parent-method was called in {}, which isn't a " + "method or state handler.", + env.func->name()); + } + + if (can_use_call_parent) { + end_types.get(Register(Reg::GPR, Reg::V0)) = TP_Type::make_from_ts(call_parent_result_type); + use_normal_last_arg = false; + } + } + + if (in_type.arg_count() < 1) { + throw std::runtime_error("Called a function, but we do not know its type"); + } + + if (use_normal_last_arg) { + end_types.get(Register(Reg::GPR, Reg::V0)) = TP_Type::make_from_ts(in_type.last_arg()); + } + // set the call type! m_call_type = in_type; m_call_type_set = true; - end_types.get(Register(Reg::GPR, Reg::V0)) = TP_Type::make_from_ts(in_type.last_arg()); - if (in_tp.kind == TP_Type::Kind::NON_OBJECT_NEW_METHOD && in_type.last_arg() == TypeSpec("array")) { // array new: diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 6e8d04457bd..fd6bc26c219 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) { @@ -3908,6 +3910,39 @@ void FunctionCallElement::update_from_stack(const Env& env, } } + // detect call-parent-method + { + const auto& guessed_name = env.func->guessed_name; + if (guessed_name.kind == FunctionName::FunctionKind::METHOD) { + // detect stuff like: ((find-parent-method...) arg...) + auto mr_find_parent = + match(Matcher::func(Matcher::symbol("find-parent-method"), + {Matcher::symbol(env.func->method_of_type), + Matcher::integer(env.func->guessed_name.method_id)}), + unstacked.at(0) + + ); + if (mr_find_parent.matched) { + new_form = pool.alloc_element( + GenericOperator::make_function(pool.form("call-parent-method")), + arg_forms); + } + } else if (guessed_name.kind == FunctionName::FunctionKind::V_STATE && arg_forms.size() == 2) { + // here, simply detect (find-parent-method...) + // + auto mr_find_parent = match(Matcher::symbol("find-parent-method"), unstacked.at(0)); + if (mr_find_parent.matched) { + auto state_info = + env.dts->ts.lookup_method(guessed_name.type_name, guessed_name.state_name); + if (arg_forms.at(0)->to_string(env) == guessed_name.type_name && + arg_forms.at(1)->to_string(env) == std::to_string(state_info.id)) { + new_form = pool.alloc_element( + GenericOperator::make_function(pool.form("find-parent-state"))); + } + } + } + } + result->push_back(new_form); } diff --git a/decompiler/IR2/GenericElementMatcher.cpp b/decompiler/IR2/GenericElementMatcher.cpp index 53d85bd5d20..d52f018091e 100644 --- a/decompiler/IR2/GenericElementMatcher.cpp +++ b/decompiler/IR2/GenericElementMatcher.cpp @@ -276,7 +276,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out, const Env* cons } else if (m_kind == Kind::VAR_NAME) { return env && env->get_variable_name_name_only(result) == m_str; } else if (m_reg_out_id != -1) { - if (m_kind == Kind::SAME_VAR && maps_out->regs.size() > m_reg_out_id && + if (m_kind == Kind::SAME_VAR && (int)maps_out->regs.size() > m_reg_out_id && maps_out->regs.at(m_reg_out_id)) { return env && env->get_variable_name_name_only(result) == env->get_variable_name_name_only(*maps_out->regs.at(m_reg_out_id)); @@ -695,7 +695,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out, const Env* cons if (as_let) { // fail if we have wrong number of entries/body elts or recursive marker if ((m_entry_matchers.size() != as_let->entries().size()) || - (m_sub_matchers.size() != as_let->body()->size()) || + ((int)m_sub_matchers.size() != as_let->body()->size()) || (as_let->is_star() != m_let_is_star)) { return false; } @@ -706,7 +706,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out, const Env* cons } } // now match body - for (int i = 0; i < m_sub_matchers.size(); ++i) { + for (int i = 0; i < (int)m_sub_matchers.size(); ++i) { Form fake; fake.elts().push_back(as_let->body()->elts().at(i)); if (!m_sub_matchers.at(i).do_match(&fake, maps_out, env)) { @@ -908,7 +908,7 @@ bool LetEntryMatcher::do_match(const LetElement::Entry& input, case Kind::ANY: case Kind::NAME: if (m_reg_out_id != -1) { - if (m_kind == Kind::NAME && maps_out->regs.size() > m_reg_out_id && + if (m_kind == Kind::NAME && (int)maps_out->regs.size() > m_reg_out_id && maps_out->regs.at(m_reg_out_id)) { return env && env->get_variable_name_name_only(input.dest) == env->get_variable_name_name_only(*maps_out->regs.at(m_reg_out_id)); diff --git a/decompiler/config/jak1/ntsc_v1/type_casts.jsonc b/decompiler/config/jak1/ntsc_v1/type_casts.jsonc index 703f0a03785..9d554f33cd5 100644 --- a/decompiler/config/jak1/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak1/ntsc_v1/type_casts.jsonc @@ -515,7 +515,6 @@ "(method 10 shadow-control)": [[1, "v1", "int"]], "(method 0 fact-info-enemy)": [[[3, 92], "gp", "fact-info-enemy"]], "(method 0 fact-info)": [ - //[16, "t9", "(function string none)"], ["_stack_", 16, "res-tag"], [[32, 43], "v1", "(pointer int32)"], [86, "gp", "fact-info"] @@ -1569,8 +1568,7 @@ ], "(method 7 rigid-body-platform)": [ - [5, "v1", "int"], - [14, "t9", "(function process-drawable int process-drawable)"] + [5, "v1", "int"] ], "(method 10 rigid-body)": [[50, "v1", "vector"]], @@ -1605,10 +1603,6 @@ [49, "v1", "village2cam"] ], - "(trans plat-button-move-downward sunken-elevator)": [ - [13, "v0", "(state sunken-elevator)"] - ], - "(method 27 sunken-elevator)": [[37, "v1", "art-joint-anim"]], "nav-enemy-set-base-collide-sphere-collide-with": [ @@ -1651,8 +1645,7 @@ "(method 7 nav-enemy)": [ [5, "v1", "int"], - [10, "v1", "int"], - [19, "t9", "(function process-drawable int none)"] + [10, "v1", "int"] ], "(enter nav-enemy-patrol nav-enemy)": [[8, "v1", "int"]], @@ -1972,8 +1965,6 @@ [87, "s4", "swingpole"] ], - "(method 10 target)": [[[10, 13], "t9", "(function process-drawable none)"]], - "draw-history": [[[99, 101], "v1", "int"]], "(method 9 attack-info)": [ @@ -2232,12 +2223,9 @@ "(method 7 beach-rock)": [ [5, "v1", "int"], - [10, "v1", "int"], - [19, "t9", "(function process-drawable int none)"] + [10, "v1", "int"] ], - "(method 10 beach-rock)": [[21, "t9", "(function process-drawable none)"]], - "(code falling beach-rock)": [ [138, "gp", "handle"], [150, "gp", "handle"], @@ -2296,18 +2284,12 @@ [42, "s3", "(inline-array sparticle-cpuinfo)"] ], - "(trans plat-button-move-downward jungle-elevator)": [ - [11, "v0", "(state plat-button)"] - ], - "(code plat-button-at-end jungle-elevator)": [ [43, "t9", "(function none :behavior plat-button)"] ], "(code bouncer-fire)": [[17, "v1", "art-joint-anim"]], - "(method 39 hopper)": [[16, "t9", "(function nav-enemy none)"]], - "(code nav-enemy-idle hopper)": [ [16, "v1", "art-joint-anim"], [70, "v1", "art-joint-anim"] @@ -2323,8 +2305,6 @@ [105, "v1", "art-joint-anim"] ], - "(method 39 junglefish)": [[12, "t9", "(function nav-enemy none)"]], - "(code nav-enemy-patrol junglefish)": [ [27, "v1", "art-joint-anim"], [107, "v1", "art-joint-anim"], @@ -2402,8 +2382,6 @@ [329, "v1", "art-joint-anim"] ], - "(method 39 sharkey)": [[71, "t9", "(function nav-enemy none)"]], - "(code nav-enemy-patrol sharkey)": [[27, "v1", "art-joint-anim"]], "(code nav-enemy-attack sharkey)": [[144, "v1", "art-joint-anim"]], @@ -2774,8 +2752,6 @@ "(code babak-with-cannon-jump-off-cannon)": [[28, "v1", "art-joint-anim"]], - "(trans nav-enemy-die babak-with-cannon)": [[40, "v0", "(state nav-enemy)"]], - "(enter othercam-running)": [ [50, "gp", "process-taskable"], [53, "gp", "process-taskable"] @@ -2808,10 +2784,6 @@ "(code yakow-kicked)": [[81, "v1", "art-joint-anim"]], - "(method 7 fishermans-boat)": [ - [20, "t9", "(function rigid-body-platform int rigid-body-platform)"] - ], - "(code muse-idle)": [ [35, "v1", "art-joint-anim"], [87, "v1", "art-joint-anim"] @@ -2896,10 +2868,6 @@ "(event square-platform-master-idle)": [[6, "a0", "square-platform-button"]], - "(method 7 square-platform)": [ - [24, "t9", "(function baseplat int baseplat)"] - ], - "(method 11 square-platform)": [ ["_stack_", 16, "res-tag"], ["_stack_", 32, "res-tag"], @@ -2925,10 +2893,6 @@ [3, "t9", "(function none :behavior qbert-plat)"] ], - "(method 23 qbert-plat)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], - "(code keg-on-paddle)": [ [5, "a0", "keg"], // i have learned that parent does not always equal the parent type! [16, "v1", "process-drawable"] @@ -2954,14 +2918,6 @@ "keg-init-by-other": [[142, "v1", "process-drawable"]], - "(method 7 keg-conveyor)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - - "(method 7 swamp-bat)": [ - [26, "t9", "(function process-drawable int process-drawable)"] - ], - "(code swamp-bat-slave-die)": [[21, "v1", "swamp-bat"]], // these casts should not be required @@ -2970,8 +2926,6 @@ [7, "a1", "swamp-bat-slave"] ], - "(method 39 swamp-rat)": [[37, "t9", "(function nav-enemy none)"]], - "(code nav-enemy-patrol swamp-rat)": [[23, "v1", "art-joint-anim"]], "(code nav-enemy-stare swamp-rat)": [[26, "v1", "art-joint-anim"]], @@ -2987,8 +2941,6 @@ "(code spiderwebs-bounce)": [[80, "v1", "art-joint-anim"]], - "(method 39 baby-spider)": [[37, "t9", "(function nav-enemy none)"]], - "(code baby-spider-hatching)": [[14, "v1", "art-joint-anim"]], "(code nav-enemy-attack baby-spider)": [[14, "v1", "art-joint-anim"]], @@ -3058,10 +3010,6 @@ [230, "v1", "baby-spider"] ], - "(method 7 cave-trap)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 57 ice-cube)": [ [16, "v1", "collide-shape-prim-group"], [26, "v1", "collide-shape-prim-group"] @@ -3092,8 +3040,6 @@ [238, "v1", "art-joint-anim"] ], - "(method 7 yeti-slave)": [[14, "t9", "(function nav-enemy int nav-enemy)"]], - "(method 21 yeti)": [[5, "s5", "(pointer yeti-slave)"]], "(code idle assistant-lavatube-start)": [ @@ -3199,6 +3145,8 @@ [20, "s3", "hud-fuel-cell"] ], + "(enter pickup fuel-cell)": [[9, "v0", "(state eco-collectable)"]], + "(method 15 hud-pickups)": [ [51, "v1", "dma-packet"], [52, "v1", "dma-packet"] @@ -3239,14 +3187,6 @@ [[53, 136], "gp", "(pointer nav-enemy)"] ], - "(method 7 battlecontroller)": [ - [29, "t9", "(function process-drawable int process-drawable)"] - ], - - "(method 10 battlecontroller)": [ - [13, "t9", "(function process-drawable none)"] - ], - "(method 27 battlecontroller)": [ ["_stack_", 16, "res-tag"], [182, "v0", "(pointer int32)"] @@ -3710,8 +3650,6 @@ [79, "v1", "float"] ], - "(method 38 fisher)": [[33, "t9", "(function fisher none)"]], - "(enter fisher-done)": [ [137, "f0", "float"], [148, "f0", "float"], @@ -3725,10 +3663,6 @@ [69, "v1", "float"] ], - "(trans play-accept fisher)": [[101, "v0", "state"]], - - "(trans idle fisher)": [[4, "v0", "state"]], - "(code idle fisher)": [ [132, "v1", "art-joint-anim"], [35, "v1", "float"] @@ -4096,10 +4030,6 @@ [101, "s2", "handle"] ], - "(method 7 cavegeyserrock)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(trans junglesnake-wake)": [[15, "v1", "collide-shape-prim-group"]], "(trans junglesnake-attack)": [[15, "v1", "collide-shape-prim-group"]], @@ -4140,10 +4070,6 @@ [191, "v1", "art-joint-anim"] ], - "(method 7 flutflutegg)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(event flutflutegg-idle)": [[30, "gp", "process-drawable"]], "(event flutflutegg-physics)": [[37, "gp", "process-drawable"]], @@ -4164,10 +4090,6 @@ "(method 26 warp-gate-switch)": [[60, "v1", "art-joint-anim"]], - "(method 31 warp-gate-switch)": [ - [61, "t9", "(function basebutton symbol none)"] - ], - "(code basebutton-going-down warp-gate-switch)": [ [79, "v0", "(state basebutton)"], [81, "t9", "(function none :behavior basebutton)"] @@ -4177,24 +4099,6 @@ "(code idle warp-gate)": [[35, "a0", "symbol"]], - "(method 21 citb-arm)": [[7, "t9", "(function citb-arm-section none)"]], - - "(method 21 citb-arm-shoulder)": [ - [7, "t9", "(function citb-arm-section none)"] - ], - - "(method 21 citb-arm-a)": [[14, "t9", "(function citb-arm none)"]], - - "(method 21 citb-arm-b)": [[14, "t9", "(function citb-arm none)"]], - - "(method 21 citb-arm-c)": [[14, "t9", "(function citb-arm none)"]], - - "(method 21 citb-arm-d)": [[14, "t9", "(function citb-arm none)"]], - - "(method 21 citb-arm-shoulder-a)": [[14, "t9", "(function citb-arm none)"]], - - "(method 21 citb-arm-shoulder-b)": [[14, "t9", "(function citb-arm none)"]], - "(method 26 citb-button)": [[31, "v1", "art-joint-anim"]], "(code citb-coil-break)": [[19, "v1", "art-joint-anim"]], @@ -4219,14 +4123,9 @@ ], "(code battlecontroller-die citb-battlecontroller)": [ - [9, "v0", "(state battlecontroller)"], [11, "t9", "(function none :behavior battlecontroller)"] ], - "(method 27 citb-battlecontroller)": [ - [7, "t9", "(function battlecontroller none)"] - ], - "(code eggtop-close)": [ [108, "v1", "art-joint-anim"], [176, "v1", "art-joint-anim"] @@ -4246,10 +4145,6 @@ "(event precurbridge-active)": [[4, "gp", "touching-shapes-entry"]], - "(method 7 jngpusher)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 11 lurkerm-piston)": [ ["_stack_", 16, "res-tag"], ["_stack_", 32, "res-tag"], @@ -4258,20 +4153,12 @@ "(code starfish-patrol)": [[16, "v1", "art-joint-anim"]], - "(method 7 hutlamp)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(code mis-bone-bridge-bump)": [[10, "v1", "art-joint-anim"]], "(code mis-bone-bridge-hit)": [[21, "v1", "art-joint-anim"]], "(code mis-bone-bridge-fall)": [[50, "v1", "art-joint-anim"]], - "(method 23 bone-platform)": [ - [9, "t9", "(function rigid-body-platform basic none)"] - ], - "mistycam-spawn": [ [[68, 76], "v1", "handle"], [80, "v1", "pov-camera"], @@ -4283,10 +4170,6 @@ [34, "gp", "handle"] ], - "(method 27 misty-battlecontroller)": [ - [7, "t9", "(function battlecontroller none)"] - ], - "(code boat-fuelcell-spawn)": [[50, "gp", "handle"]], "(code pov-camera-playing village2cam)": [ @@ -4294,10 +4177,6 @@ [65, "v1", "art-joint-anim"] ], - "(method 23 pontoon)": [ - [9, "t9", "(function rigid-body-platform basic none)"] - ], - "fireboulder-disable-blocking-collision": [ [5, "v1", "collide-shape-prim-group"], [14, "v1", "collide-shape-prim-group"] @@ -4329,10 +4208,6 @@ "(code swamp-spike-gate-up)": [[60, "v1", "art-joint-anim"]], - "(method 23 tar-plat)": [ - [9, "t9", "(function rigid-body-platform basic none)"] - ], - "(code battlecontroller-play-intro-camera swamp-battlecontroller)": [ [38, "gp", "handle"] ], @@ -4425,32 +4300,6 @@ "(trans spike-idle)": [[70, "v1", "float"]], - "(method 23 ogre-plat)": [ - [9, "t9", "(function rigid-body-platform basic none)"] - ], - - "(method 31 ogre-step)": [[23, "t9", "(function ogre-plat none)"]], - - "(method 31 ogre-step-a)": [[25, "t9", "(function ogre-step none)"]], - - "(method 31 ogre-step-b)": [[25, "t9", "(function ogre-step none)"]], - - "(method 31 ogre-step-c)": [[25, "t9", "(function ogre-step none)"]], - - "(method 31 ogre-step-d)": [[25, "t9", "(function ogre-step none)"]], - - "(method 31 ogre-isle)": [[17, "t9", "(function ogre-plat none)"]], - - "(method 31 ogre-isle-b)": [[31, "t9", "(function ogre-isle none)"]], - - "(method 31 ogre-isle-c)": [[31, "t9", "(function ogre-isle none)"]], - - "(method 31 ogre-isle-d)": [[37, "t9", "(function ogre-isle none)"]], - - "(method 7 ogre-bridge)": [ - [26, "t9", "(function process-drawable int process-drawable)"] - ], - "(code ogre-bridge-activate)": [[33, "v1", "art-joint-anim"]], "(code water-vol-idle ogre-lava)": [[36, "v1", "art-joint-anim"]], @@ -4489,10 +4338,6 @@ [346, "v1", "art-joint-anim"] ], - "(method 7 snow-fort-gate)": [ - [19, "t9", "(function process-drawable int process-drawable)"] - ], - "(code snow-button-activate)": [[25, "v1", "art-joint-anim"]], "(code snow-button-deactivate)": [[26, "v1", "art-joint-anim"]], @@ -4501,10 +4346,6 @@ [62, "t9", "(function none :behavior plat)"] ], - "(method 7 darkecobarrel)": [ - [14, "t9", "(function darkecobarrel-base int darkecobarrel-base)"] - ], - "(event darkecobarrel-mover-move)": [[76, "v1", "process-drawable"]], "(code darkecobarrel-mover-move)": [ @@ -4531,10 +4372,6 @@ "(method 11 training-cam)": [[21, "s5", "entity-actor"]], - "(method 23 tra-pontoon)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], - "(event idle scarecrow-a)": [ [75, "v1", "process-drawable"], [135, "gp", "target"], @@ -4768,10 +4605,6 @@ "command-get-camera": [[27, "gp", "symbol"]], - "(method 7 plant-boss)": [ - [47, "t9", "(function process-drawable int process-drawable)"] - ], - "(code plant-boss-arm-hit)": [[88, "v1", "art-joint-anim"]], "(code plant-boss-arm-die)": [ @@ -4850,8 +4683,6 @@ "(code plant-boss-back-arms-hit)": [[149, "v1", "art-joint-anim"]], - "(method 7 ice-cube)": [[24, "t9", "(function nav-enemy int nav-enemy)"]], - "(code ice-cube-appear)": [[14, "v1", "art-joint-anim"]], "(code ice-cube-tired)": [ @@ -4905,14 +4736,6 @@ [22, "v1", "collide-shape-prim-group"] ], - "(method 7 billy)": [ - [26, "t9", "(function process-drawable int process-drawable)"] - ], - - "(method 38 billy)": [[33, "t9", "(function nav-enemy none)"]], - - "(enter nav-enemy-victory billy-rat)": [[4, "v0", "(state nav-enemy)"]], - "(code billy-rat-salivate)": [[43, "v1", "art-joint-anim"]], "(code idle billy)": [ @@ -4956,10 +4779,6 @@ [89, "v1", "float"] ], - "(method 7 pelican)": [ - [36, "t9", "(function process-drawable int process-drawable)"] - ], - "pelican-fly": [ [61, "v1", "art-joint-anim"], [186, "v1", "art-joint-anim"] @@ -5014,14 +4833,6 @@ "(post idle citb-sage)": [[3, "t9", "(function none :behavior citb-sage)"]], - "(method 44 red-sagecage)": [[35, "t9", "(function citb-sage none)"]], - - "(method 44 blue-sagecage)": [[35, "t9", "(function citb-sage none)"]], - - "(method 44 yellow-sagecage)": [[35, "t9", "(function citb-sage none)"]], - - "(method 44 green-sagecage)": [[35, "t9", "(function citb-sage none)"]], - "(method 43 red-sagecage)": [[24, "v1", "float"]], "(method 43 blue-sagecage)": [[24, "v1", "float"]], @@ -5058,8 +4869,6 @@ "(event wait fuel-cell)": [[95, "a0", "vector"]], - "(enter pickup fuel-cell)": [[9, "v0", "(state eco-collectable)"]], - "(code ecovalve-idle)": [[41, "v1", "process-drawable"]], "(code vent-pickup)": [ @@ -5107,10 +4916,6 @@ "sun-iris-door-init-by-other": [[97, "v1", "art-joint-anim"]], - "(method 7 steam-cap)": [ - [19, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 11 steam-cap)": [ ["_stack_", 16, "res-tag"], [139, "v0", "(pointer float)"] @@ -5774,8 +5579,6 @@ [198, "v1", "art-joint-anim"] ], - "(method 10 first-person-hud)": [[32, "t9", "(function process none)"]], - "(code target-pole-flip-forward-jump)": [ [40, "t9", "(function none :behavior target)"] ], @@ -5924,10 +5727,6 @@ "(code snow-bumper-inactive-idle)": [[19, "v1", "art-joint-anim"]], - "(method 7 snow-bumper)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 11 snow-bumper)": [ ["_stack_", 16, "res-tag"], [216, "v0", "(pointer float)"] @@ -5965,10 +5764,6 @@ "(method 31 puffer)": [[16, "v1", "(array collide-shape-prim)"]], - "(method 7 puffer)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 11 puffer)": [ ["_stack_", 16, "res-tag"], [213, "v0", "(pointer float)"] @@ -5984,10 +5779,6 @@ "(code driller-lurker-die)": [[28, "v1", "art-joint-anim"]], - "(method 7 driller-lurker)": [ - [24, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 11 driller-lurker)": [ ["_stack_", 16, "res-tag"], [373, "v0", "(pointer float)"] @@ -6012,8 +5803,6 @@ [90, "v1", "art-joint-anim"] ], - "(method 39 kermit)": [[7, "t9", "(function nav-enemy none)"]], - "(code falling gnawer-falling-segment)": [ [16, "v1", "art-joint-anim"], [70, "v1", "art-joint-anim"] @@ -6035,8 +5824,6 @@ "(event gnawer-run)": [[54, "a2", "touching-shapes-entry"]], - "(method 7 gnawer)": [[19, "t9", "(function nav-enemy int nav-enemy)"]], - "(code gnawer-give-fuel-cell)": [ [43, "v0", "maincavecam"], [64, "v1", "maincavecam"] @@ -6064,10 +5851,6 @@ [124, "v1", "art-joint-anim"] ], - "(method 7 swamp-blimp)": [ - [19, "t9", "(function process-drawable int process-drawable)"] - ], - "(code swamp-tetherrock-break)": [ [238, "s4", "handle"], [261, "s4", "handle"], @@ -6117,10 +5900,6 @@ [47, "v1", "vector"] ], - "(method 23 citb-chain-plat)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], - "(code citb-firehose-blast)": [ [10, "v1", "art-joint-anim"], [86, "v1", "art-joint-anim"], @@ -6194,10 +5973,6 @@ [69, "v1", "art-joint-anim"] ], - "(method 7 balloonlurker)": [ - [29, "t9", "(function process-drawable int process-drawable)"] - ], - "(code balloonlurker-pilot-die)": [[58, "v1", "art-joint-anim"]], "(code orbit-plat-bottom-idle)": [ @@ -6269,10 +6044,6 @@ "(trans bully-stop-spinning)": [[10, "v1", "collide-shape-prim-group"]], - "(method 7 bully)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(enter seagull-idle)": [[20, "v1", "float"]], "seagull-init-by-other": [[96, "v1", "float"]], @@ -6389,10 +6160,6 @@ "joint-mod-tracker-callback": [[[3, 99], "s4", "joint-mod-tracker"]], - "(method 7 snow-ball)": [ - [26, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 11 mistycannon)": [ ["_stack_", 16, "res-tag"], ["_stack_", 32, "res-tag"], @@ -6420,10 +6187,6 @@ "(method 21 helix-water)": [[27, "a0", "process-drawable"]], - "(method 7 helix-water)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(code helix-button-activate)": [[58, "v1", "(pointer sunkencam)"]], "(code target-flut-jump)": [[137, "v1", "float"]], @@ -6520,10 +6283,6 @@ [[407, 409], "v1", "(pointer sunken-pipegame-button)"] ], - "(method 7 sunken-pipegame)": [ - [33, "t9", "(function process-drawable int process-drawable)"] - ], - "(code sunken-pipegame-begin-play)": [ [179, "v1", "float"], [260, "v1", "float"], @@ -6898,10 +6657,6 @@ "ogreboss-shoot-boulder": [[41, "a1", "process-drawable"]], - "(method 7 ogreboss-super-boulder)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "ogreboss-bounce-boulder-init-by-other": [[112, "v1", "float"]], "(code ogreboss-stage3-shuffle)": [ diff --git a/decompiler/config/jak2/ntsc_v1/type_casts.jsonc b/decompiler/config/jak2/ntsc_v1/type_casts.jsonc index f8ae7dbc1dc..7df2f41b736 100644 --- a/decompiler/config/jak2/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak2/ntsc_v1/type_casts.jsonc @@ -1,7 +1,4 @@ { - // auto find-parent-method possible - "(method 3 entity-actor)": [[7, "t9", "(function entity entity)"]], - "(method 3 entity)": [[7, "t9", "(function entity entity)"]], // "(method 2 array)": [ [23, "gp", "(array int32)"], @@ -1780,7 +1777,6 @@ "target-real-post": [[97, "f28", "float"]], "target-compute-pole": [[[12, 180], "s2", "swingpole"]], "tobot-start": [[26, "s5", "target"]], - "(method 10 target)": [[28, "t9", "(function target none)"]], "target-compute-edge": [[48, "a0", "process-drawable"]], "target-compute-edge-rider": [[48, "a0", "process-drawable"]], "target-update-ik": [[288, "f30", "float"]], @@ -1959,19 +1955,9 @@ [468, "a0", "editable-light"] ], "(method 29 editable)": [[[4, 8], "a0", "editable"]], - "(method 28 editable-point)": [ - [88, "t9", "(function editable-point editable-command none)"] - ], "(method 27 editable-plane)": [ - [9, "t9", "(function editable-plane editable-array editable)"], [10, "v0", "editable-plane"] ], - "(method 25 editable-face)": [ - [25, "t9", "(function editable-face editable-array none)"] - ], - "(method 25 editable-plane)": [ - [25, "t9", "(function editable-plane editable-array none)"] - ], "(method 29 editable-face)": [ [234, "a1", "editable-point"], [241, "f0", "float"], @@ -1984,12 +1970,8 @@ [387, "a1", "(array editable-point)"] ], "(method 27 editable-face)": [ - [9, "t9", "(function editable-face editable-array editable)"], [10, "v0", "editable-face"] ], - "(method 25 editable-light)": [ - [9, "t9", "(function editable-light editable-array none)"] - ], "(method 25 editable)": [[[12, 17], "a0", "editable"]], "merc-edge-stats": [[31, "v1", "merc-ctrl"]], "(method 8 merc-ctrl)": [ @@ -2179,7 +2161,6 @@ ], "(method 12 minimap)": [[18, "v0", "connection-minimap"]], "update-task-masks": [[30, "s5", "connection-minimap"]], - "(method 10 fail-mission)": [[43, "t9", "(function process process)"]], "restart-mission": [ [8, "v1", "connection"], [5, "v1", "connection"], @@ -2700,7 +2681,6 @@ ], "set-fog-height!": [[2, "v1", "(array texture-anim)"]], "unpack-comp-huf": [[[21, 23], "t3", "(pointer uint16)"]], - "(method 10 elec-gate)": [[13, "t9", "(function process-drawable none)"]], "(method 11 elec-gate)": [ [180, "a0", "vector"], [193, "a0", "vector"] @@ -2723,9 +2703,6 @@ [53, "gp", "process-focusable"] ], "(event idle bouncer)": [[[120, 127], "v1", "attack-info"]], - "(method 7 conveyor)": [ - [12, "t9", "(function process-drawable int process-drawable)"] - ], "(method 27 conveyor)": [ [23, "a0", "connection"], [24, "a0", "collide-shape"], @@ -2742,7 +2719,6 @@ ], "(code idle lgconveyor)": [[10, "v1", "art-joint-anim"]], "(post idle lgconveyor)": [[4, "t9", "(function none)"]], - "(method 7 elevator)": [[14, "t9", "(function base-plat int base-plat)"]], "elevator-event": [ [23, "v1", "focus"], [88, "gp", "float"], @@ -2909,7 +2885,6 @@ [[147, 217], "v1", "mc-status-code"] ], "memcard-unlocked-secrets?": [[50, "s5", "int"]], - "(method 10 progress)": [[45, "t9", "(function progress none)"]], "load-game-text-info": [[4, "v1", "game-text-info"]], "(method 16 camera-master)": [ [[11, 15], "a2", "target"], @@ -3208,14 +3183,10 @@ "(code target-look-around)": [[21, "v0", "float"]], "(exit target-swim-stance)": [[51, "v0", "sound-rpc-set-param"]], "(exit target-swim-down)": [[56, "v0", "sound-rpc-set-param"]], - "(method 7 water-anim)": [[14, "t9", "(function water-anim int water-anim)"]], "(method 26 water-anim)": [ ["_stack_", 16, "res-tag"], [52, "v0", "(pointer float)"] ], - "(method 7 flow-control)": [ - [19, "t9", "(function flow-control int flow-control)"] - ], "water-anim-event-handler": [ [23, "v1", "float"], [40, "s4", "process"], @@ -3339,7 +3310,6 @@ [10, "v1", "float"] ], "(trans idle fma-sphere)": [[39, "a2", "process-drawable"]], - "(method 10 talker)": [[29, "t9", "(function process none)"]], "(exit active talker)": [[19, "s5", "process-drawable"]], "(method 11 speech-channel)": [ [66, "v1", "process-drawable"], @@ -3433,7 +3403,6 @@ [46, "t6", "(pointer grid-hash-word)"] ], "(method 19 grid-hash)": [[46, "t6", "(pointer uint8)"]], - "(method 15 sphere-hash)": [[5, "v0", "(function grid-hash none)"]], "(method 32 sphere-hash)": [[107, "v1", "float"]], "(method 13 carry-info)": [ [14, "v1", "handle"], @@ -3541,9 +3510,6 @@ "(code die enemy)": [[30, "v1", "art-joint-anim"]], "(code die-falling enemy)": [[32, "gp", "art-joint-anim"]], "(code view-anims enemy)": [[20, "s4", "art-joint-anim"]], - "(method 7 enemy)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "nav-enemy-chase-post": [[[15, 19], "a0", "process-focusable"]], "nav-enemy-flee-post": [[[16, 20], "a0", "process-focusable"]], "nav-enemy-face-focus-post": [[[24, 28], "a0", "process-focusable"]], @@ -3573,17 +3539,11 @@ [18, "s5", "process-focusable"], [[35, 40], "s5", "process-focusable"] ], - "(method 32 youngsamos-npc)": [ - [61, "t9", "(function process-taskable none)"] - ], "(method 35 pecker-npc)": [ [58, "v1", "art-joint-anim"], [117, "v1", "art-joint-anim"] ], "(code idle scene-looper)": [[40, "gp", "handle"]], - "(method 7 rigid-body-platform)": [ - [14, "t9", "(function rigid-body-object int rigid-body-object)"] - ], "(method 53 rigid-body-platform)": [[24, "f0", "float"]], "(method 46 rigid-body-platform)": [ [13, "v1", "rigid-body-control-point"], @@ -3645,9 +3605,6 @@ [7, "s5", "nav-enemy"], [32, "a2", "nav-enemy"] ], - "(method 7 battle)": [ - [15, "t9", "(function process-drawable int process-drawable)"] - ], "(method 51 battle)": [[[38, 95], "s4", "enemy"]], "(method 26 battle)": [ [35, "a0", "connection"], @@ -4406,7 +4363,6 @@ [40, "s5", "process-focusable"], [13, "s5", "process-focusable"] ], - "(method 132 grunt)": [[16, "t9", "(function nav-enemy none)"]], "(method 77 flitter)": [ [14, "v1", "art-joint-anim"], [69, "v1", "art-joint-anim"] @@ -4428,7 +4384,6 @@ [20, "v1", "art-joint-anim"], [147, "v1", "art-joint-anim"] ], - "(method 132 flitter)": [[16, "t9", "(function nav-enemy none)"]], "(code target-tube)": [[33, "v1", "art-joint-anim"]], "(code target-tube-start)": [[109, "v1", "float"]], "(event slide-control-ride slide-control)": [ @@ -4590,9 +4545,6 @@ "(code idle hide-light)": [[10, "v1", "art-joint-anim"]], "(event impact turret-shot)": [[11, "s4", "process-drawable"]], "(code impact turret-shot)": [[4, "v1", "collide-shape-prim-group"]], - "(method 29 sinking-plat)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], "(code collapse beam)": [[25, "v1", "art-joint-anim"]], "(code fall ruins-bridge)": [ [16, "v1", "collide-shape-prim-group"], @@ -4811,7 +4763,6 @@ [40, "v1", "(inline-array tpath-control-frame)"] ], "(method 31 gun-dummy)": [[40, "v1", "(inline-array tpath-control-frame)"]], - "(method 10 training-manager)": [[51, "t9", "(function process none)"]], "(trans course training-manager)": [[[22, 493], "gp", "hud"]], "(code end-course training-manager)": [[28, "gp", "process-drawable"]], "(method 21 training-manager)": [ @@ -4865,7 +4816,6 @@ [39, "v0", "state"], [41, "t9", "(function none)"] ], - "(method 10 gem)": [[12, "t9", "(function gem none)"]], "(method 9 fact-info)": [ [245, "a0", "process-drawable"], [293, "a0", "process-drawable"], @@ -4899,7 +4849,6 @@ ], "(method 78 fodder)": [[16, "v1", "art-joint-anim"]], "(method 181 fodder)": [[2, "v1", "collide-shape-prim-group"]], - "(method 7 fodder)": [[19, "t9", "(function nav-enemy int nav-enemy)"]], "(post idle fodder)": [[4, "t9", "(function none)"]], "(method 180 fodder)": [[24, "s1", "fodder"]], "(method 55 fodder)": [[29, "s5", "process-drawable"]], @@ -5044,9 +4993,6 @@ [175, "s5", "process-drawable"], [[104, 219], "gp", "handle"] ], - "(method 10 hoverboard-training-manager)": [ - [19, "t9", "(function process none)"] - ], "(code fire skatea-jump-pad)": [[59, "t9", "(function none)"]], "(method 29 hoverboard-training-manager)": [[[18, 491], "gp", "hud-goal"]], "hoverboard-training-manager-event-handler": [ @@ -5139,10 +5085,6 @@ [48, "s2", "amphibian-joint-mod"], [49, "v1", "amphibian"] ], - "(method 7 hopper)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], - "(method 132 hopper)": [[16, "t9", "(function enemy none)"]], "(code active hopper)": [[22, "v1", "art-joint-anim"]], "(trans hostile hopper)": [ [24, "gp", "process-focusable"], @@ -5160,9 +5102,6 @@ [33, "a1", "art-joint-anim"], [86, "a1", "art-joint-anim"] ], - "(method 7 metalmonk)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "(method 87 metalmonk)": [[27, "s5", "art-joint-anim"]], "(method 104 metalmonk)": [ [14, "a0", "process-focusable"], @@ -5208,7 +5147,6 @@ [16, "a0", "process-focusable"], [19, "a0", "process-focusable"] ], - "(method 10 ginsu)": [[6, "t9", "(function sparticle-launch-control none)"]], "(code victory centurion)": [[30, "v1", "art-joint-anim"]], "(code fire centurion)": [ [22, "a0", "process-focusable"], @@ -5241,9 +5179,6 @@ [87, "a0", "process-focusable"], [90, "a0", "process-focusable"] ], - "(method 7 centurion)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "(method 78 centurion)": [ [18, "v1", "art-joint-anim"], [53, "s4", "art-joint-anim"], @@ -5264,11 +5199,6 @@ [28, "s0", "process-focusable"], [49, "s0", "process-focusable"] ], - "(method 132 centurion)": [[13, "t9", "(function enemy none)"]], - "(method 31 centurion-shot)": [[7, "t9", "(function projectile none)"]], - "(method 28 centurion-shot)": [ - [49, "t9", "(function projectile projectile-options sound-id)"] - ], "(method 74 centurion)": [ [76, "v1", "attack-info"], [78, "v1", "attack-info"], @@ -5333,9 +5263,6 @@ [139, "gp", "process-focusable"], [293, "a0", "process-focusable"] ], - "(method 7 rhino)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "(method 74 rhino)": [[68, "s2", "process-focusable"]], "(method 182 rhino)": [[36, "s2", "process-drawable"]], "(exit victory rhino)": [ @@ -5398,9 +5325,6 @@ "(code spin-kick grenadier)": [[14, "v1", "art-joint-anim"]], "(enter spin-kick grenadier)": [[29, "v1", "collide-shape-prim-group"]], "(code backup grenadier)": [[10, "v1", "art-joint-anim"]], - "(method 7 grenadier)": [ - [21, "t9", "(function process-focusable int process-focusable)"] - ], "(method 70 grenadier)": [[41, "a0", "process-focusable"]], "(code active grenadier)": [ [140, "v1", "art-joint-anim"], @@ -5447,9 +5371,6 @@ [32, "a0", "process-focusable"], [35, "a0", "process-focusable"] ], - "(method 7 rapid-gunner)": [ - [14, "t9", "(function process-focusable int process-focusable)"] - ], "(exit spin-attack rapid-gunner)": [[13, "v1", "collide-shape-prim-group"]], "(post spin-attack rapid-gunner)": [ [24, "a0", "process-focusable"], @@ -5583,9 +5504,6 @@ [123, "v1", "art-joint-anim"], [155, "v1", "art-joint-anim"] ], - "(method 7 predator)": [ - [9, "t9", "(function process-focusable int process-focusable)"] - ], "(method 184 predator)": [ [67, "s2", "process-focusable"], [79, "a0", "process-focusable"], @@ -5675,9 +5593,6 @@ [21, "v1", "collide-shape-prim-group"] ], "(method 201 crimson-guard-level)": [[18, "s3", "process-focusable"]], - "(method 7 crimson-guard-level)": [ - [19, "t9", "(function nav-enemy int nav-enemy)"] - ], "(method 115 crimson-guard-level)": [[33, "v0", "vector"]], "(method 198 crimson-guard-level)": [[242, "s4", "collide-shape-prim"]], "(enter broken dig-clasp)": [ @@ -5693,9 +5608,6 @@ "(method 23 dig-digger)": [[[1, 23], "s5", "int"]], "(enter breaking fort-fence)": [[[5, 9], "a0", "collide-shape-prim-group"]], "(method 11 fort-elec-switch)": [["_stack_", 16, "res-tag"]], - "(method 10 fort-roboscreen)": [ - [15, "t9", "(function process-drawable none)"] - ], "fort-robotank-reticle-handler": [ [6, "v1", "vector"], [[17, 34], "s5", "vector"], @@ -5728,7 +5640,6 @@ [89, "t9", "(function fort-robotank none)"] ], "(method 7 fort-robotank)": [ - [89, "t9", "(function process-drawable int process-drawable)"], [56, "gp", "(pointer uint32)"], [59, "a1", "(pointer uint32)"], [63, "gp", "(pointer uint32)"], @@ -5762,26 +5673,17 @@ "(enter die fort-missile-target)": [ [[2, 5], "v1", "collide-shape-prim-group"] ], - "(method 10 fort-missile-target)": [ - [10, "t9", "(function process-drawable none)"] - ], "(code die fort-missile)": [ [156, "v1", "process-drawable"], [227, "v1", "collide-shape-prim-group"], [229, "v1", "collide-shape-prim-group"] ], - "(method 7 fort-missile)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "birth-func-dig-digger-collide": [ [8, "v1", "process"], [12, "s3", "process-drawable"] ], "(method 23 dig-tether)": [[69, "v1", "vector"]], "(method 11 dig-digger)": [["_stack_", 16, "res-tag"]], - "(method 29 dig-sinking-plat)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], "(method 37 dig-sinking-plat)": [ [28, "v1", "art-joint-anim"], [157, "v1", "art-joint-anim"], @@ -5808,9 +5710,6 @@ ], "(code fire dig-jump-pad)": [[59, "t9", "(function none)"]], "(code die dig-spikey-sphere)": [[72, "t9", "(function none)"]], - "(method 29 dig-tipping-rock)": [ - [9, "t9", "(function rigid-body-platform float none)"] - ], "(event waiting dig-stomp-block)": [[14, "v1", "attack-info"]], "(method 37 dig-stomp-block)": [ [[42, 62], "v1", "collide-cache-tri"], @@ -5819,7 +5718,6 @@ "(method 11 dig-spikey-step)": [[96, "v0", "(pointer float)"]], "(method 37 dig-tipping-rock)": [[14, "v0", "sound-rpc-set-param"]], "(method 49 cpad-elevator)": [[2, "v1", "collide-shape-prim-group"]], - "(method 10 cpad-elevator)": [[10, "t9", "(function elevator none)"]], "(code hunt wren)": [[10, "v1", "art-joint-anim"]], "(code peck wren)": [ [36, "v1", "art-joint-anim"], @@ -5830,9 +5728,6 @@ [82, "v1", "art-joint-anim"] ], "(code land wren)": [[17, "v1", "art-joint-anim"]], - "(method 7 wren)": [ - [30, "t9", "(function process-drawable int process-drawable)"] - ], "(code idle minnow)": [[10, "v1", "art-joint-anim"]], "(post idle fish-manager)": [ [517, "v1", "process-drawable"], @@ -5845,9 +5740,6 @@ [112, "s2", "entity-actor"], [93, "s2", "basic"] ], - "(method 3 engine-minimap)": [ - [7, "t9", "(function engine-minimap engine-minimap)"] - ], "(method 24 minimap)": [ [189, "s2", "connection-minimap"], [194, "s2", "connection-minimap"], @@ -5985,9 +5877,6 @@ ], "(method 137 sew-gunturret)": [[[19, 23], "a0", "process-focusable"]], "(method 138 sew-gunturret)": [[[15, 19], "a0", "process-focusable"]], - "(method 140 pal-gun-turret)": [ - [9, "t9", "(function sew-gunturret symbol none)"] - ], "(anon-function 0 sewer-scenes)": [[79, "v1", "float"]], "(event idle sew-single-blade)": [[15, "s4", "process-focusable"]], "(event idle sew-multi-blade)": [[15, "s4", "process-focusable"]], @@ -5997,11 +5886,7 @@ "sew-tri-blade-joint-callback": [[[1, 82], "gp", "sew-tri-blade"]], "(method 49 sew-elevator)": [[2, "v1", "collide-shape-prim-group"]], "(post running sew-elevator)": [[4, "t9", "(function none)"]], - "(method 10 sew-elevator)": [[10, "t9", "(function elevator none)"]], "(event idle sew-valve)": [[4, "v1", "attack-info"]], - "(method 7 sew-valve)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "sew-mar-statue-debris-init-by-other": [ [[144, 157], "gp", "process-drawable"] ], @@ -6078,9 +5963,6 @@ "(event idle grunt-egg)": [[16, "s4", "process-focusable"]], "strip-handler": [[15, "s4", "process-focusable"]], "(post idle pitspikes)": [[4, "t9", "(function none)"]], - "(method 7 pitspikes)": [ - [14, "t9", "(function strip-hazard int strip-hazard)"] - ], "(post idle curtainsaw)": [[4, "t9", "(function none)"]], "(event impact grenade)": [ [11, "s4", "process-drawable"], @@ -6110,12 +5992,6 @@ [169, "v1", "float"], [[118, 125], "s5", "traffic-object-spawn-params"] ], - "(method 33 citizen-norm-rider)": [ - [7, "t9", "(function vehicle-rider none)"] - ], - "(method 33 crimson-guard-rider)": [ - [7, "t9", "(function vehicle-rider none)"] - ], "(enter explode vehicle)": [[298, "v1", "joint-exploder"]], "(method 47 vehicle)": [ [27, "s0", "process-focusable"], @@ -6128,7 +6004,6 @@ ], "(method 97 vehicle)": [[6, "v1", "float"]], "(method 18 vehicle-controller)": [[231, "s2", "vehicle"]], - "(method 10 vehicle)": [[12, "t9", "(function rigid-body-object none)"]], "(method 119 vehicle)": [[[19, 45], "s4", "vehicle-rider"]], "(method 99 vehicle)": [[14, "s3", "collide-shape-prim-group"]], "(method 100 vehicle)": [[163, "a0", "vector"]], @@ -6313,7 +6188,6 @@ [457, "a0", "(array float)"] ], "(code idle tomb-spider)": [[[1, 9], "v1", "(pointer process)"]], - "(method 10 tomb-sphinx)": [[10, "t9", "(function process-drawable none)"]], "tomb-stair-block-spikes-init-by-other": [ [53, "s2", "pair"], [72, "s2", "pair"], @@ -6329,9 +6203,6 @@ "(event idle tomb-stair-block-spikes)": [[24, "v1", "vector"]], "(code moving tomb-stair-block)": [[40, "v1", "art-joint-anim"]], "(post running tomb-elevator)": [[8, "t9", "(function none)"]], - "(method 10 tomb-plat-return)": [ - [10, "t9", "(function process-drawable none)"] - ], "lift-pool": [ [12, "v0", "(pointer actor-group)"], ["_stack_", 16, "res-tag"] @@ -6618,9 +6489,6 @@ "(code die-falling ashelin)": [[108, "gp", "art-joint-anim"]], "(anon-function 0 ash1-course)": [[31, "v1", "asht-wait-spot"]], "ashelin-shot-move": [[49, "v1", "(state ashelin)"]], - "(method 28 ashelin-shot)": [ - [47, "t9", "(function projectile projectile-options none)"] - ], "(method 30 ashelin-shot)": [[119, "a0", "ashelin"]], "(anon-function 2 ash1-course)": [[50, "v1", "asht-wait-spot"]], "(anon-function 7 ash1-course)": [[90, "v1", "asht-wait-spot"]], @@ -6684,10 +6552,6 @@ [288, "v1", "art-joint-anim"], [143, "v1", "lightning-tracker"] ], - "(method 10 whack-a-metal)": [[24, "t9", "(function process none)"]], - "(method 7 whack-a-metal)": [ - [26, "t9", "(function process-drawable int process-drawable)"] - ], "(method 27 whack-a-metal)": [ [69, "a1", "hip-mole"], [78, "a1", "hip-mole"], @@ -6757,9 +6621,6 @@ [27, "a0", "process-focusable"], [83, "a1", "art-joint-anim"] ], - "(method 7 juicer)": [ - [19, "t9", "(function process-focusable int process-focusable)"] - ], "(method 184 juicer)": [[4, "v1", "collide-shape-prim-group"]], "(code circling juicer)": [ [228, "gp", "art-joint-anim"], @@ -6799,9 +6660,6 @@ [284, "a0", "process-focusable"] ], "(method 25 juicer-shot)": [[131, "a1", "int"]], - "(method 7 spyder)": [ - [31, "t9", "(function process-focusable int process-focusable)"] - ], "(code attack spyder)": [ [116, "a0", "process-focusable"], [119, "a0", "process-focusable"], @@ -6822,7 +6680,6 @@ [17, "a0", "process-focusable"], [20, "a0", "process-focusable"] ], - "(method 31 spyder-shot)": [[7, "t9", "(function projectile none)"]], "(code backup spyder)": [[22, "v1", "art-joint-anim"]], "(trans hostile spyder)": [ [20, "a0", "process-focusable"], @@ -6901,9 +6758,6 @@ [23, "a0", "process-focusable"], [26, "a0", "process-focusable"] ], - "(method 7 mammoth)": [ - [26, "t9", "(function process-focusable int process-focusable)"] - ], "(code waiting mammoth)": [[41, "v1", "art-joint-anim"]], "(code wait-to-walk mammoth)": [[18, "v1", "art-joint-anim"]], "(code walking mammoth)": [[74, "a1", "art-joint-anim"]], @@ -6933,9 +6787,6 @@ [19, "s0", "mammoth"], [3, "v1", "int"] ], - "(method 28 flying-spider-shot)": [ - [27, "t9", "(function projectile projectile-options sound-id)"] - ], "(code active flying-spider)": [[10, "v1", "art-joint-anim"]], "(code ambush flying-spider)": [[14, "v1", "art-joint-anim"]], "(code ambush-falling flying-spider)": [ @@ -6985,10 +6836,6 @@ [52, "v1", "art-joint-anim"], [82, "v1", "art-joint-anim"] ], - "(method 10 slider)": [[10, "t9", "(function process-drawable none)"]], - "(method 7 slider)": [ - [26, "t9", "(function process-drawable int process-drawable)"] - ], "(event idle slider)": [ [31, "s3", "process-focusable"], [34, "s3", "process-focusable"] @@ -7050,7 +6897,6 @@ [69, "v1", "float"], [257, "v1", "float"] ], - "(method 10 spydroid)": [[14, "t9", "(function process-focusable none)"]], "(trans hostile spydroid)": [ [29, "a0", "process-focusable"], [32, "a0", "process-focusable"] @@ -7097,22 +6943,12 @@ "(event idle widow-bomb)": [[77, "v1", "float"]], "(exit idle widow-bomb)": [[15, "v1", "float"]], "(trans idle widow-bomb)": [[262, "v1", "float"]], - "(method 10 widow-bomb)": [[42, "t9", "(function process-drawable none)"]], - "(method 7 widow-bomb)": [ - [39, "t9", "(function process-drawable int process-drawable)"] - ], "tomb-boss-pillar-shrink-collision": [ [2, "v1", "collide-shape-prim-group"], [7, "v1", "collide-shape-prim-group"] ], "(enter broken tomb-boss-pillar)": [[17, "v1", "art-joint-anim"]], "(enter idle tomb-boss-pillar)": [[2, "v1", "collide-shape-prim-group"]], - "(method 10 tomb-boss-pillar)": [ - [14, "t9", "(function process-drawable none)"] - ], - "(method 7 tomb-boss-pillar)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "(event idle tomb-boss-firepot)": [ [10, "gp", "widow-shot"], [15, "v1", "attack-info"], @@ -7213,10 +7049,6 @@ [57, "gp", "process-focusable"] ], "(method 34 transport)": [[22, "v1", "vehicle-turret"]], - "(method 10 transport)": [[10, "t9", "(function process-drawable none)"]], - "(method 7 vehicle-turret)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "(method 29 vehicle-turret)": [ [14, "s5", "process-drawable"], [26, "s5", "process-drawable"] @@ -7355,13 +7187,6 @@ ], "(event idle drill-control-panel)": [[4, "v1", "attack-info"]], "(code waiting drill-elevator)": [[14, "v1", "art-joint-anim"]], - "(method 10 drill-elevator)": [ - [10, "t9", "(function process-drawable none)"] - ], - "(method 7 fire-floor)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 10 fire-floor)": [[17, "t9", "(function process-drawable none)"]], "(event idle fire-floor)": [ [18, "gp", "process-focusable"], [51, "gp", "process-focusable"], @@ -7382,17 +7207,16 @@ [14, "v1", "art-joint-anim"], [118, "v1", "art-joint-anim"] ], + "(post running drill-lift)": [ + [16, "v0", "state"], + [18, "t9", "(function none)"] + ], "(post running drill-elevator)": [[4, "t9", "(function none)"]], "(method 11 drill-laser)": [ ["_stack_", 16, "res-tag"], [42, "v0", "(pointer float)"] ], "(method 49 drill-lift)": [[2, "v1", "collide-shape-prim-group"]], - "(post running drill-lift)": [ - [16, "v0", "state"], - [18, "t9", "(function none)"] - ], - "(exit running drill-lift)": [[22, "v0", "state"]], "(code idle drill-moving-staircase)": [[10, "v1", "art-joint-anim"]], "(post idle drill-moving-staircase)": [[4, "t9", "(function none)"]], "(code swing-up drill-flip-step)": [[10, "v1", "art-joint-anim"]], @@ -7436,9 +7260,6 @@ [1, "v1", "(pointer race-ring)"] ], "(method 11 under-shoot-block)": [["_stack_", 16, "res-tag"]], - "(method 10 under-shoot-block)": [ - [62, "t9", "(function process-drawable none)"] - ], "under-block-event-handler": [ [23, "gp", "attack-info"], [28, "gp", "attack-info"], @@ -7457,7 +7278,6 @@ [30, "v1", "collide-shape-prim-group"] ], "(event idle under-break-door)": [[13, "v1", "attack-info"]], - "(method 10 under-lift)": [[10, "t9", "(function process-drawable none)"]], "(event waiting under-buoy-plat)": [[4, "v1", "attack-info"]], "(trans idle under-buoy-chain)": [[6, "v1", "process-drawable"]], "(code idle under-warp)": [[38, "v1", "art-joint-anim"]], @@ -7476,9 +7296,6 @@ [74, "v0", "(pointer float)"], ["_stack_", 16, "res-tag"] ], - "(method 29 under-buoy-plat)": [ - [9, "t9", "(function rigid-body-object float none)"] - ], "(method 49 under-lift)": [[2, "v1", "collide-shape-prim-group"]], "(post running under-lift)": [[4, "t9", "(function none)"]], "(code ambush pipe-grunt)": [[23, "a1", "art-joint-anim"]], @@ -7694,9 +7511,6 @@ [88, "gp", "process-focusable"], [119, "gp", "process-focusable"] ], - "(method 7 cty-guard-turret)": [ - [24, "t9", "(function process-focusable int process-focusable)"] - ], "(method 21 parking-spot)": [[[13, 38], "s5", "vehicle"]], "(event idle propa)": [ [[12, 15], "v1", "attack-info"], @@ -7710,9 +7524,6 @@ [26, "a0", "collide-shape"], [32, "s0", "process-focusable"] ], - "(method 7 barons-ship-lores)": [ - [24, "t9", "(function process-drawable int process-drawable)"] - ], "(event idle ctyn-lamp)": [[4, "a0", "process-drawable"]], "fruit-check-ground-bounce": [[[5, 40], "v1", "fruit-stand"]], "fruit-stand-event-handler": [[[5, 8], "v1", "attack-info"]], @@ -7725,17 +7536,6 @@ "tanker-deadly-init-by-other": [[70, "v1", "process-drawable"]], "(post idle vin-turbine)": [[205, "a0", "lightning-tracker"]], "(method 49 com-elevator)": [[2, "v1", "collide-shape-prim-group"]], - "(enter dormant com-elevator)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"] - ], - "(method 10 com-elevator)": [[10, "t9", "(function elevator none)"]], - "(method 10 tomb-trans-elevator)": [ - [10, "t9", "(function com-elevator none)"] - ], - "(method 33 tomb-trans-elevator)": [ - [7, "t9", "(function com-elevator none)"] - ], "(anon-function 4 ctypower)": [[137, "gp", "process-drawable"]], "(anon-function 0 ctypower)": [ [19, "a0", "vector"], @@ -7751,9 +7551,6 @@ [6, "t9", "(function none)"] ], "(code idle intro-flamer)": [[18, "v1", "art-joint-anim"]], - "(method 7 metalhead-spawner)": [ - [26, "t9", "(function process int process)"] - ], "(event idle farm-marrow)": [[[8, 11], "a1", "attack-info"]], "(event idle farm-beetree)": [[[8, 11], "a1", "attack-info"]], "(event idle farm-cabbage)": [[[8, 11], "a1", "attack-info"]], @@ -7837,7 +7634,6 @@ [63, "v1", "art-joint-anim"], [134, "v1", "art-joint-anim"] ], - "(method 10 stad-samos)": [[42, "t9", "(function process-focusable none)"]], "(method 29 stad-force-field)": [ [155, "v1", "process-drawable"], [418, "v1", "process-drawable"], @@ -7856,10 +7652,6 @@ "(event idle stad-force-field)": [[[9, 12], "v1", "attack-info"]], "(post idle stad-keira)": [[14, "v0", "vector"]], "(post idle stad-brutter)": [[14, "v0", "vector"]], - "(method 10 rift-rider)": [[10, "t9", "(function rigid-body-object none)"]], - "(method 45 rift-rider)": [ - [30, "t9", "(function rigid-body-object rigid-body-impact none)"] - ], "(code fall pal-falling-plat)": [ [10, "v1", "art-joint-anim"], [70, "v1", "art-joint-anim"] @@ -7869,9 +7661,6 @@ [20, "v0", "vector"], [263, "s2", "collide-shape-prim-sphere"] ], - "(method 10 fort-elec-belt-inst)": [ - [10, "t9", "(function process-drawable none)"] - ], "(method 11 fort-elec-belt)": [[20, "v0", "(pointer float)"]], "(method 10 rigid-body-queue)": [ [[124, 134], "a0", "rigid-body-object"], @@ -7879,7 +7668,6 @@ [20, "a0", "rigid-body-object"] ], "(method 15 hud)": [[[125, 128], "v1", "dma-packet"]], - "(method 10 cas-conveyor)": [[10, "t9", "(function conveyor none)"]], "(post idle cas-conveyor)": [ [58, "t9", "(function none)"], [45, "v1", "float"] @@ -7893,7 +7681,6 @@ [15, "v0", "sound-rpc-set-param"] ], "(post arrived cas-elevator)": [[11, "t9", "(function none)"]], - "(method 10 cas-elevator)": [[10, "t9", "(function elevator none)"]], "(code idle cas-rot-bridge)": [ [40, "v1", "art-joint-anim"], [98, "v1", "art-joint-anim"], @@ -7912,24 +7699,13 @@ "(event idle cas-trapdoor)": [[10, "gp", "attack-info"]], "(code drop cas-chain-plat)": [[10, "v1", "art-joint-anim"]], "(event idle cas-rot-blade)": [[7, "s4", "touching-shapes-entry"]], - "(method 10 cas-rot-blade)": [[10, "t9", "(function process-drawable none)"]], "(code spawning cas-robot-door)": [ [27, "v1", "art-joint-anim"], [417, "v1", "art-joint-anim"] ], "(enter ambush roboguard-level)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"], [[72, 76], "a0", "process-focusable"] ], - "(enter idle roboguard-level)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"] - ], - "(enter stare roboguard-level)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"] - ], "(code roll-enter roboguard-level)": [[10, "v1", "art-joint-anim"]], "(trans roll-hostile roboguard-level)": [ [120, "gp", "process-focusable"], @@ -7938,10 +7714,6 @@ ], "(code roll-to-walk roboguard-level)": [[10, "v1", "art-joint-anim"]], "(code idle-dizzy roboguard-level)": [[14, "v1", "art-joint-anim"]], - "(enter die roboguard-level)": [ - [4, "v0", "state"], - [6, "t9", "(function none)"] - ], "(method 185 roboguard-level)": [ [[5, 28], "v1", "collide-shape-prim-group"], [[42, 65], "v1", "collide-shape-prim-group"], @@ -7960,10 +7732,6 @@ [42, "s1", "process-drawable"], [58, "s1", "process-drawable"] ], - "(method 10 roboguard-level)": [[10, "t9", "(function nav-enemy none)"]], - "(method 7 roboguard-level)": [ - [9, "t9", "(function nav-enemy int nav-enemy)"] - ], "(code castle-wait-end cas-robot-door)": [[32, "v1", "art-joint-anim"]], "(method 11 cas-robot-door)": [ ["_stack_", 16, "res-tag"], @@ -7993,7 +7761,6 @@ ], "(code hostile bombbot)": [[11, "v1", "art-joint-anim"]], "(code die bombbot)": [[11, "v1", "art-joint-anim"]], - "(method 7 bombbot)": [[31, "t9", "(function nav-enemy int nav-enemy)"]], "(anon-function 8 bombbot)": [[17, "s2", "bombbot"]], "(anon-function 1 bombbot)": [[15, "s4", "bombbot"]], "bombbot-callback": [[[2, 190], "s4", "bombbot"]], @@ -8007,7 +7774,6 @@ "(method 11 cas-switch)": [["_stack_", 16, "res-tag"]], "(method 11 cas-conveyor)": [["_stack_", 16, "res-tag"]], "(method 11 cas-conveyor-switch)": [["_stack_", 16, "res-tag"]], - "(method 7 hover-formation)": [[19, "t9", "(function basic int basic)"]], "(method 11 hover-formation-control)": [[38, "s3", "process-focusable"]], "(method 16 hover-formation-control)": [[25, "s3", "process-focusable"]], "(method 13 hover-formation-control)": [ @@ -8030,7 +7796,6 @@ [49, "a0", "(pointer int32)"], [51, "a0", "(array object)"] ], - "(method 7 nav-graph-editor)": [[9, "t9", "(function process int none)"]], "(method 18 traffic-tracker)": [ [[8, 12], "a1", "handle"], [[11, 19], "a0", "handle"] @@ -8061,15 +7826,9 @@ [254, "v1", "mysql-nav-edge"] ], "(method 11 city-level-info)": [[27, "a3", "(pointer int8)"]], - "(method 36 bike-base)": [[7, "t9", "(function object none)"]], "(method 85 bike-base)": [ - [7, "t9", "(function object none)"], [[22, 26], "v1", "(pointer uint128)"] ], - "(method 7 bikea)": [[44, "t9", "(function object int bikea)"]], - "(method 7 bikeb)": [[49, "t9", "(function object int bikeb)"]], - "(method 7 bikec)": [[64, "t9", "(function object int bikec)"]], - "(method 7 guard-bike)": [[14, "t9", "(function object int guard-bike)"]], "target-pilot-exit": [[64, "gp", "vehicle"]], "target-pilot-init": [ [[61, 68], "s4", "vehicle"], @@ -8104,10 +7863,6 @@ [[28, 33], "a0", "vehicle"], [103, "a0", "process"] ], - "(method 7 cara)": [[54, "t9", "(function object object cara)"]], - "(method 7 carb)": [[39, "t9", "(function object object carb)"]], - "(method 7 carc)": [[44, "t9", "(function object object carb)"]], - "(method 7 hellcat)": [[14, "t9", "(function object object hellcat)"]], "(code in-ditch citizen)": [ [23, "v1", "art-joint-anim"], [122, "v1", "art-joint-anim"] @@ -8289,9 +8044,6 @@ [450, "v1", "process-focusable"] ], "(code get-up-front crimson-guard)": [[20, "v1", "art-joint-anim"]], - "(method 7 crimson-guard)": [ - [19, "t9", "(function process-drawable int process-drawable)"] - ], "(code attack crimson-guard)": [ [351, "a0", "process-focusable"], [380, "v1", "art-joint-anim"], @@ -8462,9 +8214,6 @@ [66, "v0", "vector"], [56, "gp", "process-focusable"] ], - "(method 7 metalhead-predator)": [ - [9, "t9", "(function process-drawable int process-drawable)"] - ], "(method 205 metalhead-predator)": [[4, "v1", "collide-shape-prim-group"]], "(code close-attack metalhead-predator)": [ [15, "v1", "art-joint-anim"], @@ -8631,15 +8380,7 @@ "hover-enemy-manager-post": [ [6, "t9", "(function hover-formation-control none)"] ], - "(method 7 hover-enemy-manager)": [ - [21, "t9", "(function process int process)"] - ], - "(method 35 turret)": [[55, "t9", "(function base-turret none)"]], - "(enter die turret)": [[11, "v0", "(state base-turret)"]], - "(exit active turret)": [[4, "v0", "(state base-turret)"]], "(post active turret)": [ - [4, "v0", "(state base-turret)"], - [6, "t9", "(function none)"], [112, "v0", "int"], [134, "v0", "int"], [157, "v0", "int"] @@ -8667,8 +8408,7 @@ "(method 78 wasp)": [[11, "v1", "art-joint-anim"]], "(trans hostile wasp)": [[36, "v1", "art-joint-anim"]], "(method 52 wasp)": [ - [21, "a1", "process-focusable"], - [99, "t9", "(function enemy vector none)"] + [21, "a1", "process-focusable"] ], "(method 115 crimson-guard-hover)": [ ["_stack_", 16, "res-tag"], @@ -8680,59 +8420,33 @@ [162, "v0", "(pointer float)"], [188, "v0", "(pointer float)"] ], - "(enter flying-death crimson-guard-hover)": [ - [4, "v0", "(state hover-enemy)"] - ], "(code knocked-recover crimson-guard-hover)": [[20, "v1", "art-joint-anim"]], "(code attack crimson-guard-hover)": [[56, "v1", "art-joint-anim"]], "(trans hostile crimson-guard-hover)": [[22, "gp", "process-focusable"]], - "(enter flying-death-explode crimson-guard-hover)": [ - [4, "v0", "(state hover-enemy)"] - ], + "(post notice crimson-guard-hover)": [[4, "t9", "(function none)"]], + "(post ambush-attack crimson-guard-hover)": [[66, "t9", "(function none)"]], "(code flying-death crimson-guard-hover)": [ [17, "v1", "art-joint-anim"], [70, "v1", "art-joint-anim"] ], - "(enter knocked crimson-guard-hover)": [[4, "v0", "(state hover-enemy)"]], "(post kick-attack crimson-guard-hover)": [ [34, "a0", "process-focusable"], [37, "a0", "process-focusable"] ], - "(post notice crimson-guard-hover)": [[4, "t9", "(function none)"]], - "(post ambush-attack crimson-guard-hover)": [[66, "t9", "(function none)"]], "(code ambush-attack crimson-guard-hover)": [[37, "v1", "art-joint-anim"]], "(trans ambush-fly crimson-guard-hover)": [[47, "gp", "process-focusable"]], "(method 74 crimson-guard-hover)": [ [9, "v1", "attack-info"], - [ - 124, - "t9", - "(function enemy process int symbol event-message-block object)" - ], [131, "a0", "symbol"], [132, "v1", "process-focusable"], - [135, "v1", "process-focusable"], - [ - 170, - "t9", - "(function enemy process int symbol event-message-block object)" - ], - [ - 182, - "t9", - "(function enemy process int symbol event-message-block object)" - ] + [135, "v1", "process-focusable"] ], "(method 162 crimson-guard-hover)": [ [31, "a0", "process-focusable"], [34, "a0", "process-focusable"] ], "(method 52 crimson-guard-hover)": [ - [21, "a1", "process-focusable"], - [99, "t9", "(function hover-enemy vector none)"] - ], - "(method 135 crimson-guard-hover)": [ - [34, "t9", "(function enemy int sound-id)"] + [21, "a1", "process-focusable"] ], "(method 77 crimson-guard-hover)": [ [19, "v1", "art-joint-anim"], @@ -8744,9 +8458,6 @@ [64, "v1", "art-joint-anim"], [95, "v1", "art-joint-anim"] ], - "(method 7 flamer)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], "(method 74 flamer)": [[78, "v1", "vector"]], "(trans hostile flamer)": [ [20, "a0", "process-focusable"], @@ -8784,7 +8495,6 @@ [47, "a0", "list-node"] ], "(method 13 hover-nav-control)": [["_stack_", 144, "float"]], - "(method 10 jellyfish)": [[10, "t9", "(function process-drawable none)"]], "(code grab-mech jellyfish)": [ [48, "v1", "art-joint-anim"], [155, "v1", "art-joint-anim"], @@ -8836,14 +8546,10 @@ [28, "v1", "drill-barons-ship"] ], "drill-barons-ship-explode-init-by-other": [[25, "a0", "process-drawable"]], - "(method 31 drill-ship-shot)": [[7, "t9", "(function guard-shot none)"]], "drill-barons-ship-turret-init-by-other": [ [117, "a0", "drill-barons-ship"], [126, "v1", "drill-barons-ship"] ], - "(method 7 drill-barons-ship-turret)": [ - [30, "t9", "(function process-drawable int process-drawable)"] - ], "(trans going-down drill-barons-ship-turret)": [ [9, "a1", "drill-barons-ship"], [14, "v1", "drill-barons-ship"], @@ -8885,9 +8591,6 @@ ["_stack_", 16, "res-tag"] ], "(post running cboss-elevator)": [[4, "t9", "(function none)"]], - "(method 10 cboss-elevator)": [ - [10, "t9", "(function process-drawable none)"] - ], "(method 77 krew-boss)": [[45, "v1", "art-joint-anim"]], "(method 78 krew-boss)": [[28, "v1", "art-joint-anim"]], "(method 74 krew-boss-clone)": [[98, "v1", "art-joint-anim"]], @@ -8898,7 +8601,6 @@ [69, "v1", "art-joint-anim"] ], "(enter die krew-boss-clone)": [[86, "v1", "collectable"]], - "(method 31 krew-boss-shot)": [[7, "t9", "(function projectile none)"]], "(code die krew-boss)": [[41, "v1", "art-joint-anim"]], "(trans hostile krew-boss)": [ [14, "a0", "process-focusable"], @@ -9536,10 +9238,6 @@ [41, "v1", "race-mesh-slice"], [45, "v1", "race-path-edge-info"] ], - "(method 7 vehicle-race-bike)": [ - [14, "t9", "(function process-drawable int process-drawable)"] - ], - "(method 10 race-manager)": [[30, "t9", "(function process none)"]], "(method 18 race-state)": [[111, "a3", "process-drawable"]], "(method 11 race-state)": [ [131, "s5", "process-focusable"], @@ -9557,7 +9255,6 @@ "(method 21 race-manager)": [[127, "s2", "race-racer-info"]], "(code fall pal-flip-step)": [[10, "v1", "art-joint-anim"]], "(method 11 pal-flip-step)": [[121, "v1", "art-joint-anim"]], - "(method 10 pal-rot-gun)": [[13, "t9", "(function process-drawable none)"]], "(event idle pal-electric-fan)": [ [29, "gp", "process-focusable"], [67, "gp", "process-focusable"] @@ -9596,9 +9293,6 @@ [64, "v1", "art-joint-anim"], [116, "v1", "art-joint-anim"] ], - "(method 10 forest-youngsamos)": [ - [40, "t9", "(function process-focusable none)"] - ], "forest-youngsamos-bounce-reaction": [[18, "v0", "(array sound-name)"]], "defend-stadium-rift-rider-handler": [ [96, "s4", "process-drawable"], @@ -9613,7 +9307,6 @@ ["_stack_", 16, "res-tag"], ["_stack_", 32, "res-tag"] ], - "(method 7 hosehead)": [[31, "t9", "(function process-drawable int none)"]], "(code debug-control hosehead)": [[20, "v1", "art-joint-anim"]], "(code notice hosehead)": [ [33, "v1", "art-joint-anim"], diff --git a/decompiler/level_extractor/BspHeader.cpp b/decompiler/level_extractor/BspHeader.cpp index 98f2f4b2e41..5b00795b389 100644 --- a/decompiler/level_extractor/BspHeader.cpp +++ b/decompiler/level_extractor/BspHeader.cpp @@ -2023,8 +2023,8 @@ void DrawableInlineArrayActor::read_from_file(TypedRef ref, void CollideHash::read_from_file(TypedRef ref, const decompiler::DecompilerTypeSystem& dts, - level_tools::DrawStats* stats, - GameVersion version) { + level_tools::DrawStats* /*stats*/, + GameVersion /*version*/) { num_items = read_plain_data_field(ref, "num-items", dts); item_array = deref_label(get_field_ref(ref, "item-array", dts)); } diff --git a/decompiler/types2/ForwardProp.cpp b/decompiler/types2/ForwardProp.cpp index 32423097acb..5226f6bda61 100644 --- a/decompiler/types2/ForwardProp.cpp +++ b/decompiler/types2/ForwardProp.cpp @@ -138,6 +138,8 @@ std::optional try_get_type_symbol_val(const std::string& name, return TP_Type::make_run_function_in_process_function(); } else if (name == "set-to-run" && env.func->name() != "enter-state") { return TP_Type::make_set_to_run_function(); + } else if (name == "find-parent-method") { + return TP_Type::make_find_parent_method_function(); } // look up the type of the symbol @@ -2441,10 +2443,6 @@ void CallOp::propagate_types2(types2::Instruction& instr, in_type = TypeSpec("function", new_arg_types); } - if (in_type.arg_count() < 1) { - throw std::runtime_error("Called a function, but we do not know its type"); - } - // special case: variable argument count if (in_type.arg_count() == 2 && in_type.get_arg(0) == TypeSpec("_varargs_")) { can_backprop = false; // for now... can special case this later. @@ -2510,12 +2508,78 @@ void CallOp::propagate_types2(types2::Instruction& instr, arg_type.print()); } } + bool use_normal_last_arg = true; + + if (in_tp.kind == TP_Type::Kind::FIND_PARENT_METHOD_FUNCTION) { + bool can_use_call_parent = true; + TypeSpec call_parent_result_type; + const auto& guessed_name = env.func->guessed_name; + + if (guessed_name.kind == FunctionName::FunctionKind::METHOD || + guessed_name.kind == FunctionName::FunctionKind::V_STATE) { + // should call something like: + // (find-parent-method sharkey 39) + const auto& type_arg = input_types[Register(Reg::GPR, arg_regs[0])]->type; + if (can_use_call_parent && type_arg->kind != TP_Type::Kind::TYPE_OF_TYPE_NO_VIRTUAL) { + lg::warn( + "Can't use call-parent-method because the first argument to find-parent-method is a " + "{}, which should be a type", + type_arg->print()); + can_use_call_parent = false; + } + + if (can_use_call_parent && type_arg->get_type_objects_typespec() != guessed_name.type_name) { + lg::warn( + "Can't use call-parent-method because the first argument type is wrong: got {}, but " + "expected {}", + type_arg->get_type_objects_typespec().print(), guessed_name.type_name); + can_use_call_parent = false; + } + const auto& id_arg = input_types[Register(Reg::GPR, arg_regs[1])]->type; + int expected_id = -1; + if (guessed_name.kind == FunctionName::FunctionKind::V_STATE) { + auto state_info = dts.ts.lookup_method(guessed_name.type_name, guessed_name.state_name); + expected_id = state_info.id; + call_parent_result_type = + state_info.type.substitute_for_method_call(guessed_name.type_name); + } else { + expected_id = guessed_name.method_id; + call_parent_result_type = env.func->type; // same type as this method! + } + if (can_use_call_parent && !id_arg->is_integer_constant(expected_id)) { + lg::warn( + "Can't use call-parent-method because the second argument is wrong: got {}, but " + "expected a constant integer {}", + id_arg->print(), expected_id); + can_use_call_parent = false; + } + + } else { + can_use_call_parent = false; + lg::warn( + "Can't use call-parent-method because find-parent-method was called in {}, which isn't a " + "method or state handler.", + env.func->name()); + } + + if (can_use_call_parent) { + out_types[Register(Reg::GPR, Reg::V0)]->type = TP_Type::make_from_ts(call_parent_result_type); + printf("used special %s\n", call_parent_result_type.print().c_str()); + use_normal_last_arg = false; + } + } + + if (in_type.arg_count() < 1) { + throw std::runtime_error("Called a function, but we do not know its type"); + } + + if (use_normal_last_arg) { + out_types[Register(Reg::GPR, Reg::V0)]->type = TP_Type::make_from_ts(in_type.last_arg()); + } // set the call type! m_call_type = in_type; m_call_type_set = true; - out_types[Register(Reg::GPR, Reg::V0)]->type = TP_Type::make_from_ts(in_type.last_arg()); - if (in_tp.kind == TP_Type::Kind::NON_OBJECT_NEW_METHOD && in_tp.method_from_type() == TypeSpec("array") && input_types[Register(Reg::GPR, arg_regs[2])]) { diff --git a/decompiler/util/TP_Type.cpp b/decompiler/util/TP_Type.cpp index 601e8f0a9db..60d6c1730f3 100644 --- a/decompiler/util/TP_Type.cpp +++ b/decompiler/util/TP_Type.cpp @@ -82,6 +82,8 @@ std::string TP_Type::print() const { return ""; case Kind::GET_ART_BY_NAME_METHOD: return ""; + case Kind::FIND_PARENT_METHOD_FUNCTION: + return ""; case Kind::SYMBOL: return fmt::format("", m_str); case Kind::INVALID: @@ -146,6 +148,7 @@ bool TP_Type::operator==(const TP_Type& other) const { case Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION: case Kind::SET_TO_RUN_FUNCTION: case Kind::GET_ART_BY_NAME_METHOD: + case Kind::FIND_PARENT_METHOD_FUNCTION: return true; case Kind::INVALID: default: @@ -215,6 +218,9 @@ TypeSpec TP_Type::typespec() const { case Kind::SET_TO_RUN_FUNCTION: // give a general function so we can't call it normally. return TypeSpec("function"); + case Kind::FIND_PARENT_METHOD_FUNCTION: + // hard-coded here. Needed so that we can properly analyze reg use for the call. + return TypeSpec("function", {TypeSpec("type"), TypeSpec("int"), TypeSpec("function")}); case Kind::GET_ART_BY_NAME_METHOD: return m_ts; case Kind::SYMBOL: diff --git a/decompiler/util/TP_Type.h b/decompiler/util/TP_Type.h index f8ffe87e7be..1898f3c9a75 100644 --- a/decompiler/util/TP_Type.h +++ b/decompiler/util/TP_Type.h @@ -44,6 +44,7 @@ class TP_Type { SET_TO_RUN_FUNCTION, GET_ART_BY_NAME_METHOD, SYMBOL, + FIND_PARENT_METHOD_FUNCTION, INVALID } kind = Kind::UNINITIALIZED; TP_Type() = default; @@ -78,6 +79,7 @@ class TP_Type { case Kind::SET_TO_RUN_FUNCTION: case Kind::GET_ART_BY_NAME_METHOD: case Kind::NON_OBJECT_NEW_METHOD: + case Kind::FIND_PARENT_METHOD_FUNCTION: case Kind::SYMBOL: return false; case Kind::UNINITIALIZED: @@ -323,6 +325,12 @@ class TP_Type { return result; } + static TP_Type make_find_parent_method_function() { + TP_Type result; + result.kind = Kind::FIND_PARENT_METHOD_FUNCTION; + return result; + } + const TypeSpec& get_objects_typespec() const { ASSERT(kind == Kind::TYPESPEC || kind == Kind::INTEGER_CONSTANT_PLUS_VAR); return m_ts; diff --git a/game/kernel/jak2/klisten.cpp b/game/kernel/jak2/klisten.cpp index b3dea6ece61..4bcef8115f2 100644 --- a/game/kernel/jak2/klisten.cpp +++ b/game/kernel/jak2/klisten.cpp @@ -178,7 +178,7 @@ int sql_query_sync(Ptr string_in) { auto new_result_ptr = call_method_of_type_arg2(intern_from_c("debug").offset, type, GOAL_NEW_METHOD, type.offset, results.size()); SQLResult* new_result = Ptr(new_result_ptr).c(); - for (int i = 0; i < results.size(); i++) { + for (int i = 0; i < (int)results.size(); i++) { new_result->data[i] = Ptr(make_debug_string_from_c(results.at(i).data())); } new_result->len = results.size(); diff --git a/goal_src/jak1/engine/common-obs/collectables.gc b/goal_src/jak1/engine/common-obs/collectables.gc index 73d0562f02f..ed41c7de494 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 fc46bfed423..17e584aef6e 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 bfd3c0e8736..6e79103e785 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 9d28a7110f5..d703c928b33 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 6eeedf12ad4..4ad351cd0dd 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 b8ab1c2f273..7011cb998ab 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 a1a23bf596a..aa64657e579 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 ca0e63387c2..d7aff099656 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 96cb58bfd24..206495c40e4 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 56334995a70..18e93e14698 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 1b948f8fb27..c38245c3b47 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 22d17078a2e..c6c122ffe5e 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 08cdb42588b..d94a2d31e21 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 7301dd672e7..da6dca2f611 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 fd041ee21b2..b49021b6ff7 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 71d97713ffa..50eaa72746e 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 094bf305c8f..de888e5806b 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 e4b3926299b..3cbbea8b313 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 3e308f0c2df..80ec11dc438 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 69bcaa6475d..9c0b07c4385 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 5958f1950c0..0711f749f2a 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 831efc24455..93c3dd10382 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 8500fbd5eaa..f94e7bc2301 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 9e8534afc2f..a6accc39460 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 7d34a1fe277..7591d10d4c6 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 ba4adeab9bc..622e6cf9424 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 18fdef3ccbf..47b43e41f0c 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 49664b0e323..c078bb76883 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 182b9a4798b..95d2a251fee 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 fa1db29ed19..2d6322888a7 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 e85f00c2c1a..f41bd8aef0d 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 7fe96af989e..1830f3606f6 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 82b27c87ed3..bb46873783b 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 120f71801c1..ccbf5313c9a 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 995a473cc66..37696e6add6 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 6e6bcba1dfe..792f80fdc7f 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 46dd85e8e49..ebd02e0ef11 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 b6cc6bf9611..58817f53701 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 b3811611b8b..ad2e9bc04a5 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 131f7037702..41730670f63 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 1f5eb4f5e54..d51e5ae9e4b 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 b586d61d922..b55a31ab7b3 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 4bf8e2f92ca..70a1b78d0f4 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 4b0c15185b7..43d2beed5be 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 65ac57a1635..15f099c0395 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 75e35b45d6a..79329cdbc2a 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 9edcf2640f2..4ee9f2be26f 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 ac800315f9d..8bb613a26db 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 9caae1fa299..3c19dafebda 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 27b69218344..c3546b71670 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 f5625fa8cbb..7884b267ce9 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 05be0d3d1b1..74c2ce8d5c7 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 f99a5f7d068..96abe2e2aac 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 5af193d4c6a..68d012090a8 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 66164dbaf48..c1e07cf0c76 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 9a528031753..83a098b0891 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/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index 81212b5825e..2b83f0a1d7f 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -24,15 +24,11 @@ ) ) -;; WARN: Return type mismatch process-focusable vs enemy. (defmethod relocate enemy ((this enemy) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) - (the-as - enemy - ((the-as (function process-focusable int process-focusable) (find-parent-method enemy 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod get-rand-float enemy ((this enemy)) diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index bd26e93db0e..1ad337542cd 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -259,7 +259,7 @@ (defmethod deactivate talker ((this talker)) (send-event (handle->process (-> this voicebox)) 'die) - ((the-as (function process none) (find-parent-method talker 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index 11e3799df1c..2e860ddb1a6 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -1231,7 +1231,7 @@ (if (not (logtest? (-> self fact options) (actor-option no-reaction))) (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) ) - (let ((t9-2 (-> (the-as state (find-parent-method eco 26)) code))) + (let ((t9-2 (-> (the-as state (find-parent-state)) code))) (if t9-2 ((the-as (function none) t9-2)) ) @@ -1668,7 +1668,7 @@ This commonly includes things such as: (defmethod deactivate gem ((this gem)) (+! (-> *game-info* live-gem-count) -1) - ((the-as (function gem none) (find-parent-method gem 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/engine/common_objs/conveyor.gc b/goal_src/jak2/engine/common_objs/conveyor.gc index d0fd988a80f..05a04d01998 100644 --- a/goal_src/jak2/engine/common_objs/conveyor.gc +++ b/goal_src/jak2/engine/common_objs/conveyor.gc @@ -57,13 +57,9 @@ ) -;; WARN: Return type mismatch process-drawable vs conveyor. (defmethod relocate conveyor ((this conveyor) (new-addr int)) (&+! (-> this sections) new-addr) - (the-as - conveyor - ((the-as (function process-drawable int process-drawable) (find-parent-method conveyor 7)) this new-addr) - ) + (call-parent-method this new-addr) ) ;; WARN: Return type mismatch symbol vs art-group. diff --git a/goal_src/jak2/engine/common_objs/elevator.gc b/goal_src/jak2/engine/common_objs/elevator.gc index 8cf98535585..574095e0935 100644 --- a/goal_src/jak2/engine/common_objs/elevator.gc +++ b/goal_src/jak2/engine/common_objs/elevator.gc @@ -760,12 +760,11 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -;; WARN: Return type mismatch base-plat vs elevator. (defmethod relocate elevator ((this elevator) (arg0 int)) (if (nonzero? (-> this path-seq)) (&+! (-> this path-seq) arg0) ) - (the-as elevator ((the-as (function base-plat int base-plat) (find-parent-method elevator 7)) this arg0)) + (call-parent-method this arg0) ) (defmethod activate-elevator elevator ((this elevator)) diff --git a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc index c6646fef323..843d2c9c909 100644 --- a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc +++ b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc @@ -73,18 +73,11 @@ ) -;; WARN: Return type mismatch rigid-body-object vs rigid-body-platform. (defmethod relocate rigid-body-platform ((this rigid-body-platform) (new-addr int)) (if (nonzero? (-> this control-point-array)) (&+! (-> this control-point-array) new-addr) ) - (the-as - rigid-body-platform - ((the-as (function rigid-body-object int rigid-body-object) (find-parent-method rigid-body-platform 7)) - this - new-addr - ) - ) + (call-parent-method this new-addr) ) (defmethod rigid-body-platform-method-53 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) diff --git a/goal_src/jak2/engine/common_objs/water-anim.gc b/goal_src/jak2/engine/common_objs/water-anim.gc index eb05d42105c..91e5ad29863 100644 --- a/goal_src/jak2/engine/common_objs/water-anim.gc +++ b/goal_src/jak2/engine/common_objs/water-anim.gc @@ -45,7 +45,7 @@ (if (nonzero? (-> this flow)) (&+! (-> this flow) arg0) ) - ((the-as (function water-anim int water-anim) (find-parent-method water-anim 7)) this arg0) + (call-parent-method this arg0) ) (defskelgroup skel-water-anim-nest-dark-eco-largepool water-anim-nest-dark-eco water-anim-nest-dark-eco-largepool-lod0-jg -1 diff --git a/goal_src/jak2/engine/common_objs/water-flow.gc b/goal_src/jak2/engine/common_objs/water-flow.gc index 5737f0c52f9..f5ba23f9e54 100644 --- a/goal_src/jak2/engine/common_objs/water-flow.gc +++ b/goal_src/jak2/engine/common_objs/water-flow.gc @@ -68,7 +68,7 @@ (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) - ((the-as (function flow-control int flow-control) (find-parent-method flow-control 7)) this arg0) + (call-parent-method this arg0) ) (defmethod draw-path flow-control ((this flow-control)) diff --git a/goal_src/jak2/engine/debug/editable.gc b/goal_src/jak2/engine/debug/editable.gc index c8da3fdb038..d8580ae0711 100644 --- a/goal_src/jak2/engine/debug/editable.gc +++ b/goal_src/jak2/engine/debug/editable.gc @@ -736,10 +736,7 @@ ) ) ) - ((the-as (function editable-point editable-command none) (find-parent-method editable-point 28)) - this - (the-as editable-command arg0) - ) + (call-parent-method this arg0) 0 (none) ) @@ -1038,7 +1035,7 @@ ;; WARN: Function (method 25 editable-light) has a return type of none, but the expression builder found a return statement. (defmethod editable-method-25 editable-light ((this editable-light) (arg0 editable-array)) - ((the-as (function editable-light editable-array none) (find-parent-method editable-light 25)) this arg0) + (call-parent-method this arg0) (when (nonzero? (-> this id)) (let ((s5-1 (clear *temp-string*))) (format s5-1 "delete from light where light_id=~D" (-> this id)) @@ -1203,7 +1200,7 @@ (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) ) ) - ((the-as (function editable-face editable-array none) (find-parent-method editable-face 25)) this arg0) + (call-parent-method this arg0) (none) ) @@ -1231,13 +1228,7 @@ ;; WARN: Return type mismatch editable-face vs editable. (defmethod editable-method-27 editable-face ((this editable-face) (arg0 editable-array)) - (let ((gp-1 - (the-as - editable-face - ((the-as (function editable-face editable-array editable) (find-parent-method editable-face 27)) this arg0) - ) - ) - ) + (let ((gp-1 (the-as editable-face (call-parent-method this arg0)))) (dotimes (s4-0 (-> gp-1 length)) (set! (-> gp-1 vertex s4-0) (the-as editable-point (editable-method-27 (-> gp-1 vertex s4-0) arg0))) (set! (-> gp-1 vertex s4-0 owner) (cons gp-1 (-> gp-1 vertex s4-0 owner))) diff --git a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc index 4a5d9f595f1..49962abe95a 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -162,12 +162,8 @@ (none) ) -;; WARN: Return type mismatch none vs nav-graph-editor. (defmethod relocate nav-graph-editor ((this nav-graph-editor) (arg0 int)) - (the-as - nav-graph-editor - ((the-as (function process int none) (find-parent-method nav-graph-editor 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch symbol vs none. diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index 71512ae21b3..2a12574afbd 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -1683,7 +1683,6 @@ ) ) -;; WARN: Return type mismatch process vs none. (defmethod deactivate fail-mission ((this fail-mission)) (set-filter-color! 1.0 1.0 1.0) (sound-group-continue (sound-group sfx music dialog sog3 ambient dialog2 sog6 sog7)) @@ -1691,7 +1690,7 @@ (update-rates! (-> *display* entity-clock) 1.0) (update-rates! (-> *display* target-clock) 1.0) (update-rates! (-> *display* camera-clock) 1.0) - ((the-as (function process process) (find-parent-method fail-mission 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc index 81084d1fad1..4e7571235bd 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc @@ -735,7 +735,7 @@ (defmethod dump-grid-info sphere-hash ((this sphere-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" - ((the (function sphere-hash none) (find-parent-method sphere-hash 15)) this) + (call-parent-method this) (new 'stack-no-clear 'vector) (let ((f30-0 6144.0)) (set! (-> this work temp-box-min quad) (-> (target-pos 0) quad)) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index 5f6306022a7..5cdbd839305 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -3310,7 +3310,7 @@ ) (set! (-> *setting-control* cam-default mode-name) #f) (set-zero! *camera-smush-control*) - ((the-as (function target none) (find-parent-method target 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index 4ba6329a895..32a2d8cab04 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -54,7 +54,7 @@ (stereo-mode-backup int32 :offset-assert 216) (secrets-unlocked symbol :offset-assert 220) (missions-total-spacing float :offset-assert 224) - (clear-screen symbol :offset-assert 228) + (clear-screen symbol :offset-assert 228) ) :method-count-assert 9 :size-assert #xe8 @@ -470,7 +470,7 @@ (enable-level-text-file-loading) (persist-with-delay *setting-control* 'allow-progress (seconds 0.1) 'allow-progress #f 0.0 0) (persist-with-delay *setting-control* 'allow-pause (seconds 0.1) 'allow-pause #f 0.0 0) - ((the-as (function progress none) (find-parent-method progress 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/kernel/gcommon.gc b/goal_src/jak2/kernel/gcommon.gc index d7d5037abae..8c3b8d42021 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 52c6400fedc..4a01bd3e939 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/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index 9db0f871cc7..d93c6843333 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -805,21 +805,17 @@ This commonly includes things such as: (defmethod deactivate slider ((this slider)) (sound-stop (the-as sound-id (-> this sound-id))) - ((the-as (function process-drawable none) (find-parent-method slider 10)) this) + (call-parent-method this) (none) ) -;; WARN: Return type mismatch process-drawable vs slider. (defmethod relocate slider ((this slider) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this l-bolts v1-0)) (&+! (-> this l-bolts v1-0) arg0) ) ) - (the-as - slider - ((the-as (function process-drawable int process-drawable) (find-parent-method slider 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/atoll/juicer.gc b/goal_src/jak2/levels/atoll/juicer.gc index 3d3dcb6900a..a86e9a68ce1 100644 --- a/goal_src/jak2/levels/atoll/juicer.gc +++ b/goal_src/jak2/levels/atoll/juicer.gc @@ -1738,7 +1738,6 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs juicer. (defmethod relocate juicer ((this juicer) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) @@ -1746,10 +1745,7 @@ (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - juicer - ((the-as (function process-focusable int process-focusable) (find-parent-method juicer 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! juicer ((this juicer)) diff --git a/goal_src/jak2/levels/castle/boss/castle-baron.gc b/goal_src/jak2/levels/castle/boss/castle-baron.gc index 2399aef37cb..6cdf73479fd 100644 --- a/goal_src/jak2/levels/castle/boss/castle-baron.gc +++ b/goal_src/jak2/levels/castle/boss/castle-baron.gc @@ -110,7 +110,7 @@ This commonly includes things such as: (defmethod deactivate cboss-elevator ((this cboss-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method cboss-elevator 10)) this) + (call-parent-method this) (none) ) @@ -1353,7 +1353,7 @@ For example for an elevator pre-compute the distance between the first and last (defmethod init-proj-settings! krew-boss-shot ((this krew-boss-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method krew-boss-shot 31)) this) + (call-parent-method this) (set! (-> this move) krew-boss-shot-move) (set! (-> this max-speed) 245760.0) (set! (-> this timeout) (seconds 5)) diff --git a/goal_src/jak2/levels/castle/castle-obs.gc b/goal_src/jak2/levels/castle/castle-obs.gc index 348d55296e9..79b31c7263d 100644 --- a/goal_src/jak2/levels/castle/castle-obs.gc +++ b/goal_src/jak2/levels/castle/castle-obs.gc @@ -79,7 +79,7 @@ This commonly includes things such as: (defmethod deactivate cas-conveyor ((this cas-conveyor)) (sound-stop (-> this sound-id)) - ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) this) + (call-parent-method this) (none) ) @@ -935,7 +935,7 @@ This commonly includes things such as: (defmethod deactivate cas-elevator ((this cas-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function elevator none) (find-parent-method cas-elevator 10)) this) + (call-parent-method this) (none) ) @@ -1987,7 +1987,7 @@ This commonly includes things such as: (defmethod deactivate cas-rot-blade ((this cas-rot-blade)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method cas-rot-blade 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/castle/pad/caspad-obs.gc b/goal_src/jak2/levels/castle/pad/caspad-obs.gc index c56edebe077..1a4b87f6e84 100644 --- a/goal_src/jak2/levels/castle/pad/caspad-obs.gc +++ b/goal_src/jak2/levels/castle/pad/caspad-obs.gc @@ -152,7 +152,7 @@ (defmethod deactivate cpad-elevator ((this cpad-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function elevator none) (find-parent-method cpad-elevator 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/castle/roboguard-level.gc b/goal_src/jak2/levels/castle/roboguard-level.gc index 2d27093fca4..41cf8afbdf4 100644 --- a/goal_src/jak2/levels/castle/roboguard-level.gc +++ b/goal_src/jak2/levels/castle/roboguard-level.gc @@ -334,9 +334,9 @@ (defstate ambush (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 44)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (logand! (-> self flags) -9) @@ -402,9 +402,9 @@ (defstate idle (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 31)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -490,9 +490,9 @@ (defstate stare (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 35)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -753,9 +753,9 @@ (defstate die (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 38)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -1186,16 +1186,12 @@ (defmethod deactivate roboguard-level ((this roboguard-level)) (sound-stop (-> this roll-sound)) - ((the-as (function nav-enemy none) (find-parent-method roboguard-level 10)) this) + (call-parent-method this) (none) ) -;; WARN: Return type mismatch nav-enemy vs roboguard-level. (defmethod relocate roboguard-level ((this roboguard-level) (arg0 int)) - (the-as - roboguard-level - ((the-as (function nav-enemy int nav-enemy) (find-parent-method roboguard-level 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy-collision! roboguard-level ((this roboguard-level)) diff --git a/goal_src/jak2/levels/city/bombbot/bombbot.gc b/goal_src/jak2/levels/city/bombbot/bombbot.gc index 18d096f405f..8e9b8c6dd6f 100644 --- a/goal_src/jak2/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak2/levels/city/bombbot/bombbot.gc @@ -2163,7 +2163,6 @@ ) ) -;; WARN: Return type mismatch nav-enemy vs bombbot. (defmethod relocate bombbot ((this bombbot) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this joint-ik v1-0)) @@ -2173,7 +2172,7 @@ (if (nonzero? (-> this rigidbody)) (&+! (-> this rigidbody) arg0) ) - (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) this arg0)) + (call-parent-method this arg0) ) (defmethod init-enemy-collision! bombbot ((this bombbot)) diff --git a/goal_src/jak2/levels/city/ctywide-obs.gc b/goal_src/jak2/levels/city/ctywide-obs.gc index 5828a1e4181..4a08280009f 100644 --- a/goal_src/jak2/levels/city/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/ctywide-obs.gc @@ -2019,7 +2019,6 @@ This commonly includes things such as: ) ) -;; WARN: Return type mismatch process-focusable vs cty-guard-turret. (defmethod relocate cty-guard-turret ((this cty-guard-turret) (arg0 int)) (if (nonzero? (-> this jm-turret)) (&+! (-> this jm-turret) arg0) @@ -2030,13 +2029,7 @@ This commonly includes things such as: (if (nonzero? (-> this jm-gunsR)) (&+! (-> this jm-gunsR) arg0) ) - (the-as - cty-guard-turret - ((the-as (function process-focusable int process-focusable) (find-parent-method cty-guard-turret 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) (defmethod cty-guard-turret-method-32 cty-guard-turret ((this cty-guard-turret)) @@ -3927,7 +3920,6 @@ This commonly includes things such as: (none) ) -;; WARN: Return type mismatch process-drawable vs barons-ship-lores. (defmethod relocate barons-ship-lores ((this barons-ship-lores) (arg0 int)) (if (nonzero? (-> this paths 0)) (&+! (-> this paths 0) arg0) @@ -3938,10 +3930,7 @@ This commonly includes things such as: (if (nonzero? (-> this paths 2)) (&+! (-> this paths 2) arg0) ) - (the-as - barons-ship-lores - ((the-as (function process-drawable int process-drawable) (find-parent-method barons-ship-lores 7)) this arg0) - ) + (call-parent-method this arg0) ) (defstate idle (barons-ship-lores) diff --git a/goal_src/jak2/levels/city/traffic/citizen/guard.gc b/goal_src/jak2/levels/city/traffic/citizen/guard.gc index a565e261991..ef83e7aae19 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/guard.gc @@ -3705,7 +3705,6 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs crimson-guard. (defmethod relocate crimson-guard ((this crimson-guard) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) @@ -3713,10 +3712,7 @@ (if (nonzero? (-> this l-control)) (&+! (-> this l-control) arg0) ) - (the-as - crimson-guard - ((the-as (function process-drawable int process-drawable) (find-parent-method crimson-guard 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! crimson-guard ((this crimson-guard)) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc index 750a2dc3e88..3e8e6c775a5 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc @@ -1096,15 +1096,8 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs metalhead-predator. (defmethod relocate metalhead-predator ((this metalhead-predator) (arg0 int)) - (the-as - metalhead-predator - ((the-as (function process-drawable int process-drawable) (find-parent-method metalhead-predator 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! metalhead-predator ((this metalhead-predator)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc index 3e32a5fff79..c681da46de6 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc @@ -920,7 +920,7 @@ (defmethod do-engine-sounds bike-base ((this bike-base)) - ((the-as (function object none) (find-parent-method bike-base 36)) this) + (call-parent-method this) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (if (zero? (-> this roll-sound-id)) (set! (-> this roll-sound-id) (new-sound-id)) @@ -952,7 +952,7 @@ ) (defmethod draw-thrusters bike-base ((this bike-base)) - ((the-as (function object none) (find-parent-method bike-base 85)) this) + (call-parent-method this) (when (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 3))) (let* ((v1-4 (the-as object (-> s5-0 0 vector 2))) @@ -1047,7 +1047,7 @@ (if (nonzero? (-> this brake-r)) (&+! (-> this brake-r) arg0) ) - ((the-as (function object int bikea) (find-parent-method bikea 7)) this arg0) + (call-parent-method this arg0) ) (defmethod allocate-and-init-cshape bikea ((this bikea)) @@ -1181,7 +1181,7 @@ (if (nonzero? (-> this flap-r)) (&+! (-> this flap-r) arg0) ) - ((the-as (function object int bikeb) (find-parent-method bikeb 7)) this arg0) + (call-parent-method this arg0) ) (defmethod allocate-and-init-cshape bikeb ((this bikeb)) @@ -1329,7 +1329,7 @@ (if (nonzero? (-> this spoiler-r)) (&+! (-> this spoiler-r) arg0) ) - ((the-as (function object int bikec) (find-parent-method bikec 7)) this arg0) + (call-parent-method this arg0) ) (defmethod allocate-and-init-cshape bikec ((this bikec)) @@ -1464,7 +1464,7 @@ (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) - ((the-as (function object int guard-bike) (find-parent-method guard-bike 7)) this arg0) + (call-parent-method this arg0) ) (defmethod start-jump guard-bike ((this guard-bike)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/car.gc b/goal_src/jak2/levels/city/traffic/vehicle/car.gc index fc52f261f44..115fb619ed9 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/car.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/car.gc @@ -1170,7 +1170,7 @@ (if (nonzero? (-> this rudder-r)) (&+! (-> this rudder-r) arg0) ) - ((the-as (function object object cara) (find-parent-method cara 7)) this arg0) + (call-parent-method this arg0) ) (defmethod allocate-and-init-cshape cara ((this cara)) @@ -1310,7 +1310,7 @@ (if (nonzero? (-> this fin-rr)) (&+! (-> this fin-rr) arg0) ) - ((the-as (function object object carb) (find-parent-method carb 7)) this arg0) + (call-parent-method this arg0) ) (defmethod allocate-and-init-cshape carb ((this carb)) @@ -1427,7 +1427,6 @@ ) -;; WARN: Return type mismatch carb vs carc. (defmethod relocate carc ((this carc) (arg0 int)) (if (nonzero? (-> this steering-wheel)) (&+! (-> this steering-wheel) arg0) @@ -1450,7 +1449,7 @@ (if (nonzero? (-> this fin2-rr)) (&+! (-> this fin2-rr) arg0) ) - (the-as carc ((the-as (function object object carb) (find-parent-method carc 7)) this arg0)) + (call-parent-method this arg0) ) (defmethod allocate-and-init-cshape carc ((this carc)) @@ -1583,7 +1582,7 @@ (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) - ((the-as (function object object hellcat) (find-parent-method hellcat 7)) this arg0) + (call-parent-method this arg0) ) (defmethod allocate-and-init-cshape hellcat ((this hellcat)) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc index 2ce98bf2b5b..ad7e77ed114 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc @@ -117,15 +117,11 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs vehicle-turret. (defmethod relocate vehicle-turret ((this vehicle-turret) (arg0 int)) (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) - (the-as - vehicle-turret - ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-turret 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod vehicle-turret-method-30 vehicle-turret ((this vehicle-turret)) @@ -271,7 +267,7 @@ (defmethod deactivate transport ((this transport)) (sound-stop (-> this ambient-sound-id)) - ((the-as (function process-drawable none) (find-parent-method transport 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc index 2e9353d7809..b597fe7c9b7 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc @@ -295,7 +295,7 @@ This commonly includes things such as: ) (defmethod vehicle-rider-method-33 citizen-norm-rider ((this citizen-norm-rider)) - ((the-as (function vehicle-rider none) (find-parent-method citizen-norm-rider 33)) this) + (call-parent-method this) (setup-masks (-> this draw) 0 -1) (setup-masks (-> this draw) 32 0) (cond @@ -394,7 +394,7 @@ This commonly includes things such as: ) (defmethod vehicle-rider-method-33 crimson-guard-rider ((this crimson-guard-rider)) - ((the-as (function vehicle-rider none) (find-parent-method crimson-guard-rider 33)) this) + (call-parent-method this) (setup-masks (-> this draw) 0 28) (setup-masks (-> this draw) 3 0) (if (logtest? (-> this flags) 4) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc index a45f78fb4f1..6cd8b67b1f3 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc @@ -152,7 +152,7 @@ (defmethod deactivate vehicle ((this vehicle)) (vehicle-method-110 this) - ((the-as (function rigid-body-object none) (find-parent-method vehicle 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc b/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc index 99fe11e6891..511562af9e5 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc @@ -369,7 +369,7 @@ (sound-play "ashelin-shot-hi") ) ((= v1-0 (projectile-options lose-altitude proj-options-2)) - ((the-as (function projectile projectile-options none) (find-parent-method ashelin-shot 28)) this arg0) + (call-parent-method this arg0) ) ) ) diff --git a/goal_src/jak2/levels/common/battle.gc b/goal_src/jak2/levels/common/battle.gc index 1f255f25c86..7b61072b6d4 100644 --- a/goal_src/jak2/levels/common/battle.gc +++ b/goal_src/jak2/levels/common/battle.gc @@ -1159,7 +1159,7 @@ (when (handle->process v0-7) (set! (-> arg0 creature) v0-7) (set! (-> arg0 mode) (the-as uint 1)) - (set! (-> arg0 last-spawn-time) (current-time)) + (set-time! (-> arg0 last-spawn-time)) ) ) ) @@ -1197,10 +1197,10 @@ (let ((v1-5 (-> arg0 noticed-attack-time))) (cond ((zero? v1-5) - (set! (-> arg0 noticed-attack-time) (current-time)) + (set-time! (-> arg0 noticed-attack-time)) ) (else - (if (>= (- (current-time) v1-5) (the-as time-frame (-> arg0 notice-attack-delay))) + (if (time-elapsed? v1-5 (the-as time-frame (-> arg0 notice-attack-delay))) (logior! (-> arg0 flags) (battle-spawner-flags hit)) ) ) @@ -1387,7 +1387,7 @@ :virtual #t :event battle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self on-notice))) (if gp-0 (script-eval (the-as pair gp-0) :vector (-> self root trans)) @@ -1467,10 +1467,10 @@ (let ((a1-14 (-> this jammed-starting-time))) (cond ((zero? (-> this jammed-starting-time)) - (set! (-> this jammed-starting-time) (current-time)) + (set-time! (-> this jammed-starting-time)) ) (else - (if (>= (- (current-time) a1-14) (seconds 3.5)) + (if (time-elapsed? a1-14 (seconds 3.5)) (logior! (-> this flags) (battle-flags no-spawner-block)) ) ) @@ -1488,23 +1488,23 @@ (< a0-4 (the-as int (-> this info desired-alive-count))) (< (-> this count) v1-4) ) - (when (>= (- (current-time) (-> this cant-spawn-time)) (the-as time-frame (-> this next-spawn-delay))) + (when (time-elapsed? (-> this cant-spawn-time) (the-as time-frame (-> this next-spawn-delay))) (let ((a1-29 (get-best-spawner this))) (cond (a1-29 (spawn-from-spawner this a1-29 #f) (set! (-> this next-spawn-delay) (the-as uint (get-spawn-delay this))) - (set! (-> this cant-spawn-time) (current-time)) + (set-time! (-> this cant-spawn-time)) ) (else - (set! (-> this cant-spawn-time) (current-time)) + (set-time! (-> this cant-spawn-time)) ) ) ) ) ) (else - (set! (-> this cant-spawn-time) (current-time)) + (set-time! (-> this cant-spawn-time)) ) ) ) @@ -1516,7 +1516,7 @@ :virtual #t :event battle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self flags) (battle-flags active)) (logclear! (-> self flags) (battle-flags no-spawner-block)) (set! (-> self jammed-starting-time) 0) @@ -1594,14 +1594,10 @@ this ) -;; WARN: Return type mismatch process-drawable vs battle. (defmethod relocate battle ((this battle) (arg0 int)) (&+! (-> this spawners) arg0) (&+! (-> this allies) arg0) - (the-as - battle - ((the-as (function process-drawable int process-drawable) (find-parent-method battle 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod initialize-spawner-breeds battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) diff --git a/goal_src/jak2/levels/common/elec-gate.gc b/goal_src/jak2/levels/common/elec-gate.gc index cfeedf73f89..3bf51e543b1 100644 --- a/goal_src/jak2/levels/common/elec-gate.gc +++ b/goal_src/jak2/levels/common/elec-gate.gc @@ -762,7 +762,7 @@ (defmethod deactivate elec-gate ((this elec-gate)) (set-elec-scale-if-close! this 0.0) - ((the-as (function process-drawable none) (find-parent-method elec-gate 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/centurion.gc b/goal_src/jak2/levels/common/enemy/centurion.gc index bd787f8e7a0..d11f5c8e685 100644 --- a/goal_src/jak2/levels/common/enemy/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/centurion.gc @@ -160,7 +160,7 @@ (sound-play "cent-shot-hit") ) ((= v1-0 (projectile-options lose-altitude proj-options-2)) - ((the-as (function projectile projectile-options sound-id) (find-parent-method centurion-shot 28)) this arg0) + (call-parent-method this arg0) ) ) ) @@ -170,7 +170,7 @@ (defmethod init-proj-settings! centurion-shot ((this centurion-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method centurion-shot 31)) this) + (call-parent-method this) (set! (-> this max-speed) 327680.0) (set! (-> this timeout) (seconds 1.25)) (none) @@ -887,7 +887,7 @@ (defmethod dispose! centurion ((this centurion)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (play-communicator-speech! (-> *talker-speech* 58)) - ((the-as (function enemy none) (find-parent-method centurion 132)) this) + (call-parent-method this) (none) ) @@ -1486,15 +1486,11 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs centurion. (defmethod relocate centurion ((this centurion) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - centurion - ((the-as (function process-focusable int process-focusable) (find-parent-method centurion 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! centurion ((this centurion)) diff --git a/goal_src/jak2/levels/common/enemy/flitter.gc b/goal_src/jak2/levels/common/enemy/flitter.gc index 83d3cdef209..2546ab88c3a 100644 --- a/goal_src/jak2/levels/common/enemy/flitter.gc +++ b/goal_src/jak2/levels/common/enemy/flitter.gc @@ -1248,7 +1248,7 @@ (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method flitter 132)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc index 78b5215f19c..5c4baddd6b5 100644 --- a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc +++ b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc @@ -1032,7 +1032,6 @@ (none) ) -;; WARN: Return type mismatch nav-enemy vs fodder. (defmethod relocate fodder ((this fodder) (arg0 int)) (if (nonzero? (-> this left-eye)) (&+! (-> this left-eye) arg0) @@ -1040,7 +1039,7 @@ (if (nonzero? (-> this right-eye)) (&+! (-> this right-eye) arg0) ) - (the-as fodder ((the-as (function nav-enemy int nav-enemy) (find-parent-method fodder 7)) this arg0)) + (call-parent-method this arg0) ) (defun fodder-setup-eye-control ((arg0 joint-mod)) diff --git a/goal_src/jak2/levels/common/enemy/grenadier.gc b/goal_src/jak2/levels/common/enemy/grenadier.gc index dcc17c92715..a51027a593c 100644 --- a/goal_src/jak2/levels/common/enemy/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/grenadier.gc @@ -1245,7 +1245,6 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs grenadier. (defmethod relocate grenadier ((this grenadier) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) @@ -1255,10 +1254,7 @@ (&+! (-> this hostile-path) arg0) ) ) - (the-as - grenadier - ((the-as (function process-focusable int process-focusable) (find-parent-method grenadier 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! grenadier ((this grenadier)) diff --git a/goal_src/jak2/levels/common/enemy/grunt.gc b/goal_src/jak2/levels/common/enemy/grunt.gc index 43bb20ad6a5..8bf3f444b5e 100644 --- a/goal_src/jak2/levels/common/enemy/grunt.gc +++ b/goal_src/jak2/levels/common/enemy/grunt.gc @@ -1409,7 +1409,7 @@ (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method grunt 132)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc index dcf8af3b746..bd07fad212c 100644 --- a/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/crimson-guard-level.gc @@ -4151,7 +4151,6 @@ (none) ) -;; WARN: Return type mismatch nav-enemy vs crimson-guard-level. (defmethod relocate crimson-guard-level ((this crimson-guard-level) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) @@ -4159,10 +4158,7 @@ (if (nonzero? (-> this l-control)) (&+! (-> this l-control) arg0) ) - (the-as - crimson-guard-level - ((the-as (function nav-enemy int nav-enemy) (find-parent-method crimson-guard-level 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch float vs none. diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index e4587ca2d4d..7ac20a23dc0 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -919,19 +919,15 @@ (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) ) - ((the-as (function enemy none) (find-parent-method hopper 132)) this) + (call-parent-method this) (none) ) -;; WARN: Return type mismatch process-focusable vs hopper. (defmethod relocate hopper ((this hopper) (arg0 int)) (if (nonzero? (-> this path-intro)) (&+! (-> this path-intro) arg0) ) - (the-as - hopper - ((the-as (function process-focusable int process-focusable) (find-parent-method hopper 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy-collision! hopper ((this hopper)) diff --git a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc index 9ca1720be90..971ebeaf15d 100644 --- a/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc +++ b/goal_src/jak2/levels/common/enemy/hover/crimson-guard-hover.gc @@ -593,7 +593,7 @@ (defmethod enemy-method-135 crimson-guard-hover ((this crimson-guard-hover) (arg0 int)) (if (and (zero? arg0) (logtest? #x4000000 (-> this incoming penetrate-using))) (sound-play "hover-take-hit") - ((the-as (function enemy int sound-id) (find-parent-method crimson-guard-hover 135)) this arg0) + (call-parent-method this arg0) ) (the-as sound-id 0) ) @@ -913,7 +913,7 @@ (defstate knocked (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 30)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -987,7 +987,7 @@ (defstate flying-death (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 138)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -1048,7 +1048,7 @@ (defstate flying-death-explode (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 139)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -1144,16 +1144,7 @@ ) ) ) - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - this - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method this arg0 arg1 arg2 arg3) ) (('notify) (let ((a0-27 (the-as object (-> arg3 param 0))) @@ -1173,28 +1164,10 @@ ) ) ) - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - this - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method this arg0 arg1 arg2 arg3) ) (else - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - this - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method this arg0 arg1 arg2 arg3) ) ) ) @@ -1289,7 +1262,7 @@ ) ) (else - ((the-as (function hover-enemy vector none) (find-parent-method crimson-guard-hover 52)) this arg0) + (call-parent-method this arg0) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/flamer.gc b/goal_src/jak2/levels/common/enemy/hover/flamer.gc index 3a3ce7d9dcc..d61c2bff949 100644 --- a/goal_src/jak2/levels/common/enemy/hover/flamer.gc +++ b/goal_src/jak2/levels/common/enemy/hover/flamer.gc @@ -1395,15 +1395,11 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs flamer. (defmethod relocate flamer ((this flamer) (arg0 int)) (if (nonzero? (-> this flit-joint)) (&+! (-> this flit-joint) arg0) ) - (the-as - flamer - ((the-as (function process-drawable int process-drawable) (find-parent-method flamer 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! flamer ((this flamer)) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc index 5d461f39f1c..158e8121edb 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy-battle.gc @@ -247,7 +247,6 @@ (none) ) -;; WARN: Return type mismatch process vs hover-enemy-manager. (defmethod relocate hover-enemy-manager ((this hover-enemy-manager) (arg0 int)) (when (-> this formation) (if (nonzero? (-> this formation)) @@ -257,10 +256,7 @@ (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) - (the-as - hover-enemy-manager - ((the-as (function process int process) (find-parent-method hover-enemy-manager 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod hover-enemy-manager-init! hover-enemy-manager ((this hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc index 31e493eeaf4..42fd06991d7 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc @@ -605,7 +605,7 @@ (set! (-> self knocked-start-level) (-> self root trans y)) ) :exit (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method hover-enemy 30)) exit))) + (let ((t9-1 (-> (the-as state (find-parent-state)) exit))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc index 962ceda4164..f85a2273cf6 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc @@ -648,7 +648,6 @@ ) ) -;; WARN: Return type mismatch basic vs hover-formation. (defmethod relocate hover-formation ((this hover-formation) (arg0 int)) (if (nonzero? (-> this formation)) (&+! (-> this formation) arg0) @@ -656,10 +655,7 @@ (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) - (the-as - hover-formation - ((the-as (function basic int basic) (find-parent-method hover-formation 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod hover-formation-method-15 hover-formation ((this hover-formation) (arg0 vector) (arg1 vector)) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index 402c0ad344c..d8971c637ae 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -500,7 +500,7 @@ ) ) (else - ((the-as (function enemy vector none) (find-parent-method wasp 52)) this arg0) + (call-parent-method this arg0) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/metalmonk.gc b/goal_src/jak2/levels/common/enemy/metalmonk.gc index cdaa15d10f1..eec7024413a 100644 --- a/goal_src/jak2/levels/common/enemy/metalmonk.gc +++ b/goal_src/jak2/levels/common/enemy/metalmonk.gc @@ -1150,15 +1150,11 @@ #f ) -;; WARN: Return type mismatch process-focusable vs metalmonk. (defmethod relocate metalmonk ((this metalmonk) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) - (the-as - metalmonk - ((the-as (function process-focusable int process-focusable) (find-parent-method metalmonk 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! metalmonk ((this metalmonk)) diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 654c33c2436..e0ce458d8b0 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -45,7 +45,7 @@ (defmethod init-proj-settings! spyder-shot ((this spyder-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method spyder-shot 31)) this) + (call-parent-method this) (set! (-> this max-speed) 307200.0) (set! (-> this timeout) (seconds 0.267)) (none) @@ -1304,7 +1304,6 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs spyder. (defmethod relocate spyder ((this spyder) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) @@ -1314,10 +1313,7 @@ (&+! (-> this joint-ik v1-4) arg0) ) ) - (the-as - spyder - ((the-as (function process-focusable int process-focusable) (find-parent-method spyder 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! spyder ((this spyder)) diff --git a/goal_src/jak2/levels/common/entities/com-elevator.gc b/goal_src/jak2/levels/common/entities/com-elevator.gc index 2cd9f01aae1..a31e259cc41 100644 --- a/goal_src/jak2/levels/common/entities/com-elevator.gc +++ b/goal_src/jak2/levels/common/entities/com-elevator.gc @@ -97,9 +97,9 @@ (defstate dormant (com-elevator) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method com-elevator 34)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -179,7 +179,7 @@ (defmethod deactivate com-elevator ((this com-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function elevator none) (find-parent-method com-elevator 10)) this) + (call-parent-method this) (none) ) @@ -312,7 +312,7 @@ For example for an elevator pre-compute the distance between the first and last (defmethod deactivate tomb-trans-elevator ((this tomb-trans-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 10)) this) + (call-parent-method this) (none) ) @@ -320,7 +320,7 @@ For example for an elevator pre-compute the distance between the first and last (defmethod init-plat! tomb-trans-elevator ((this tomb-trans-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." - ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 33)) this) + (call-parent-method this) (set! (-> this sound-id) (new-sound-id)) (none) ) diff --git a/goal_src/jak2/levels/common/entities/spydroid.gc b/goal_src/jak2/levels/common/entities/spydroid.gc index f27ca182dbe..29c863bca6d 100644 --- a/goal_src/jak2/levels/common/entities/spydroid.gc +++ b/goal_src/jak2/levels/common/entities/spydroid.gc @@ -1304,7 +1304,7 @@ (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) - ((the-as (function process-focusable none) (find-parent-method spydroid 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/common/race/race-manager.gc b/goal_src/jak2/levels/common/race/race-manager.gc index 05f99ae762f..92a34828c09 100644 --- a/goal_src/jak2/levels/common/race/race-manager.gc +++ b/goal_src/jak2/levels/common/race/race-manager.gc @@ -1566,7 +1566,7 @@ (defmethod deactivate race-manager ((this race-manager)) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (send-event *traffic-manager* 'restore-default-settings) - ((the-as (function process none) (find-parent-method race-manager 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/common/scene-actor.gc b/goal_src/jak2/levels/common/scene-actor.gc index cde2fd97291..a9c104125d2 100644 --- a/goal_src/jak2/levels/common/scene-actor.gc +++ b/goal_src/jak2/levels/common/scene-actor.gc @@ -688,7 +688,7 @@ This commonly includes things such as: ) ) ) - ((the-as (function process-taskable none) (find-parent-method youngsamos-npc 32)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/dig/dig-obs.gc b/goal_src/jak2/levels/dig/dig-obs.gc index 2da63616a50..ab01a2138d9 100644 --- a/goal_src/jak2/levels/dig/dig-obs.gc +++ b/goal_src/jak2/levels/dig/dig-obs.gc @@ -30,7 +30,7 @@ ) (defmethod rigid-body-object-method-29 dig-sinking-plat ((this dig-sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-sinking-plat 29)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index bec8cf180ee..de520a2077a 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -1403,7 +1403,7 @@ This commonly includes things such as: ) (defmethod rigid-body-object-method-29 dig-tipping-rock ((this dig-tipping-rock) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-tipping-rock 29)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) diff --git a/goal_src/jak2/levels/drill/drill-baron.gc b/goal_src/jak2/levels/drill/drill-baron.gc index 19904249c53..253418da9a7 100644 --- a/goal_src/jak2/levels/drill/drill-baron.gc +++ b/goal_src/jak2/levels/drill/drill-baron.gc @@ -977,7 +977,6 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs drill-barons-ship-turret. (defmethod relocate drill-barons-ship-turret ((this drill-barons-ship-turret) (arg0 int)) (when (-> this jmod) (if (nonzero? (-> this jmod)) @@ -994,13 +993,7 @@ (&+! (-> this jmod-right) arg0) ) ) - (the-as - drill-barons-ship-turret - ((the-as (function process-drawable int process-drawable) (find-parent-method drill-barons-ship-turret 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. @@ -1122,7 +1115,7 @@ This commonly includes things such as: (defmethod init-proj-settings! drill-ship-shot ((this drill-ship-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function guard-shot none) (find-parent-method drill-ship-shot 31)) this) + (call-parent-method this) (set! (-> this attack-mode) 'drill-ship-shot) (set! (-> this move) guard-shot-move) (set! (-> this max-speed) 737280.0) diff --git a/goal_src/jak2/levels/drill/drill-obs.gc b/goal_src/jak2/levels/drill/drill-obs.gc index 57652064d9c..d80d1f3ec70 100644 --- a/goal_src/jak2/levels/drill/drill-obs.gc +++ b/goal_src/jak2/levels/drill/drill-obs.gc @@ -460,7 +460,7 @@ This commonly includes things such as: (defmethod deactivate drill-elevator ((this drill-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method drill-elevator 10)) this) + (call-parent-method this) (none) ) @@ -809,15 +809,11 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -;; WARN: Return type mismatch process-drawable vs fire-floor. (defmethod relocate fire-floor ((this fire-floor) (arg0 int)) (if (nonzero? (-> this part-off)) (&+! (-> this part-off) arg0) ) - (the-as - fire-floor - ((the-as (function process-drawable int process-drawable) (find-parent-method fire-floor 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod deactivate fire-floor ((this fire-floor)) @@ -825,7 +821,7 @@ For example for an elevator pre-compute the distance between the first and last (if (nonzero? (-> this part-off)) (kill-and-free-particles (-> this part-off)) ) - ((the-as (function process-drawable none) (find-parent-method fire-floor 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/drill/drillmid-obs.gc b/goal_src/jak2/levels/drill/drillmid-obs.gc index c4bba05e781..751b1b02a36 100644 --- a/goal_src/jak2/levels/drill/drillmid-obs.gc +++ b/goal_src/jak2/levels/drill/drillmid-obs.gc @@ -176,7 +176,7 @@ This commonly includes things such as: :exit (behavior () (sound-stop (-> self sound-id)) (sound-play "drl-elev-stop") - (let ((t9-4 (-> (the-as state (find-parent-method drill-lift 36)) exit))) + (let ((t9-4 (-> (find-parent-state) exit))) (if t9-4 (t9-4) ) @@ -184,7 +184,7 @@ This commonly includes things such as: ) :post (behavior () (sound-play "drl-elevator-lp" :id (-> self sound-id) :position (-> self root trans)) - (let ((t9-2 (-> (the-as state (find-parent-method drill-lift 36)) post))) + (let ((t9-2 (-> (the-as state (find-parent-state)) post))) (if t9-2 ((the-as (function none) t9-2)) ) diff --git a/goal_src/jak2/levels/drill/ginsu.gc b/goal_src/jak2/levels/drill/ginsu.gc index 3069c6f4b32..79de2f1e822 100644 --- a/goal_src/jak2/levels/drill/ginsu.gc +++ b/goal_src/jak2/levels/drill/ginsu.gc @@ -910,11 +910,9 @@ ) (defmethod deactivate ginsu ((this ginsu)) - (when (nonzero? (-> this blade-part)) - (let ((a0-1 (-> this blade-part))) - ((the-as (function sparticle-launch-control none) (method-of-object a0-1 kill-and-free-particles)) a0-1) + (if (nonzero? (-> this blade-part)) + (kill-and-free-particles (-> this blade-part)) ) - ) (if (-> this blade-sound-playing) (sound-stop (-> this blade-sound)) ) diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index b2d9b37fd82..e60ca21ca1d 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -395,7 +395,7 @@ This commonly includes things such as: (send-event (handle->process (-> this hud)) 'hide-and-die) ) (sound-stop (-> this sound-id)) - ((the-as (function process-focusable none) (find-parent-method forest-youngsamos 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index 4558721448f..00c4ec9fac1 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -1422,12 +1422,8 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs predator. (defmethod relocate predator ((this predator) (arg0 int)) - (the-as - predator - ((the-as (function process-focusable int process-focusable) (find-parent-method predator 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod nav-enemy-method-167 predator ((this predator)) diff --git a/goal_src/jak2/levels/forest/wren.gc b/goal_src/jak2/levels/forest/wren.gc index 0a2ab4a9810..d81d0a6a3bd 100644 --- a/goal_src/jak2/levels/forest/wren.gc +++ b/goal_src/jak2/levels/forest/wren.gc @@ -429,7 +429,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) -;; WARN: Return type mismatch process-drawable vs wren. (defmethod relocate wren ((this wren) (arg0 int)) (dotimes (v1-0 2) (when (-> this fly-curve v1-0) @@ -438,10 +437,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (the-as - wren - ((the-as (function process-drawable int process-drawable) (find-parent-method wren 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc index 34125059b2d..0cb2e68d833 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc @@ -380,7 +380,7 @@ This commonly includes things such as: (defmethod deactivate fort-missile-target ((this fort-missile-target)) (sound-stop (the-as sound-id (-> this sound-id))) - ((the-as (function process-drawable none) (find-parent-method fort-missile-target 10)) this) + (call-parent-method this) (none) ) @@ -921,15 +921,11 @@ This commonly includes things such as: (none) ) -;; WARN: Return type mismatch process-drawable vs fort-missile. (defmethod relocate fort-missile ((this fort-missile) (arg0 int)) (if (nonzero? (-> this part-doom)) (&+! (-> this part-doom) arg0) ) - (the-as - fort-missile - ((the-as (function process-drawable int process-drawable) (find-parent-method fort-missile 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc index a4b0939fcf3..e417a8373d5 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -326,7 +326,7 @@ (defmethod deactivate fort-roboscreen ((this fort-roboscreen)) (disable *screen-filter*) (set-roboscreen-alpha! 0.0) - ((the-as (function process-drawable none) (find-parent-method fort-roboscreen 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index 18d6304ba31..e830997aa98 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -940,7 +940,6 @@ (none) ) -;; WARN: Return type mismatch process-drawable vs fort-robotank. (defmethod relocate fort-robotank ((this fort-robotank) (arg0 int)) (if (nonzero? (-> this barrel-part)) (&+! (-> this barrel-part) arg0) @@ -989,10 +988,7 @@ ) ) ) - (the-as - fort-robotank - ((the-as (function process-drawable int process-drawable) (find-parent-method fort-robotank 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc index 204254c71d3..c30cf59fe35 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc @@ -254,7 +254,7 @@ This commonly includes things such as: (defstate shutdown (elec-lock-gate) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method elec-lock-gate 22)) enter))) + (let ((t9-1 (-> (the-as state (find-parent-state)) enter))) (if t9-1 ((the-as (function none) t9-1)) ) diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index 8fc4d090210..e5178ec585b 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -391,7 +391,7 @@ This commonly includes things such as: (defmethod deactivate fort-elec-belt-inst ((this fort-elec-belt-inst)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method fort-elec-belt-inst 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index 7696aba2ea3..8b3ddf8d565 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -149,7 +149,7 @@ ) (training-manager-method-24 this) (training-manager-method-25 this) - ((the-as (function process none) (find-parent-method training-manager 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/hiphog/whack.gc b/goal_src/jak2/levels/hiphog/whack.gc index c2fe211b873..d7b902533d6 100644 --- a/goal_src/jak2/levels/hiphog/whack.gc +++ b/goal_src/jak2/levels/hiphog/whack.gc @@ -1697,21 +1697,17 @@ (kill-and-free-particles (-> this score-part s5-0)) ) ) - ((the-as (function process none) (find-parent-method whack-a-metal 10)) this) + (call-parent-method this) (none) ) -;; WARN: Return type mismatch process-drawable vs whack-a-metal. (defmethod relocate whack-a-metal ((this whack-a-metal) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this score-part v1-0)) (&+! (-> this score-part v1-0) arg0) ) ) - (the-as - whack-a-metal - ((the-as (function process-drawable int process-drawable) (find-parent-method whack-a-metal 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod whack-a-metal-method-29 whack-a-metal ((this whack-a-metal) (arg0 int) (arg1 int)) diff --git a/goal_src/jak2/levels/intro/intro-obs.gc b/goal_src/jak2/levels/intro/intro-obs.gc index ea14672ab76..d0d3e476cc0 100644 --- a/goal_src/jak2/levels/intro/intro-obs.gc +++ b/goal_src/jak2/levels/intro/intro-obs.gc @@ -347,17 +347,13 @@ This commonly includes things such as: ) ) -;; WARN: Return type mismatch process vs metalhead-spawner. (defmethod relocate metalhead-spawner ((this metalhead-spawner) (arg0 int)) (dotimes (v1-0 19) (if (nonzero? (-> this path-tbl v1-0)) (&+! (-> this path-tbl v1-0) arg0) ) ) - (the-as - metalhead-spawner - ((the-as (function process int process) (find-parent-method metalhead-spawner 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index 0e9369c9fee..afd19a7c01e 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -3191,7 +3191,7 @@ This commonly includes things such as: (task-arrow-spawn gp-0 self) ) ) - (let ((t9-5 (-> (the-as state (find-parent-method trans-plat 34)) enter))) + (let ((t9-5 (-> (the-as state (find-parent-state)) enter))) (if t9-5 ((the-as (function none) t9-5)) ) @@ -3201,7 +3201,7 @@ This commonly includes things such as: (while (-> self child) (deactivate (-> self child 0)) ) - (let ((t9-2 (-> (the-as state (find-parent-method trans-plat 34)) exit))) + (let ((t9-2 (-> (the-as state (find-parent-state)) exit))) (if t9-2 (t9-2) ) @@ -3225,7 +3225,7 @@ This commonly includes things such as: 0 ) ) - (let ((t9-2 (-> (the-as state (find-parent-method trans-plat 34)) trans))) + (let ((t9-2 (-> (the-as state (find-parent-state)) trans))) (if t9-2 (t9-2) ) diff --git a/goal_src/jak2/levels/mountain/rhino.gc b/goal_src/jak2/levels/mountain/rhino.gc index aa9e6827281..68e6e1bba62 100644 --- a/goal_src/jak2/levels/mountain/rhino.gc +++ b/goal_src/jak2/levels/mountain/rhino.gc @@ -1621,15 +1621,11 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs rhino. (defmethod relocate rhino ((this rhino) (arg0 int)) (if (nonzero? (-> this path-intro)) (&+! (-> this path-intro) arg0) ) - (the-as - rhino - ((the-as (function process-focusable int process-focusable) (find-parent-method rhino 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! rhino ((this rhino)) diff --git a/goal_src/jak2/levels/nest/flying-spider.gc b/goal_src/jak2/levels/nest/flying-spider.gc index dfdcd3dd050..f07d00c6aaf 100644 --- a/goal_src/jak2/levels/nest/flying-spider.gc +++ b/goal_src/jak2/levels/nest/flying-spider.gc @@ -18,14 +18,11 @@ ) -;; WARN: Return type mismatch sound-id vs none. +;; WARN: Return type mismatch object vs none. (defmethod play-impact-sound flying-spider-shot ((this flying-spider-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "fly-spider-shot") - ((the-as (function projectile projectile-options sound-id) (find-parent-method flying-spider-shot 28)) - this - arg0 - ) + (call-parent-method this arg0) ) (none) ) diff --git a/goal_src/jak2/levels/nest/mammoth.gc b/goal_src/jak2/levels/nest/mammoth.gc index 6c0b62eef27..5268848096c 100644 --- a/goal_src/jak2/levels/nest/mammoth.gc +++ b/goal_src/jak2/levels/nest/mammoth.gc @@ -1490,17 +1490,13 @@ #f ) -;; WARN: Return type mismatch process-focusable vs mammoth. (defmethod relocate mammoth ((this mammoth) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this joint-ik v1-0)) (&+! (-> this joint-ik v1-0) arg0) ) ) - (the-as - mammoth - ((the-as (function process-focusable int process-focusable) (find-parent-method mammoth 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy-collision! mammoth ((this mammoth)) diff --git a/goal_src/jak2/levels/nest/mantis.gc b/goal_src/jak2/levels/nest/mantis.gc index 82c68ad4bd7..802d1619400 100644 --- a/goal_src/jak2/levels/nest/mantis.gc +++ b/goal_src/jak2/levels/nest/mantis.gc @@ -404,7 +404,7 @@ (defstate active (mantis) :virtual #t :trans (behavior () - (let ((t9-1 (-> (the-as (state enemy) (find-parent-method mantis 32)) trans))) + (let ((t9-1 (-> (the-as (state enemy) (find-parent-state)) trans))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak2/levels/palace/cable/palcab-obs.gc b/goal_src/jak2/levels/palace/cable/palcab-obs.gc index 7b012731b41..b4c3e60070c 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-obs.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-obs.gc @@ -913,7 +913,7 @@ This commonly includes things such as: (defmethod deactivate pal-rot-gun ((this pal-rot-gun)) (sound-stop (-> this sound-id)) (sound-stop (-> this shot-sound-id)) - ((the-as (function process-drawable none) (find-parent-method pal-rot-gun 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index dda704ab075..ca51c8dc5de 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -1413,15 +1413,11 @@ (none) ) -;; WARN: Return type mismatch process-focusable vs rapid-gunner. (defmethod relocate rapid-gunner ((this rapid-gunner) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - rapid-gunner - ((the-as (function process-focusable int process-focusable) (find-parent-method rapid-gunner 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod init-enemy! rapid-gunner ((this rapid-gunner)) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index 3e48a691a67..3627282b3aa 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -23,7 +23,7 @@ ) (defmethod rigid-body-object-method-29 sinking-plat ((this sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method sinking-plat 29)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) diff --git a/goal_src/jak2/levels/sewer/hosehead.gc b/goal_src/jak2/levels/sewer/hosehead.gc index 99d5245a354..e08c7648435 100644 --- a/goal_src/jak2/levels/sewer/hosehead.gc +++ b/goal_src/jak2/levels/sewer/hosehead.gc @@ -2191,7 +2191,6 @@ ) ) -;; WARN: Return type mismatch none vs hosehead. (defmethod relocate hosehead ((this hosehead) (arg0 int)) (if (nonzero? (-> this head-joint-mod)) (&+! (-> this head-joint-mod) arg0) @@ -2201,7 +2200,7 @@ (&+! (-> this joint-ik v1-4) arg0) ) ) - (the-as hosehead ((the-as (function process-drawable int none) (find-parent-method hosehead 7)) this arg0)) + (call-parent-method this arg0) ) (defmethod init-enemy! hosehead ((this hosehead)) diff --git a/goal_src/jak2/levels/sewer/sew-gunturret.gc b/goal_src/jak2/levels/sewer/sew-gunturret.gc index 12bd91ff6bf..9381a2fef25 100644 --- a/goal_src/jak2/levels/sewer/sew-gunturret.gc +++ b/goal_src/jak2/levels/sewer/sew-gunturret.gc @@ -1172,7 +1172,7 @@ (defmethod fire-turret! pal-gun-turret ((this pal-gun-turret) (arg0 symbol)) "@overrides Calls [[sew-gunturret::140]] but also customizes the turret flash via [[set-palcab-turret-flash!]]" - ((the-as (function sew-gunturret symbol none) (find-parent-method pal-gun-turret 140)) this arg0) + (call-parent-method this arg0) (set-palcab-turret-flash! 1.0) ) diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 08b6d678f33..079438d4e46 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -136,7 +136,7 @@ (defmethod deactivate sew-elevator ((this sew-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function elevator none) (find-parent-method sew-elevator 10)) this) + (call-parent-method this) (none) ) @@ -313,15 +313,11 @@ For example for an elevator pre-compute the distance between the first and last ) ) -;; WARN: Return type mismatch process-drawable vs sew-valve. (defmethod relocate sew-valve ((this sew-valve) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - sew-valve - ((the-as (function process-drawable int process-drawable) (find-parent-method sew-valve 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/stadium/racebike.gc b/goal_src/jak2/levels/stadium/racebike.gc index c168e646886..0122e0cea37 100644 --- a/goal_src/jak2/levels/stadium/racebike.gc +++ b/goal_src/jak2/levels/stadium/racebike.gc @@ -767,15 +767,11 @@ ) -;; WARN: Return type mismatch process-drawable vs vehicle-race-bike. (defmethod relocate vehicle-race-bike ((this vehicle-race-bike) (arg0 int)) (if (nonzero? (-> this steering-wheel)) (&+! (-> this steering-wheel) arg0) ) - (the-as - vehicle-race-bike - ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-race-bike 7)) this arg0) - ) + (call-parent-method this arg0) ) (defmethod update-joint-mods vehicle-race-bike ((this vehicle-race-bike)) diff --git a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc index 3b0973a3889..33b4da92a00 100644 --- a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc +++ b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc @@ -342,7 +342,7 @@ ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -382,7 +382,7 @@ ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -455,7 +455,7 @@ (suspend) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -520,7 +520,7 @@ ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -560,7 +560,7 @@ ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -597,7 +597,7 @@ ) (send-event (handle->process (-> self voicebox)) 'speak-effect #f) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1313,7 +1313,7 @@ (defmethod deactivate hoverboard-training-manager ((this hoverboard-training-manager)) (send-event *traffic-manager* 'restore-default-settings) - ((the-as (function process none) (find-parent-method hoverboard-training-manager 10)) this) + (call-parent-method this) (none) ) @@ -1432,7 +1432,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (until #f @@ -1560,7 +1560,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (until #f diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index dd7723c3289..b1f36e5877a 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -945,7 +945,7 @@ This commonly includes things such as: (if (< 40960.0 (-> arg0 impulse)) (sound-play "rift-fall") ) - ((the-as (function rigid-body-object rigid-body-impact none) (find-parent-method rift-rider 45)) this arg0) + (call-parent-method this arg0) (none) ) @@ -1012,7 +1012,7 @@ This commonly includes things such as: (defmethod deactivate rift-rider ((this rift-rider)) (sound-stop (-> this sound-id)) - ((the-as (function rigid-body-object none) (find-parent-method rift-rider 10)) this) + (call-parent-method this) (none) ) @@ -1968,7 +1968,7 @@ This commonly includes things such as: (send-event (handle->process (-> this hud)) 'hide-and-die) ) (kill-lightning this) - ((the-as (function process-focusable none) (find-parent-method stad-samos 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/strip/strip-obs.gc b/goal_src/jak2/levels/strip/strip-obs.gc index df3cf48529b..9332e93984d 100644 --- a/goal_src/jak2/levels/strip/strip-obs.gc +++ b/goal_src/jak2/levels/strip/strip-obs.gc @@ -365,15 +365,11 @@ This commonly includes things such as: ) ) -;; WARN: Return type mismatch strip-hazard vs pitspikes. (defmethod relocate pitspikes ((this pitspikes) (arg0 int)) (if (nonzero? (-> this spinner)) (&+! (-> this spinner) arg0) ) - (the-as - pitspikes - ((the-as (function strip-hazard int strip-hazard) (find-parent-method pitspikes 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/tomb/tomb-beetle.gc b/goal_src/jak2/levels/tomb/tomb-beetle.gc index 6d2703f66ea..328c04fc434 100644 --- a/goal_src/jak2/levels/tomb/tomb-beetle.gc +++ b/goal_src/jak2/levels/tomb/tomb-beetle.gc @@ -301,7 +301,7 @@ :enter (behavior () (set! (-> self root trans quad) (-> self entity extra trans quad)) (quaternion-copy! (-> self root quat) (-> self entity quat)) - (let ((t9-2 (-> (the-as (state enemy) (find-parent-method tomb-beetle 27)) enter))) + (let ((t9-2 (-> (the-as (state enemy) (find-parent-state)) enter))) (if t9-2 (t9-2) ) diff --git a/goal_src/jak2/levels/tomb/tomb-obs.gc b/goal_src/jak2/levels/tomb/tomb-obs.gc index 7beac462b6f..fff7ac4af9a 100644 --- a/goal_src/jak2/levels/tomb/tomb-obs.gc +++ b/goal_src/jak2/levels/tomb/tomb-obs.gc @@ -1575,7 +1575,7 @@ This commonly includes things such as: (defmethod deactivate tomb-plat-return ((this tomb-plat-return)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-plat-return 10)) this) + (call-parent-method this) (none) ) @@ -1916,7 +1916,7 @@ This commonly includes things such as: (defmethod deactivate tomb-sphinx ((this tomb-sphinx)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-sphinx 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/tomb/tomb-water.gc b/goal_src/jak2/levels/tomb/tomb-water.gc index a25200e7f4e..b0d1026f84b 100644 --- a/goal_src/jak2/levels/tomb/tomb-water.gc +++ b/goal_src/jak2/levels/tomb/tomb-water.gc @@ -622,7 +622,7 @@ This commonly includes things such as: ) ) :trans (behavior () - (let ((t9-1 (-> (the-as (state basebutton) (find-parent-method tomb-beetle-button 30)) trans))) + (let ((t9-1 (-> (the-as (state basebutton) (find-parent-state)) trans))) (if t9-1 (t9-1) ) diff --git a/goal_src/jak2/levels/tomb/widow-extras.gc b/goal_src/jak2/levels/tomb/widow-extras.gc index 254b45175c5..ebdfefd3128 100644 --- a/goal_src/jak2/levels/tomb/widow-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-extras.gc @@ -1193,11 +1193,10 @@ This commonly includes things such as: (if (nonzero? (-> this skid-part)) (kill-and-free-particles (-> this warning-spark-part)) ) - ((the-as (function process-drawable none) (find-parent-method widow-bomb 10)) this) + (call-parent-method this) (none) ) -;; WARN: Return type mismatch process-drawable vs widow-bomb. (defmethod relocate widow-bomb ((this widow-bomb) (arg0 int)) (if (nonzero? (-> this explode-part)) (&+! (-> this explode-part) arg0) @@ -1217,10 +1216,7 @@ This commonly includes things such as: (if (nonzero? (-> this spin-jm)) (&+! (-> this spin-jm) arg0) ) - (the-as - widow-bomb - ((the-as (function process-drawable int process-drawable) (find-parent-method widow-bomb 7)) this arg0) - ) + (call-parent-method this arg0) ) (defbehavior widow-bomb-reaction widow ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) @@ -1568,19 +1564,15 @@ This commonly includes things such as: (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) - ((the-as (function process-drawable none) (find-parent-method tomb-boss-pillar 10)) this) + (call-parent-method this) (none) ) -;; WARN: Return type mismatch process-drawable vs tomb-boss-pillar. (defmethod relocate tomb-boss-pillar ((this tomb-boss-pillar) (arg0 int)) (if (nonzero? (-> this explode-part)) (&+! (-> this explode-part) arg0) ) - (the-as - tomb-boss-pillar - ((the-as (function process-drawable int process-drawable) (find-parent-method tomb-boss-pillar 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/under/jellyfish.gc b/goal_src/jak2/levels/under/jellyfish.gc index 0d3b8d85165..86bdc6a929d 100644 --- a/goal_src/jak2/levels/under/jellyfish.gc +++ b/goal_src/jak2/levels/under/jellyfish.gc @@ -401,7 +401,7 @@ (defstate stare (jellyfish) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state enemy) (find-parent-method jellyfish 35)) enter))) + (let ((t9-1 (-> (the-as (state enemy) (find-parent-state)) enter))) (if t9-1 (t9-1) ) @@ -1169,7 +1169,7 @@ (defmethod deactivate jellyfish ((this jellyfish)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method jellyfish 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/under/under-obs.gc b/goal_src/jak2/levels/under/under-obs.gc index fc1ba1040b5..665824e1111 100644 --- a/goal_src/jak2/levels/under/under-obs.gc +++ b/goal_src/jak2/levels/under/under-obs.gc @@ -866,7 +866,7 @@ This commonly includes things such as: ) (defmethod rigid-body-object-method-29 under-buoy-plat ((this under-buoy-plat) (arg0 float)) - ((the-as (function rigid-body-object float none) (find-parent-method under-buoy-plat 29)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this orig-trans)) 0 (none) @@ -1563,7 +1563,7 @@ This commonly includes things such as: (defmethod deactivate under-lift ((this under-lift)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method under-lift 10)) this) + (call-parent-method this) (none) ) diff --git a/goal_src/jak2/levels/under/under-shoot-block.gc b/goal_src/jak2/levels/under/under-shoot-block.gc index 0fb34fedbb0..74fd3b48502 100644 --- a/goal_src/jak2/levels/under/under-shoot-block.gc +++ b/goal_src/jak2/levels/under/under-shoot-block.gc @@ -2204,7 +2204,7 @@ ) ) ) - ((the-as (function process-drawable none) (find-parent-method under-shoot-block 10)) this) + (call-parent-method this) (none) ) diff --git a/goalc/compiler/Compiler.h b/goalc/compiler/Compiler.h index de54236d25e..07634759950 100644 --- a/goalc/compiler/Compiler.h +++ b/goalc/compiler/Compiler.h @@ -219,8 +219,8 @@ class Compiler { const std::vector>& unnamed, const std::unordered_map>>& named); - std::string as_string(const goos::Object& o); - std::string symbol_string(const goos::Object& o); + const std::string& as_string(const goos::Object& o); + const std::string& symbol_string(const goos::Object& o); std::string quoted_sym_as_string(const goos::Object& o); goos::Object unquote(const goos::Object& o); bool is_quoted_sym(const goos::Object& o); @@ -246,7 +246,6 @@ class Compiler { TypeSpec parse_typespec(const goos::Object& src, Env* env); bool is_local_symbol(const goos::Object& obj, Env* env); - emitter::HWRegKind get_preferred_reg_kind(const TypeSpec& ts); Val* compile_real_function_call(const goos::Object& form, RegVal* function, const std::vector& args, @@ -697,6 +696,7 @@ class Compiler { Val* compile_car(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_cdr(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_method_of_type(const goos::Object& form, const goos::Object& rest, Env* env); + Val* compile_method_id_of_type(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_method_of_object(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_addr_of(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_declare_type(const goos::Object& form, const goos::Object& rest, Env* env); @@ -705,6 +705,9 @@ class Compiler { Val* compile_size_of(const goos::Object& form, const goos::Object& rest, Env* env); ConstPropResult const_prop_size_of(const goos::Object& form, const goos::Object& rest, Env* env); Val* compile_psize_of(const goos::Object& form, const goos::Object& rest, Env* env); + Val* compile_current_method_id(const goos::Object& form, const goos::Object& rest, Env* env); + Val* compile_current_method_type(const goos::Object& form, const goos::Object& rest, Env* env); + Val* compile_cast_to_method_type(const goos::Object& form, const goos::Object& rest, Env* env); // State Val* compile_define_state_hook(const goos::Object& form, const goos::Object& rest, Env* env); diff --git a/goalc/compiler/Env.h b/goalc/compiler/Env.h index b9f36a01a9d..74014ebaae7 100644 --- a/goalc/compiler/Env.h +++ b/goalc/compiler/Env.h @@ -240,6 +240,8 @@ class FunctionEnv : public DeclareEnv { int segment = -1; std::string method_of_type_name = "#f"; + TypeSpec method_function_type; + std::optional method_id; bool is_asm_func = false; bool asm_func_saved_regs = false; TypeSpec asm_func_return_type; diff --git a/goalc/compiler/Util.cpp b/goalc/compiler/Util.cpp index 04513cf664d..81b1b41c0d9 100644 --- a/goalc/compiler/Util.cpp +++ b/goalc/compiler/Util.cpp @@ -214,14 +214,14 @@ void Compiler::for_each_in_list(const goos::Object& list, /*! * Convert a goos::Object that's a string to a std::string. Must be a string. */ -std::string Compiler::as_string(const goos::Object& o) { +const std::string& Compiler::as_string(const goos::Object& o) { return o.as_string()->data; } /*! * Convert a goos::Object that's a symbol to a std::string. Must be a string. */ -std::string Compiler::symbol_string(const goos::Object& o) { +const std::string& Compiler::symbol_string(const goos::Object& o) { return o.as_symbol()->name; } @@ -290,6 +290,11 @@ TypeSpec Compiler::parse_typespec(const goos::Object& src, Env* env) { src.as_pair()->cdr.is_empty_list()) { return env->function_env()->method_of_type_name; } + if (src.is_pair() && src.as_pair()->car.is_symbol("current-method-function-type") && + src.as_pair()->cdr.is_empty_list()) { + return env->function_env()->method_function_type.substitute_for_method_call( + env->function_env()->method_of_type_name); + } return ::parse_typespec(&m_ts, src); } @@ -316,17 +321,6 @@ bool Compiler::is_local_symbol(const goos::Object& obj, Env* env) { return false; } -emitter::HWRegKind Compiler::get_preferred_reg_kind(const TypeSpec& ts) { - switch (m_ts.lookup_type(ts)->get_preferred_reg_class()) { - case RegClass::GPR_64: - return emitter::HWRegKind::GPR; - case RegClass::FLOAT: - return emitter::HWRegKind::XMM; - default: - throw std::runtime_error("Unknown preferred register kind"); - } -} - bool Compiler::is_none(Val* in) { return dynamic_cast(in); } diff --git a/goalc/compiler/compilation/Atoms.cpp b/goalc/compiler/compilation/Atoms.cpp index 0d24c01c640..aa9e47c6f78 100644 --- a/goalc/compiler/compilation/Atoms.cpp +++ b/goalc/compiler/compilation/Atoms.cpp @@ -207,11 +207,14 @@ const std::unordered_map< {"car", {"", &Compiler::compile_car}}, {"cdr", {"", &Compiler::compile_cdr}}, {"method-of-type", {"", &Compiler::compile_method_of_type}}, + {"method-id-of-type", {"", &Compiler::compile_method_id_of_type}}, {"method-of-object", {"", &Compiler::compile_method_of_object}}, {"declare-type", {"", &Compiler::compile_declare_type}}, {"none", {"", &Compiler::compile_none}}, {"size-of", {"", &Compiler::compile_size_of}}, {"psize-of", {"", &Compiler::compile_psize_of}}, + {"current-method-id", {"", &Compiler::compile_current_method_id}}, + {"cast-to-method-type", {"", &Compiler::compile_cast_to_method_type}}, // LAMBDA {"lambda", {"", &Compiler::compile_lambda}}, @@ -231,7 +234,7 @@ const std::unordered_map< &Compiler::compile_macro_expand}}, // OBJECT - // {"current-method-type", {"", &Compiler::compile_current_method_type}}, + {"current-method-type", {"", &Compiler::compile_current_method_type}}, // MATH {"+", {"", &Compiler::compile_add}}, diff --git a/goalc/compiler/compilation/Type.cpp b/goalc/compiler/compilation/Type.cpp index 0cd071c4175..1fbea4517f9 100644 --- a/goalc/compiler/compilation/Type.cpp +++ b/goalc/compiler/compilation/Type.cpp @@ -492,6 +492,9 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _ auto new_func_env = std::make_unique(env, lambda.debug_name, &m_goos.reader); new_func_env->set_segment(env->function_env()->segment_for_static_data()); new_func_env->method_of_type_name = symbol_string(type_name); + auto method_info = m_ts.lookup_method(symbol_string(type_name), symbol_string(method_name)); + new_func_env->method_id = method_info.id; + new_func_env->method_function_type = method_info.type; // set up arguments if (lambda.params.size() > 8) { @@ -517,7 +520,6 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _ reset_args_for_coloring.push_back(ireg_arg); } - auto method_info = m_ts.lookup_method(symbol_string(type_name), symbol_string(method_name)); auto behavior = method_info.type.try_get_tag("behavior"); if (behavior) { auto self_var = new_func_env->make_gpr(m_ts.make_typespec(*behavior)); @@ -1307,6 +1309,47 @@ Val* Compiler::compile_method_of_type(const goos::Object& form, return get_none(); } +Val* Compiler::compile_method_id_of_type(const goos::Object& form, + const goos::Object& rest, + Env* env) { + auto args = get_va(form, rest); + va_check(form, args, {{goos::ObjectType::SYMBOL}, {goos::ObjectType::SYMBOL}}, {}); + auto arg = args.unnamed.at(0); + if (m_ts.fully_defined_type_exists(symbol_string(arg))) { + auto info = m_ts.lookup_method(symbol_string(arg), symbol_string(args.unnamed.at(1))); + return compile_integer(info.id, env); + } else if (m_ts.partially_defined_type_exists(symbol_string(arg))) { + throw_compiler_error( + form, "The method-id-of-type form is ambiguous when used on a forward declared type."); + } else { + throw_compiler_error(form, "unknown type"); + } +} + +Val* Compiler::compile_cast_to_method_type(const goos::Object& form, + const goos::Object& rest, + Env* env) { + auto args = get_va(form, rest); + va_check(form, args, {{goos::ObjectType::SYMBOL}, {goos::ObjectType::SYMBOL}, {}}, {}); + auto arg = args.unnamed.at(0); + if (m_ts.fully_defined_type_exists(symbol_string(arg))) { + auto info = m_ts.lookup_method(symbol_string(arg), symbol_string(args.unnamed.at(1))); + + auto base = compile_error_guard(args.unnamed.at(2), env); + auto result = env->function_env()->alloc_val(info.type, base); + if (base->settable()) { + result->mark_as_settable(); + } + + return result; + } else if (m_ts.partially_defined_type_exists(symbol_string(arg))) { + throw_compiler_error( + form, "The cast-to-method-type form is ambiguous when used on a forward declared type."); + } else { + throw_compiler_error(form, "unknown type"); + } +} + Val* Compiler::compile_method_of_object(const goos::Object& form, const goos::Object& rest, Env* env) { @@ -1467,3 +1510,27 @@ Compiler::ConstPropResult Compiler::const_prop_size_of(const goos::Object& form, Val* Compiler::compile_psize_of(const goos::Object& form, const goos::Object& rest, Env* env) { return compile_integer((get_size_for_size_of(form, rest) + 0xf) & ~0xf, env); } + +Val* Compiler::compile_current_method_id(const goos::Object& form, + const goos::Object& rest, + Env* env) { + auto args = get_va(form, rest); + va_check(form, args, {}, {}); + auto* fe = env->function_env(); + if (!fe->method_id) { + throw_compiler_error(form, "current-method-id wasn't called from a method."); + } + return compile_integer(*fe->method_id, env); +} + +Val* Compiler::compile_current_method_type(const goos::Object& form, + const goos::Object& rest, + Env* env) { + auto args = get_va(form, rest); + va_check(form, args, {}, {}); + auto* fe = env->function_env(); + if (!fe->method_id || fe->method_of_type_name.empty()) { + throw_compiler_error(form, "current-method-type wasn't called from a method."); + } + return compile_get_symbol_value(form, fe->method_of_type_name, env); +} \ No newline at end of file diff --git a/lsp/handlers/initialize.h b/lsp/handlers/initialize.h index 622f4b4dd3d..69ee45537a7 100644 --- a/lsp/handlers/initialize.h +++ b/lsp/handlers/initialize.h @@ -8,7 +8,7 @@ using json = nlohmann::json; -std::optional initialize_handler(Workspace& workspace, int id, json params) { +std::optional initialize_handler(Workspace& /*workspace*/, int /*id*/, json /*params*/) { InitializeResult result; return result.to_json(); } diff --git a/lsp/handlers/lsp_router.cpp b/lsp/handlers/lsp_router.cpp index 182f0a0ea72..74f0ee8fead 100644 --- a/lsp/handlers/lsp_router.cpp +++ b/lsp/handlers/lsp_router.cpp @@ -29,8 +29,8 @@ LSPRoute::LSPRoute(std::function(Workspace&, int, json)> req : m_route_type(LSPRouteType::REQUEST_RESPONSE), m_request_handler(request_handler) {} void LSPRouter::init_routes() { - m_routes["shutdown"] = - LSPRoute([](Workspace& workspace, int id, nlohmann::json params) -> std::optional { + m_routes["shutdown"] = LSPRoute( + [](Workspace& /*workspace*/, int /*id*/, nlohmann::json /*params*/) -> std::optional { lg::info("Shutting down LSP due to explicit request"); exit(0); }); diff --git a/lsp/handlers/text_document/completion.h b/lsp/handlers/text_document/completion.h index 70540ec4bdd..e75767d1668 100644 --- a/lsp/handlers/text_document/completion.h +++ b/lsp/handlers/text_document/completion.h @@ -7,7 +7,7 @@ #include "lsp/state/data/mips_instructions.h" #include "lsp/state/workspace.h" -std::optional get_completions_handler(Workspace& workspace, int id, json params) { +std::optional get_completions_handler(Workspace& /*workspace*/, int /*id*/, json params) { auto converted_params = params.get(); // TODO - these need to be cached, diff --git a/lsp/handlers/text_document/document_color.h b/lsp/handlers/text_document/document_color.h index e88e2f4b3d9..df4e5fbcf79 100644 --- a/lsp/handlers/text_document/document_color.h +++ b/lsp/handlers/text_document/document_color.h @@ -29,7 +29,7 @@ std::optional color_hexstring_to_lsp_color(const std::string& co return LSPSpec::Color{red, green, blue, 1.0}; } -std::optional document_color_handler(Workspace& workspace, int id, json raw_params) { +std::optional document_color_handler(Workspace& /*workspace*/, int /*id*/, json raw_params) { auto params = raw_params.get(); json colors = json::array(); diff --git a/lsp/handlers/text_document/document_symbol.h b/lsp/handlers/text_document/document_symbol.h index 01dbe653970..66d8159f075 100644 --- a/lsp/handlers/text_document/document_symbol.h +++ b/lsp/handlers/text_document/document_symbol.h @@ -9,7 +9,7 @@ using json = nlohmann::json; -std::optional document_symbols_handler(Workspace& workspace, int id, json params) { +std::optional document_symbols_handler(Workspace& workspace, int /*id*/, json params) { auto converted_params = params.get(); auto tracked_file = workspace.get_tracked_ir_file(converted_params.m_textDocument.m_uri); diff --git a/lsp/handlers/text_document/formatting.h b/lsp/handlers/text_document/formatting.h index bbad93c0cec..27dc6568e51 100644 --- a/lsp/handlers/text_document/formatting.h +++ b/lsp/handlers/text_document/formatting.h @@ -9,7 +9,7 @@ #include "lsp/state/data/mips_instructions.h" #include "lsp/state/workspace.h" -std::optional formatting_handler(Workspace& workspace, int id, json raw_params) { +std::optional formatting_handler(Workspace& workspace, int /*id*/, json raw_params) { auto params = raw_params.get(); const auto file_type = workspace.determine_filetype_from_uri(params.textDocument.m_uri); diff --git a/lsp/handlers/text_document/go_to.h b/lsp/handlers/text_document/go_to.h index 015cc56cb1c..ba78a47314b 100644 --- a/lsp/handlers/text_document/go_to.h +++ b/lsp/handlers/text_document/go_to.h @@ -7,7 +7,7 @@ #include "lsp/state/data/mips_instructions.h" #include "lsp/state/workspace.h" -std::optional go_to_definition_handler(Workspace& workspace, int id, json raw_params) { +std::optional go_to_definition_handler(Workspace& workspace, int /*id*/, json raw_params) { auto params = raw_params.get(); const auto file_type = workspace.determine_filetype_from_uri(params.m_textDocument.m_uri); diff --git a/lsp/handlers/text_document/hover.h b/lsp/handlers/text_document/hover.h index 26d854714cf..b16b7a3016e 100644 --- a/lsp/handlers/text_document/hover.h +++ b/lsp/handlers/text_document/hover.h @@ -173,7 +173,7 @@ std::string truncate_docstring(const std::string& docstring) { return truncated; } -std::optional hover_handler(Workspace& workspace, int id, json raw_params) { +std::optional hover_handler(Workspace& workspace, int /*id*/, json raw_params) { auto params = raw_params.get(); auto file_type = workspace.determine_filetype_from_uri(params.m_textDocument.m_uri); @@ -221,9 +221,9 @@ std::optional hover_handler(Workspace& workspace, int id, json raw_params) signature += symbol.value(); if (takes_args) { signature += "("; - for (int i = 0; i < args.size(); i++) { + for (int i = 0; i < (int)args.size(); i++) { const auto& arg = args.at(i); - if (i == args.size() - 1) { + if (i == (int)args.size() - 1) { signature += fmt::format("{}: {}", arg.name, arg.type); } else { signature += fmt::format("{}: {}, ", arg.name, arg.type); diff --git a/scripts/shell/decomp.sh b/scripts/shell/decomp.sh index 10917385c17..973e4eb1d5f 100755 --- a/scripts/shell/decomp.sh +++ b/scripts/shell/decomp.sh @@ -3,4 +3,4 @@ # Directory of this script DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" - "${DIR}"/../../build/decompiler/decompiler "${DIR}"/../../decompiler/config/jak1/jak1_config.jsonc "${DIR}"/../../iso_data "${DIR}"/../../decompiler_out --version ntsc_v1 +"${DIR}"/../../build/decompiler/decompiler "${DIR}"/../../decompiler/config/jak1/jak1_config.jsonc "${DIR}"/../../iso_data "${DIR}"/../../decompiler_out --version ntsc_v1 diff --git a/test/decompiler/reference/jak1/decompiler-macros.gc b/test/decompiler/reference/jak1/decompiler-macros.gc index 17cd3a2fe32..645a6269867 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 fbca31d8394..1cf21228383 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 3aa7ff2024d..c09a020e657 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 852682d6e62..7534c56ad5b 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 f94aca3919a..6446fff52b6 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 50994927f3f..3fe0bc1e4ca 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 469a811a1b2..f2c88c66afa 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 ed71bb6407f..9bec20b1550 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 3b4995bc200..f3cc172747d 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 5164aa030ba..ab74e7a4c56 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 8621d9585c5..e3b1def1488 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 1c4e208ffe5..b232f9e4a69 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 6d0a3f2194d..12c636090ee 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 226fc8ecc62..777f91387df 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 9d8f17f6f50..2ae690d7df5 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 1f4b3140311..f8f2d66aec2 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 90132492b64..82ff4a448e8 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 6460bf7f864..38e6c8048f8 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 7b1d396f2cb..038471d61da 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 facfbd34708..2c64c9b1750 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 0502dd5ad25..448ceb4e460 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 3414b5661d5..5b9b1ab03a9 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 f8e4f1e421b..2159eb21f97 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 3f303c50134..ffedb7d0e8f 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 af3bee82bfd..43d15354693 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 3ea4f4b731b..52111b61134 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 7a653023688..506b261cf9e 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 9df7fb3fb81..27841588664 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 a9f0518c838..859c4938ddd 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 8b7d15e20ff..decadd6dfb9 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 03d8be7682d..e8f9968c4c2 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 f46679d1bb1..6bb4facc000 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 8f5fd442a0c..b0723cb1c73 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 d39743c241d..7560d8e9ed9 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 b71cbb686c3..67c6553a7aa 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 382c0aae6cf..c67589370a5 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 41792faa3e1..c8f213afb1e 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 e276abf93aa..7776347354d 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 4ddaea648fe..ae486eae5d6 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 1743cbb464a..4140d632b41 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 fdbef2f1d8e..565e2d60ce6 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 89be9fd4dca..c98bbefd076 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 dce450794ec..fa363686dda 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 d97c9fd9136..95c63d39317 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 3e51388ac2a..bc68b0234da 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 7afc91c4108..a008ca2fa62 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 a6af529ca53..292fa1bc021 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 6e9713e07f3..db0a77795f1 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 c4fefd5a7b5..bf7df04745f 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 bef42ed0d7c..554b05cec08 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 3b9d7f0c6b7..739c9cf2865 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 a582682917f..2ecc69bb8b2 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 dfd5c8af4e0..a693d679ba9 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 83590cf4817..3ce9a58f003 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 5007c89efe6..227ba9d89e8 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 4a3646c9af3..55b8f4f78cc 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!" diff --git a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc index 6f288b66dc8..631e4a0b0e1 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc @@ -22,15 +22,11 @@ ) ;; definition for method 7 of type enemy -;; WARN: Return type mismatch process-focusable vs enemy. (defmethod relocate enemy ((this enemy) (arg0 int)) (if (nonzero? (-> this neck)) (&+! (-> this neck) arg0) ) - (the-as - enemy - ((the-as (function process-focusable int process-focusable) (find-parent-method enemy 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 117 of type enemy diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index d2f52b0f9c4..a6c6b20320e 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -272,7 +272,7 @@ ;; definition for method 10 of type talker (defmethod deactivate talker ((this talker)) (send-event (handle->process (-> this voicebox)) 'die) - ((the-as (function process none) (find-parent-method talker 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc index b3a893d6023..e19530fd491 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc @@ -1322,7 +1322,7 @@ (if (not (logtest? (-> self fact options) (actor-option no-reaction))) (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) ) - (let ((t9-2 (-> (the-as state (find-parent-method eco 26)) code))) + (let ((t9-2 (-> (the-as state (find-parent-state)) code))) (if t9-2 ((the-as (function none) t9-2)) ) @@ -1888,7 +1888,7 @@ This commonly includes things such as: ;; definition for method 10 of type gem (defmethod deactivate gem ((this gem)) (+! (-> *game-info* live-gem-count) -1) - ((the-as (function gem none) (find-parent-method gem 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc index abea432fe2a..1b65a327e50 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc @@ -103,13 +103,9 @@ ) ;; definition for method 7 of type conveyor -;; WARN: Return type mismatch process-drawable vs conveyor. (defmethod relocate conveyor ((this conveyor) (new-addr int)) (&+! (-> this sections) new-addr) - (the-as - conveyor - ((the-as (function process-drawable int process-drawable) (find-parent-method conveyor 7)) this new-addr) - ) + (call-parent-method this new-addr) ) ;; definition for method 22 of type conveyor diff --git a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc index ee498405484..59b40d55022 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc @@ -808,12 +808,11 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 7 of type elevator -;; WARN: Return type mismatch base-plat vs elevator. (defmethod relocate elevator ((this elevator) (arg0 int)) (if (nonzero? (-> this path-seq)) (&+! (-> this path-seq) arg0) ) - (the-as elevator ((the-as (function base-plat int base-plat) (find-parent-method elevator 7)) this arg0)) + (call-parent-method this arg0) ) ;; definition for method 40 of type elevator diff --git a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc index e2fa8501371..ee76b1b9c31 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/rigid-body-plat_REF.gc @@ -161,18 +161,11 @@ ) ;; definition for method 7 of type rigid-body-platform -;; WARN: Return type mismatch rigid-body-object vs rigid-body-platform. (defmethod relocate rigid-body-platform ((this rigid-body-platform) (new-addr int)) (if (nonzero? (-> this control-point-array)) (&+! (-> this control-point-array) new-addr) ) - (the-as - rigid-body-platform - ((the-as (function rigid-body-object int rigid-body-object) (find-parent-method rigid-body-platform 7)) - this - new-addr - ) - ) + (call-parent-method this new-addr) ) ;; definition for method 53 of type rigid-body-platform diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc index 0191e33767f..ea179a81cd4 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-anim_REF.gc @@ -63,7 +63,7 @@ (if (nonzero? (-> this flow)) (&+! (-> this flow) arg0) ) - ((the-as (function water-anim int water-anim) (find-parent-method water-anim 7)) this arg0) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-flow_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-flow_REF.gc index 01f39d9275a..63e97e6ffe9 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-flow_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-flow_REF.gc @@ -111,7 +111,7 @@ (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) - ((the-as (function flow-control int flow-control) (find-parent-method flow-control 7)) this arg0) + (call-parent-method this arg0) ) ;; definition for method 9 of type flow-control diff --git a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc index 5b54c893939..ae820bda629 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc @@ -776,10 +776,7 @@ ) ) ) - ((the-as (function editable-point editable-command none) (find-parent-method editable-point 28)) - this - (the-as editable-command arg0) - ) + (call-parent-method this arg0) 0 (none) ) @@ -1107,7 +1104,7 @@ ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 25 editable-light) has a return type of none, but the expression builder found a return statement. (defmethod editable-method-25 editable-light ((this editable-light) (arg0 editable-array)) - ((the-as (function editable-light editable-array none) (find-parent-method editable-light 25)) this arg0) + (call-parent-method this arg0) (when (nonzero? (-> this id)) (let ((s5-1 (clear *temp-string*))) (format s5-1 "delete from light where light_id=~D" (-> this id)) @@ -1278,7 +1275,7 @@ (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) ) ) - ((the-as (function editable-face editable-array none) (find-parent-method editable-face 25)) this arg0) + (call-parent-method this arg0) (none) ) @@ -1308,13 +1305,7 @@ ;; definition for method 27 of type editable-face ;; WARN: Return type mismatch editable-face vs editable. (defmethod editable-method-27 editable-face ((this editable-face) (arg0 editable-array)) - (let ((gp-1 - (the-as - editable-face - ((the-as (function editable-face editable-array editable) (find-parent-method editable-face 27)) this arg0) - ) - ) - ) + (let ((gp-1 (the-as editable-face (call-parent-method this arg0)))) (dotimes (s4-0 (-> gp-1 length)) (set! (-> gp-1 vertex s4-0) (the-as editable-point (editable-method-27 (-> gp-1 vertex s4-0) arg0))) (set! (-> gp-1 vertex s4-0 owner) (cons gp-1 (-> gp-1 vertex s4-0 owner))) @@ -1738,7 +1729,7 @@ (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) ) ) - ((the-as (function editable-plane editable-array none) (find-parent-method editable-plane 25)) this arg0) + (call-parent-method this arg0) (none) ) @@ -1752,13 +1743,7 @@ ;; definition for method 27 of type editable-plane ;; WARN: Return type mismatch editable-plane vs editable. (defmethod editable-method-27 editable-plane ((this editable-plane) (arg0 editable-array)) - (let ((gp-1 - (the-as - editable-plane - ((the-as (function editable-plane editable-array editable) (find-parent-method editable-plane 27)) this arg0) - ) - ) - ) + (let ((gp-1 (the-as editable-plane (call-parent-method this arg0)))) (dotimes (s4-0 (-> gp-1 length)) (set! (-> gp-1 vertex s4-0) (the-as editable-point (editable-method-27 (-> gp-1 vertex s4-0) arg0))) (set! (-> gp-1 vertex s4-0 owner) (cons gp-1 (-> gp-1 vertex s4-0 owner))) diff --git a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc index 7cd8b0aa0df..897178cef6d 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/nav-graph-editor_REF.gc @@ -225,12 +225,8 @@ ) ;; definition for method 7 of type nav-graph-editor -;; WARN: Return type mismatch none vs nav-graph-editor. (defmethod relocate nav-graph-editor ((this nav-graph-editor) (arg0 int)) - (the-as - nav-graph-editor - ((the-as (function process int none) (find-parent-method nav-graph-editor 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 60 of type nav-graph-editor diff --git a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc index b9e9f8948fb..33d04ef4325 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc @@ -573,7 +573,7 @@ ;; definition for method 3 of type entity (defmethod inspect entity ((this entity)) - ((the-as (function entity entity) (find-parent-method entity 3)) this) + (call-parent-method this) (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) (format #t "~Taid: ~D~%" (-> this aid)) this @@ -591,7 +591,7 @@ ;; definition for method 3 of type entity-actor (defmethod inspect entity-actor ((this entity-actor)) - ((the-as (function entity entity) (find-parent-method entity-actor 3)) this) + (call-parent-method this) (format #t "~Tetype: ~A~%" (-> this etype)) (format #t "~Ttask: ~d~%" (-> this task)) (format #t "~Tkill-mask: #x~X : (" (-> this kill-mask)) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc index 1453856a8fa..c9a524276bd 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc @@ -1647,7 +1647,6 @@ ) ;; definition for method 10 of type fail-mission -;; WARN: Return type mismatch process vs none. (defmethod deactivate fail-mission ((this fail-mission)) (set-filter-color! 1.0 1.0 1.0) (sound-group-continue (sound-group sfx music dialog sog3 ambient dialog2 sog6 sog7)) @@ -1655,7 +1654,7 @@ (update-rates! (-> *display* entity-clock) 1.0) (update-rates! (-> *display* target-clock) 1.0) (update-rates! (-> *display* camera-clock) 1.0) - ((the-as (function process process) (find-parent-method fail-mission 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc index 5bccb75dcb4..4e276f2979e 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash_REF.gc @@ -813,7 +813,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod dump-grid-info sphere-hash ((this sphere-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" - ((find-parent-method sphere-hash 15) this) + (call-parent-method this) (new 'stack-no-clear 'vector) (let ((f30-0 6144.0)) (set! (-> this work temp-box-min quad) (-> (target-pos 0) quad)) diff --git a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc index f3659316fb3..d0142f5d6a3 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -3366,7 +3366,7 @@ ) (set! (-> *setting-control* cam-default mode-name) #f) (set-zero! *camera-smush-control*) - ((the-as (function target none) (find-parent-method target 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc index c2aee3251ed..292585d4b16 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc @@ -1164,7 +1164,7 @@ ;; definition for method 3 of type engine-minimap (defmethod inspect engine-minimap ((this engine-minimap)) - ((the-as (function engine-minimap engine-minimap) (find-parent-method engine-minimap 3)) this) + (call-parent-method this) (let ((s5-0 0) (s4-0 (the-as connection-pers (-> *minimap* engine alive-list))) ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc index fd8256230fc..d2182e2606d 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -550,7 +550,7 @@ (enable-level-text-file-loading) (persist-with-delay *setting-control* 'allow-progress (seconds 0.1) 'allow-progress #f 0.0 0) (persist-with-delay *setting-control* 'allow-pause (seconds 0.1) 'allow-pause #f 0.0 0) - ((the-as (function progress none) (find-parent-method progress 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc index 3a7bbf706ed..562e30d681d 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc @@ -918,22 +918,18 @@ This commonly includes things such as: ;; definition for method 10 of type slider (defmethod deactivate slider ((this slider)) (sound-stop (the-as sound-id (-> this sound-id))) - ((the-as (function process-drawable none) (find-parent-method slider 10)) this) + (call-parent-method this) (none) ) ;; definition for method 7 of type slider -;; WARN: Return type mismatch process-drawable vs slider. (defmethod relocate slider ((this slider) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this l-bolts v1-0)) (&+! (-> this l-bolts v1-0) arg0) ) ) - (the-as - slider - ((the-as (function process-drawable int process-drawable) (find-parent-method slider 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type slider diff --git a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc index a11e761f684..a3625b5ee66 100644 --- a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc @@ -1869,7 +1869,6 @@ ) ;; definition for method 7 of type juicer -;; WARN: Return type mismatch process-focusable vs juicer. (defmethod relocate juicer ((this juicer) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) @@ -1877,10 +1876,7 @@ (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - juicer - ((the-as (function process-focusable int process-focusable) (find-parent-method juicer 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type juicer diff --git a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc index 1220ae52871..05770deeecc 100644 --- a/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/boss/castle-baron_REF.gc @@ -138,7 +138,7 @@ This commonly includes things such as: ;; definition for method 10 of type cboss-elevator (defmethod deactivate cboss-elevator ((this cboss-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method cboss-elevator 10)) this) + (call-parent-method this) (none) ) @@ -1493,7 +1493,7 @@ For example for an elevator pre-compute the distance between the first and last ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! krew-boss-shot ((this krew-boss-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method krew-boss-shot 31)) this) + (call-parent-method this) (set! (-> this move) krew-boss-shot-move) (set! (-> this max-speed) 245760.0) (set! (-> this timeout) (seconds 5)) diff --git a/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc b/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc index 8e30ce417e1..9cce38d4355 100644 --- a/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc @@ -101,7 +101,7 @@ This commonly includes things such as: ;; definition for method 10 of type cas-conveyor (defmethod deactivate cas-conveyor ((this cas-conveyor)) (sound-stop (-> this sound-id)) - ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) this) + (call-parent-method this) (none) ) @@ -1056,7 +1056,7 @@ This commonly includes things such as: ;; definition for method 10 of type cas-elevator (defmethod deactivate cas-elevator ((this cas-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function elevator none) (find-parent-method cas-elevator 10)) this) + (call-parent-method this) (none) ) @@ -2225,7 +2225,7 @@ This commonly includes things such as: ;; definition for method 10 of type cas-rot-blade (defmethod deactivate cas-rot-blade ((this cas-rot-blade)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method cas-rot-blade 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc b/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc index d535f03db76..c117b5f3b69 100644 --- a/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/pad/caspad-obs_REF.gc @@ -170,7 +170,7 @@ ;; definition for method 10 of type cpad-elevator (defmethod deactivate cpad-elevator ((this cpad-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function elevator none) (find-parent-method cpad-elevator 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc index 9d50333dfdd..da554fb997a 100644 --- a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc @@ -362,9 +362,9 @@ (defstate ambush (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 44)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (logand! (-> self flags) -9) @@ -431,9 +431,9 @@ (defstate idle (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 31)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -520,9 +520,9 @@ (defstate stare (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 35)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -789,9 +789,9 @@ (defstate die (roboguard-level) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method roboguard-level 38)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (roboguard-level-method-185 self (the-as symbol 0)) @@ -1239,17 +1239,13 @@ ;; definition for method 10 of type roboguard-level (defmethod deactivate roboguard-level ((this roboguard-level)) (sound-stop (-> this roll-sound)) - ((the-as (function nav-enemy none) (find-parent-method roboguard-level 10)) this) + (call-parent-method this) (none) ) ;; definition for method 7 of type roboguard-level -;; WARN: Return type mismatch nav-enemy vs roboguard-level. (defmethod relocate roboguard-level ((this roboguard-level) (arg0 int)) - (the-as - roboguard-level - ((the-as (function nav-enemy int nav-enemy) (find-parent-method roboguard-level 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 114 of type roboguard-level diff --git a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc index d4f2dcae314..758978be7b7 100644 --- a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc @@ -2305,7 +2305,6 @@ ) ;; definition for method 7 of type bombbot -;; WARN: Return type mismatch nav-enemy vs bombbot. (defmethod relocate bombbot ((this bombbot) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this joint-ik v1-0)) @@ -2315,7 +2314,7 @@ (if (nonzero? (-> this rigidbody)) (&+! (-> this rigidbody) arg0) ) - (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) this arg0)) + (call-parent-method this arg0) ) ;; definition for method 114 of type bombbot diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc index 8a379f39173..484e2bf65c4 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc @@ -2056,7 +2056,6 @@ This commonly includes things such as: ) ;; definition for method 7 of type cty-guard-turret -;; WARN: Return type mismatch process-focusable vs cty-guard-turret. (defmethod relocate cty-guard-turret ((this cty-guard-turret) (arg0 int)) (if (nonzero? (-> this jm-turret)) (&+! (-> this jm-turret) arg0) @@ -2067,13 +2066,7 @@ This commonly includes things such as: (if (nonzero? (-> this jm-gunsR)) (&+! (-> this jm-gunsR) arg0) ) - (the-as - cty-guard-turret - ((the-as (function process-focusable int process-focusable) (find-parent-method cty-guard-turret 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) ;; definition for method 32 of type cty-guard-turret @@ -4100,7 +4093,6 @@ This commonly includes things such as: ) ;; definition for method 7 of type barons-ship-lores -;; WARN: Return type mismatch process-drawable vs barons-ship-lores. (defmethod relocate barons-ship-lores ((this barons-ship-lores) (arg0 int)) (if (nonzero? (-> this paths 0)) (&+! (-> this paths 0) arg0) @@ -4111,10 +4103,7 @@ This commonly includes things such as: (if (nonzero? (-> this paths 2)) (&+! (-> this paths 2) arg0) ) - (the-as - barons-ship-lores - ((the-as (function process-drawable int process-drawable) (find-parent-method barons-ship-lores 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc index 0eb5f13e943..18a88f085d6 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/guard_REF.gc @@ -3870,7 +3870,6 @@ ) ;; definition for method 7 of type crimson-guard -;; WARN: Return type mismatch process-drawable vs crimson-guard. (defmethod relocate crimson-guard ((this crimson-guard) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) @@ -3878,10 +3877,7 @@ (if (nonzero? (-> this l-control)) (&+! (-> this l-control) arg0) ) - (the-as - crimson-guard - ((the-as (function process-drawable int process-drawable) (find-parent-method crimson-guard 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type crimson-guard diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc index f629f01cc70..919c48785c4 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-predator_REF.gc @@ -1159,15 +1159,8 @@ ) ;; definition for method 7 of type metalhead-predator -;; WARN: Return type mismatch process-drawable vs metalhead-predator. (defmethod relocate metalhead-predator ((this metalhead-predator) (arg0 int)) - (the-as - metalhead-predator - ((the-as (function process-drawable int process-drawable) (find-parent-method metalhead-predator 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type metalhead-predator diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc index b3f33005ddd..76639dab178 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/bike_REF.gc @@ -942,7 +942,7 @@ ;; definition for method 36 of type bike-base ;; WARN: Return type mismatch int vs none. (defmethod do-engine-sounds bike-base ((this bike-base)) - ((the-as (function object none) (find-parent-method bike-base 36)) this) + (call-parent-method this) (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (if (zero? (-> this roll-sound-id)) (set! (-> this roll-sound-id) (new-sound-id)) @@ -977,7 +977,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod draw-thrusters bike-base ((this bike-base)) - ((the-as (function object none) (find-parent-method bike-base 85)) this) + (call-parent-method this) (when (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 3))) (let* ((v1-4 (the-as object (-> s5-0 0 vector 2))) @@ -1093,7 +1093,7 @@ (if (nonzero? (-> this brake-r)) (&+! (-> this brake-r) arg0) ) - ((the-as (function object int bikea) (find-parent-method bikea 7)) this arg0) + (call-parent-method this arg0) ) ;; definition for method 32 of type bikea @@ -1255,7 +1255,7 @@ (if (nonzero? (-> this flap-r)) (&+! (-> this flap-r) arg0) ) - ((the-as (function object int bikeb) (find-parent-method bikeb 7)) this arg0) + (call-parent-method this arg0) ) ;; definition for method 32 of type bikeb @@ -1434,7 +1434,7 @@ (if (nonzero? (-> this spoiler-r)) (&+! (-> this spoiler-r) arg0) ) - ((the-as (function object int bikec) (find-parent-method bikec 7)) this arg0) + (call-parent-method this arg0) ) ;; definition for method 32 of type bikec @@ -1591,7 +1591,7 @@ (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) - ((the-as (function object int guard-bike) (find-parent-method guard-bike 7)) this arg0) + (call-parent-method this arg0) ) ;; definition for method 65 of type guard-bike diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc index af300f88bc0..70823a0893d 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/car_REF.gc @@ -1216,7 +1216,7 @@ (if (nonzero? (-> this rudder-r)) (&+! (-> this rudder-r) arg0) ) - ((the-as (function object object cara) (find-parent-method cara 7)) this arg0) + (call-parent-method this arg0) ) ;; definition for method 32 of type cara @@ -1382,7 +1382,7 @@ (if (nonzero? (-> this fin-rr)) (&+! (-> this fin-rr) arg0) ) - ((the-as (function object object carb) (find-parent-method carb 7)) this arg0) + (call-parent-method this arg0) ) ;; definition for method 32 of type carb @@ -1526,7 +1526,6 @@ ) ;; definition for method 7 of type carc -;; WARN: Return type mismatch carb vs carc. (defmethod relocate carc ((this carc) (arg0 int)) (if (nonzero? (-> this steering-wheel)) (&+! (-> this steering-wheel) arg0) @@ -1549,7 +1548,7 @@ (if (nonzero? (-> this fin2-rr)) (&+! (-> this fin2-rr) arg0) ) - (the-as carc ((the-as (function object object carb) (find-parent-method carc 7)) this arg0)) + (call-parent-method this arg0) ) ;; definition for method 32 of type carc @@ -1704,7 +1703,7 @@ (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) - ((the-as (function object object hellcat) (find-parent-method hellcat 7)) this arg0) + (call-parent-method this arg0) ) ;; definition for method 32 of type hellcat diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc index f2054df4717..4cc96521ffb 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/transport_REF.gc @@ -133,15 +133,11 @@ ) ;; definition for method 7 of type vehicle-turret -;; WARN: Return type mismatch process-drawable vs vehicle-turret. (defmethod relocate vehicle-turret ((this vehicle-turret) (arg0 int)) (if (nonzero? (-> this turret-jm)) (&+! (-> this turret-jm) arg0) ) - (the-as - vehicle-turret - ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-turret 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 30 of type vehicle-turret @@ -339,7 +335,7 @@ ;; definition for method 10 of type transport (defmethod deactivate transport ((this transport)) (sound-stop (-> this ambient-sound-id)) - ((the-as (function process-drawable none) (find-parent-method transport 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc index b09bcc68bf3..3aa0e5de6a2 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-rider_REF.gc @@ -344,7 +344,7 @@ This commonly includes things such as: ;; definition for method 33 of type citizen-norm-rider ;; WARN: Return type mismatch int vs none. (defmethod vehicle-rider-method-33 citizen-norm-rider ((this citizen-norm-rider)) - ((the-as (function vehicle-rider none) (find-parent-method citizen-norm-rider 33)) this) + (call-parent-method this) (setup-masks (-> this draw) 0 -1) (setup-masks (-> this draw) 32 0) (cond @@ -461,7 +461,7 @@ This commonly includes things such as: ;; definition for method 33 of type crimson-guard-rider ;; WARN: Return type mismatch int vs none. (defmethod vehicle-rider-method-33 crimson-guard-rider ((this crimson-guard-rider)) - ((the-as (function vehicle-rider none) (find-parent-method crimson-guard-rider 33)) this) + (call-parent-method this) (setup-masks (-> this draw) 0 28) (setup-masks (-> this draw) 3 0) (if (logtest? (-> this flags) 4) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc index a6d974f1499..f2da4eb1ec2 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-util_REF.gc @@ -198,7 +198,7 @@ ;; definition for method 10 of type vehicle (defmethod deactivate vehicle ((this vehicle)) (vehicle-method-110 this) - ((the-as (function rigid-body-object none) (find-parent-method vehicle 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-shot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-shot_REF.gc index 9fe8cc5a730..c1bb3644350 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-shot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-shot_REF.gc @@ -401,7 +401,7 @@ (sound-play "ashelin-shot-hi") ) ((= v1-0 (projectile-options lose-altitude proj-options-2)) - ((the-as (function projectile projectile-options none) (find-parent-method ashelin-shot 28)) this arg0) + (call-parent-method this arg0) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/battle_REF.gc b/test/decompiler/reference/jak2/levels/common/battle_REF.gc index c3ea7908d81..2f06eefc7ae 100644 --- a/test/decompiler/reference/jak2/levels/common/battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/battle_REF.gc @@ -1745,14 +1745,10 @@ ) ;; definition for method 7 of type battle -;; WARN: Return type mismatch process-drawable vs battle. (defmethod relocate battle ((this battle) (arg0 int)) (&+! (-> this spawners) arg0) (&+! (-> this allies) arg0) - (the-as - battle - ((the-as (function process-drawable int process-drawable) (find-parent-method battle 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 29 of type battle diff --git a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc index ca3d23c1311..9757a8916da 100644 --- a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc @@ -836,7 +836,7 @@ ;; definition for method 10 of type elec-gate (defmethod deactivate elec-gate ((this elec-gate)) (set-elec-scale-if-close! this 0.0) - ((the-as (function process-drawable none) (find-parent-method elec-gate 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc index c23c7c08fad..75b988f6a6a 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc @@ -186,7 +186,7 @@ (sound-play "cent-shot-hit") ) ((= v1-0 (projectile-options lose-altitude proj-options-2)) - ((the-as (function projectile projectile-options sound-id) (find-parent-method centurion-shot 28)) this arg0) + (call-parent-method this arg0) ) ) ) @@ -198,7 +198,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! centurion-shot ((this centurion-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method centurion-shot 31)) this) + (call-parent-method this) (set! (-> this max-speed) 327680.0) (set! (-> this timeout) (seconds 1.25)) (none) @@ -983,7 +983,7 @@ (defmethod dispose! centurion ((this centurion)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (play-communicator-speech! (-> *talker-speech* 58)) - ((the-as (function enemy none) (find-parent-method centurion 132)) this) + (call-parent-method this) (none) ) @@ -1596,15 +1596,11 @@ ) ;; definition for method 7 of type centurion -;; WARN: Return type mismatch process-focusable vs centurion. (defmethod relocate centurion ((this centurion) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - centurion - ((the-as (function process-focusable int process-focusable) (find-parent-method centurion 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type centurion diff --git a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc index 7a03e2f894d..7b39f359ca8 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc @@ -1305,7 +1305,7 @@ (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method flitter 132)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc index f0992882e2c..44de7ee7196 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/fodder/fodder_REF.gc @@ -1100,7 +1100,6 @@ ) ;; definition for method 7 of type fodder -;; WARN: Return type mismatch nav-enemy vs fodder. (defmethod relocate fodder ((this fodder) (arg0 int)) (if (nonzero? (-> this left-eye)) (&+! (-> this left-eye) arg0) @@ -1108,7 +1107,7 @@ (if (nonzero? (-> this right-eye)) (&+! (-> this right-eye) arg0) ) - (the-as fodder ((the-as (function nav-enemy int nav-enemy) (find-parent-method fodder 7)) this arg0)) + (call-parent-method this arg0) ) ;; definition for function fodder-setup-eye-control diff --git a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc index c6764bfa528..842f671bbb3 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc @@ -1293,7 +1293,6 @@ ) ;; definition for method 7 of type grenadier -;; WARN: Return type mismatch process-focusable vs grenadier. (defmethod relocate grenadier ((this grenadier) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) @@ -1303,10 +1302,7 @@ (&+! (-> this hostile-path) arg0) ) ) - (the-as - grenadier - ((the-as (function process-focusable int process-focusable) (find-parent-method grenadier 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type grenadier diff --git a/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc index e9884d097cd..2d9c992ef29 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc @@ -1489,7 +1489,7 @@ (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method grunt 132)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc index 7f3478b29de..3a011e2e535 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/crimson-guard-level_REF.gc @@ -4313,7 +4313,6 @@ ) ;; definition for method 7 of type crimson-guard-level -;; WARN: Return type mismatch nav-enemy vs crimson-guard-level. (defmethod relocate crimson-guard-level ((this crimson-guard-level) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) @@ -4321,10 +4320,7 @@ (if (nonzero? (-> this l-control)) (&+! (-> this l-control) arg0) ) - (the-as - crimson-guard-level - ((the-as (function nav-enemy int nav-enemy) (find-parent-method crimson-guard-level 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 203 of type crimson-guard-level diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc index 7fc8ef454de..6c7db238f87 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc @@ -864,20 +864,16 @@ (logior! (-> this minimap flags) (minimap-flag fade-out)) (set! (-> this minimap) #f) ) - ((the-as (function enemy none) (find-parent-method hopper 132)) this) + (call-parent-method this) (none) ) ;; definition for method 7 of type hopper -;; WARN: Return type mismatch process-focusable vs hopper. (defmethod relocate hopper ((this hopper) (arg0 int)) (if (nonzero? (-> this path-intro)) (&+! (-> this path-intro) arg0) ) - (the-as - hopper - ((the-as (function process-focusable int process-focusable) (find-parent-method hopper 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 114 of type hopper diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc index 7376f7a35e0..a1e61ae4755 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/crimson-guard-hover_REF.gc @@ -667,7 +667,7 @@ (defmethod enemy-method-135 crimson-guard-hover ((this crimson-guard-hover) (arg0 int)) (if (and (zero? arg0) (logtest? #x4000000 (-> this incoming penetrate-using))) (sound-play "hover-take-hit") - ((the-as (function enemy int sound-id) (find-parent-method crimson-guard-hover 135)) this arg0) + (call-parent-method this arg0) ) (the-as sound-id 0) ) @@ -995,7 +995,7 @@ (defstate knocked (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 30)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -1072,7 +1072,7 @@ (defstate flying-death (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 138)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -1134,7 +1134,7 @@ (defstate flying-death-explode (crimson-guard-hover) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state hover-enemy) (find-parent-method crimson-guard-hover 139)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 (t9-1) ) @@ -1231,16 +1231,7 @@ ) ) ) - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - this - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method this arg0 arg1 arg2 arg3) ) (('notify) (let ((a0-27 (the-as object (-> arg3 param 0))) @@ -1260,28 +1251,10 @@ ) ) ) - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - this - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method this arg0 arg1 arg2 arg3) ) (else - ((the-as - (function enemy process int symbol event-message-block object) - (find-parent-method crimson-guard-hover 74) - ) - this - arg0 - arg1 - arg2 - arg3 - ) + (call-parent-method this arg0 arg1 arg2 arg3) ) ) ) @@ -1380,7 +1353,7 @@ ) ) (else - ((the-as (function hover-enemy vector none) (find-parent-method crimson-guard-hover 52)) this arg0) + (call-parent-method this arg0) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc index 63c7ff49d92..9ede4df5367 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/flamer_REF.gc @@ -1496,15 +1496,11 @@ ) ;; definition for method 7 of type flamer -;; WARN: Return type mismatch process-drawable vs flamer. (defmethod relocate flamer ((this flamer) (arg0 int)) (if (nonzero? (-> this flit-joint)) (&+! (-> this flit-joint) arg0) ) - (the-as - flamer - ((the-as (function process-drawable int process-drawable) (find-parent-method flamer 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type flamer diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc index 7afa1b734c7..47e8f18bfd3 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-battle_REF.gc @@ -287,7 +287,6 @@ ) ;; definition for method 7 of type hover-enemy-manager -;; WARN: Return type mismatch process vs hover-enemy-manager. (defmethod relocate hover-enemy-manager ((this hover-enemy-manager) (arg0 int)) (when (-> this formation) (if (nonzero? (-> this formation)) @@ -297,10 +296,7 @@ (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) - (the-as - hover-enemy-manager - ((the-as (function process int process) (find-parent-method hover-enemy-manager 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 17 of type hover-enemy-manager diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc index 78e22e96a93..a4fbbbeec47 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy_REF.gc @@ -629,7 +629,7 @@ (set! (-> self knocked-start-level) (-> self root trans y)) ) :exit (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method hover-enemy 30)) exit))) + (let ((t9-1 (-> (the-as state (find-parent-state)) exit))) (if t9-1 (t9-1) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc index ad4381eba92..b5e4749eac8 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation_REF.gc @@ -681,7 +681,6 @@ ) ;; definition for method 7 of type hover-formation -;; WARN: Return type mismatch basic vs hover-formation. (defmethod relocate hover-formation ((this hover-formation) (arg0 int)) (if (nonzero? (-> this formation)) (&+! (-> this formation) arg0) @@ -689,10 +688,7 @@ (if (nonzero? (-> this path)) (&+! (-> this path) arg0) ) - (the-as - hover-formation - ((the-as (function basic int basic) (find-parent-method hover-formation 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 15 of type hover-formation diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc index 10cc412ae97..fc71d3c3a9d 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/wasp_REF.gc @@ -537,7 +537,7 @@ ) ) (else - ((the-as (function enemy vector none) (find-parent-method wasp 52)) this arg0) + (call-parent-method this arg0) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc index 6cc53de2612..871886d00f8 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc @@ -1233,15 +1233,11 @@ ) ;; definition for method 7 of type metalmonk -;; WARN: Return type mismatch process-focusable vs metalmonk. (defmethod relocate metalmonk ((this metalmonk) (arg0 int)) (if (nonzero? (-> this intro-path)) (&+! (-> this intro-path) arg0) ) - (the-as - metalmonk - ((the-as (function process-focusable int process-focusable) (find-parent-method metalmonk 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type metalmonk diff --git a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc index 95e4e0a90f5..71f3dadfcb0 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc @@ -44,7 +44,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! spyder-shot ((this spyder-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function projectile none) (find-parent-method spyder-shot 31)) this) + (call-parent-method this) (set! (-> this max-speed) 307200.0) (set! (-> this timeout) (seconds 0.267)) (none) @@ -1392,7 +1392,6 @@ ) ;; definition for method 7 of type spyder -;; WARN: Return type mismatch process-focusable vs spyder. (defmethod relocate spyder ((this spyder) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) @@ -1402,10 +1401,7 @@ (&+! (-> this joint-ik v1-4) arg0) ) ) - (the-as - spyder - ((the-as (function process-focusable int process-focusable) (find-parent-method spyder 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type spyder diff --git a/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc index e26aaf0f0ae..2b2c7d912da 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/com-elevator_REF.gc @@ -114,9 +114,9 @@ (defstate dormant (com-elevator) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method com-elevator 34)) enter))) + (let ((t9-1 (-> (find-parent-state) enter))) (if t9-1 - ((the-as (function none) t9-1)) + (t9-1) ) ) (process-entity-status! self (entity-perm-status subtask-complete) #t) @@ -199,7 +199,7 @@ ;; definition for method 10 of type com-elevator (defmethod deactivate com-elevator ((this com-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function elevator none) (find-parent-method com-elevator 10)) this) + (call-parent-method this) (none) ) @@ -350,7 +350,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 10 of type tomb-trans-elevator (defmethod deactivate tomb-trans-elevator ((this tomb-trans-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 10)) this) + (call-parent-method this) (none) ) @@ -359,7 +359,7 @@ For example for an elevator pre-compute the distance between the first and last (defmethod init-plat! tomb-trans-elevator ((this tomb-trans-elevator)) "Does any necessary initial platform setup. For example for an elevator pre-compute the distance between the first and last points (both ways) and clear the sound." - ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 33)) this) + (call-parent-method this) (set! (-> this sound-id) (new-sound-id)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc index 4e8895b9930..a8f64425078 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc @@ -1366,7 +1366,7 @@ (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) - ((the-as (function process-focusable none) (find-parent-method spydroid 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc index 6ff54d231e1..cb4fba747c8 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-manager_REF.gc @@ -1605,7 +1605,7 @@ (defmethod deactivate race-manager ((this race-manager)) (persist-with-delay *setting-control* 'music-volume (seconds 3) 'music-volume 'abs 0.0 0) (send-event *traffic-manager* 'restore-default-settings) - ((the-as (function process none) (find-parent-method race-manager 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc index 8bdb52ad43f..1a5c181dd36 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc @@ -861,7 +861,7 @@ This commonly includes things such as: ) ) ) - ((the-as (function process-taskable none) (find-parent-method youngsamos-npc 32)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc index ad2eb4828c8..09de1ca28eb 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc @@ -48,7 +48,7 @@ ;; definition for method 29 of type dig-sinking-plat ;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-29 dig-sinking-plat ((this dig-sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-sinking-plat 29)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc index e6b86f2daf7..039a21ce0a6 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc @@ -1574,7 +1574,7 @@ This commonly includes things such as: ;; definition for method 29 of type dig-tipping-rock ;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-29 dig-tipping-rock ((this dig-tipping-rock) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-tipping-rock 29)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc index f09de6ee8ce..9a76d69412a 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc @@ -1105,7 +1105,6 @@ ) ;; definition for method 7 of type drill-barons-ship-turret -;; WARN: Return type mismatch process-drawable vs drill-barons-ship-turret. (defmethod relocate drill-barons-ship-turret ((this drill-barons-ship-turret) (arg0 int)) (when (-> this jmod) (if (nonzero? (-> this jmod)) @@ -1122,13 +1121,7 @@ (&+! (-> this jmod-right) arg0) ) ) - (the-as - drill-barons-ship-turret - ((the-as (function process-drawable int process-drawable) (find-parent-method drill-barons-ship-turret 7)) - this - arg0 - ) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type drill-barons-ship @@ -1271,7 +1264,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch int vs none. (defmethod init-proj-settings! drill-ship-shot ((this drill-ship-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - ((the-as (function guard-shot none) (find-parent-method drill-ship-shot 31)) this) + (call-parent-method this) (set! (-> this attack-mode) 'drill-ship-shot) (set! (-> this move) guard-shot-move) (set! (-> this max-speed) 737280.0) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc index 3fb114f77e8..b3ee53e2b38 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc @@ -531,7 +531,7 @@ This commonly includes things such as: ;; definition for method 10 of type drill-elevator (defmethod deactivate drill-elevator ((this drill-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method drill-elevator 10)) this) + (call-parent-method this) (none) ) @@ -944,15 +944,11 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 7 of type fire-floor -;; WARN: Return type mismatch process-drawable vs fire-floor. (defmethod relocate fire-floor ((this fire-floor) (arg0 int)) (if (nonzero? (-> this part-off)) (&+! (-> this part-off) arg0) ) - (the-as - fire-floor - ((the-as (function process-drawable int process-drawable) (find-parent-method fire-floor 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 10 of type fire-floor @@ -961,7 +957,7 @@ For example for an elevator pre-compute the distance between the first and last (if (nonzero? (-> this part-off)) (kill-and-free-particles (-> this part-off)) ) - ((the-as (function process-drawable none) (find-parent-method fire-floor 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc b/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc index 9fe455e0f17..f29d16398c4 100644 --- a/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc @@ -204,7 +204,7 @@ This commonly includes things such as: :exit (behavior () (sound-stop (-> self sound-id)) (sound-play "drl-elev-stop") - (let ((t9-4 (-> (the-as state (find-parent-method drill-lift 36)) exit))) + (let ((t9-4 (-> (find-parent-state) exit))) (if t9-4 (t9-4) ) @@ -212,7 +212,7 @@ This commonly includes things such as: ) :post (behavior () (sound-play "drl-elevator-lp" :id (-> self sound-id) :position (-> self root trans)) - (let ((t9-2 (-> (the-as state (find-parent-method drill-lift 36)) post))) + (let ((t9-2 (-> (the-as state (find-parent-state)) post))) (if t9-2 ((the-as (function none) t9-2)) ) diff --git a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc index c29c40268b6..5f3c9b64b6c 100644 --- a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc @@ -992,11 +992,9 @@ ;; definition for method 10 of type ginsu (defmethod deactivate ginsu ((this ginsu)) - (when (nonzero? (-> this blade-part)) - (let ((a0-1 (-> this blade-part))) - ((the-as (function sparticle-launch-control none) (method-of-object a0-1 kill-and-free-particles)) a0-1) + (if (nonzero? (-> this blade-part)) + (kill-and-free-particles (-> this blade-part)) ) - ) (if (-> this blade-sound-playing) (sound-stop (-> this blade-sound)) ) diff --git a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc index 6363c5500b8..74d4f1618c0 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc @@ -438,7 +438,7 @@ This commonly includes things such as: (send-event (handle->process (-> this hud)) 'hide-and-die) ) (sound-stop (-> this sound-id)) - ((the-as (function process-focusable none) (find-parent-method forest-youngsamos 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc index 93df0012f42..869b481ce21 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc @@ -1506,12 +1506,8 @@ ) ;; definition for method 7 of type predator -;; WARN: Return type mismatch process-focusable vs predator. (defmethod relocate predator ((this predator) (arg0 int)) - (the-as - predator - ((the-as (function process-focusable int process-focusable) (find-parent-method predator 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 167 of type predator diff --git a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc index 15e1c0be34b..2a9e55164fa 100644 --- a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc @@ -448,7 +448,6 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ;; definition for method 7 of type wren -;; WARN: Return type mismatch process-drawable vs wren. (defmethod relocate wren ((this wren) (arg0 int)) (dotimes (v1-0 2) (when (-> this fly-curve v1-0) @@ -457,10 +456,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (the-as - wren - ((the-as (function process-drawable int process-drawable) (find-parent-method wren 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type wren diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc index adfbe215196..20eea3a206b 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-obs_REF.gc @@ -418,7 +418,7 @@ This commonly includes things such as: ;; definition for method 10 of type fort-missile-target (defmethod deactivate fort-missile-target ((this fort-missile-target)) (sound-stop (the-as sound-id (-> this sound-id))) - ((the-as (function process-drawable none) (find-parent-method fort-missile-target 10)) this) + (call-parent-method this) (none) ) @@ -991,15 +991,11 @@ This commonly includes things such as: ) ;; definition for method 7 of type fort-missile -;; WARN: Return type mismatch process-drawable vs fort-missile. (defmethod relocate fort-missile ((this fort-missile) (arg0 int)) (if (nonzero? (-> this part-doom)) (&+! (-> this part-doom) arg0) ) - (the-as - fort-missile - ((the-as (function process-drawable int process-drawable) (find-parent-method fort-missile 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type fort-missile diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc index d14e62ac2e8..804de9106b9 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank-turret_REF.gc @@ -380,7 +380,7 @@ (defmethod deactivate fort-roboscreen ((this fort-roboscreen)) (disable *screen-filter*) (set-roboscreen-alpha! 0.0) - ((the-as (function process-drawable none) (find-parent-method fort-roboscreen 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc index 51f2c99644a..86db587b46d 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fort-robotank_REF.gc @@ -1064,7 +1064,6 @@ ) ;; definition for method 7 of type fort-robotank -;; WARN: Return type mismatch process-drawable vs fort-robotank. (defmethod relocate fort-robotank ((this fort-robotank) (arg0 int)) (if (nonzero? (-> this barrel-part)) (&+! (-> this barrel-part) arg0) @@ -1113,10 +1112,7 @@ ) ) ) - (the-as - fort-robotank - ((the-as (function process-drawable int process-drawable) (find-parent-method fort-robotank 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type fort-robotank diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc index f4838553978..75426b5a104 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-obs_REF.gc @@ -313,7 +313,7 @@ This commonly includes things such as: (defstate shutdown (elec-lock-gate) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as state (find-parent-method elec-lock-gate 22)) enter))) + (let ((t9-1 (-> (the-as state (find-parent-state)) enter))) (if t9-1 ((the-as (function none) t9-1)) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc index d824e2a87f3..bb1a10545f3 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-obs_REF.gc @@ -429,7 +429,7 @@ This commonly includes things such as: ;; definition for method 10 of type fort-elec-belt-inst (defmethod deactivate fort-elec-belt-inst ((this fort-elec-belt-inst)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method fort-elec-belt-inst 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc index 70a96a30b9a..75b9bc53080 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -209,7 +209,7 @@ ) (training-manager-method-24 this) (training-manager-method-25 this) - ((the-as (function process none) (find-parent-method training-manager 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc index 32a630858a9..e48ef02c4d6 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc @@ -1796,22 +1796,18 @@ (kill-and-free-particles (-> this score-part s5-0)) ) ) - ((the-as (function process none) (find-parent-method whack-a-metal 10)) this) + (call-parent-method this) (none) ) ;; definition for method 7 of type whack-a-metal -;; WARN: Return type mismatch process-drawable vs whack-a-metal. (defmethod relocate whack-a-metal ((this whack-a-metal) (arg0 int)) (dotimes (v1-0 2) (if (nonzero? (-> this score-part v1-0)) (&+! (-> this score-part v1-0) arg0) ) ) - (the-as - whack-a-metal - ((the-as (function process-drawable int process-drawable) (find-parent-method whack-a-metal 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 29 of type whack-a-metal diff --git a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc index 3733bee46b5..aac87b824f9 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc @@ -390,17 +390,13 @@ This commonly includes things such as: ) ;; definition for method 7 of type metalhead-spawner -;; WARN: Return type mismatch process vs metalhead-spawner. (defmethod relocate metalhead-spawner ((this metalhead-spawner) (arg0 int)) (dotimes (v1-0 19) (if (nonzero? (-> this path-tbl v1-0)) (&+! (-> this path-tbl v1-0) arg0) ) ) - (the-as - metalhead-spawner - ((the-as (function process int process) (find-parent-method metalhead-spawner 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type metalhead-spawner diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc index c0b00899b1e..f39220e67b0 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc @@ -3524,7 +3524,7 @@ This commonly includes things such as: (task-arrow-spawn gp-0 self) ) ) - (let ((t9-5 (-> (the-as state (find-parent-method trans-plat 34)) enter))) + (let ((t9-5 (-> (the-as state (find-parent-state)) enter))) (if t9-5 ((the-as (function none) t9-5)) ) @@ -3534,7 +3534,7 @@ This commonly includes things such as: (while (-> self child) (deactivate (-> self child 0)) ) - (let ((t9-2 (-> (the-as state (find-parent-method trans-plat 34)) exit))) + (let ((t9-2 (-> (the-as state (find-parent-state)) exit))) (if t9-2 (t9-2) ) @@ -3558,7 +3558,7 @@ This commonly includes things such as: 0 ) ) - (let ((t9-2 (-> (the-as state (find-parent-method trans-plat 34)) trans))) + (let ((t9-2 (-> (the-as state (find-parent-state)) trans))) (if t9-2 (t9-2) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc index f80efa6bbf8..171c7ffc3a2 100644 --- a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc @@ -1904,15 +1904,11 @@ ) ;; definition for method 7 of type rhino -;; WARN: Return type mismatch process-focusable vs rhino. (defmethod relocate rhino ((this rhino) (arg0 int)) (if (nonzero? (-> this path-intro)) (&+! (-> this path-intro) arg0) ) - (the-as - rhino - ((the-as (function process-focusable int process-focusable) (find-parent-method rhino 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type rhino diff --git a/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc b/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc index a0b99261f3d..5c04cc533f6 100644 --- a/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc @@ -24,14 +24,11 @@ ) ;; definition for method 28 of type flying-spider-shot -;; WARN: Return type mismatch sound-id vs none. +;; WARN: Return type mismatch object vs none. (defmethod play-impact-sound flying-spider-shot ((this flying-spider-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "fly-spider-shot") - ((the-as (function projectile projectile-options sound-id) (find-parent-method flying-spider-shot 28)) - this - arg0 - ) + (call-parent-method this arg0) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc index 144f97d9241..2d66ed83f3f 100644 --- a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc @@ -1588,17 +1588,13 @@ ) ;; definition for method 7 of type mammoth -;; WARN: Return type mismatch process-focusable vs mammoth. (defmethod relocate mammoth ((this mammoth) (arg0 int)) (dotimes (v1-0 4) (if (nonzero? (-> this joint-ik v1-0)) (&+! (-> this joint-ik v1-0) arg0) ) ) - (the-as - mammoth - ((the-as (function process-focusable int process-focusable) (find-parent-method mammoth 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 114 of type mammoth diff --git a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc index 16e5c0a28b6..72f8124a11e 100644 --- a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc @@ -448,7 +448,7 @@ (defstate active (mantis) :virtual #t :trans (behavior () - (let ((t9-1 (-> (the-as (state enemy) (find-parent-method mantis 32)) trans))) + (let ((t9-1 (-> (the-as (state enemy) (find-parent-state)) trans))) (if t9-1 (t9-1) ) diff --git a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc index 0e5733b0425..29de5be14cd 100644 --- a/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/cable/palcab-obs_REF.gc @@ -1037,7 +1037,7 @@ This commonly includes things such as: (defmethod deactivate pal-rot-gun ((this pal-rot-gun)) (sound-stop (-> this sound-id)) (sound-stop (-> this shot-sound-id)) - ((the-as (function process-drawable none) (find-parent-method pal-rot-gun 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc index 40b4d333f3a..dffa66dd1f1 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -1466,15 +1466,11 @@ ) ;; definition for method 7 of type rapid-gunner -;; WARN: Return type mismatch process-focusable vs rapid-gunner. (defmethod relocate rapid-gunner ((this rapid-gunner) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - rapid-gunner - ((the-as (function process-focusable int process-focusable) (find-parent-method rapid-gunner 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 115 of type rapid-gunner diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc index 987d021aa4b..0049f8cabf7 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc @@ -34,7 +34,7 @@ ;; definition for method 29 of type sinking-plat ;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-29 sinking-plat ((this sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method sinking-plat 29)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc index 5757f422b64..a45cf0bbc95 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc @@ -2332,7 +2332,6 @@ ) ;; definition for method 7 of type hosehead -;; WARN: Return type mismatch none vs hosehead. (defmethod relocate hosehead ((this hosehead) (arg0 int)) (if (nonzero? (-> this head-joint-mod)) (&+! (-> this head-joint-mod) arg0) @@ -2342,7 +2341,7 @@ (&+! (-> this joint-ik v1-4) arg0) ) ) - (the-as hosehead ((the-as (function process-drawable int none) (find-parent-method hosehead 7)) this arg0)) + (call-parent-method this arg0) ) ;; definition for method 115 of type hosehead diff --git a/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc index 8f6adf4140d..5fad71b21a3 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc @@ -1285,7 +1285,7 @@ ;; definition for method 140 of type pal-gun-turret (defmethod fire-turret! pal-gun-turret ((this pal-gun-turret) (arg0 symbol)) "@overrides Calls [[sew-gunturret::140]] but also customizes the turret flash via [[set-palcab-turret-flash!]]" - ((the-as (function sew-gunturret symbol none) (find-parent-method pal-gun-turret 140)) this arg0) + (call-parent-method this arg0) (set-palcab-turret-flash! 1.0) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc index 6e72a73c18a..27d30d454a3 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -153,7 +153,7 @@ ;; definition for method 10 of type sew-elevator (defmethod deactivate sew-elevator ((this sew-elevator)) (sound-stop (-> this sound-id)) - ((the-as (function elevator none) (find-parent-method sew-elevator 10)) this) + (call-parent-method this) (none) ) @@ -361,15 +361,11 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 7 of type sew-valve -;; WARN: Return type mismatch process-drawable vs sew-valve. (defmethod relocate sew-valve ((this sew-valve) (arg0 int)) (if (nonzero? (-> this joint)) (&+! (-> this joint) arg0) ) - (the-as - sew-valve - ((the-as (function process-drawable int process-drawable) (find-parent-method sew-valve 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type sew-valve diff --git a/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc b/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc index 54615ab91a3..4c0eda29692 100644 --- a/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc @@ -805,15 +805,11 @@ ) ;; definition for method 7 of type vehicle-race-bike -;; WARN: Return type mismatch process-drawable vs vehicle-race-bike. (defmethod relocate vehicle-race-bike ((this vehicle-race-bike) (arg0 int)) (if (nonzero? (-> this steering-wheel)) (&+! (-> this steering-wheel) arg0) ) - (the-as - vehicle-race-bike - ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-race-bike 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 86 of type vehicle-race-bike diff --git a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc index 85ac0e2ef54..a0267b2fa17 100644 --- a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-obs_REF.gc @@ -1362,7 +1362,7 @@ ;; definition for method 10 of type hoverboard-training-manager (defmethod deactivate hoverboard-training-manager ((this hoverboard-training-manager)) (send-event *traffic-manager* 'restore-default-settings) - ((the-as (function process none) (find-parent-method hoverboard-training-manager 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc index 1ba01d01106..3f5969620e1 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc @@ -1045,7 +1045,7 @@ This commonly includes things such as: (if (< 40960.0 (-> arg0 impulse)) (sound-play "rift-fall") ) - ((the-as (function rigid-body-object rigid-body-impact none) (find-parent-method rift-rider 45)) this arg0) + (call-parent-method this arg0) (none) ) @@ -1116,7 +1116,7 @@ This commonly includes things such as: ;; definition for method 10 of type rift-rider (defmethod deactivate rift-rider ((this rift-rider)) (sound-stop (-> this sound-id)) - ((the-as (function rigid-body-object none) (find-parent-method rift-rider 10)) this) + (call-parent-method this) (none) ) @@ -2161,7 +2161,7 @@ This commonly includes things such as: (send-event (handle->process (-> this hud)) 'hide-and-die) ) (kill-lightning this) - ((the-as (function process-focusable none) (find-parent-method stad-samos 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc index 32ca1a736f3..ae85d29cda3 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc @@ -427,15 +427,11 @@ This commonly includes things such as: ) ;; definition for method 7 of type pitspikes -;; WARN: Return type mismatch strip-hazard vs pitspikes. (defmethod relocate pitspikes ((this pitspikes) (arg0 int)) (if (nonzero? (-> this spinner)) (&+! (-> this spinner) arg0) ) - (the-as - pitspikes - ((the-as (function strip-hazard int strip-hazard) (find-parent-method pitspikes 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type pitspikes diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc index 64ca82bf4c7..0e06130a28b 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc @@ -343,7 +343,7 @@ :enter (behavior () (set! (-> self root trans quad) (-> self entity extra trans quad)) (quaternion-copy! (-> self root quat) (-> self entity quat)) - (let ((t9-2 (-> (the-as (state enemy) (find-parent-method tomb-beetle 27)) enter))) + (let ((t9-2 (-> (the-as (state enemy) (find-parent-state)) enter))) (if t9-2 (t9-2) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc index 7c70141a2c2..c2b0ad15f6e 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc @@ -1793,7 +1793,7 @@ This commonly includes things such as: ;; definition for method 10 of type tomb-plat-return (defmethod deactivate tomb-plat-return ((this tomb-plat-return)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-plat-return 10)) this) + (call-parent-method this) (none) ) @@ -2160,7 +2160,7 @@ This commonly includes things such as: ;; definition for method 10 of type tomb-sphinx (defmethod deactivate tomb-sphinx ((this tomb-sphinx)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-sphinx 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc index 34b298162b1..7015651eece 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc @@ -676,7 +676,7 @@ This commonly includes things such as: ) ) :trans (behavior () - (let ((t9-1 (-> (the-as (state basebutton) (find-parent-method tomb-beetle-button 30)) trans))) + (let ((t9-1 (-> (the-as (state basebutton) (find-parent-state)) trans))) (if t9-1 (t9-1) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc index 23228215553..0d28047476d 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc @@ -1274,12 +1274,11 @@ This commonly includes things such as: (if (nonzero? (-> this skid-part)) (kill-and-free-particles (-> this warning-spark-part)) ) - ((the-as (function process-drawable none) (find-parent-method widow-bomb 10)) this) + (call-parent-method this) (none) ) ;; definition for method 7 of type widow-bomb -;; WARN: Return type mismatch process-drawable vs widow-bomb. (defmethod relocate widow-bomb ((this widow-bomb) (arg0 int)) (if (nonzero? (-> this explode-part)) (&+! (-> this explode-part) arg0) @@ -1299,10 +1298,7 @@ This commonly includes things such as: (if (nonzero? (-> this spin-jm)) (&+! (-> this spin-jm) arg0) ) - (the-as - widow-bomb - ((the-as (function process-drawable int process-drawable) (find-parent-method widow-bomb 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for function widow-bomb-reaction @@ -1694,20 +1690,16 @@ This commonly includes things such as: (if (nonzero? (-> this explode-part)) (kill-and-free-particles (-> this explode-part)) ) - ((the-as (function process-drawable none) (find-parent-method tomb-boss-pillar 10)) this) + (call-parent-method this) (none) ) ;; definition for method 7 of type tomb-boss-pillar -;; WARN: Return type mismatch process-drawable vs tomb-boss-pillar. (defmethod relocate tomb-boss-pillar ((this tomb-boss-pillar) (arg0 int)) (if (nonzero? (-> this explode-part)) (&+! (-> this explode-part) arg0) ) - (the-as - tomb-boss-pillar - ((the-as (function process-drawable int process-drawable) (find-parent-method tomb-boss-pillar 7)) this arg0) - ) + (call-parent-method this arg0) ) ;; definition for method 11 of type tomb-boss-pillar diff --git a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc index 3475f1fc0f9..8b0f2d2b543 100644 --- a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc @@ -509,7 +509,7 @@ (defstate stare (jellyfish) :virtual #t :enter (behavior () - (let ((t9-1 (-> (the-as (state enemy) (find-parent-method jellyfish 35)) enter))) + (let ((t9-1 (-> (the-as (state enemy) (find-parent-state)) enter))) (if t9-1 (t9-1) ) @@ -1299,7 +1299,7 @@ ;; definition for method 10 of type jellyfish (defmethod deactivate jellyfish ((this jellyfish)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method jellyfish 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc index 19df5a8b98d..6f56de1e6ef 100644 --- a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc @@ -983,7 +983,7 @@ This commonly includes things such as: ;; definition for method 29 of type under-buoy-plat ;; WARN: Return type mismatch int vs none. (defmethod rigid-body-object-method-29 under-buoy-plat ((this under-buoy-plat) (arg0 float)) - ((the-as (function rigid-body-object float none) (find-parent-method under-buoy-plat 29)) this arg0) + (call-parent-method this arg0) (rigid-body-platform-method-56 this (-> this orig-trans)) 0 (none) @@ -1775,7 +1775,7 @@ This commonly includes things such as: ;; definition for method 10 of type under-lift (defmethod deactivate under-lift ((this under-lift)) (sound-stop (-> this sound-id)) - ((the-as (function process-drawable none) (find-parent-method under-lift 10)) this) + (call-parent-method this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc b/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc index ad8ce908ba7..d69be6f55ef 100644 --- a/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-shoot-block_REF.gc @@ -2356,7 +2356,7 @@ ) ) ) - ((the-as (function process-drawable none) (find-parent-method under-shoot-block 10)) this) + (call-parent-method this) (none) )