mirror of
https://github.com/open-goal/jak-project
synced 2026-07-11 23:30:16 -04:00
decomp for jak1, methods only
This commit is contained in:
@@ -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,64 @@ 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;
|
||||
// should be calling this from a method:
|
||||
if (env.func->guessed_name.kind != FunctionName::FunctionKind::METHOD) {
|
||||
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.",
|
||||
env.func->name());
|
||||
}
|
||||
// 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() != env.func->method_of_type) {
|
||||
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(), env.func->method_of_type);
|
||||
can_use_call_parent = false;
|
||||
}
|
||||
const auto& id_arg = input.get(Register(Reg::GPR, Reg::A1));
|
||||
if (can_use_call_parent && !id_arg.is_integer_constant(env.func->guessed_name.method_id)) {
|
||||
lg::warn(
|
||||
"Can't use call-parent-method because the second argument is wrong: got {}, but expected "
|
||||
"a constant integer {}",
|
||||
id_arg.print(), env.func->guessed_name.method_id);
|
||||
can_use_call_parent = false;
|
||||
}
|
||||
|
||||
if (can_use_call_parent) {
|
||||
end_types.get(Register(Reg::GPR, Reg::V0)) = TP_Type::make_from_ts(env.func->type);
|
||||
use_normal_last_arg = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (use_normal_last_arg) {
|
||||
end_types.get(Register(Reg::GPR, Reg::V0)) = TP_Type::make_from_ts(in_type.last_arg());
|
||||
}
|
||||
|
||||
if (in_type.arg_count() < 1) {
|
||||
throw std::runtime_error("Called a function, but we do not know its type");
|
||||
}
|
||||
|
||||
// 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:
|
||||
|
||||
@@ -3892,6 +3892,25 @@ 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) {
|
||||
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<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("call-parent-method")),
|
||||
arg_forms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result->push_back(new_form);
|
||||
}
|
||||
|
||||
|
||||
@@ -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"]],
|
||||
@@ -1651,8 +1649,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 +1969,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 +2227,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"],
|
||||
@@ -2306,8 +2298,6 @@
|
||||
|
||||
"(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 +2313,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 +2390,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"]],
|
||||
@@ -2896,10 +2882,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 +2907,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 +2932,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
|
||||
@@ -2987,8 +2957,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 +3026,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 +3056,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)": [
|
||||
@@ -3239,14 +3201,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 +3664,6 @@
|
||||
[79, "v1", "float"]
|
||||
],
|
||||
|
||||
"(method 38 fisher)": [[33, "t9", "(function fisher none)"]],
|
||||
|
||||
"(enter fisher-done)": [
|
||||
[137, "f0", "float"],
|
||||
[148, "f0", "float"],
|
||||
@@ -4096,10 +4048,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 +4088,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 +4108,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 +4117,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"]],
|
||||
@@ -4223,10 +4145,6 @@
|
||||
[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 +4164,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"],
|
||||
@@ -4268,10 +4182,6 @@
|
||||
|
||||
"(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 +4193,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 +4200,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"]
|
||||
@@ -4425,32 +4327,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 +4365,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 +4373,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 +4399,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 +4632,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 +4710,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,12 +4763,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"]],
|
||||
@@ -5014,14 +4866,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"]],
|
||||
@@ -5107,10 +4951,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)"]
|
||||
@@ -5924,10 +5764,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 +5801,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 +5816,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 +5840,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 +5861,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 +5888,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 +5937,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 +6010,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 +6081,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 +6197,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 +6224,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 +6320,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 +6694,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)": [
|
||||
|
||||
@@ -82,6 +82,8 @@ std::string TP_Type::print() const {
|
||||
return "<run-function-in-process-func>";
|
||||
case Kind::GET_ART_BY_NAME_METHOD:
|
||||
return "<get-art-by-name-method>";
|
||||
case Kind::FIND_PARENT_METHOD_FUNCTION:
|
||||
return "<find-parent-method-func>";
|
||||
case Kind::SYMBOL:
|
||||
return fmt::format("<sym {}>", 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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
(if (nonzero? (-> obj rand-gen))
|
||||
(set! (-> obj rand-gen) (the-as random-generator (+ (the-as int (-> obj rand-gen)) arg0)))
|
||||
)
|
||||
(the-as nav-enemy ((the-as (function process-drawable int none) (find-parent-method nav-enemy 7)) obj arg0))
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod new-patrol-point! nav-enemy ((obj nav-enemy))
|
||||
|
||||
@@ -319,13 +319,7 @@
|
||||
(the-as rigid-body-control-point-inline-array (+ (the-as int (-> obj control-point-array)) arg0))
|
||||
)
|
||||
)
|
||||
(the-as
|
||||
rigid-body-platform
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method rigid-body-platform 7))
|
||||
obj
|
||||
arg0
|
||||
)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod rigid-body-platform-method-22 rigid-body-platform ((obj rigid-body-platform) (arg0 vector) (arg1 float))
|
||||
|
||||
@@ -146,7 +146,7 @@ nav-enemy-default-event-handler
|
||||
(set! (-> obj last-y) f28-0)
|
||||
)
|
||||
)
|
||||
((the-as (function nav-enemy none) (find-parent-method sharkey 39)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -2045,7 +2045,7 @@
|
||||
|
||||
(defmethod deactivate target ((obj target))
|
||||
(set-zero! *camera-smush-control*)
|
||||
((the-as (function process-drawable none) (find-parent-method target 10)) obj)
|
||||
(call-parent-method obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
@@ -962,10 +962,7 @@
|
||||
(if (nonzero? (-> obj wobbler))
|
||||
(&+! (-> obj wobbler) arg0)
|
||||
)
|
||||
(the-as
|
||||
flutflutegg
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method flutflutegg 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement.
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
(if (nonzero? (-> obj part-landing))
|
||||
(set! (-> obj part-landing) (the-as sparticle-launch-control (+ (the-as int (-> obj part-landing)) arg0)))
|
||||
)
|
||||
(the-as beach-rock ((the-as (function process-drawable int none) (find-parent-method beach-rock 7)) obj arg0))
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod deactivate beach-rock ((obj beach-rock))
|
||||
@@ -265,7 +265,7 @@
|
||||
(if (nonzero? (-> obj part-landing))
|
||||
(kill-and-free-particles (-> obj part-landing))
|
||||
)
|
||||
((the-as (function process-drawable none) (find-parent-method beach-rock 10)) obj)
|
||||
(call-parent-method obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
)
|
||||
|
||||
(defmethod setup-new-process! citb-arm ((obj citb-arm))
|
||||
((the-as (function citb-arm-section none) (find-parent-method citb-arm 21)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj draw origin-joint-index) (the-as uint 4))
|
||||
(set-vector! (-> obj cull-dir-local) 0.0 0.0 -1.0 1.0)
|
||||
(set! (-> obj cull-dot) (cos 5461.3335))
|
||||
@@ -198,7 +198,7 @@
|
||||
|
||||
|
||||
(defmethod setup-new-process! citb-arm-shoulder ((obj citb-arm-shoulder))
|
||||
((the-as (function citb-arm-section none) (find-parent-method citb-arm-shoulder 21)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj draw origin-joint-index) (the-as uint 4))
|
||||
(set-vector! (-> obj cull-dir-local) 1.0 0.0 1.0 1.0)
|
||||
(set! (-> obj cull-dot) (cos 8374.045))
|
||||
@@ -262,7 +262,7 @@
|
||||
|
||||
(defmethod setup-new-process! citb-arm-a ((obj citb-arm-a))
|
||||
(initialize-skeleton obj *citb-arm-a-sg* '())
|
||||
((the-as (function citb-arm none) (find-parent-method citb-arm-a 21)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj root-override root-prim local-sphere z) -184320.0)
|
||||
0
|
||||
(none)
|
||||
@@ -270,7 +270,7 @@
|
||||
|
||||
(defmethod setup-new-process! citb-arm-b ((obj citb-arm-b))
|
||||
(initialize-skeleton obj *citb-arm-b-sg* '())
|
||||
((the-as (function citb-arm none) (find-parent-method citb-arm-b 21)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj root-override root-prim local-sphere z) -225280.0)
|
||||
0
|
||||
(none)
|
||||
@@ -278,7 +278,7 @@
|
||||
|
||||
(defmethod setup-new-process! citb-arm-c ((obj citb-arm-c))
|
||||
(initialize-skeleton obj *citb-arm-c-sg* '())
|
||||
((the-as (function citb-arm none) (find-parent-method citb-arm-c 21)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj root-override root-prim local-sphere z) -266240.0)
|
||||
0
|
||||
(none)
|
||||
@@ -286,7 +286,7 @@
|
||||
|
||||
(defmethod setup-new-process! citb-arm-d ((obj citb-arm-d))
|
||||
(initialize-skeleton obj *citb-arm-d-sg* '())
|
||||
((the-as (function citb-arm none) (find-parent-method citb-arm-d 21)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj root-override root-prim local-sphere z) -307200.0)
|
||||
0
|
||||
(none)
|
||||
@@ -294,14 +294,14 @@
|
||||
|
||||
(defmethod setup-new-process! citb-arm-shoulder-a ((obj citb-arm-shoulder-a))
|
||||
(initialize-skeleton obj *citb-arm-shoulder-a-sg* '())
|
||||
((the-as (function citb-arm none) (find-parent-method citb-arm-shoulder-a 21)) (the-as citb-arm obj))
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod setup-new-process! citb-arm-shoulder-b ((obj citb-arm-shoulder-b))
|
||||
(initialize-skeleton obj *citb-arm-shoulder-b-sg* '())
|
||||
((the-as (function citb-arm none) (find-parent-method citb-arm-shoulder-b 21)) (the-as citb-arm obj))
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -1550,7 +1550,7 @@
|
||||
)
|
||||
|
||||
(defmethod battlecontroller-method-27 citb-battlecontroller ((obj citb-battlecontroller))
|
||||
((the-as (function battlecontroller none) (find-parent-method citb-battlecontroller 27)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj activate-distance) 143360.0)
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -515,7 +515,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> obj sound-name) "redsage-fires")
|
||||
((the-as (function citb-sage none) (find-parent-method red-sagecage 44)) obj)
|
||||
(call-parent-method obj)
|
||||
(the-as symbol 0)
|
||||
)
|
||||
|
||||
@@ -633,7 +633,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> obj sound-name) "bluesage-fires")
|
||||
((the-as (function citb-sage none) (find-parent-method blue-sagecage 44)) obj)
|
||||
(call-parent-method obj)
|
||||
(the-as symbol 0)
|
||||
)
|
||||
|
||||
@@ -746,7 +746,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> obj sound-name) "yellsage-fire")
|
||||
((the-as (function citb-sage none) (find-parent-method yellow-sagecage 44)) obj)
|
||||
(call-parent-method obj)
|
||||
(the-as symbol 0)
|
||||
)
|
||||
|
||||
@@ -826,7 +826,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> obj sound-name) "greensage-fires")
|
||||
((the-as (function citb-sage none) (find-parent-method green-sagecage 44)) obj)
|
||||
(call-parent-method obj)
|
||||
(the-as symbol 0)
|
||||
)
|
||||
|
||||
|
||||
@@ -434,7 +434,7 @@
|
||||
)
|
||||
|
||||
(defmethod rigid-body-platform-method-23 citb-chain-plat ((obj citb-chain-plat) (arg0 float))
|
||||
((the-as (function rigid-body-platform float none) (find-parent-method citb-chain-plat 23)) obj arg0)
|
||||
(call-parent-method obj arg0)
|
||||
(rigid-body-platform-method-27 obj (-> obj orig-trans))
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -590,10 +590,7 @@ battlecontroller-default-event-handler
|
||||
(if (nonzero? (-> obj path-spawn))
|
||||
(&+! (-> obj path-spawn) arg0)
|
||||
)
|
||||
(the-as
|
||||
battlecontroller
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method battlecontroller 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod deactivate battlecontroller ((obj 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)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -1175,7 +1175,7 @@
|
||||
(go (method-of-object obj play-anim))
|
||||
)
|
||||
(else
|
||||
((the-as (function fisher none) (find-parent-method fisher 38)) obj)
|
||||
(call-parent-method obj)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
|
||||
@@ -32,7 +32,7 @@ nav-enemy-default-event-handler
|
||||
(set! (-> v1-1 settings bot-plane w) (- (- (-> obj shadow-min-y) (-> obj collide-info trans y))))
|
||||
)
|
||||
0
|
||||
((the-as (function nav-enemy none) (find-parent-method hopper 39)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -1085,10 +1085,7 @@
|
||||
(if (nonzero? (-> obj back-prim))
|
||||
(&+! (-> obj back-prim) arg0)
|
||||
)
|
||||
(the-as
|
||||
jngpusher
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method jngpusher 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defskelgroup *jngpusher-sg* jngpusher 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 10))
|
||||
|
||||
@@ -25,7 +25,7 @@ nav-enemy-default-event-handler
|
||||
|
||||
(defmethod common-post junglefish ((obj junglefish))
|
||||
(water-control-method-10 (-> obj water))
|
||||
((the-as (function nav-enemy none) (find-parent-method junglefish 39)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -67,10 +67,7 @@
|
||||
(&+! (-> obj death-prim v1-8) arg0)
|
||||
)
|
||||
)
|
||||
(the-as
|
||||
plant-boss
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method plant-boss 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(deftype plant-boss-arm (process-drawable)
|
||||
|
||||
@@ -403,10 +403,7 @@
|
||||
(if (nonzero? (-> obj spawn-array))
|
||||
(&+! (-> obj spawn-array) arg0)
|
||||
)
|
||||
(the-as
|
||||
darkecobarrel
|
||||
((the-as (function darkecobarrel-base int darkecobarrel-base) (find-parent-method darkecobarrel 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defskelgroup *darkecobarrel-sg* darkecobarrel darkecobarrel-lod0-jg darkecobarrel-idle-ja
|
||||
|
||||
@@ -232,7 +232,7 @@ baby-spider-default-event-handler
|
||||
(vector-z-quaternion! (new-stack-vector0) (-> obj collide-info quat))
|
||||
(-> obj up-vector)
|
||||
)
|
||||
((the-as (function nav-enemy none) (find-parent-method baby-spider 39)) obj)
|
||||
(call-parent-method obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
@@ -954,10 +954,7 @@
|
||||
(if (nonzero? (-> obj sound2))
|
||||
(&+! (-> obj sound2) arg0)
|
||||
)
|
||||
(the-as
|
||||
driller-lurker
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method driller-lurker 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod deactivate driller-lurker ((obj driller-lurker))
|
||||
|
||||
@@ -1313,10 +1313,7 @@
|
||||
(if (nonzero? (-> obj sound2))
|
||||
(&+! (-> obj sound2) arg0)
|
||||
)
|
||||
(the-as
|
||||
gnawer
|
||||
((the-as (function nav-enemy int nav-enemy) (find-parent-method gnawer 7)) (the-as nav-enemy obj) arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! gnawer ((obj gnawer) (arg0 entity-actor))
|
||||
|
||||
@@ -816,10 +816,7 @@
|
||||
(if (nonzero? (-> obj mine 1))
|
||||
(&+! (-> obj mine 1) arg0)
|
||||
)
|
||||
(the-as
|
||||
balloonlurker
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method balloonlurker 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defstate balloonlurker-pilot-idle (balloonlurker-pilot)
|
||||
|
||||
@@ -562,10 +562,7 @@
|
||||
(if (nonzero? (-> obj pivot))
|
||||
(&+! (-> obj pivot) arg0)
|
||||
)
|
||||
(the-as
|
||||
keg-conveyor
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method keg-conveyor 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
;; WARN: Function (method 11 keg-conveyor) has a return type of none, but the expression builder found a return statement.
|
||||
|
||||
@@ -1578,10 +1578,7 @@
|
||||
)
|
||||
|
||||
(defmethod rigid-body-platform-method-23 bone-platform ((obj bone-platform) (arg0 float))
|
||||
((the-as (function rigid-body-platform basic none) (find-parent-method bone-platform 23))
|
||||
obj
|
||||
(the-as basic arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
(rigid-body-platform-method-27 obj (-> obj anchor-point))
|
||||
0
|
||||
(none)
|
||||
@@ -1760,7 +1757,7 @@
|
||||
)
|
||||
|
||||
(defmethod battlecontroller-method-27 misty-battlecontroller ((obj misty-battlecontroller))
|
||||
((the-as (function battlecontroller none) (find-parent-method misty-battlecontroller 27)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj misty-ambush-collision-hack) #t)
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -440,7 +440,7 @@
|
||||
|
||||
|
||||
(defmethod rigid-body-platform-method-23 ogre-plat ((obj ogre-plat) (arg0 float))
|
||||
((the-as (function rigid-body-platform basic none) (find-parent-method ogre-plat 23)) obj (the-as basic arg0))
|
||||
(call-parent-method obj arg0)
|
||||
(rigid-body-platform-method-27 obj (-> obj anchor-point))
|
||||
0
|
||||
(none)
|
||||
@@ -607,7 +607,7 @@
|
||||
(set! (-> obj float-y-offset) 0.0)
|
||||
(+! (-> obj root-overlay trans y) (-> obj idle-y-offset))
|
||||
(rigid-body-platform-method-29 obj *ogre-step-constants*)
|
||||
((the-as (function ogre-plat none) (find-parent-method ogre-step 31)) obj)
|
||||
(call-parent-method obj)
|
||||
(let ((a0-5 (entity-actor-lookup (-> obj entity) 'alt-actor 0)))
|
||||
(if (and a0-5 (logtest? (-> a0-5 extra perm status) (entity-perm-status complete)))
|
||||
(set! (-> obj active) #t)
|
||||
@@ -665,7 +665,7 @@
|
||||
(defmethod rigid-body-platform-method-31 ogre-step-a ((obj ogre-step-a))
|
||||
(set-vector! (-> obj root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0)
|
||||
(initialize-skeleton obj *ogre-step-a-sg* '())
|
||||
((the-as (function ogre-step none) (find-parent-method ogre-step-a 31)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -673,7 +673,7 @@
|
||||
(defmethod rigid-body-platform-method-31 ogre-step-b ((obj ogre-step-b))
|
||||
(set-vector! (-> obj root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0)
|
||||
(initialize-skeleton obj *ogre-step-b-sg* '())
|
||||
((the-as (function ogre-step none) (find-parent-method ogre-step-b 31)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -681,7 +681,7 @@
|
||||
(defmethod rigid-body-platform-method-31 ogre-step-c ((obj ogre-step-c))
|
||||
(set-vector! (-> obj root-overlay root-prim local-sphere) 0.0 12288.0 0.0 26624.0)
|
||||
(initialize-skeleton obj *ogre-step-c-sg* '())
|
||||
((the-as (function ogre-step none) (find-parent-method ogre-step-c 31)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -689,7 +689,7 @@
|
||||
(defmethod rigid-body-platform-method-31 ogre-step-d ((obj ogre-step-d))
|
||||
(set-vector! (-> obj root-overlay root-prim local-sphere) 0.0 12288.0 0.0 20480.0)
|
||||
(initialize-skeleton obj *ogre-step-b-sg* '())
|
||||
((the-as (function ogre-step none) (find-parent-method ogre-step-d 31)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -734,7 +734,7 @@
|
||||
(set! (-> obj idle-y-offset) -6144.0)
|
||||
(set! (-> obj float-y-offset) 4096.0)
|
||||
(rigid-body-platform-method-29 obj *ogre-isle-constants*)
|
||||
((the-as (function ogre-plat none) (find-parent-method ogre-isle 31)) obj)
|
||||
(call-parent-method obj)
|
||||
(set! (-> obj active) #t)
|
||||
0
|
||||
(none)
|
||||
@@ -771,7 +771,7 @@
|
||||
(+! (-> obj root-overlay trans x) -8192.0)
|
||||
(set-vector! (-> obj root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0)
|
||||
(initialize-skeleton obj *ogre-isle-b-sg* '())
|
||||
((the-as (function ogre-isle none) (find-parent-method ogre-isle-b 31)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -780,7 +780,7 @@
|
||||
(+! (-> obj root-overlay trans x) -8192.0)
|
||||
(set-vector! (-> obj root-overlay root-prim local-sphere) 0.0 8192.0 0.0 24576.0)
|
||||
(initialize-skeleton obj *ogre-isle-b-sg* '())
|
||||
((the-as (function ogre-isle none) (find-parent-method ogre-isle-c 31)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -790,7 +790,7 @@
|
||||
(+! (-> obj root-overlay trans z) -8192.0)
|
||||
(set-vector! (-> obj root-overlay root-prim local-sphere) 0.0 8192.0 0.0 22528.0)
|
||||
(initialize-skeleton obj *ogre-isle-d-sg* '())
|
||||
((the-as (function ogre-isle none) (find-parent-method ogre-isle-d 31)) obj)
|
||||
(call-parent-method obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -825,10 +825,7 @@
|
||||
(&+! (-> obj joint-mod-array v1-0) arg0)
|
||||
)
|
||||
)
|
||||
(the-as
|
||||
ogre-bridge
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method ogre-bridge 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defbehavior ogre-bridge-update-joints ogre-bridge ()
|
||||
|
||||
@@ -751,13 +751,7 @@
|
||||
(if (nonzero? (-> obj joint))
|
||||
(&+! (-> obj joint) arg0)
|
||||
)
|
||||
(the-as
|
||||
ogreboss-super-boulder
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method ogreboss-super-boulder 7))
|
||||
obj
|
||||
arg0
|
||||
)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defstate ogreboss-super-boulder-killed-player (ogreboss-super-boulder)
|
||||
|
||||
@@ -287,10 +287,7 @@
|
||||
(if (nonzero? (-> obj alt-actors))
|
||||
(&+! (-> obj alt-actors) arg0)
|
||||
)
|
||||
(the-as
|
||||
cave-trap
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method cave-trap 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! cave-trap ((obj cave-trap) (arg0 entity-actor))
|
||||
|
||||
@@ -588,7 +588,7 @@
|
||||
(if (nonzero? (-> obj part4))
|
||||
(&+! (-> obj part4) arg0)
|
||||
)
|
||||
(the-as ice-cube ((the-as (function nav-enemy int nav-enemy) (find-parent-method ice-cube 7)) obj arg0))
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! ice-cube ((obj ice-cube) (arg0 entity-actor))
|
||||
|
||||
@@ -560,11 +560,7 @@
|
||||
(&+! (-> obj 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 obj)
|
||||
arg0
|
||||
)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! snow-ball ((obj snow-ball) (arg0 entity-actor))
|
||||
|
||||
@@ -299,10 +299,7 @@
|
||||
(if (nonzero? (-> obj part2))
|
||||
(&+! (-> obj part2) arg0)
|
||||
)
|
||||
(the-as
|
||||
snow-bumper
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method snow-bumper 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! snow-bumper ((obj snow-bumper) (arg0 entity-actor))
|
||||
|
||||
@@ -1001,10 +1001,7 @@
|
||||
(if (nonzero? (-> obj part3))
|
||||
(&+! (-> obj part3) arg0)
|
||||
)
|
||||
(the-as
|
||||
snow-fort-gate
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method snow-fort-gate 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! snow-fort-gate ((obj snow-fort-gate) (arg0 entity-actor))
|
||||
|
||||
@@ -541,7 +541,7 @@
|
||||
(if (nonzero? (-> obj part2))
|
||||
(&+! (-> obj part2) arg0)
|
||||
)
|
||||
(the-as yeti-slave ((the-as (function nav-enemy int nav-enemy) (find-parent-method yeti-slave 7)) obj arg0))
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defbehavior yeti-slave-init-by-other yeti-slave ((arg0 entity) (arg1 yeti) (arg2 vector) (arg3 vector) (arg4 symbol))
|
||||
|
||||
@@ -734,10 +734,7 @@
|
||||
(if (nonzero? (-> obj neck))
|
||||
(&+! (-> obj neck) arg0)
|
||||
)
|
||||
(the-as
|
||||
bully
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method bully 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! bully ((obj bully) (arg0 entity-actor))
|
||||
|
||||
@@ -669,10 +669,7 @@
|
||||
(if (nonzero? (-> obj alt-actors))
|
||||
(&+! (-> obj alt-actors) arg0)
|
||||
)
|
||||
(the-as
|
||||
helix-water
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method helix-water 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! helix-water ((obj helix-water) (arg0 entity-actor))
|
||||
|
||||
@@ -1059,10 +1059,7 @@
|
||||
(if (nonzero? (-> obj neck))
|
||||
(&+! (-> obj neck) arg0)
|
||||
)
|
||||
(the-as
|
||||
puffer
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method puffer 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! puffer ((obj puffer) (arg0 entity-actor))
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
)
|
||||
|
||||
(defmethod rigid-body-platform-method-23 qbert-plat ((obj qbert-plat) (arg0 float))
|
||||
((the-as (function rigid-body-platform float none) (find-parent-method qbert-plat 23)) obj arg0)
|
||||
(call-parent-method obj arg0)
|
||||
(rigid-body-platform-method-27 obj (-> obj anchor-point))
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -404,10 +404,7 @@
|
||||
(if (nonzero? (-> obj part4))
|
||||
(&+! (-> obj part4) arg0)
|
||||
)
|
||||
(the-as
|
||||
square-platform
|
||||
((the-as (function baseplat int baseplat) (find-parent-method square-platform 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! square-platform ((obj square-platform) (arg0 entity-actor))
|
||||
|
||||
@@ -650,10 +650,7 @@
|
||||
(if (nonzero? (-> obj part3))
|
||||
(&+! (-> obj part3) arg0)
|
||||
)
|
||||
(the-as
|
||||
steam-cap
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method steam-cap 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod deactivate steam-cap ((obj steam-cap))
|
||||
|
||||
@@ -913,10 +913,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(the-as
|
||||
sunken-pipegame
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method sunken-pipegame 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defmethod init-from-entity! sunken-pipegame ((obj sunken-pipegame) (arg0 entity-actor))
|
||||
|
||||
@@ -43,10 +43,7 @@
|
||||
(&+! (-> obj path-data v1-0) arg0)
|
||||
)
|
||||
)
|
||||
(the-as
|
||||
billy
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method billy 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(deftype billy-snack (process-drawable)
|
||||
@@ -438,7 +435,7 @@
|
||||
(go (method-of-object obj play-anim))
|
||||
)
|
||||
(else
|
||||
((the-as (function nav-enemy none) (find-parent-method billy 38)) (the-as nav-enemy obj))
|
||||
(call-parent-method obj)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
|
||||
@@ -829,7 +829,7 @@
|
||||
nav-enemy-default-event-handler
|
||||
|
||||
(defmethod common-post kermit ((obj kermit))
|
||||
((the-as (function nav-enemy none) (find-parent-method kermit 39)) obj)
|
||||
(call-parent-method obj)
|
||||
(when (-> obj charged-up)
|
||||
)
|
||||
0
|
||||
|
||||
@@ -62,10 +62,7 @@
|
||||
(&+! (-> obj path-list v1-0) arg0)
|
||||
)
|
||||
)
|
||||
(the-as
|
||||
swamp-bat
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method swamp-bat 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(deftype swamp-bat-slave (process-drawable)
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
)
|
||||
|
||||
(defmethod rigid-body-platform-method-23 tra-pontoon ((obj tra-pontoon) (arg0 float))
|
||||
((the-as (function rigid-body-platform float none) (find-parent-method tra-pontoon 23)) obj arg0)
|
||||
(call-parent-method obj arg0)
|
||||
(rigid-body-platform-method-27 obj (-> obj anchor-point))
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -585,10 +585,7 @@
|
||||
(if (nonzero? (-> obj bag))
|
||||
(&+! (-> obj bag) arg0)
|
||||
)
|
||||
(the-as
|
||||
swamp-blimp
|
||||
((the-as (function process-drawable int process-drawable) (find-parent-method swamp-blimp 7)) obj arg0)
|
||||
)
|
||||
(call-parent-method obj arg0)
|
||||
)
|
||||
|
||||
(defstate swamp-tetherrock-die (swamp-tetherrock)
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
)
|
||||
|
||||
(defmethod rigid-body-platform-method-23 pontoon ((obj pontoon) (arg0 float))
|
||||
((the-as (function rigid-body-platform basic none) (find-parent-method pontoon 23)) obj (the-as basic arg0))
|
||||
(call-parent-method obj arg0)
|
||||
(rigid-body-platform-method-27 obj (-> obj anchor-point))
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -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<RegVal*>& args,
|
||||
@@ -705,6 +704,7 @@ 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);
|
||||
|
||||
// State
|
||||
Val* compile_define_state_hook(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
|
||||
@@ -240,6 +240,7 @@ class FunctionEnv : public DeclareEnv {
|
||||
|
||||
int segment = -1;
|
||||
std::string method_of_type_name = "#f";
|
||||
std::optional<int> method_id;
|
||||
bool is_asm_func = false;
|
||||
bool asm_func_saved_regs = false;
|
||||
TypeSpec asm_func_return_type;
|
||||
|
||||
@@ -316,17 +316,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<None*>(in);
|
||||
}
|
||||
|
||||
@@ -212,6 +212,7 @@ const std::unordered_map<
|
||||
{"none", {"", &Compiler::compile_none}},
|
||||
{"size-of", {"", &Compiler::compile_size_of}},
|
||||
{"psize-of", {"", &Compiler::compile_psize_of}},
|
||||
{"current-method-id", {"", &Compiler::compile_current_method_id}},
|
||||
|
||||
// LAMBDA
|
||||
{"lambda", {"", &Compiler::compile_lambda}},
|
||||
|
||||
@@ -492,6 +492,8 @@ Val* Compiler::compile_defmethod(const goos::Object& form, const goos::Object& _
|
||||
auto new_func_env = std::make_unique<FunctionEnv>(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);
|
||||
new_func_env->method_id =
|
||||
m_ts.lookup_method(symbol_string(type_name), symbol_string(method_name)).id;
|
||||
|
||||
// set up arguments
|
||||
if (lambda.params.size() > 8) {
|
||||
@@ -1467,3 +1469,15 @@ 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);
|
||||
}
|
||||
Reference in New Issue
Block a user